mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
304 lines
7.4 KiB
Go
304 lines
7.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 AiResponse type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &AiResponse{}
|
|
|
|
// AiResponse struct for AiResponse
|
|
type AiResponse struct {
|
|
Code *string `json:"code,omitempty"`
|
|
Data interface{} `json:"data,omitempty"`
|
|
Data2 interface{} `json:"data2,omitempty"`
|
|
Msg *string `json:"msg,omitempty"`
|
|
Status *string `json:"status,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _AiResponse AiResponse
|
|
|
|
// NewAiResponse instantiates a new AiResponse 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 NewAiResponse() *AiResponse {
|
|
this := AiResponse{}
|
|
return &this
|
|
}
|
|
|
|
// NewAiResponseWithDefaults instantiates a new AiResponse 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 NewAiResponseWithDefaults() *AiResponse {
|
|
this := AiResponse{}
|
|
return &this
|
|
}
|
|
|
|
// GetCode returns the Code field value if set, zero value otherwise.
|
|
func (o *AiResponse) GetCode() string {
|
|
if o == nil || IsNil(o.Code) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Code
|
|
}
|
|
|
|
// GetCodeOk returns a tuple with the Code field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiResponse) GetCodeOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Code) {
|
|
return nil, false
|
|
}
|
|
return o.Code, true
|
|
}
|
|
|
|
// HasCode returns a boolean if a field has been set.
|
|
func (o *AiResponse) HasCode() bool {
|
|
if o != nil && !IsNil(o.Code) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCode gets a reference to the given string and assigns it to the Code field.
|
|
func (o *AiResponse) SetCode(v string) {
|
|
o.Code = &v
|
|
}
|
|
|
|
// GetData returns the Data field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *AiResponse) GetData() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
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.
|
|
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
|
func (o *AiResponse) GetDataOk() (*interface{}, 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 *AiResponse) HasData() bool {
|
|
if o != nil && !IsNil(o.Data) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetData gets a reference to the given interface{} and assigns it to the Data field.
|
|
func (o *AiResponse) SetData(v interface{}) {
|
|
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 *AiResponse) 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 *AiResponse) 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 *AiResponse) 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 *AiResponse) SetData2(v interface{}) {
|
|
o.Data2 = v
|
|
}
|
|
|
|
// GetMsg returns the Msg field value if set, zero value otherwise.
|
|
func (o *AiResponse) GetMsg() string {
|
|
if o == nil || IsNil(o.Msg) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Msg
|
|
}
|
|
|
|
// GetMsgOk returns a tuple with the Msg field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiResponse) GetMsgOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Msg) {
|
|
return nil, false
|
|
}
|
|
return o.Msg, true
|
|
}
|
|
|
|
// HasMsg returns a boolean if a field has been set.
|
|
func (o *AiResponse) HasMsg() bool {
|
|
if o != nil && !IsNil(o.Msg) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMsg gets a reference to the given string and assigns it to the Msg field.
|
|
func (o *AiResponse) SetMsg(v string) {
|
|
o.Msg = &v
|
|
}
|
|
|
|
// GetStatus returns the Status field value if set, zero value otherwise.
|
|
func (o *AiResponse) GetStatus() string {
|
|
if o == nil || IsNil(o.Status) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Status
|
|
}
|
|
|
|
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiResponse) GetStatusOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Status) {
|
|
return nil, false
|
|
}
|
|
return o.Status, true
|
|
}
|
|
|
|
// HasStatus returns a boolean if a field has been set.
|
|
func (o *AiResponse) HasStatus() bool {
|
|
if o != nil && !IsNil(o.Status) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStatus gets a reference to the given string and assigns it to the Status field.
|
|
func (o *AiResponse) SetStatus(v string) {
|
|
o.Status = &v
|
|
}
|
|
|
|
func (o AiResponse) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o AiResponse) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Code) {
|
|
toSerialize["code"] = o.Code
|
|
}
|
|
if o.Data != nil {
|
|
toSerialize["data"] = o.Data
|
|
}
|
|
if o.Data2 != nil {
|
|
toSerialize["data2"] = o.Data2
|
|
}
|
|
if !IsNil(o.Msg) {
|
|
toSerialize["msg"] = o.Msg
|
|
}
|
|
if !IsNil(o.Status) {
|
|
toSerialize["status"] = o.Status
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *AiResponse) UnmarshalJSON(data []byte) (err error) {
|
|
varAiResponse := _AiResponse{}
|
|
|
|
err = json.Unmarshal(data, &varAiResponse)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = AiResponse(varAiResponse)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "code")
|
|
delete(additionalProperties, "data")
|
|
delete(additionalProperties, "data2")
|
|
delete(additionalProperties, "msg")
|
|
delete(additionalProperties, "status")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableAiResponse struct {
|
|
value *AiResponse
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableAiResponse) Get() *AiResponse {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableAiResponse) Set(val *AiResponse) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableAiResponse) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableAiResponse) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableAiResponse(val *AiResponse) *NullableAiResponse {
|
|
return &NullableAiResponse{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableAiResponse) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableAiResponse) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|