Files
sdk/model_billing_tier_limits.go

340 lines
9.5 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 BillingTierLimits type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BillingTierLimits{}
// BillingTierLimits struct for BillingTierLimits
type BillingTierLimits struct {
AllowedModels []string `json:"allowedModels,omitempty"`
DailyCreditsCents *int64 `json:"dailyCreditsCents,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
MaxAgents *int64 `json:"maxAgents,omitempty"`
Name *string `json:"name,omitempty"`
// UnlimitedAgents reports that MaxAgents 0 means \"no ceiling\" rather than \"no agents\" — the reading a bare zero cannot carry.
UnlimitedAgents *bool `json:"unlimitedAgents,omitempty"`
AdditionalProperties map[string]interface{}
}
type _BillingTierLimits BillingTierLimits
// NewBillingTierLimits instantiates a new BillingTierLimits 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 NewBillingTierLimits() *BillingTierLimits {
this := BillingTierLimits{}
return &this
}
// NewBillingTierLimitsWithDefaults instantiates a new BillingTierLimits 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 NewBillingTierLimitsWithDefaults() *BillingTierLimits {
this := BillingTierLimits{}
return &this
}
// GetAllowedModels returns the AllowedModels field value if set, zero value otherwise.
func (o *BillingTierLimits) GetAllowedModels() []string {
if o == nil || IsNil(o.AllowedModels) {
var ret []string
return ret
}
return o.AllowedModels
}
// GetAllowedModelsOk returns a tuple with the AllowedModels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingTierLimits) GetAllowedModelsOk() ([]string, bool) {
if o == nil || IsNil(o.AllowedModels) {
return nil, false
}
return o.AllowedModels, true
}
// HasAllowedModels returns a boolean if a field has been set.
func (o *BillingTierLimits) HasAllowedModels() bool {
if o != nil && !IsNil(o.AllowedModels) {
return true
}
return false
}
// SetAllowedModels gets a reference to the given []string and assigns it to the AllowedModels field.
func (o *BillingTierLimits) SetAllowedModels(v []string) {
o.AllowedModels = v
}
// GetDailyCreditsCents returns the DailyCreditsCents field value if set, zero value otherwise.
func (o *BillingTierLimits) GetDailyCreditsCents() int64 {
if o == nil || IsNil(o.DailyCreditsCents) {
var ret int64
return ret
}
return *o.DailyCreditsCents
}
// GetDailyCreditsCentsOk returns a tuple with the DailyCreditsCents field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingTierLimits) GetDailyCreditsCentsOk() (*int64, bool) {
if o == nil || IsNil(o.DailyCreditsCents) {
return nil, false
}
return o.DailyCreditsCents, true
}
// HasDailyCreditsCents returns a boolean if a field has been set.
func (o *BillingTierLimits) HasDailyCreditsCents() bool {
if o != nil && !IsNil(o.DailyCreditsCents) {
return true
}
return false
}
// SetDailyCreditsCents gets a reference to the given int64 and assigns it to the DailyCreditsCents field.
func (o *BillingTierLimits) SetDailyCreditsCents(v int64) {
o.DailyCreditsCents = &v
}
// GetDisplayName returns the DisplayName field value if set, zero value otherwise.
func (o *BillingTierLimits) GetDisplayName() string {
if o == nil || IsNil(o.DisplayName) {
var ret string
return ret
}
return *o.DisplayName
}
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingTierLimits) GetDisplayNameOk() (*string, bool) {
if o == nil || IsNil(o.DisplayName) {
return nil, false
}
return o.DisplayName, true
}
// HasDisplayName returns a boolean if a field has been set.
func (o *BillingTierLimits) HasDisplayName() bool {
if o != nil && !IsNil(o.DisplayName) {
return true
}
return false
}
// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field.
func (o *BillingTierLimits) SetDisplayName(v string) {
o.DisplayName = &v
}
// GetMaxAgents returns the MaxAgents field value if set, zero value otherwise.
func (o *BillingTierLimits) GetMaxAgents() int64 {
if o == nil || IsNil(o.MaxAgents) {
var ret int64
return ret
}
return *o.MaxAgents
}
// GetMaxAgentsOk returns a tuple with the MaxAgents field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingTierLimits) GetMaxAgentsOk() (*int64, bool) {
if o == nil || IsNil(o.MaxAgents) {
return nil, false
}
return o.MaxAgents, true
}
// HasMaxAgents returns a boolean if a field has been set.
func (o *BillingTierLimits) HasMaxAgents() bool {
if o != nil && !IsNil(o.MaxAgents) {
return true
}
return false
}
// SetMaxAgents gets a reference to the given int64 and assigns it to the MaxAgents field.
func (o *BillingTierLimits) SetMaxAgents(v int64) {
o.MaxAgents = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *BillingTierLimits) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingTierLimits) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *BillingTierLimits) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *BillingTierLimits) SetName(v string) {
o.Name = &v
}
// GetUnlimitedAgents returns the UnlimitedAgents field value if set, zero value otherwise.
func (o *BillingTierLimits) GetUnlimitedAgents() bool {
if o == nil || IsNil(o.UnlimitedAgents) {
var ret bool
return ret
}
return *o.UnlimitedAgents
}
// GetUnlimitedAgentsOk returns a tuple with the UnlimitedAgents field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingTierLimits) GetUnlimitedAgentsOk() (*bool, bool) {
if o == nil || IsNil(o.UnlimitedAgents) {
return nil, false
}
return o.UnlimitedAgents, true
}
// HasUnlimitedAgents returns a boolean if a field has been set.
func (o *BillingTierLimits) HasUnlimitedAgents() bool {
if o != nil && !IsNil(o.UnlimitedAgents) {
return true
}
return false
}
// SetUnlimitedAgents gets a reference to the given bool and assigns it to the UnlimitedAgents field.
func (o *BillingTierLimits) SetUnlimitedAgents(v bool) {
o.UnlimitedAgents = &v
}
func (o BillingTierLimits) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BillingTierLimits) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.AllowedModels) {
toSerialize["allowedModels"] = o.AllowedModels
}
if !IsNil(o.DailyCreditsCents) {
toSerialize["dailyCreditsCents"] = o.DailyCreditsCents
}
if !IsNil(o.DisplayName) {
toSerialize["displayName"] = o.DisplayName
}
if !IsNil(o.MaxAgents) {
toSerialize["maxAgents"] = o.MaxAgents
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.UnlimitedAgents) {
toSerialize["unlimitedAgents"] = o.UnlimitedAgents
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *BillingTierLimits) UnmarshalJSON(data []byte) (err error) {
varBillingTierLimits := _BillingTierLimits{}
err = json.Unmarshal(data, &varBillingTierLimits)
if err != nil {
return err
}
*o = BillingTierLimits(varBillingTierLimits)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "allowedModels")
delete(additionalProperties, "dailyCreditsCents")
delete(additionalProperties, "displayName")
delete(additionalProperties, "maxAgents")
delete(additionalProperties, "name")
delete(additionalProperties, "unlimitedAgents")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableBillingTierLimits struct {
value *BillingTierLimits
isSet bool
}
func (v NullableBillingTierLimits) Get() *BillingTierLimits {
return v.value
}
func (v *NullableBillingTierLimits) Set(val *BillingTierLimits) {
v.value = val
v.isSet = true
}
func (v NullableBillingTierLimits) IsSet() bool {
return v.isSet
}
func (v *NullableBillingTierLimits) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBillingTierLimits(val *BillingTierLimits) *NullableBillingTierLimits {
return &NullableBillingTierLimits{value: val, isSet: true}
}
func (v NullableBillingTierLimits) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBillingTierLimits) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}