mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
191 lines
4.7 KiB
Go
191 lines
4.7 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 AiTaskStats type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &AiTaskStats{}
|
|
|
|
// AiTaskStats struct for AiTaskStats
|
|
type AiTaskStats struct {
|
|
Events *int32 `json:"events,omitempty"`
|
|
Models map[string]int32 `json:"models,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _AiTaskStats AiTaskStats
|
|
|
|
// NewAiTaskStats instantiates a new AiTaskStats 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 NewAiTaskStats() *AiTaskStats {
|
|
this := AiTaskStats{}
|
|
return &this
|
|
}
|
|
|
|
// NewAiTaskStatsWithDefaults instantiates a new AiTaskStats 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 NewAiTaskStatsWithDefaults() *AiTaskStats {
|
|
this := AiTaskStats{}
|
|
return &this
|
|
}
|
|
|
|
// GetEvents returns the Events field value if set, zero value otherwise.
|
|
func (o *AiTaskStats) GetEvents() int32 {
|
|
if o == nil || IsNil(o.Events) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.Events
|
|
}
|
|
|
|
// GetEventsOk returns a tuple with the Events field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiTaskStats) GetEventsOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.Events) {
|
|
return nil, false
|
|
}
|
|
return o.Events, true
|
|
}
|
|
|
|
// HasEvents returns a boolean if a field has been set.
|
|
func (o *AiTaskStats) HasEvents() bool {
|
|
if o != nil && !IsNil(o.Events) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetEvents gets a reference to the given int32 and assigns it to the Events field.
|
|
func (o *AiTaskStats) SetEvents(v int32) {
|
|
o.Events = &v
|
|
}
|
|
|
|
// GetModels returns the Models field value if set, zero value otherwise.
|
|
func (o *AiTaskStats) GetModels() map[string]int32 {
|
|
if o == nil || IsNil(o.Models) {
|
|
var ret map[string]int32
|
|
return ret
|
|
}
|
|
return o.Models
|
|
}
|
|
|
|
// GetModelsOk returns a tuple with the Models field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiTaskStats) GetModelsOk() (map[string]int32, bool) {
|
|
if o == nil || IsNil(o.Models) {
|
|
return map[string]int32{}, false
|
|
}
|
|
return o.Models, true
|
|
}
|
|
|
|
// HasModels returns a boolean if a field has been set.
|
|
func (o *AiTaskStats) HasModels() bool {
|
|
if o != nil && !IsNil(o.Models) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetModels gets a reference to the given map[string]int32 and assigns it to the Models field.
|
|
func (o *AiTaskStats) SetModels(v map[string]int32) {
|
|
o.Models = v
|
|
}
|
|
|
|
func (o AiTaskStats) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o AiTaskStats) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Events) {
|
|
toSerialize["events"] = o.Events
|
|
}
|
|
if !IsNil(o.Models) {
|
|
toSerialize["models"] = o.Models
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *AiTaskStats) UnmarshalJSON(data []byte) (err error) {
|
|
varAiTaskStats := _AiTaskStats{}
|
|
|
|
err = json.Unmarshal(data, &varAiTaskStats)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = AiTaskStats(varAiTaskStats)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "events")
|
|
delete(additionalProperties, "models")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableAiTaskStats struct {
|
|
value *AiTaskStats
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableAiTaskStats) Get() *AiTaskStats {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableAiTaskStats) Set(val *AiTaskStats) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableAiTaskStats) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableAiTaskStats) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableAiTaskStats(val *AiTaskStats) *NullableAiTaskStats {
|
|
return &NullableAiTaskStats{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableAiTaskStats) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableAiTaskStats) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|