Files
sdk/model_affiliate_code_view.go

383 lines
11 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
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 AffiliateCodeView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AffiliateCodeView{}
// AffiliateCodeView struct for AffiliateCodeView
type AffiliateCodeView struct {
// Clicks is how many pings this code has taken. The one STORED counter here and pure vanity: no accrual or payout reads it, pings are coalesced in memory and flushed in batches, and a dropped tally is accepted rather than contending with the money write path. Do not reconcile it against anything.
Clicks *int64 `json:"clicks,omitempty"`
// Code is the link's slug — 3–32 chars of a–z, 0–9 and hyphen — unique across the WHOLE directory, so any affiliate's code resolves an attribution.
Code *string `json:"code,omitempty"`
// Conversions is how many of those signups have actually produced positive commission for the caller. Also derived, from the accrual rows, so it is ≤ signups and lags a referral until the first sweep after it spends.
Conversions *int64 `json:"conversions,omitempty"`
// CreatedAt is when the link was minted, Unix seconds UTC.
CreatedAt *int64 `json:"createdAt,omitempty"`
// Label is the caller's own note for the link (\"twitter\", \"newsletter\"). Cosmetic: trimmed, stripped of control characters, capped at 48 bytes, and never part of the code. \"primary\" on the link mirrored at approval.
Label *string `json:"label,omitempty"`
// Signups is how many orgs were attributed with this code — DERIVED by counting attribution edges, never stored, so it cannot drift from the ledger.
Signups *int64 `json:"signups,omitempty"`
// URL is the full shareable link, the brand host plus ?aff=<code>. The host is the deployment's own brand, so a Lux or Zoo install never mints a hanzo.ai link.
Url *string `json:"url,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AffiliateCodeView AffiliateCodeView
// NewAffiliateCodeView instantiates a new AffiliateCodeView 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 NewAffiliateCodeView() *AffiliateCodeView {
this := AffiliateCodeView{}
return &this
}
// NewAffiliateCodeViewWithDefaults instantiates a new AffiliateCodeView 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 NewAffiliateCodeViewWithDefaults() *AffiliateCodeView {
this := AffiliateCodeView{}
return &this
}
// GetClicks returns the Clicks field value if set, zero value otherwise.
func (o *AffiliateCodeView) GetClicks() int64 {
if o == nil || IsNil(o.Clicks) {
var ret int64
return ret
}
return *o.Clicks
}
// GetClicksOk returns a tuple with the Clicks field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AffiliateCodeView) GetClicksOk() (*int64, bool) {
if o == nil || IsNil(o.Clicks) {
return nil, false
}
return o.Clicks, true
}
// HasClicks returns a boolean if a field has been set.
func (o *AffiliateCodeView) HasClicks() bool {
if o != nil && !IsNil(o.Clicks) {
return true
}
return false
}
// SetClicks gets a reference to the given int64 and assigns it to the Clicks field.
func (o *AffiliateCodeView) SetClicks(v int64) {
o.Clicks = &v
}
// GetCode returns the Code field value if set, zero value otherwise.
func (o *AffiliateCodeView) 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 *AffiliateCodeView) 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 *AffiliateCodeView) 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 *AffiliateCodeView) SetCode(v string) {
o.Code = &v
}
// GetConversions returns the Conversions field value if set, zero value otherwise.
func (o *AffiliateCodeView) GetConversions() int64 {
if o == nil || IsNil(o.Conversions) {
var ret int64
return ret
}
return *o.Conversions
}
// GetConversionsOk returns a tuple with the Conversions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AffiliateCodeView) GetConversionsOk() (*int64, bool) {
if o == nil || IsNil(o.Conversions) {
return nil, false
}
return o.Conversions, true
}
// HasConversions returns a boolean if a field has been set.
func (o *AffiliateCodeView) HasConversions() bool {
if o != nil && !IsNil(o.Conversions) {
return true
}
return false
}
// SetConversions gets a reference to the given int64 and assigns it to the Conversions field.
func (o *AffiliateCodeView) SetConversions(v int64) {
o.Conversions = &v
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *AffiliateCodeView) GetCreatedAt() int64 {
if o == nil || IsNil(o.CreatedAt) {
var ret int64
return ret
}
return *o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AffiliateCodeView) GetCreatedAtOk() (*int64, bool) {
if o == nil || IsNil(o.CreatedAt) {
return nil, false
}
return o.CreatedAt, true
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *AffiliateCodeView) HasCreatedAt() bool {
if o != nil && !IsNil(o.CreatedAt) {
return true
}
return false
}
// SetCreatedAt gets a reference to the given int64 and assigns it to the CreatedAt field.
func (o *AffiliateCodeView) SetCreatedAt(v int64) {
o.CreatedAt = &v
}
// GetLabel returns the Label field value if set, zero value otherwise.
func (o *AffiliateCodeView) 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 *AffiliateCodeView) 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 *AffiliateCodeView) 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 *AffiliateCodeView) SetLabel(v string) {
o.Label = &v
}
// GetSignups returns the Signups field value if set, zero value otherwise.
func (o *AffiliateCodeView) GetSignups() int64 {
if o == nil || IsNil(o.Signups) {
var ret int64
return ret
}
return *o.Signups
}
// GetSignupsOk returns a tuple with the Signups field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AffiliateCodeView) GetSignupsOk() (*int64, bool) {
if o == nil || IsNil(o.Signups) {
return nil, false
}
return o.Signups, true
}
// HasSignups returns a boolean if a field has been set.
func (o *AffiliateCodeView) HasSignups() bool {
if o != nil && !IsNil(o.Signups) {
return true
}
return false
}
// SetSignups gets a reference to the given int64 and assigns it to the Signups field.
func (o *AffiliateCodeView) SetSignups(v int64) {
o.Signups = &v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *AffiliateCodeView) GetUrl() string {
if o == nil || IsNil(o.Url) {
var ret string
return ret
}
return *o.Url
}
// GetUrlOk returns a tuple with the Url field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AffiliateCodeView) GetUrlOk() (*string, bool) {
if o == nil || IsNil(o.Url) {
return nil, false
}
return o.Url, true
}
// HasUrl returns a boolean if a field has been set.
func (o *AffiliateCodeView) HasUrl() bool {
if o != nil && !IsNil(o.Url) {
return true
}
return false
}
// SetUrl gets a reference to the given string and assigns it to the Url field.
func (o *AffiliateCodeView) SetUrl(v string) {
o.Url = &v
}
func (o AffiliateCodeView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AffiliateCodeView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Clicks) {
toSerialize["clicks"] = o.Clicks
}
if !IsNil(o.Code) {
toSerialize["code"] = o.Code
}
if !IsNil(o.Conversions) {
toSerialize["conversions"] = o.Conversions
}
if !IsNil(o.CreatedAt) {
toSerialize["createdAt"] = o.CreatedAt
}
if !IsNil(o.Label) {
toSerialize["label"] = o.Label
}
if !IsNil(o.Signups) {
toSerialize["signups"] = o.Signups
}
if !IsNil(o.Url) {
toSerialize["url"] = o.Url
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AffiliateCodeView) UnmarshalJSON(data []byte) (err error) {
varAffiliateCodeView := _AffiliateCodeView{}
err = json.Unmarshal(data, &varAffiliateCodeView)
if err != nil {
return err
}
*o = AffiliateCodeView(varAffiliateCodeView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "clicks")
delete(additionalProperties, "code")
delete(additionalProperties, "conversions")
delete(additionalProperties, "createdAt")
delete(additionalProperties, "label")
delete(additionalProperties, "signups")
delete(additionalProperties, "url")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAffiliateCodeView struct {
value *AffiliateCodeView
isSet bool
}
func (v NullableAffiliateCodeView) Get() *AffiliateCodeView {
return v.value
}
func (v *NullableAffiliateCodeView) Set(val *AffiliateCodeView) {
v.value = val
v.isSet = true
}
func (v NullableAffiliateCodeView) IsSet() bool {
return v.isSet
}
func (v *NullableAffiliateCodeView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAffiliateCodeView(val *AffiliateCodeView) *NullableAffiliateCodeView {
return &NullableAffiliateCodeView{value: val, isSet: true}
}
func (v NullableAffiliateCodeView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAffiliateCodeView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}