Files
sdk/model_web3_rpc_in.go

307 lines
7.5 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 Web3RpcIn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Web3RpcIn{}
// Web3RpcIn struct for Web3RpcIn
type Web3RpcIn struct {
// Chain is the registry id, from the URL.
Chain *string `json:"chain,omitempty"`
Id interface{} `json:"id,omitempty"`
// JSONRPC must be \"2.0\" when present.
Jsonrpc *string `json:"jsonrpc,omitempty"`
// Method is the RPC method, e.g. eth_getBalance.
Method *string `json:"method,omitempty"`
Params interface{} `json:"params,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Web3RpcIn Web3RpcIn
// NewWeb3RpcIn instantiates a new Web3RpcIn 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 NewWeb3RpcIn() *Web3RpcIn {
this := Web3RpcIn{}
return &this
}
// NewWeb3RpcInWithDefaults instantiates a new Web3RpcIn 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 NewWeb3RpcInWithDefaults() *Web3RpcIn {
this := Web3RpcIn{}
return &this
}
// GetChain returns the Chain field value if set, zero value otherwise.
func (o *Web3RpcIn) GetChain() string {
if o == nil || IsNil(o.Chain) {
var ret string
return ret
}
return *o.Chain
}
// GetChainOk returns a tuple with the Chain field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Web3RpcIn) GetChainOk() (*string, bool) {
if o == nil || IsNil(o.Chain) {
return nil, false
}
return o.Chain, true
}
// HasChain returns a boolean if a field has been set.
func (o *Web3RpcIn) HasChain() bool {
if o != nil && !IsNil(o.Chain) {
return true
}
return false
}
// SetChain gets a reference to the given string and assigns it to the Chain field.
func (o *Web3RpcIn) SetChain(v string) {
o.Chain = &v
}
// GetId returns the Id field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Web3RpcIn) 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 *Web3RpcIn) 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 *Web3RpcIn) 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 *Web3RpcIn) SetId(v interface{}) {
o.Id = v
}
// GetJsonrpc returns the Jsonrpc field value if set, zero value otherwise.
func (o *Web3RpcIn) 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 *Web3RpcIn) 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 *Web3RpcIn) 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 *Web3RpcIn) SetJsonrpc(v string) {
o.Jsonrpc = &v
}
// GetMethod returns the Method field value if set, zero value otherwise.
func (o *Web3RpcIn) 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 *Web3RpcIn) 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 *Web3RpcIn) 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 *Web3RpcIn) SetMethod(v string) {
o.Method = &v
}
// GetParams returns the Params field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Web3RpcIn) GetParams() interface{} {
if o == nil {
var ret 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.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *Web3RpcIn) GetParamsOk() (*interface{}, bool) {
if o == nil || IsNil(o.Params) {
return nil, false
}
return &o.Params, true
}
// HasParams returns a boolean if a field has been set.
func (o *Web3RpcIn) HasParams() bool {
if o != nil && !IsNil(o.Params) {
return true
}
return false
}
// SetParams gets a reference to the given interface{} and assigns it to the Params field.
func (o *Web3RpcIn) SetParams(v interface{}) {
o.Params = v
}
func (o Web3RpcIn) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Web3RpcIn) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Chain) {
toSerialize["chain"] = o.Chain
}
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 o.Params != nil {
toSerialize["params"] = o.Params
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Web3RpcIn) UnmarshalJSON(data []byte) (err error) {
varWeb3RpcIn := _Web3RpcIn{}
err = json.Unmarshal(data, &varWeb3RpcIn)
if err != nil {
return err
}
*o = Web3RpcIn(varWeb3RpcIn)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "chain")
delete(additionalProperties, "id")
delete(additionalProperties, "jsonrpc")
delete(additionalProperties, "method")
delete(additionalProperties, "params")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableWeb3RpcIn struct {
value *Web3RpcIn
isSet bool
}
func (v NullableWeb3RpcIn) Get() *Web3RpcIn {
return v.value
}
func (v *NullableWeb3RpcIn) Set(val *Web3RpcIn) {
v.value = val
v.isSet = true
}
func (v NullableWeb3RpcIn) IsSet() bool {
return v.isSet
}
func (v *NullableWeb3RpcIn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableWeb3RpcIn(val *Web3RpcIn) *NullableWeb3RpcIn {
return &NullableWeb3RpcIn{value: val, isSet: true}
}
func (v NullableWeb3RpcIn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableWeb3RpcIn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}