mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
193 lines
5.5 KiB
Go
193 lines
5.5 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 AffiliateCreateLinkRequest type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &AffiliateCreateLinkRequest{}
|
|
|
|
// AffiliateCreateLinkRequest struct for AffiliateCreateLinkRequest
|
|
type AffiliateCreateLinkRequest struct {
|
|
// Code is an optional vanity code; it must be free across the whole directory, and omitting it mints a random one. Body-only.
|
|
Code *string `json:"code,omitempty"`
|
|
// Label is cosmetic — trimmed, stripped of control characters, capped — and never part of a code. Body-only: the URL cannot supply it.
|
|
Label *string `json:"label,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _AffiliateCreateLinkRequest AffiliateCreateLinkRequest
|
|
|
|
// NewAffiliateCreateLinkRequest instantiates a new AffiliateCreateLinkRequest 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 NewAffiliateCreateLinkRequest() *AffiliateCreateLinkRequest {
|
|
this := AffiliateCreateLinkRequest{}
|
|
return &this
|
|
}
|
|
|
|
// NewAffiliateCreateLinkRequestWithDefaults instantiates a new AffiliateCreateLinkRequest 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 NewAffiliateCreateLinkRequestWithDefaults() *AffiliateCreateLinkRequest {
|
|
this := AffiliateCreateLinkRequest{}
|
|
return &this
|
|
}
|
|
|
|
// GetCode returns the Code field value if set, zero value otherwise.
|
|
func (o *AffiliateCreateLinkRequest) GetCode() string {
|
|
if o == nil || IsNil(o.Code) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Code
|
|
}
|
|
|
|
// GetCodeOk returns a tuple with the Code field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AffiliateCreateLinkRequest) GetCodeOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Code) {
|
|
return nil, false
|
|
}
|
|
return o.Code, true
|
|
}
|
|
|
|
// HasCode returns a boolean if a field has been set.
|
|
func (o *AffiliateCreateLinkRequest) HasCode() bool {
|
|
if o != nil && !IsNil(o.Code) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCode gets a reference to the given string and assigns it to the Code field.
|
|
func (o *AffiliateCreateLinkRequest) SetCode(v string) {
|
|
o.Code = &v
|
|
}
|
|
|
|
// GetLabel returns the Label field value if set, zero value otherwise.
|
|
func (o *AffiliateCreateLinkRequest) GetLabel() string {
|
|
if o == nil || IsNil(o.Label) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Label
|
|
}
|
|
|
|
// GetLabelOk returns a tuple with the Label field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AffiliateCreateLinkRequest) GetLabelOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Label) {
|
|
return nil, false
|
|
}
|
|
return o.Label, true
|
|
}
|
|
|
|
// HasLabel returns a boolean if a field has been set.
|
|
func (o *AffiliateCreateLinkRequest) HasLabel() bool {
|
|
if o != nil && !IsNil(o.Label) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLabel gets a reference to the given string and assigns it to the Label field.
|
|
func (o *AffiliateCreateLinkRequest) SetLabel(v string) {
|
|
o.Label = &v
|
|
}
|
|
|
|
func (o AffiliateCreateLinkRequest) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o AffiliateCreateLinkRequest) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Code) {
|
|
toSerialize["code"] = o.Code
|
|
}
|
|
if !IsNil(o.Label) {
|
|
toSerialize["label"] = o.Label
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *AffiliateCreateLinkRequest) UnmarshalJSON(data []byte) (err error) {
|
|
varAffiliateCreateLinkRequest := _AffiliateCreateLinkRequest{}
|
|
|
|
err = json.Unmarshal(data, &varAffiliateCreateLinkRequest)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = AffiliateCreateLinkRequest(varAffiliateCreateLinkRequest)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "code")
|
|
delete(additionalProperties, "label")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableAffiliateCreateLinkRequest struct {
|
|
value *AffiliateCreateLinkRequest
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableAffiliateCreateLinkRequest) Get() *AffiliateCreateLinkRequest {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableAffiliateCreateLinkRequest) Set(val *AffiliateCreateLinkRequest) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableAffiliateCreateLinkRequest) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableAffiliateCreateLinkRequest) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableAffiliateCreateLinkRequest(val *AffiliateCreateLinkRequest) *NullableAffiliateCreateLinkRequest {
|
|
return &NullableAffiliateCreateLinkRequest{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableAffiliateCreateLinkRequest) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableAffiliateCreateLinkRequest) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|