mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
192 lines
5.4 KiB
Go
192 lines
5.4 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 BillingSubscriptions type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &BillingSubscriptions{}
|
|
|
|
// BillingSubscriptions struct for BillingSubscriptions
|
|
type BillingSubscriptions struct {
|
|
// Count is the row count beside the rows, which is the shape this address has always answered with.
|
|
Count *int64 `json:"count,omitempty"`
|
|
Subscriptions []BillingSubscription `json:"subscriptions,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _BillingSubscriptions BillingSubscriptions
|
|
|
|
// NewBillingSubscriptions instantiates a new BillingSubscriptions 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 NewBillingSubscriptions() *BillingSubscriptions {
|
|
this := BillingSubscriptions{}
|
|
return &this
|
|
}
|
|
|
|
// NewBillingSubscriptionsWithDefaults instantiates a new BillingSubscriptions 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 NewBillingSubscriptionsWithDefaults() *BillingSubscriptions {
|
|
this := BillingSubscriptions{}
|
|
return &this
|
|
}
|
|
|
|
// GetCount returns the Count field value if set, zero value otherwise.
|
|
func (o *BillingSubscriptions) GetCount() int64 {
|
|
if o == nil || IsNil(o.Count) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Count
|
|
}
|
|
|
|
// GetCountOk returns a tuple with the Count field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingSubscriptions) GetCountOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Count) {
|
|
return nil, false
|
|
}
|
|
return o.Count, true
|
|
}
|
|
|
|
// HasCount returns a boolean if a field has been set.
|
|
func (o *BillingSubscriptions) HasCount() bool {
|
|
if o != nil && !IsNil(o.Count) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCount gets a reference to the given int64 and assigns it to the Count field.
|
|
func (o *BillingSubscriptions) SetCount(v int64) {
|
|
o.Count = &v
|
|
}
|
|
|
|
// GetSubscriptions returns the Subscriptions field value if set, zero value otherwise.
|
|
func (o *BillingSubscriptions) GetSubscriptions() []BillingSubscription {
|
|
if o == nil || IsNil(o.Subscriptions) {
|
|
var ret []BillingSubscription
|
|
return ret
|
|
}
|
|
return o.Subscriptions
|
|
}
|
|
|
|
// GetSubscriptionsOk returns a tuple with the Subscriptions field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingSubscriptions) GetSubscriptionsOk() ([]BillingSubscription, bool) {
|
|
if o == nil || IsNil(o.Subscriptions) {
|
|
return nil, false
|
|
}
|
|
return o.Subscriptions, true
|
|
}
|
|
|
|
// HasSubscriptions returns a boolean if a field has been set.
|
|
func (o *BillingSubscriptions) HasSubscriptions() bool {
|
|
if o != nil && !IsNil(o.Subscriptions) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSubscriptions gets a reference to the given []BillingSubscription and assigns it to the Subscriptions field.
|
|
func (o *BillingSubscriptions) SetSubscriptions(v []BillingSubscription) {
|
|
o.Subscriptions = v
|
|
}
|
|
|
|
func (o BillingSubscriptions) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o BillingSubscriptions) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Count) {
|
|
toSerialize["count"] = o.Count
|
|
}
|
|
if !IsNil(o.Subscriptions) {
|
|
toSerialize["subscriptions"] = o.Subscriptions
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *BillingSubscriptions) UnmarshalJSON(data []byte) (err error) {
|
|
varBillingSubscriptions := _BillingSubscriptions{}
|
|
|
|
err = json.Unmarshal(data, &varBillingSubscriptions)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = BillingSubscriptions(varBillingSubscriptions)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "count")
|
|
delete(additionalProperties, "subscriptions")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableBillingSubscriptions struct {
|
|
value *BillingSubscriptions
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableBillingSubscriptions) Get() *BillingSubscriptions {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableBillingSubscriptions) Set(val *BillingSubscriptions) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableBillingSubscriptions) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableBillingSubscriptions) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableBillingSubscriptions(val *BillingSubscriptions) *NullableBillingSubscriptions {
|
|
return &NullableBillingSubscriptions{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableBillingSubscriptions) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableBillingSubscriptions) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|