Files
sdk/model_billing_tier.go

342 lines
9.0 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 BillingTier type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BillingTier{}
// BillingTier struct for BillingTier
type BillingTier struct {
Balance *BillingTierBalance `json:"balance,omitempty"`
// Plan is the catalog rung the subject is served as (\"\" with no plan). A tier is a class of rungs; a bound that differs within one class keys on this.
Plan *string `json:"plan,omitempty"`
// PlanName is the display name of the served plan (\"Unlimited\"), \"\" with no plan. A plan only the plan authority knows has no catalog name, so a reader shows this, not the tier. Last, for the ZAP wire.
PlanName *string `json:"planName,omitempty"`
// Subscription is the id of the subscription row whose plan is the served rung, \"\" when the tier is not a subscription's.
Subscription *string `json:"subscription,omitempty"`
Tier *BillingTierLimits `json:"tier,omitempty"`
User *string `json:"user,omitempty"`
AdditionalProperties map[string]interface{}
}
type _BillingTier BillingTier
// NewBillingTier instantiates a new BillingTier 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 NewBillingTier() *BillingTier {
this := BillingTier{}
return &this
}
// NewBillingTierWithDefaults instantiates a new BillingTier 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 NewBillingTierWithDefaults() *BillingTier {
this := BillingTier{}
return &this
}
// GetBalance returns the Balance field value if set, zero value otherwise.
func (o *BillingTier) GetBalance() BillingTierBalance {
if o == nil || IsNil(o.Balance) {
var ret BillingTierBalance
return ret
}
return *o.Balance
}
// GetBalanceOk returns a tuple with the Balance field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingTier) GetBalanceOk() (*BillingTierBalance, bool) {
if o == nil || IsNil(o.Balance) {
return nil, false
}
return o.Balance, true
}
// HasBalance returns a boolean if a field has been set.
func (o *BillingTier) HasBalance() bool {
if o != nil && !IsNil(o.Balance) {
return true
}
return false
}
// SetBalance gets a reference to the given BillingTierBalance and assigns it to the Balance field.
func (o *BillingTier) SetBalance(v BillingTierBalance) {
o.Balance = &v
}
// GetPlan returns the Plan field value if set, zero value otherwise.
func (o *BillingTier) GetPlan() string {
if o == nil || IsNil(o.Plan) {
var ret string
return ret
}
return *o.Plan
}
// GetPlanOk returns a tuple with the Plan field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingTier) GetPlanOk() (*string, bool) {
if o == nil || IsNil(o.Plan) {
return nil, false
}
return o.Plan, true
}
// HasPlan returns a boolean if a field has been set.
func (o *BillingTier) HasPlan() bool {
if o != nil && !IsNil(o.Plan) {
return true
}
return false
}
// SetPlan gets a reference to the given string and assigns it to the Plan field.
func (o *BillingTier) SetPlan(v string) {
o.Plan = &v
}
// GetPlanName returns the PlanName field value if set, zero value otherwise.
func (o *BillingTier) GetPlanName() string {
if o == nil || IsNil(o.PlanName) {
var ret string
return ret
}
return *o.PlanName
}
// GetPlanNameOk returns a tuple with the PlanName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingTier) GetPlanNameOk() (*string, bool) {
if o == nil || IsNil(o.PlanName) {
return nil, false
}
return o.PlanName, true
}
// HasPlanName returns a boolean if a field has been set.
func (o *BillingTier) HasPlanName() bool {
if o != nil && !IsNil(o.PlanName) {
return true
}
return false
}
// SetPlanName gets a reference to the given string and assigns it to the PlanName field.
func (o *BillingTier) SetPlanName(v string) {
o.PlanName = &v
}
// GetSubscription returns the Subscription field value if set, zero value otherwise.
func (o *BillingTier) GetSubscription() string {
if o == nil || IsNil(o.Subscription) {
var ret string
return ret
}
return *o.Subscription
}
// GetSubscriptionOk returns a tuple with the Subscription field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingTier) GetSubscriptionOk() (*string, bool) {
if o == nil || IsNil(o.Subscription) {
return nil, false
}
return o.Subscription, true
}
// HasSubscription returns a boolean if a field has been set.
func (o *BillingTier) HasSubscription() bool {
if o != nil && !IsNil(o.Subscription) {
return true
}
return false
}
// SetSubscription gets a reference to the given string and assigns it to the Subscription field.
func (o *BillingTier) SetSubscription(v string) {
o.Subscription = &v
}
// GetTier returns the Tier field value if set, zero value otherwise.
func (o *BillingTier) GetTier() BillingTierLimits {
if o == nil || IsNil(o.Tier) {
var ret BillingTierLimits
return ret
}
return *o.Tier
}
// GetTierOk returns a tuple with the Tier field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingTier) GetTierOk() (*BillingTierLimits, bool) {
if o == nil || IsNil(o.Tier) {
return nil, false
}
return o.Tier, true
}
// HasTier returns a boolean if a field has been set.
func (o *BillingTier) HasTier() bool {
if o != nil && !IsNil(o.Tier) {
return true
}
return false
}
// SetTier gets a reference to the given BillingTierLimits and assigns it to the Tier field.
func (o *BillingTier) SetTier(v BillingTierLimits) {
o.Tier = &v
}
// GetUser returns the User field value if set, zero value otherwise.
func (o *BillingTier) GetUser() string {
if o == nil || IsNil(o.User) {
var ret string
return ret
}
return *o.User
}
// GetUserOk returns a tuple with the User field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingTier) GetUserOk() (*string, bool) {
if o == nil || IsNil(o.User) {
return nil, false
}
return o.User, true
}
// HasUser returns a boolean if a field has been set.
func (o *BillingTier) HasUser() bool {
if o != nil && !IsNil(o.User) {
return true
}
return false
}
// SetUser gets a reference to the given string and assigns it to the User field.
func (o *BillingTier) SetUser(v string) {
o.User = &v
}
func (o BillingTier) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BillingTier) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Balance) {
toSerialize["balance"] = o.Balance
}
if !IsNil(o.Plan) {
toSerialize["plan"] = o.Plan
}
if !IsNil(o.PlanName) {
toSerialize["planName"] = o.PlanName
}
if !IsNil(o.Subscription) {
toSerialize["subscription"] = o.Subscription
}
if !IsNil(o.Tier) {
toSerialize["tier"] = o.Tier
}
if !IsNil(o.User) {
toSerialize["user"] = o.User
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *BillingTier) UnmarshalJSON(data []byte) (err error) {
varBillingTier := _BillingTier{}
err = json.Unmarshal(data, &varBillingTier)
if err != nil {
return err
}
*o = BillingTier(varBillingTier)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "balance")
delete(additionalProperties, "plan")
delete(additionalProperties, "planName")
delete(additionalProperties, "subscription")
delete(additionalProperties, "tier")
delete(additionalProperties, "user")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableBillingTier struct {
value *BillingTier
isSet bool
}
func (v NullableBillingTier) Get() *BillingTier {
return v.value
}
func (v *NullableBillingTier) Set(val *BillingTier) {
v.value = val
v.isSet = true
}
func (v NullableBillingTier) IsSet() bool {
return v.isSet
}
func (v *NullableBillingTier) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBillingTier(val *BillingTier) *NullableBillingTier {
return &NullableBillingTier{value: val, isSet: true}
}
func (v NullableBillingTier) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBillingTier) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}