mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
231 lines
5.8 KiB
Go
231 lines
5.8 KiB
Go
/*
|
|
Hanzo Cloud API
|
|
|
|
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
|
|
|
|
API version: v1
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package hanzoai
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
// checks if the AuthorClaim type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &AuthorClaim{}
|
|
|
|
// AuthorClaim struct for AuthorClaim
|
|
type AuthorClaim struct {
|
|
// Created reports whether this call recorded a new claim (201) or found an existing one (200).
|
|
Created *bool `json:"created,omitempty"`
|
|
// Org is the verified owner-wide claim, present when an owner was claimed. It covers every repository the author publishes under that owner.
|
|
Org *AuthorOrgView `json:"org,omitempty"`
|
|
// Repo is the verified repository claim, present when a repository was claimed.
|
|
Repo *AuthorAuthorRepo `json:"repo,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _AuthorClaim AuthorClaim
|
|
|
|
// NewAuthorClaim instantiates a new AuthorClaim object
|
|
// This constructor will assign default values to properties that have it defined,
|
|
// and makes sure properties required by API are set, but the set of arguments
|
|
// will change when the set of required properties is changed
|
|
func NewAuthorClaim() *AuthorClaim {
|
|
this := AuthorClaim{}
|
|
return &this
|
|
}
|
|
|
|
// NewAuthorClaimWithDefaults instantiates a new AuthorClaim object
|
|
// This constructor will only assign default values to properties that have it defined,
|
|
// but it doesn't guarantee that properties required by API are set
|
|
func NewAuthorClaimWithDefaults() *AuthorClaim {
|
|
this := AuthorClaim{}
|
|
return &this
|
|
}
|
|
|
|
// GetCreated returns the Created field value if set, zero value otherwise.
|
|
func (o *AuthorClaim) GetCreated() bool {
|
|
if o == nil || IsNil(o.Created) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Created
|
|
}
|
|
|
|
// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AuthorClaim) GetCreatedOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Created) {
|
|
return nil, false
|
|
}
|
|
return o.Created, true
|
|
}
|
|
|
|
// HasCreated returns a boolean if a field has been set.
|
|
func (o *AuthorClaim) HasCreated() bool {
|
|
if o != nil && !IsNil(o.Created) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCreated gets a reference to the given bool and assigns it to the Created field.
|
|
func (o *AuthorClaim) SetCreated(v bool) {
|
|
o.Created = &v
|
|
}
|
|
|
|
// GetOrg returns the Org field value if set, zero value otherwise.
|
|
func (o *AuthorClaim) GetOrg() AuthorOrgView {
|
|
if o == nil || IsNil(o.Org) {
|
|
var ret AuthorOrgView
|
|
return ret
|
|
}
|
|
return *o.Org
|
|
}
|
|
|
|
// GetOrgOk returns a tuple with the Org field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AuthorClaim) GetOrgOk() (*AuthorOrgView, bool) {
|
|
if o == nil || IsNil(o.Org) {
|
|
return nil, false
|
|
}
|
|
return o.Org, true
|
|
}
|
|
|
|
// HasOrg returns a boolean if a field has been set.
|
|
func (o *AuthorClaim) HasOrg() bool {
|
|
if o != nil && !IsNil(o.Org) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetOrg gets a reference to the given AuthorOrgView and assigns it to the Org field.
|
|
func (o *AuthorClaim) SetOrg(v AuthorOrgView) {
|
|
o.Org = &v
|
|
}
|
|
|
|
// GetRepo returns the Repo field value if set, zero value otherwise.
|
|
func (o *AuthorClaim) GetRepo() AuthorAuthorRepo {
|
|
if o == nil || IsNil(o.Repo) {
|
|
var ret AuthorAuthorRepo
|
|
return ret
|
|
}
|
|
return *o.Repo
|
|
}
|
|
|
|
// GetRepoOk returns a tuple with the Repo field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AuthorClaim) GetRepoOk() (*AuthorAuthorRepo, bool) {
|
|
if o == nil || IsNil(o.Repo) {
|
|
return nil, false
|
|
}
|
|
return o.Repo, true
|
|
}
|
|
|
|
// HasRepo returns a boolean if a field has been set.
|
|
func (o *AuthorClaim) HasRepo() bool {
|
|
if o != nil && !IsNil(o.Repo) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRepo gets a reference to the given AuthorAuthorRepo and assigns it to the Repo field.
|
|
func (o *AuthorClaim) SetRepo(v AuthorAuthorRepo) {
|
|
o.Repo = &v
|
|
}
|
|
|
|
func (o AuthorClaim) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o AuthorClaim) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Created) {
|
|
toSerialize["created"] = o.Created
|
|
}
|
|
if !IsNil(o.Org) {
|
|
toSerialize["org"] = o.Org
|
|
}
|
|
if !IsNil(o.Repo) {
|
|
toSerialize["repo"] = o.Repo
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *AuthorClaim) UnmarshalJSON(data []byte) (err error) {
|
|
varAuthorClaim := _AuthorClaim{}
|
|
|
|
err = json.Unmarshal(data, &varAuthorClaim)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = AuthorClaim(varAuthorClaim)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "created")
|
|
delete(additionalProperties, "org")
|
|
delete(additionalProperties, "repo")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableAuthorClaim struct {
|
|
value *AuthorClaim
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableAuthorClaim) Get() *AuthorClaim {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableAuthorClaim) Set(val *AuthorClaim) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableAuthorClaim) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableAuthorClaim) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableAuthorClaim(val *AuthorClaim) *NullableAuthorClaim {
|
|
return &NullableAuthorClaim{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableAuthorClaim) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableAuthorClaim) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|