mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
307 lines
7.8 KiB
Go
307 lines
7.8 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 Web3ChainStatus type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &Web3ChainStatus{}
|
|
|
|
// Web3ChainStatus struct for Web3ChainStatus
|
|
type Web3ChainStatus 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"`
|
|
// Height is the latest block, omitted when the chain did not answer rather than reported as zero — a zero height is a real value on a fresh chain.
|
|
Height *int64 `json:"height,omitempty"`
|
|
// ID is the URL name: the value of :chain.
|
|
Id *string `json:"id,omitempty"`
|
|
// Live is whether the upstream answered eth_blockNumber.
|
|
Live *bool `json:"live,omitempty"`
|
|
// Name is for humans.
|
|
Name *string `json:"name,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _Web3ChainStatus Web3ChainStatus
|
|
|
|
// NewWeb3ChainStatus instantiates a new Web3ChainStatus 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 NewWeb3ChainStatus() *Web3ChainStatus {
|
|
this := Web3ChainStatus{}
|
|
return &this
|
|
}
|
|
|
|
// NewWeb3ChainStatusWithDefaults instantiates a new Web3ChainStatus 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 NewWeb3ChainStatusWithDefaults() *Web3ChainStatus {
|
|
this := Web3ChainStatus{}
|
|
return &this
|
|
}
|
|
|
|
// GetChainId returns the ChainId field value if set, zero value otherwise.
|
|
func (o *Web3ChainStatus) 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 *Web3ChainStatus) 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 *Web3ChainStatus) 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 *Web3ChainStatus) SetChainId(v int64) {
|
|
o.ChainId = &v
|
|
}
|
|
|
|
// GetHeight returns the Height field value if set, zero value otherwise.
|
|
func (o *Web3ChainStatus) GetHeight() int64 {
|
|
if o == nil || IsNil(o.Height) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Height
|
|
}
|
|
|
|
// GetHeightOk returns a tuple with the Height field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Web3ChainStatus) GetHeightOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Height) {
|
|
return nil, false
|
|
}
|
|
return o.Height, true
|
|
}
|
|
|
|
// HasHeight returns a boolean if a field has been set.
|
|
func (o *Web3ChainStatus) HasHeight() bool {
|
|
if o != nil && !IsNil(o.Height) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetHeight gets a reference to the given int64 and assigns it to the Height field.
|
|
func (o *Web3ChainStatus) SetHeight(v int64) {
|
|
o.Height = &v
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *Web3ChainStatus) 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 *Web3ChainStatus) 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 *Web3ChainStatus) 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 *Web3ChainStatus) SetId(v string) {
|
|
o.Id = &v
|
|
}
|
|
|
|
// GetLive returns the Live field value if set, zero value otherwise.
|
|
func (o *Web3ChainStatus) GetLive() bool {
|
|
if o == nil || IsNil(o.Live) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Live
|
|
}
|
|
|
|
// GetLiveOk returns a tuple with the Live field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Web3ChainStatus) GetLiveOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Live) {
|
|
return nil, false
|
|
}
|
|
return o.Live, true
|
|
}
|
|
|
|
// HasLive returns a boolean if a field has been set.
|
|
func (o *Web3ChainStatus) HasLive() bool {
|
|
if o != nil && !IsNil(o.Live) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLive gets a reference to the given bool and assigns it to the Live field.
|
|
func (o *Web3ChainStatus) SetLive(v bool) {
|
|
o.Live = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *Web3ChainStatus) 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 *Web3ChainStatus) 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 *Web3ChainStatus) 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 *Web3ChainStatus) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
func (o Web3ChainStatus) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o Web3ChainStatus) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.ChainId) {
|
|
toSerialize["chainId"] = o.ChainId
|
|
}
|
|
if !IsNil(o.Height) {
|
|
toSerialize["height"] = o.Height
|
|
}
|
|
if !IsNil(o.Id) {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if !IsNil(o.Live) {
|
|
toSerialize["live"] = o.Live
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *Web3ChainStatus) UnmarshalJSON(data []byte) (err error) {
|
|
varWeb3ChainStatus := _Web3ChainStatus{}
|
|
|
|
err = json.Unmarshal(data, &varWeb3ChainStatus)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = Web3ChainStatus(varWeb3ChainStatus)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "chainId")
|
|
delete(additionalProperties, "height")
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "live")
|
|
delete(additionalProperties, "name")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableWeb3ChainStatus struct {
|
|
value *Web3ChainStatus
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableWeb3ChainStatus) Get() *Web3ChainStatus {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableWeb3ChainStatus) Set(val *Web3ChainStatus) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableWeb3ChainStatus) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableWeb3ChainStatus) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableWeb3ChainStatus(val *Web3ChainStatus) *NullableWeb3ChainStatus {
|
|
return &NullableWeb3ChainStatus{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableWeb3ChainStatus) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableWeb3ChainStatus) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|