Files
sdk/model_web3_balances.go

231 lines
5.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 Web3Balances type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Web3Balances{}
// Web3Balances struct for Web3Balances
type Web3Balances struct {
// Address is the account they belong to.
Address *string `json:"address,omitempty"`
// Chain is the chain the balances were read from.
Chain *string `json:"chain,omitempty"`
// Native is the chain's own currency, as a 0x-quantity — the RPC's own encoding, not a float, because a wei value does not survive float64.
Native *string `json:"native,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Web3Balances Web3Balances
// NewWeb3Balances instantiates a new Web3Balances 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 NewWeb3Balances() *Web3Balances {
this := Web3Balances{}
return &this
}
// NewWeb3BalancesWithDefaults instantiates a new Web3Balances 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 NewWeb3BalancesWithDefaults() *Web3Balances {
this := Web3Balances{}
return &this
}
// GetAddress returns the Address field value if set, zero value otherwise.
func (o *Web3Balances) GetAddress() string {
if o == nil || IsNil(o.Address) {
var ret string
return ret
}
return *o.Address
}
// GetAddressOk returns a tuple with the Address field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Web3Balances) GetAddressOk() (*string, bool) {
if o == nil || IsNil(o.Address) {
return nil, false
}
return o.Address, true
}
// HasAddress returns a boolean if a field has been set.
func (o *Web3Balances) HasAddress() bool {
if o != nil && !IsNil(o.Address) {
return true
}
return false
}
// SetAddress gets a reference to the given string and assigns it to the Address field.
func (o *Web3Balances) SetAddress(v string) {
o.Address = &v
}
// GetChain returns the Chain field value if set, zero value otherwise.
func (o *Web3Balances) 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 *Web3Balances) 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 *Web3Balances) 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 *Web3Balances) SetChain(v string) {
o.Chain = &v
}
// GetNative returns the Native field value if set, zero value otherwise.
func (o *Web3Balances) GetNative() string {
if o == nil || IsNil(o.Native) {
var ret string
return ret
}
return *o.Native
}
// GetNativeOk returns a tuple with the Native field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Web3Balances) GetNativeOk() (*string, bool) {
if o == nil || IsNil(o.Native) {
return nil, false
}
return o.Native, true
}
// HasNative returns a boolean if a field has been set.
func (o *Web3Balances) HasNative() bool {
if o != nil && !IsNil(o.Native) {
return true
}
return false
}
// SetNative gets a reference to the given string and assigns it to the Native field.
func (o *Web3Balances) SetNative(v string) {
o.Native = &v
}
func (o Web3Balances) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Web3Balances) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Address) {
toSerialize["address"] = o.Address
}
if !IsNil(o.Chain) {
toSerialize["chain"] = o.Chain
}
if !IsNil(o.Native) {
toSerialize["native"] = o.Native
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Web3Balances) UnmarshalJSON(data []byte) (err error) {
varWeb3Balances := _Web3Balances{}
err = json.Unmarshal(data, &varWeb3Balances)
if err != nil {
return err
}
*o = Web3Balances(varWeb3Balances)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "address")
delete(additionalProperties, "chain")
delete(additionalProperties, "native")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableWeb3Balances struct {
value *Web3Balances
isSet bool
}
func (v NullableWeb3Balances) Get() *Web3Balances {
return v.value
}
func (v *NullableWeb3Balances) Set(val *Web3Balances) {
v.value = val
v.isSet = true
}
func (v NullableWeb3Balances) IsSet() bool {
return v.isSet
}
func (v *NullableWeb3Balances) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableWeb3Balances(val *Web3Balances) *NullableWeb3Balances {
return &NullableWeb3Balances{value: val, isSet: true}
}
func (v NullableWeb3Balances) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableWeb3Balances) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}