Files
sdk/model_affiliate_level_view.go

231 lines
6.6 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 AffiliateLevelView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AffiliateLevelView{}
// AffiliateLevelView struct for AffiliateLevelView
type AffiliateLevelView struct {
// DownlineCount is how many orgs sit exactly this many hops below the caller. It is 0 in the schedule quoted to a caller that has not applied, which has no downline to count.
DownlineCount *int64 `json:"downlineCount,omitempty"`
// Level is the upline distance from the org whose spend is being shared: 1 is the direct referrer, 2 and 3 the referrers above it. Nothing accrues past 3.
Level *int64 `json:"level,omitempty"`
// RateBps is the commission paid at this level, in basis points OF Hanzo's margin (2000 = 20% of margin, never of the customer's bill). Level 1 is the affiliate's own negotiated rate; 2 and 3 are platform switches read live, so this is the schedule actually in force, not one compiled in.
RateBps *int64 `json:"rateBps,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AffiliateLevelView AffiliateLevelView
// NewAffiliateLevelView instantiates a new AffiliateLevelView 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 NewAffiliateLevelView() *AffiliateLevelView {
this := AffiliateLevelView{}
return &this
}
// NewAffiliateLevelViewWithDefaults instantiates a new AffiliateLevelView 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 NewAffiliateLevelViewWithDefaults() *AffiliateLevelView {
this := AffiliateLevelView{}
return &this
}
// GetDownlineCount returns the DownlineCount field value if set, zero value otherwise.
func (o *AffiliateLevelView) GetDownlineCount() int64 {
if o == nil || IsNil(o.DownlineCount) {
var ret int64
return ret
}
return *o.DownlineCount
}
// GetDownlineCountOk returns a tuple with the DownlineCount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AffiliateLevelView) GetDownlineCountOk() (*int64, bool) {
if o == nil || IsNil(o.DownlineCount) {
return nil, false
}
return o.DownlineCount, true
}
// HasDownlineCount returns a boolean if a field has been set.
func (o *AffiliateLevelView) HasDownlineCount() bool {
if o != nil && !IsNil(o.DownlineCount) {
return true
}
return false
}
// SetDownlineCount gets a reference to the given int64 and assigns it to the DownlineCount field.
func (o *AffiliateLevelView) SetDownlineCount(v int64) {
o.DownlineCount = &v
}
// GetLevel returns the Level field value if set, zero value otherwise.
func (o *AffiliateLevelView) GetLevel() int64 {
if o == nil || IsNil(o.Level) {
var ret int64
return ret
}
return *o.Level
}
// GetLevelOk returns a tuple with the Level field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AffiliateLevelView) GetLevelOk() (*int64, bool) {
if o == nil || IsNil(o.Level) {
return nil, false
}
return o.Level, true
}
// HasLevel returns a boolean if a field has been set.
func (o *AffiliateLevelView) HasLevel() bool {
if o != nil && !IsNil(o.Level) {
return true
}
return false
}
// SetLevel gets a reference to the given int64 and assigns it to the Level field.
func (o *AffiliateLevelView) SetLevel(v int64) {
o.Level = &v
}
// GetRateBps returns the RateBps field value if set, zero value otherwise.
func (o *AffiliateLevelView) 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 *AffiliateLevelView) 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 *AffiliateLevelView) 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 *AffiliateLevelView) SetRateBps(v int64) {
o.RateBps = &v
}
func (o AffiliateLevelView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AffiliateLevelView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.DownlineCount) {
toSerialize["downlineCount"] = o.DownlineCount
}
if !IsNil(o.Level) {
toSerialize["level"] = o.Level
}
if !IsNil(o.RateBps) {
toSerialize["rateBps"] = o.RateBps
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AffiliateLevelView) UnmarshalJSON(data []byte) (err error) {
varAffiliateLevelView := _AffiliateLevelView{}
err = json.Unmarshal(data, &varAffiliateLevelView)
if err != nil {
return err
}
*o = AffiliateLevelView(varAffiliateLevelView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "downlineCount")
delete(additionalProperties, "level")
delete(additionalProperties, "rateBps")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAffiliateLevelView struct {
value *AffiliateLevelView
isSet bool
}
func (v NullableAffiliateLevelView) Get() *AffiliateLevelView {
return v.value
}
func (v *NullableAffiliateLevelView) Set(val *AffiliateLevelView) {
v.value = val
v.isSet = true
}
func (v NullableAffiliateLevelView) IsSet() bool {
return v.isSet
}
func (v *NullableAffiliateLevelView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAffiliateLevelView(val *AffiliateLevelView) *NullableAffiliateLevelView {
return &NullableAffiliateLevelView{value: val, isSet: true}
}
func (v NullableAffiliateLevelView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAffiliateLevelView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}