mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
413 lines
11 KiB
Go
413 lines
11 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 BillingRollup type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &BillingRollup{}
|
|
|
|
// BillingRollup struct for BillingRollup
|
|
type BillingRollup struct {
|
|
Balance *BillingRollupBalance `json:"balance,omitempty"`
|
|
ConsumedCents *int64 `json:"consumedCents,omitempty"`
|
|
Currency *string `json:"currency,omitempty"`
|
|
Included *BillingRollupAllotment `json:"included,omitempty"`
|
|
OverageCents *int64 `json:"overageCents,omitempty"`
|
|
Period *string `json:"period,omitempty"`
|
|
Plan *string `json:"plan,omitempty"`
|
|
User *string `json:"user,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _BillingRollup BillingRollup
|
|
|
|
// NewBillingRollup instantiates a new BillingRollup 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 NewBillingRollup() *BillingRollup {
|
|
this := BillingRollup{}
|
|
return &this
|
|
}
|
|
|
|
// NewBillingRollupWithDefaults instantiates a new BillingRollup 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 NewBillingRollupWithDefaults() *BillingRollup {
|
|
this := BillingRollup{}
|
|
return &this
|
|
}
|
|
|
|
// GetBalance returns the Balance field value if set, zero value otherwise.
|
|
func (o *BillingRollup) GetBalance() BillingRollupBalance {
|
|
if o == nil || IsNil(o.Balance) {
|
|
var ret BillingRollupBalance
|
|
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 *BillingRollup) GetBalanceOk() (*BillingRollupBalance, 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 *BillingRollup) HasBalance() bool {
|
|
if o != nil && !IsNil(o.Balance) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetBalance gets a reference to the given BillingRollupBalance and assigns it to the Balance field.
|
|
func (o *BillingRollup) SetBalance(v BillingRollupBalance) {
|
|
o.Balance = &v
|
|
}
|
|
|
|
// GetConsumedCents returns the ConsumedCents field value if set, zero value otherwise.
|
|
func (o *BillingRollup) GetConsumedCents() int64 {
|
|
if o == nil || IsNil(o.ConsumedCents) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.ConsumedCents
|
|
}
|
|
|
|
// GetConsumedCentsOk returns a tuple with the ConsumedCents field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingRollup) GetConsumedCentsOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.ConsumedCents) {
|
|
return nil, false
|
|
}
|
|
return o.ConsumedCents, true
|
|
}
|
|
|
|
// HasConsumedCents returns a boolean if a field has been set.
|
|
func (o *BillingRollup) HasConsumedCents() bool {
|
|
if o != nil && !IsNil(o.ConsumedCents) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetConsumedCents gets a reference to the given int64 and assigns it to the ConsumedCents field.
|
|
func (o *BillingRollup) SetConsumedCents(v int64) {
|
|
o.ConsumedCents = &v
|
|
}
|
|
|
|
// GetCurrency returns the Currency field value if set, zero value otherwise.
|
|
func (o *BillingRollup) GetCurrency() string {
|
|
if o == nil || IsNil(o.Currency) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Currency
|
|
}
|
|
|
|
// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingRollup) GetCurrencyOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Currency) {
|
|
return nil, false
|
|
}
|
|
return o.Currency, true
|
|
}
|
|
|
|
// HasCurrency returns a boolean if a field has been set.
|
|
func (o *BillingRollup) HasCurrency() bool {
|
|
if o != nil && !IsNil(o.Currency) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCurrency gets a reference to the given string and assigns it to the Currency field.
|
|
func (o *BillingRollup) SetCurrency(v string) {
|
|
o.Currency = &v
|
|
}
|
|
|
|
// GetIncluded returns the Included field value if set, zero value otherwise.
|
|
func (o *BillingRollup) GetIncluded() BillingRollupAllotment {
|
|
if o == nil || IsNil(o.Included) {
|
|
var ret BillingRollupAllotment
|
|
return ret
|
|
}
|
|
return *o.Included
|
|
}
|
|
|
|
// GetIncludedOk returns a tuple with the Included field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingRollup) GetIncludedOk() (*BillingRollupAllotment, bool) {
|
|
if o == nil || IsNil(o.Included) {
|
|
return nil, false
|
|
}
|
|
return o.Included, true
|
|
}
|
|
|
|
// HasIncluded returns a boolean if a field has been set.
|
|
func (o *BillingRollup) HasIncluded() bool {
|
|
if o != nil && !IsNil(o.Included) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetIncluded gets a reference to the given BillingRollupAllotment and assigns it to the Included field.
|
|
func (o *BillingRollup) SetIncluded(v BillingRollupAllotment) {
|
|
o.Included = &v
|
|
}
|
|
|
|
// GetOverageCents returns the OverageCents field value if set, zero value otherwise.
|
|
func (o *BillingRollup) GetOverageCents() int64 {
|
|
if o == nil || IsNil(o.OverageCents) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.OverageCents
|
|
}
|
|
|
|
// GetOverageCentsOk returns a tuple with the OverageCents field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingRollup) GetOverageCentsOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.OverageCents) {
|
|
return nil, false
|
|
}
|
|
return o.OverageCents, true
|
|
}
|
|
|
|
// HasOverageCents returns a boolean if a field has been set.
|
|
func (o *BillingRollup) HasOverageCents() bool {
|
|
if o != nil && !IsNil(o.OverageCents) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetOverageCents gets a reference to the given int64 and assigns it to the OverageCents field.
|
|
func (o *BillingRollup) SetOverageCents(v int64) {
|
|
o.OverageCents = &v
|
|
}
|
|
|
|
// GetPeriod returns the Period field value if set, zero value otherwise.
|
|
func (o *BillingRollup) GetPeriod() string {
|
|
if o == nil || IsNil(o.Period) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Period
|
|
}
|
|
|
|
// GetPeriodOk returns a tuple with the Period field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingRollup) GetPeriodOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Period) {
|
|
return nil, false
|
|
}
|
|
return o.Period, true
|
|
}
|
|
|
|
// HasPeriod returns a boolean if a field has been set.
|
|
func (o *BillingRollup) HasPeriod() bool {
|
|
if o != nil && !IsNil(o.Period) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPeriod gets a reference to the given string and assigns it to the Period field.
|
|
func (o *BillingRollup) SetPeriod(v string) {
|
|
o.Period = &v
|
|
}
|
|
|
|
// GetPlan returns the Plan field value if set, zero value otherwise.
|
|
func (o *BillingRollup) 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 *BillingRollup) 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 *BillingRollup) 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 *BillingRollup) SetPlan(v string) {
|
|
o.Plan = &v
|
|
}
|
|
|
|
// GetUser returns the User field value if set, zero value otherwise.
|
|
func (o *BillingRollup) 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 *BillingRollup) 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 *BillingRollup) 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 *BillingRollup) SetUser(v string) {
|
|
o.User = &v
|
|
}
|
|
|
|
func (o BillingRollup) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o BillingRollup) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Balance) {
|
|
toSerialize["balance"] = o.Balance
|
|
}
|
|
if !IsNil(o.ConsumedCents) {
|
|
toSerialize["consumedCents"] = o.ConsumedCents
|
|
}
|
|
if !IsNil(o.Currency) {
|
|
toSerialize["currency"] = o.Currency
|
|
}
|
|
if !IsNil(o.Included) {
|
|
toSerialize["included"] = o.Included
|
|
}
|
|
if !IsNil(o.OverageCents) {
|
|
toSerialize["overageCents"] = o.OverageCents
|
|
}
|
|
if !IsNil(o.Period) {
|
|
toSerialize["period"] = o.Period
|
|
}
|
|
if !IsNil(o.Plan) {
|
|
toSerialize["plan"] = o.Plan
|
|
}
|
|
if !IsNil(o.User) {
|
|
toSerialize["user"] = o.User
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *BillingRollup) UnmarshalJSON(data []byte) (err error) {
|
|
varBillingRollup := _BillingRollup{}
|
|
|
|
err = json.Unmarshal(data, &varBillingRollup)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = BillingRollup(varBillingRollup)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "balance")
|
|
delete(additionalProperties, "consumedCents")
|
|
delete(additionalProperties, "currency")
|
|
delete(additionalProperties, "included")
|
|
delete(additionalProperties, "overageCents")
|
|
delete(additionalProperties, "period")
|
|
delete(additionalProperties, "plan")
|
|
delete(additionalProperties, "user")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableBillingRollup struct {
|
|
value *BillingRollup
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableBillingRollup) Get() *BillingRollup {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableBillingRollup) Set(val *BillingRollup) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableBillingRollup) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableBillingRollup) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableBillingRollup(val *BillingRollup) *NullableBillingRollup {
|
|
return &NullableBillingRollup{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableBillingRollup) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableBillingRollup) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|