Files
sdk/model_ai_rate.go

269 lines
6.3 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 AiRate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AiRate{}
// AiRate struct for AiRate
type AiRate struct {
// Default is the platform's requests a minute, the most the organization may set.
Default *int64 `json:"default,omitempty"`
// Org is the organization.
Org *string `json:"org,omitempty"`
// Own is the organization's own setting, 0 when it holds its people to the default.
Own *int64 `json:"own,omitempty"`
// Rpm is the model requests a minute one person may make acting in it now: its own setting where it set less than the default, else the default.
Rpm *int64 `json:"rpm,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AiRate AiRate
// NewAiRate instantiates a new AiRate 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 NewAiRate() *AiRate {
this := AiRate{}
return &this
}
// NewAiRateWithDefaults instantiates a new AiRate 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 NewAiRateWithDefaults() *AiRate {
this := AiRate{}
return &this
}
// GetDefault returns the Default field value if set, zero value otherwise.
func (o *AiRate) GetDefault() int64 {
if o == nil || IsNil(o.Default) {
var ret int64
return ret
}
return *o.Default
}
// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiRate) GetDefaultOk() (*int64, bool) {
if o == nil || IsNil(o.Default) {
return nil, false
}
return o.Default, true
}
// HasDefault returns a boolean if a field has been set.
func (o *AiRate) HasDefault() bool {
if o != nil && !IsNil(o.Default) {
return true
}
return false
}
// SetDefault gets a reference to the given int64 and assigns it to the Default field.
func (o *AiRate) SetDefault(v int64) {
o.Default = &v
}
// GetOrg returns the Org field value if set, zero value otherwise.
func (o *AiRate) GetOrg() string {
if o == nil || IsNil(o.Org) {
var ret string
return ret
}
return *o.Org
}
// GetOrgOk returns a tuple with the Org field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiRate) GetOrgOk() (*string, bool) {
if o == nil || IsNil(o.Org) {
return nil, false
}
return o.Org, true
}
// HasOrg returns a boolean if a field has been set.
func (o *AiRate) HasOrg() bool {
if o != nil && !IsNil(o.Org) {
return true
}
return false
}
// SetOrg gets a reference to the given string and assigns it to the Org field.
func (o *AiRate) SetOrg(v string) {
o.Org = &v
}
// GetOwn returns the Own field value if set, zero value otherwise.
func (o *AiRate) GetOwn() int64 {
if o == nil || IsNil(o.Own) {
var ret int64
return ret
}
return *o.Own
}
// GetOwnOk returns a tuple with the Own field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiRate) GetOwnOk() (*int64, bool) {
if o == nil || IsNil(o.Own) {
return nil, false
}
return o.Own, true
}
// HasOwn returns a boolean if a field has been set.
func (o *AiRate) HasOwn() bool {
if o != nil && !IsNil(o.Own) {
return true
}
return false
}
// SetOwn gets a reference to the given int64 and assigns it to the Own field.
func (o *AiRate) SetOwn(v int64) {
o.Own = &v
}
// GetRpm returns the Rpm field value if set, zero value otherwise.
func (o *AiRate) GetRpm() int64 {
if o == nil || IsNil(o.Rpm) {
var ret int64
return ret
}
return *o.Rpm
}
// GetRpmOk returns a tuple with the Rpm field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiRate) GetRpmOk() (*int64, bool) {
if o == nil || IsNil(o.Rpm) {
return nil, false
}
return o.Rpm, true
}
// HasRpm returns a boolean if a field has been set.
func (o *AiRate) HasRpm() bool {
if o != nil && !IsNil(o.Rpm) {
return true
}
return false
}
// SetRpm gets a reference to the given int64 and assigns it to the Rpm field.
func (o *AiRate) SetRpm(v int64) {
o.Rpm = &v
}
func (o AiRate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AiRate) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Default) {
toSerialize["default"] = o.Default
}
if !IsNil(o.Org) {
toSerialize["org"] = o.Org
}
if !IsNil(o.Own) {
toSerialize["own"] = o.Own
}
if !IsNil(o.Rpm) {
toSerialize["rpm"] = o.Rpm
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AiRate) UnmarshalJSON(data []byte) (err error) {
varAiRate := _AiRate{}
err = json.Unmarshal(data, &varAiRate)
if err != nil {
return err
}
*o = AiRate(varAiRate)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "default")
delete(additionalProperties, "org")
delete(additionalProperties, "own")
delete(additionalProperties, "rpm")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAiRate struct {
value *AiRate
isSet bool
}
func (v NullableAiRate) Get() *AiRate {
return v.value
}
func (v *NullableAiRate) Set(val *AiRate) {
v.value = val
v.isSet = true
}
func (v NullableAiRate) IsSet() bool {
return v.isSet
}
func (v *NullableAiRate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAiRate(val *AiRate) *NullableAiRate {
return &NullableAiRate{value: val, isSet: true}
}
func (v NullableAiRate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAiRate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}