Files
sdk/model_web3_chain.go

231 lines
5.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 Web3Chain type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Web3Chain{}
// Web3Chain struct for Web3Chain
type Web3Chain struct {
// ChainID is the EIP-155 id, so a caller can check it matches the wallet they are about to sign with.
ChainId *int64 `json:"chainId,omitempty"`
// ID is the URL name: the value of :chain.
Id *string `json:"id,omitempty"`
// Name is for humans.
Name *string `json:"name,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Web3Chain Web3Chain
// NewWeb3Chain instantiates a new Web3Chain 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 NewWeb3Chain() *Web3Chain {
this := Web3Chain{}
return &this
}
// NewWeb3ChainWithDefaults instantiates a new Web3Chain 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 NewWeb3ChainWithDefaults() *Web3Chain {
this := Web3Chain{}
return &this
}
// GetChainId returns the ChainId field value if set, zero value otherwise.
func (o *Web3Chain) GetChainId() int64 {
if o == nil || IsNil(o.ChainId) {
var ret int64
return ret
}
return *o.ChainId
}
// GetChainIdOk returns a tuple with the ChainId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Web3Chain) GetChainIdOk() (*int64, bool) {
if o == nil || IsNil(o.ChainId) {
return nil, false
}
return o.ChainId, true
}
// HasChainId returns a boolean if a field has been set.
func (o *Web3Chain) HasChainId() bool {
if o != nil && !IsNil(o.ChainId) {
return true
}
return false
}
// SetChainId gets a reference to the given int64 and assigns it to the ChainId field.
func (o *Web3Chain) SetChainId(v int64) {
o.ChainId = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *Web3Chain) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
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.
func (o *Web3Chain) GetIdOk() (*string, 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 *Web3Chain) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *Web3Chain) SetId(v string) {
o.Id = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *Web3Chain) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Web3Chain) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *Web3Chain) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *Web3Chain) SetName(v string) {
o.Name = &v
}
func (o Web3Chain) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Web3Chain) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ChainId) {
toSerialize["chainId"] = o.ChainId
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Web3Chain) UnmarshalJSON(data []byte) (err error) {
varWeb3Chain := _Web3Chain{}
err = json.Unmarshal(data, &varWeb3Chain)
if err != nil {
return err
}
*o = Web3Chain(varWeb3Chain)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "chainId")
delete(additionalProperties, "id")
delete(additionalProperties, "name")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableWeb3Chain struct {
value *Web3Chain
isSet bool
}
func (v NullableWeb3Chain) Get() *Web3Chain {
return v.value
}
func (v *NullableWeb3Chain) Set(val *Web3Chain) {
v.value = val
v.isSet = true
}
func (v NullableWeb3Chain) IsSet() bool {
return v.isSet
}
func (v *NullableWeb3Chain) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableWeb3Chain(val *Web3Chain) *NullableWeb3Chain {
return &NullableWeb3Chain{value: val, isSet: true}
}
func (v NullableWeb3Chain) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableWeb3Chain) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}