mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
266 lines
6.6 KiB
Go
266 lines
6.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 MCPRequest type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &MCPRequest{}
|
|
|
|
// MCPRequest struct for MCPRequest
|
|
type MCPRequest struct {
|
|
Id interface{} `json:"id,omitempty"`
|
|
Jsonrpc *string `json:"jsonrpc,omitempty"`
|
|
Method *string `json:"method,omitempty"`
|
|
Params map[string]interface{} `json:"params,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _MCPRequest MCPRequest
|
|
|
|
// NewMCPRequest instantiates a new MCPRequest 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 NewMCPRequest() *MCPRequest {
|
|
this := MCPRequest{}
|
|
return &this
|
|
}
|
|
|
|
// NewMCPRequestWithDefaults instantiates a new MCPRequest 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 NewMCPRequestWithDefaults() *MCPRequest {
|
|
this := MCPRequest{}
|
|
return &this
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *MCPRequest) 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 *MCPRequest) 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 *MCPRequest) 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 *MCPRequest) SetId(v interface{}) {
|
|
o.Id = v
|
|
}
|
|
|
|
// GetJsonrpc returns the Jsonrpc field value if set, zero value otherwise.
|
|
func (o *MCPRequest) 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 *MCPRequest) 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 *MCPRequest) 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 *MCPRequest) SetJsonrpc(v string) {
|
|
o.Jsonrpc = &v
|
|
}
|
|
|
|
// GetMethod returns the Method field value if set, zero value otherwise.
|
|
func (o *MCPRequest) GetMethod() string {
|
|
if o == nil || IsNil(o.Method) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Method
|
|
}
|
|
|
|
// GetMethodOk returns a tuple with the Method field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MCPRequest) GetMethodOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Method) {
|
|
return nil, false
|
|
}
|
|
return o.Method, true
|
|
}
|
|
|
|
// HasMethod returns a boolean if a field has been set.
|
|
func (o *MCPRequest) HasMethod() bool {
|
|
if o != nil && !IsNil(o.Method) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMethod gets a reference to the given string and assigns it to the Method field.
|
|
func (o *MCPRequest) SetMethod(v string) {
|
|
o.Method = &v
|
|
}
|
|
|
|
// GetParams returns the Params field value if set, zero value otherwise.
|
|
func (o *MCPRequest) GetParams() map[string]interface{} {
|
|
if o == nil || IsNil(o.Params) {
|
|
var ret map[string]interface{}
|
|
return ret
|
|
}
|
|
return o.Params
|
|
}
|
|
|
|
// GetParamsOk returns a tuple with the Params field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MCPRequest) GetParamsOk() (map[string]interface{}, bool) {
|
|
if o == nil || IsNil(o.Params) {
|
|
return map[string]interface{}{}, false
|
|
}
|
|
return o.Params, true
|
|
}
|
|
|
|
// HasParams returns a boolean if a field has been set.
|
|
func (o *MCPRequest) HasParams() bool {
|
|
if o != nil && !IsNil(o.Params) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetParams gets a reference to the given map[string]interface{} and assigns it to the Params field.
|
|
func (o *MCPRequest) SetParams(v map[string]interface{}) {
|
|
o.Params = v
|
|
}
|
|
|
|
func (o MCPRequest) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o MCPRequest) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if o.Id != nil {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if !IsNil(o.Jsonrpc) {
|
|
toSerialize["jsonrpc"] = o.Jsonrpc
|
|
}
|
|
if !IsNil(o.Method) {
|
|
toSerialize["method"] = o.Method
|
|
}
|
|
if !IsNil(o.Params) {
|
|
toSerialize["params"] = o.Params
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *MCPRequest) UnmarshalJSON(data []byte) (err error) {
|
|
varMCPRequest := _MCPRequest{}
|
|
|
|
err = json.Unmarshal(data, &varMCPRequest)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = MCPRequest(varMCPRequest)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "jsonrpc")
|
|
delete(additionalProperties, "method")
|
|
delete(additionalProperties, "params")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableMCPRequest struct {
|
|
value *MCPRequest
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableMCPRequest) Get() *MCPRequest {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableMCPRequest) Set(val *MCPRequest) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableMCPRequest) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableMCPRequest) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableMCPRequest(val *MCPRequest) *NullableMCPRequest {
|
|
return &NullableMCPRequest{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableMCPRequest) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableMCPRequest) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|