mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
7.0 KiB
Go
269 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"
|
|
)
|
|
|
|
// checks if the Web3RpcOut type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &Web3RpcOut{}
|
|
|
|
// Web3RpcOut struct for Web3RpcOut
|
|
type Web3RpcOut struct {
|
|
// Error is the JSON-RPC error object, present instead of Result. Its presence is the ONLY way a failure shows up here: the HTTP status stays 200, because that is what a standard JSON-RPC client parses.
|
|
Error *Web3RpcError `json:"error,omitempty"`
|
|
Id interface{} `json:"id,omitempty"`
|
|
// JSONRPC is always \"2.0\". An upstream that omits it has it filled in, so a client never has to cope with a response that is missing the one field telling it which protocol it is reading.
|
|
Jsonrpc *string `json:"jsonrpc,omitempty"`
|
|
Result interface{} `json:"result,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _Web3RpcOut Web3RpcOut
|
|
|
|
// NewWeb3RpcOut instantiates a new Web3RpcOut 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 NewWeb3RpcOut() *Web3RpcOut {
|
|
this := Web3RpcOut{}
|
|
return &this
|
|
}
|
|
|
|
// NewWeb3RpcOutWithDefaults instantiates a new Web3RpcOut 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 NewWeb3RpcOutWithDefaults() *Web3RpcOut {
|
|
this := Web3RpcOut{}
|
|
return &this
|
|
}
|
|
|
|
// GetError returns the Error field value if set, zero value otherwise.
|
|
func (o *Web3RpcOut) GetError() Web3RpcError {
|
|
if o == nil || IsNil(o.Error) {
|
|
var ret Web3RpcError
|
|
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 *Web3RpcOut) GetErrorOk() (*Web3RpcError, 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 *Web3RpcOut) HasError() bool {
|
|
if o != nil && !IsNil(o.Error) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetError gets a reference to the given Web3RpcError and assigns it to the Error field.
|
|
func (o *Web3RpcOut) SetError(v Web3RpcError) {
|
|
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 *Web3RpcOut) 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 *Web3RpcOut) 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 *Web3RpcOut) 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 *Web3RpcOut) SetId(v interface{}) {
|
|
o.Id = v
|
|
}
|
|
|
|
// GetJsonrpc returns the Jsonrpc field value if set, zero value otherwise.
|
|
func (o *Web3RpcOut) 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 *Web3RpcOut) 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 *Web3RpcOut) 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 *Web3RpcOut) SetJsonrpc(v string) {
|
|
o.Jsonrpc = &v
|
|
}
|
|
|
|
// GetResult returns the Result field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *Web3RpcOut) GetResult() interface{} {
|
|
if o == nil {
|
|
var ret 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.
|
|
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
|
func (o *Web3RpcOut) GetResultOk() (*interface{}, bool) {
|
|
if o == nil || IsNil(o.Result) {
|
|
return nil, false
|
|
}
|
|
return &o.Result, true
|
|
}
|
|
|
|
// HasResult returns a boolean if a field has been set.
|
|
func (o *Web3RpcOut) HasResult() bool {
|
|
if o != nil && !IsNil(o.Result) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetResult gets a reference to the given interface{} and assigns it to the Result field.
|
|
func (o *Web3RpcOut) SetResult(v interface{}) {
|
|
o.Result = v
|
|
}
|
|
|
|
func (o Web3RpcOut) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o Web3RpcOut) 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 o.Result != nil {
|
|
toSerialize["result"] = o.Result
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *Web3RpcOut) UnmarshalJSON(data []byte) (err error) {
|
|
varWeb3RpcOut := _Web3RpcOut{}
|
|
|
|
err = json.Unmarshal(data, &varWeb3RpcOut)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = Web3RpcOut(varWeb3RpcOut)
|
|
|
|
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 NullableWeb3RpcOut struct {
|
|
value *Web3RpcOut
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableWeb3RpcOut) Get() *Web3RpcOut {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableWeb3RpcOut) Set(val *Web3RpcOut) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableWeb3RpcOut) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableWeb3RpcOut) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableWeb3RpcOut(val *Web3RpcOut) *NullableWeb3RpcOut {
|
|
return &NullableWeb3RpcOut{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableWeb3RpcOut) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableWeb3RpcOut) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|