Files
sdk/model_get_ai_nodes_200_response.go

272 lines
7.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"
"fmt"
)
// checks if the GetAiNodes200Response type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GetAiNodes200Response{}
// GetAiNodes200Response struct for GetAiNodes200Response
type GetAiNodes200Response struct {
Data []Node `json:"data,omitempty"`
Data2 interface{} `json:"data2,omitempty"`
// Empty on success, the reason on failure.
Msg string `json:"msg"`
Status string `json:"status"`
AdditionalProperties map[string]interface{}
}
type _GetAiNodes200Response GetAiNodes200Response
// NewGetAiNodes200Response instantiates a new GetAiNodes200Response 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 NewGetAiNodes200Response(msg string, status string) *GetAiNodes200Response {
this := GetAiNodes200Response{}
this.Msg = msg
this.Status = status
return &this
}
// NewGetAiNodes200ResponseWithDefaults instantiates a new GetAiNodes200Response 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 NewGetAiNodes200ResponseWithDefaults() *GetAiNodes200Response {
this := GetAiNodes200Response{}
return &this
}
// GetData returns the Data field value if set, zero value otherwise.
func (o *GetAiNodes200Response) GetData() []Node {
if o == nil || IsNil(o.Data) {
var ret []Node
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 *GetAiNodes200Response) GetDataOk() ([]Node, 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 *GetAiNodes200Response) HasData() bool {
if o != nil && !IsNil(o.Data) {
return true
}
return false
}
// SetData gets a reference to the given []Node and assigns it to the Data field.
func (o *GetAiNodes200Response) SetData(v []Node) {
o.Data = v
}
// GetData2 returns the Data2 field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *GetAiNodes200Response) GetData2() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Data2
}
// GetData2Ok returns a tuple with the Data2 field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *GetAiNodes200Response) GetData2Ok() (*interface{}, bool) {
if o == nil || IsNil(o.Data2) {
return nil, false
}
return &o.Data2, true
}
// HasData2 returns a boolean if a field has been set.
func (o *GetAiNodes200Response) HasData2() bool {
if o != nil && !IsNil(o.Data2) {
return true
}
return false
}
// SetData2 gets a reference to the given interface{} and assigns it to the Data2 field.
func (o *GetAiNodes200Response) SetData2(v interface{}) {
o.Data2 = v
}
// GetMsg returns the Msg field value
func (o *GetAiNodes200Response) GetMsg() string {
if o == nil {
var ret string
return ret
}
return o.Msg
}
// GetMsgOk returns a tuple with the Msg field value
// and a boolean to check if the value has been set.
func (o *GetAiNodes200Response) GetMsgOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Msg, true
}
// SetMsg sets field value
func (o *GetAiNodes200Response) SetMsg(v string) {
o.Msg = v
}
// GetStatus returns the Status field value
func (o *GetAiNodes200Response) GetStatus() string {
if o == nil {
var ret string
return ret
}
return o.Status
}
// GetStatusOk returns a tuple with the Status field value
// and a boolean to check if the value has been set.
func (o *GetAiNodes200Response) GetStatusOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Status, true
}
// SetStatus sets field value
func (o *GetAiNodes200Response) SetStatus(v string) {
o.Status = v
}
func (o GetAiNodes200Response) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GetAiNodes200Response) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Data) {
toSerialize["data"] = o.Data
}
if o.Data2 != nil {
toSerialize["data2"] = o.Data2
}
toSerialize["msg"] = o.Msg
toSerialize["status"] = o.Status
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GetAiNodes200Response) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"msg",
"status",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varGetAiNodes200Response := _GetAiNodes200Response{}
err = json.Unmarshal(data, &varGetAiNodes200Response)
if err != nil {
return err
}
*o = GetAiNodes200Response(varGetAiNodes200Response)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "data")
delete(additionalProperties, "data2")
delete(additionalProperties, "msg")
delete(additionalProperties, "status")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGetAiNodes200Response struct {
value *GetAiNodes200Response
isSet bool
}
func (v NullableGetAiNodes200Response) Get() *GetAiNodes200Response {
return v.value
}
func (v *NullableGetAiNodes200Response) Set(val *GetAiNodes200Response) {
v.value = val
v.isSet = true
}
func (v NullableGetAiNodes200Response) IsSet() bool {
return v.isSet
}
func (v *NullableGetAiNodes200Response) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGetAiNodes200Response(val *GetAiNodes200Response) *NullableGetAiNodes200Response {
return &NullableGetAiNodes200Response{value: val, isSet: true}
}
func (v NullableGetAiNodes200Response) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGetAiNodes200Response) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}