mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
345 lines
9.8 KiB
Go
345 lines
9.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 AffiliateApplication type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &AffiliateApplication{}
|
|
|
|
// AffiliateApplication struct for AffiliateApplication
|
|
type AffiliateApplication struct {
|
|
// Code is the minted referral code. Empty on a first apply — applying does not mint a code, approval does; a re-apply echoes whatever the row already holds.
|
|
Code *string `json:"code,omitempty"`
|
|
// Created says whether THIS call made the row. false means the org had already applied and nothing changed — no second row, no reset of an existing approval. The HTTP status states the same fact: 201 when true, 200 when false.
|
|
Created *bool `json:"created,omitempty"`
|
|
// ID is the affiliate's server-minted handle, \"aff_\"-prefixed — the id staff approve, suspend, re-rate and pay against.
|
|
Id *string `json:"id,omitempty"`
|
|
// RateBps is the direct (level 1) commission rate the row carries, in basis points OF Hanzo's margin (2000 = 20% of margin, never of the customer's bill).
|
|
RateBps *int64 `json:"rateBps,omitempty"`
|
|
// RequestedCode echoes the vanity code asked for, normalized to lower case. It is a request only: approval mints a different slug if this one is taken.
|
|
RequestedCode *string `json:"requestedCode,omitempty"`
|
|
// Status is \"applied\" for a row this call created. A re-apply echoes the existing row's status, which may already be \"approved\" or \"suspended\".
|
|
Status *string `json:"status,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _AffiliateApplication AffiliateApplication
|
|
|
|
// NewAffiliateApplication instantiates a new AffiliateApplication 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 NewAffiliateApplication() *AffiliateApplication {
|
|
this := AffiliateApplication{}
|
|
return &this
|
|
}
|
|
|
|
// NewAffiliateApplicationWithDefaults instantiates a new AffiliateApplication 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 NewAffiliateApplicationWithDefaults() *AffiliateApplication {
|
|
this := AffiliateApplication{}
|
|
return &this
|
|
}
|
|
|
|
// GetCode returns the Code field value if set, zero value otherwise.
|
|
func (o *AffiliateApplication) 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 *AffiliateApplication) 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 *AffiliateApplication) 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 *AffiliateApplication) SetCode(v string) {
|
|
o.Code = &v
|
|
}
|
|
|
|
// GetCreated returns the Created field value if set, zero value otherwise.
|
|
func (o *AffiliateApplication) 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 *AffiliateApplication) 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 *AffiliateApplication) 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 *AffiliateApplication) SetCreated(v bool) {
|
|
o.Created = &v
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *AffiliateApplication) GetId() string {
|
|
if o == nil || IsNil(o.Id) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Id
|
|
}
|
|
|
|
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AffiliateApplication) GetIdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Id) {
|
|
return nil, false
|
|
}
|
|
return o.Id, true
|
|
}
|
|
|
|
// HasId returns a boolean if a field has been set.
|
|
func (o *AffiliateApplication) HasId() bool {
|
|
if o != nil && !IsNil(o.Id) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetId gets a reference to the given string and assigns it to the Id field.
|
|
func (o *AffiliateApplication) SetId(v string) {
|
|
o.Id = &v
|
|
}
|
|
|
|
// GetRateBps returns the RateBps field value if set, zero value otherwise.
|
|
func (o *AffiliateApplication) GetRateBps() int64 {
|
|
if o == nil || IsNil(o.RateBps) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.RateBps
|
|
}
|
|
|
|
// GetRateBpsOk returns a tuple with the RateBps field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AffiliateApplication) GetRateBpsOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.RateBps) {
|
|
return nil, false
|
|
}
|
|
return o.RateBps, true
|
|
}
|
|
|
|
// HasRateBps returns a boolean if a field has been set.
|
|
func (o *AffiliateApplication) HasRateBps() bool {
|
|
if o != nil && !IsNil(o.RateBps) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRateBps gets a reference to the given int64 and assigns it to the RateBps field.
|
|
func (o *AffiliateApplication) SetRateBps(v int64) {
|
|
o.RateBps = &v
|
|
}
|
|
|
|
// GetRequestedCode returns the RequestedCode field value if set, zero value otherwise.
|
|
func (o *AffiliateApplication) 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 *AffiliateApplication) 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 *AffiliateApplication) 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 *AffiliateApplication) SetRequestedCode(v string) {
|
|
o.RequestedCode = &v
|
|
}
|
|
|
|
// GetStatus returns the Status field value if set, zero value otherwise.
|
|
func (o *AffiliateApplication) GetStatus() string {
|
|
if o == nil || IsNil(o.Status) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Status
|
|
}
|
|
|
|
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AffiliateApplication) GetStatusOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Status) {
|
|
return nil, false
|
|
}
|
|
return o.Status, true
|
|
}
|
|
|
|
// HasStatus returns a boolean if a field has been set.
|
|
func (o *AffiliateApplication) HasStatus() bool {
|
|
if o != nil && !IsNil(o.Status) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStatus gets a reference to the given string and assigns it to the Status field.
|
|
func (o *AffiliateApplication) SetStatus(v string) {
|
|
o.Status = &v
|
|
}
|
|
|
|
func (o AffiliateApplication) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o AffiliateApplication) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Code) {
|
|
toSerialize["code"] = o.Code
|
|
}
|
|
if !IsNil(o.Created) {
|
|
toSerialize["created"] = o.Created
|
|
}
|
|
if !IsNil(o.Id) {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if !IsNil(o.RateBps) {
|
|
toSerialize["rateBps"] = o.RateBps
|
|
}
|
|
if !IsNil(o.RequestedCode) {
|
|
toSerialize["requestedCode"] = o.RequestedCode
|
|
}
|
|
if !IsNil(o.Status) {
|
|
toSerialize["status"] = o.Status
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *AffiliateApplication) UnmarshalJSON(data []byte) (err error) {
|
|
varAffiliateApplication := _AffiliateApplication{}
|
|
|
|
err = json.Unmarshal(data, &varAffiliateApplication)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = AffiliateApplication(varAffiliateApplication)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "code")
|
|
delete(additionalProperties, "created")
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "rateBps")
|
|
delete(additionalProperties, "requestedCode")
|
|
delete(additionalProperties, "status")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableAffiliateApplication struct {
|
|
value *AffiliateApplication
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableAffiliateApplication) Get() *AffiliateApplication {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableAffiliateApplication) Set(val *AffiliateApplication) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableAffiliateApplication) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableAffiliateApplication) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableAffiliateApplication(val *AffiliateApplication) *NullableAffiliateApplication {
|
|
return &NullableAffiliateApplication{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableAffiliateApplication) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableAffiliateApplication) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|