Files
sdk/model_ai_throughput_stats.go

191 lines
5.0 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 AiThroughputStats type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AiThroughputStats{}
// AiThroughputStats struct for AiThroughputStats
type AiThroughputStats struct {
PerHour []int32 `json:"per_hour,omitempty"`
TotalWindow *int32 `json:"total_window,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AiThroughputStats AiThroughputStats
// NewAiThroughputStats instantiates a new AiThroughputStats 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 NewAiThroughputStats() *AiThroughputStats {
this := AiThroughputStats{}
return &this
}
// NewAiThroughputStatsWithDefaults instantiates a new AiThroughputStats 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 NewAiThroughputStatsWithDefaults() *AiThroughputStats {
this := AiThroughputStats{}
return &this
}
// GetPerHour returns the PerHour field value if set, zero value otherwise.
func (o *AiThroughputStats) GetPerHour() []int32 {
if o == nil || IsNil(o.PerHour) {
var ret []int32
return ret
}
return o.PerHour
}
// GetPerHourOk returns a tuple with the PerHour field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiThroughputStats) GetPerHourOk() ([]int32, bool) {
if o == nil || IsNil(o.PerHour) {
return nil, false
}
return o.PerHour, true
}
// HasPerHour returns a boolean if a field has been set.
func (o *AiThroughputStats) HasPerHour() bool {
if o != nil && !IsNil(o.PerHour) {
return true
}
return false
}
// SetPerHour gets a reference to the given []int32 and assigns it to the PerHour field.
func (o *AiThroughputStats) SetPerHour(v []int32) {
o.PerHour = v
}
// GetTotalWindow returns the TotalWindow field value if set, zero value otherwise.
func (o *AiThroughputStats) GetTotalWindow() int32 {
if o == nil || IsNil(o.TotalWindow) {
var ret int32
return ret
}
return *o.TotalWindow
}
// GetTotalWindowOk returns a tuple with the TotalWindow field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiThroughputStats) GetTotalWindowOk() (*int32, bool) {
if o == nil || IsNil(o.TotalWindow) {
return nil, false
}
return o.TotalWindow, true
}
// HasTotalWindow returns a boolean if a field has been set.
func (o *AiThroughputStats) HasTotalWindow() bool {
if o != nil && !IsNil(o.TotalWindow) {
return true
}
return false
}
// SetTotalWindow gets a reference to the given int32 and assigns it to the TotalWindow field.
func (o *AiThroughputStats) SetTotalWindow(v int32) {
o.TotalWindow = &v
}
func (o AiThroughputStats) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AiThroughputStats) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.PerHour) {
toSerialize["per_hour"] = o.PerHour
}
if !IsNil(o.TotalWindow) {
toSerialize["total_window"] = o.TotalWindow
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AiThroughputStats) UnmarshalJSON(data []byte) (err error) {
varAiThroughputStats := _AiThroughputStats{}
err = json.Unmarshal(data, &varAiThroughputStats)
if err != nil {
return err
}
*o = AiThroughputStats(varAiThroughputStats)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "per_hour")
delete(additionalProperties, "total_window")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAiThroughputStats struct {
value *AiThroughputStats
isSet bool
}
func (v NullableAiThroughputStats) Get() *AiThroughputStats {
return v.value
}
func (v *NullableAiThroughputStats) Set(val *AiThroughputStats) {
v.value = val
v.isSet = true
}
func (v NullableAiThroughputStats) IsSet() bool {
return v.isSet
}
func (v *NullableAiThroughputStats) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAiThroughputStats(val *AiThroughputStats) *NullableAiThroughputStats {
return &NullableAiThroughputStats{value: val, isSet: true}
}
func (v NullableAiThroughputStats) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAiThroughputStats) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}