Files
sdk/model_affiliate_apply_request.go

155 lines
4.4 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 AffiliateApplyRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AffiliateApplyRequest{}
// AffiliateApplyRequest struct for AffiliateApplyRequest
type AffiliateApplyRequest struct {
// RequestedCode is the vanity code the applicant asks for; approval may mint a different one if it is taken. Body-only: the URL cannot supply it.
RequestedCode *string `json:"requestedCode,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AffiliateApplyRequest AffiliateApplyRequest
// NewAffiliateApplyRequest instantiates a new AffiliateApplyRequest 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 NewAffiliateApplyRequest() *AffiliateApplyRequest {
this := AffiliateApplyRequest{}
return &this
}
// NewAffiliateApplyRequestWithDefaults instantiates a new AffiliateApplyRequest 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 NewAffiliateApplyRequestWithDefaults() *AffiliateApplyRequest {
this := AffiliateApplyRequest{}
return &this
}
// GetRequestedCode returns the RequestedCode field value if set, zero value otherwise.
func (o *AffiliateApplyRequest) GetRequestedCode() string {
if o == nil || IsNil(o.RequestedCode) {
var ret string
return ret
}
return *o.RequestedCode
}
// GetRequestedCodeOk returns a tuple with the RequestedCode field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AffiliateApplyRequest) GetRequestedCodeOk() (*string, bool) {
if o == nil || IsNil(o.RequestedCode) {
return nil, false
}
return o.RequestedCode, true
}
// HasRequestedCode returns a boolean if a field has been set.
func (o *AffiliateApplyRequest) HasRequestedCode() bool {
if o != nil && !IsNil(o.RequestedCode) {
return true
}
return false
}
// SetRequestedCode gets a reference to the given string and assigns it to the RequestedCode field.
func (o *AffiliateApplyRequest) SetRequestedCode(v string) {
o.RequestedCode = &v
}
func (o AffiliateApplyRequest) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AffiliateApplyRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.RequestedCode) {
toSerialize["requestedCode"] = o.RequestedCode
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AffiliateApplyRequest) UnmarshalJSON(data []byte) (err error) {
varAffiliateApplyRequest := _AffiliateApplyRequest{}
err = json.Unmarshal(data, &varAffiliateApplyRequest)
if err != nil {
return err
}
*o = AffiliateApplyRequest(varAffiliateApplyRequest)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "requestedCode")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAffiliateApplyRequest struct {
value *AffiliateApplyRequest
isSet bool
}
func (v NullableAffiliateApplyRequest) Get() *AffiliateApplyRequest {
return v.value
}
func (v *NullableAffiliateApplyRequest) Set(val *AffiliateApplyRequest) {
v.value = val
v.isSet = true
}
func (v NullableAffiliateApplyRequest) IsSet() bool {
return v.isSet
}
func (v *NullableAffiliateApplyRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAffiliateApplyRequest(val *AffiliateApplyRequest) *NullableAffiliateApplyRequest {
return &NullableAffiliateApplyRequest{value: val, isSet: true}
}
func (v NullableAffiliateApplyRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAffiliateApplyRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}