mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
266 lines
6.7 KiB
Go
266 lines
6.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 MCPResponse type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &MCPResponse{}
|
|
|
|
// MCPResponse struct for MCPResponse
|
|
type MCPResponse struct {
|
|
Error *MCPError `json:"error,omitempty"`
|
|
Id interface{} `json:"id,omitempty"`
|
|
Jsonrpc *string `json:"jsonrpc,omitempty"`
|
|
Result map[string]interface{} `json:"result,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _MCPResponse MCPResponse
|
|
|
|
// NewMCPResponse instantiates a new MCPResponse 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 NewMCPResponse() *MCPResponse {
|
|
this := MCPResponse{}
|
|
return &this
|
|
}
|
|
|
|
// NewMCPResponseWithDefaults instantiates a new MCPResponse 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 NewMCPResponseWithDefaults() *MCPResponse {
|
|
this := MCPResponse{}
|
|
return &this
|
|
}
|
|
|
|
// GetError returns the Error field value if set, zero value otherwise.
|
|
func (o *MCPResponse) GetError() MCPError {
|
|
if o == nil || IsNil(o.Error) {
|
|
var ret MCPError
|
|
return ret
|
|
}
|
|
return *o.Error
|
|
}
|
|
|
|
// GetErrorOk returns a tuple with the Error field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MCPResponse) GetErrorOk() (*MCPError, bool) {
|
|
if o == nil || IsNil(o.Error) {
|
|
return nil, false
|
|
}
|
|
return o.Error, true
|
|
}
|
|
|
|
// HasError returns a boolean if a field has been set.
|
|
func (o *MCPResponse) HasError() bool {
|
|
if o != nil && !IsNil(o.Error) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetError gets a reference to the given MCPError and assigns it to the Error field.
|
|
func (o *MCPResponse) SetError(v MCPError) {
|
|
o.Error = &v
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *MCPResponse) GetId() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
return ret
|
|
}
|
|
return o.Id
|
|
}
|
|
|
|
// GetIdOk returns a tuple with the Id 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 *MCPResponse) GetIdOk() (*interface{}, bool) {
|
|
if o == nil || IsNil(o.Id) {
|
|
return nil, false
|
|
}
|
|
return &o.Id, true
|
|
}
|
|
|
|
// HasId returns a boolean if a field has been set.
|
|
func (o *MCPResponse) HasId() bool {
|
|
if o != nil && !IsNil(o.Id) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetId gets a reference to the given interface{} and assigns it to the Id field.
|
|
func (o *MCPResponse) SetId(v interface{}) {
|
|
o.Id = v
|
|
}
|
|
|
|
// GetJsonrpc returns the Jsonrpc field value if set, zero value otherwise.
|
|
func (o *MCPResponse) GetJsonrpc() string {
|
|
if o == nil || IsNil(o.Jsonrpc) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Jsonrpc
|
|
}
|
|
|
|
// GetJsonrpcOk returns a tuple with the Jsonrpc field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MCPResponse) GetJsonrpcOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Jsonrpc) {
|
|
return nil, false
|
|
}
|
|
return o.Jsonrpc, true
|
|
}
|
|
|
|
// HasJsonrpc returns a boolean if a field has been set.
|
|
func (o *MCPResponse) HasJsonrpc() bool {
|
|
if o != nil && !IsNil(o.Jsonrpc) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetJsonrpc gets a reference to the given string and assigns it to the Jsonrpc field.
|
|
func (o *MCPResponse) SetJsonrpc(v string) {
|
|
o.Jsonrpc = &v
|
|
}
|
|
|
|
// GetResult returns the Result field value if set, zero value otherwise.
|
|
func (o *MCPResponse) GetResult() map[string]interface{} {
|
|
if o == nil || IsNil(o.Result) {
|
|
var ret map[string]interface{}
|
|
return ret
|
|
}
|
|
return o.Result
|
|
}
|
|
|
|
// GetResultOk returns a tuple with the Result field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MCPResponse) GetResultOk() (map[string]interface{}, bool) {
|
|
if o == nil || IsNil(o.Result) {
|
|
return map[string]interface{}{}, false
|
|
}
|
|
return o.Result, true
|
|
}
|
|
|
|
// HasResult returns a boolean if a field has been set.
|
|
func (o *MCPResponse) HasResult() bool {
|
|
if o != nil && !IsNil(o.Result) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetResult gets a reference to the given map[string]interface{} and assigns it to the Result field.
|
|
func (o *MCPResponse) SetResult(v map[string]interface{}) {
|
|
o.Result = v
|
|
}
|
|
|
|
func (o MCPResponse) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o MCPResponse) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Error) {
|
|
toSerialize["error"] = o.Error
|
|
}
|
|
if o.Id != nil {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if !IsNil(o.Jsonrpc) {
|
|
toSerialize["jsonrpc"] = o.Jsonrpc
|
|
}
|
|
if !IsNil(o.Result) {
|
|
toSerialize["result"] = o.Result
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *MCPResponse) UnmarshalJSON(data []byte) (err error) {
|
|
varMCPResponse := _MCPResponse{}
|
|
|
|
err = json.Unmarshal(data, &varMCPResponse)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = MCPResponse(varMCPResponse)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "error")
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "jsonrpc")
|
|
delete(additionalProperties, "result")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableMCPResponse struct {
|
|
value *MCPResponse
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableMCPResponse) Get() *MCPResponse {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableMCPResponse) Set(val *MCPResponse) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableMCPResponse) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableMCPResponse) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableMCPResponse(val *MCPResponse) *NullableMCPResponse {
|
|
return &NullableMCPResponse{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableMCPResponse) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableMCPResponse) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|