mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
191 lines
5.4 KiB
Go
191 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 AiCacheWrites type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &AiCacheWrites{}
|
|
|
|
// AiCacheWrites struct for AiCacheWrites
|
|
type AiCacheWrites struct {
|
|
Ephemeral1hInputTokens *int32 `json:"ephemeral_1h_input_tokens,omitempty"`
|
|
Ephemeral5mInputTokens *int32 `json:"ephemeral_5m_input_tokens,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _AiCacheWrites AiCacheWrites
|
|
|
|
// NewAiCacheWrites instantiates a new AiCacheWrites 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 NewAiCacheWrites() *AiCacheWrites {
|
|
this := AiCacheWrites{}
|
|
return &this
|
|
}
|
|
|
|
// NewAiCacheWritesWithDefaults instantiates a new AiCacheWrites 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 NewAiCacheWritesWithDefaults() *AiCacheWrites {
|
|
this := AiCacheWrites{}
|
|
return &this
|
|
}
|
|
|
|
// GetEphemeral1hInputTokens returns the Ephemeral1hInputTokens field value if set, zero value otherwise.
|
|
func (o *AiCacheWrites) GetEphemeral1hInputTokens() int32 {
|
|
if o == nil || IsNil(o.Ephemeral1hInputTokens) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.Ephemeral1hInputTokens
|
|
}
|
|
|
|
// GetEphemeral1hInputTokensOk returns a tuple with the Ephemeral1hInputTokens field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiCacheWrites) GetEphemeral1hInputTokensOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.Ephemeral1hInputTokens) {
|
|
return nil, false
|
|
}
|
|
return o.Ephemeral1hInputTokens, true
|
|
}
|
|
|
|
// HasEphemeral1hInputTokens returns a boolean if a field has been set.
|
|
func (o *AiCacheWrites) HasEphemeral1hInputTokens() bool {
|
|
if o != nil && !IsNil(o.Ephemeral1hInputTokens) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetEphemeral1hInputTokens gets a reference to the given int32 and assigns it to the Ephemeral1hInputTokens field.
|
|
func (o *AiCacheWrites) SetEphemeral1hInputTokens(v int32) {
|
|
o.Ephemeral1hInputTokens = &v
|
|
}
|
|
|
|
// GetEphemeral5mInputTokens returns the Ephemeral5mInputTokens field value if set, zero value otherwise.
|
|
func (o *AiCacheWrites) GetEphemeral5mInputTokens() int32 {
|
|
if o == nil || IsNil(o.Ephemeral5mInputTokens) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.Ephemeral5mInputTokens
|
|
}
|
|
|
|
// GetEphemeral5mInputTokensOk returns a tuple with the Ephemeral5mInputTokens field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiCacheWrites) GetEphemeral5mInputTokensOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.Ephemeral5mInputTokens) {
|
|
return nil, false
|
|
}
|
|
return o.Ephemeral5mInputTokens, true
|
|
}
|
|
|
|
// HasEphemeral5mInputTokens returns a boolean if a field has been set.
|
|
func (o *AiCacheWrites) HasEphemeral5mInputTokens() bool {
|
|
if o != nil && !IsNil(o.Ephemeral5mInputTokens) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetEphemeral5mInputTokens gets a reference to the given int32 and assigns it to the Ephemeral5mInputTokens field.
|
|
func (o *AiCacheWrites) SetEphemeral5mInputTokens(v int32) {
|
|
o.Ephemeral5mInputTokens = &v
|
|
}
|
|
|
|
func (o AiCacheWrites) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o AiCacheWrites) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Ephemeral1hInputTokens) {
|
|
toSerialize["ephemeral_1h_input_tokens"] = o.Ephemeral1hInputTokens
|
|
}
|
|
if !IsNil(o.Ephemeral5mInputTokens) {
|
|
toSerialize["ephemeral_5m_input_tokens"] = o.Ephemeral5mInputTokens
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *AiCacheWrites) UnmarshalJSON(data []byte) (err error) {
|
|
varAiCacheWrites := _AiCacheWrites{}
|
|
|
|
err = json.Unmarshal(data, &varAiCacheWrites)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = AiCacheWrites(varAiCacheWrites)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "ephemeral_1h_input_tokens")
|
|
delete(additionalProperties, "ephemeral_5m_input_tokens")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableAiCacheWrites struct {
|
|
value *AiCacheWrites
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableAiCacheWrites) Get() *AiCacheWrites {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableAiCacheWrites) Set(val *AiCacheWrites) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableAiCacheWrites) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableAiCacheWrites) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableAiCacheWrites(val *AiCacheWrites) *NullableAiCacheWrites {
|
|
return &NullableAiCacheWrites{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableAiCacheWrites) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableAiCacheWrites) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|