Files
sdk/model_ai_model_list.go

228 lines
5.6 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 AiModelList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AiModelList{}
// AiModelList struct for AiModelList
type AiModelList struct {
Data []AiModelInfo `json:"data,omitempty"`
Models []AiModelInfo `json:"models,omitempty"`
Object *string `json:"object,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AiModelList AiModelList
// NewAiModelList instantiates a new AiModelList 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 NewAiModelList() *AiModelList {
this := AiModelList{}
return &this
}
// NewAiModelListWithDefaults instantiates a new AiModelList 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 NewAiModelListWithDefaults() *AiModelList {
this := AiModelList{}
return &this
}
// GetData returns the Data field value if set, zero value otherwise.
func (o *AiModelList) GetData() []AiModelInfo {
if o == nil || IsNil(o.Data) {
var ret []AiModelInfo
return ret
}
return o.Data
}
// GetDataOk returns a tuple with the Data field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiModelList) GetDataOk() ([]AiModelInfo, bool) {
if o == nil || IsNil(o.Data) {
return nil, false
}
return o.Data, true
}
// HasData returns a boolean if a field has been set.
func (o *AiModelList) HasData() bool {
if o != nil && !IsNil(o.Data) {
return true
}
return false
}
// SetData gets a reference to the given []AiModelInfo and assigns it to the Data field.
func (o *AiModelList) SetData(v []AiModelInfo) {
o.Data = v
}
// GetModels returns the Models field value if set, zero value otherwise.
func (o *AiModelList) GetModels() []AiModelInfo {
if o == nil || IsNil(o.Models) {
var ret []AiModelInfo
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 *AiModelList) GetModelsOk() ([]AiModelInfo, bool) {
if o == nil || IsNil(o.Models) {
return nil, false
}
return o.Models, true
}
// HasModels returns a boolean if a field has been set.
func (o *AiModelList) HasModels() bool {
if o != nil && !IsNil(o.Models) {
return true
}
return false
}
// SetModels gets a reference to the given []AiModelInfo and assigns it to the Models field.
func (o *AiModelList) SetModels(v []AiModelInfo) {
o.Models = v
}
// GetObject returns the Object field value if set, zero value otherwise.
func (o *AiModelList) GetObject() string {
if o == nil || IsNil(o.Object) {
var ret string
return ret
}
return *o.Object
}
// GetObjectOk returns a tuple with the Object field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiModelList) GetObjectOk() (*string, bool) {
if o == nil || IsNil(o.Object) {
return nil, false
}
return o.Object, true
}
// HasObject returns a boolean if a field has been set.
func (o *AiModelList) HasObject() bool {
if o != nil && !IsNil(o.Object) {
return true
}
return false
}
// SetObject gets a reference to the given string and assigns it to the Object field.
func (o *AiModelList) SetObject(v string) {
o.Object = &v
}
func (o AiModelList) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AiModelList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Data) {
toSerialize["data"] = o.Data
}
if !IsNil(o.Models) {
toSerialize["models"] = o.Models
}
if !IsNil(o.Object) {
toSerialize["object"] = o.Object
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AiModelList) UnmarshalJSON(data []byte) (err error) {
varAiModelList := _AiModelList{}
err = json.Unmarshal(data, &varAiModelList)
if err != nil {
return err
}
*o = AiModelList(varAiModelList)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "data")
delete(additionalProperties, "models")
delete(additionalProperties, "object")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAiModelList struct {
value *AiModelList
isSet bool
}
func (v NullableAiModelList) Get() *AiModelList {
return v.value
}
func (v *NullableAiModelList) Set(val *AiModelList) {
v.value = val
v.isSet = true
}
func (v NullableAiModelList) IsSet() bool {
return v.isSet
}
func (v *NullableAiModelList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAiModelList(val *AiModelList) *NullableAiModelList {
return &NullableAiModelList{value: val, isSet: true}
}
func (v NullableAiModelList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAiModelList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}