mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
193 lines
5.0 KiB
Go
193 lines
5.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 BillingCryptoPair type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &BillingCryptoPair{}
|
|
|
|
// BillingCryptoPair struct for BillingCryptoPair
|
|
type BillingCryptoPair struct {
|
|
// Chain is the network, as a deposit names it (\"base\").
|
|
Chain *string `json:"chain,omitempty"`
|
|
// Token is the asset on that chain, as a deposit names it (\"usdc\").
|
|
Token *string `json:"token,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _BillingCryptoPair BillingCryptoPair
|
|
|
|
// NewBillingCryptoPair instantiates a new BillingCryptoPair 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 NewBillingCryptoPair() *BillingCryptoPair {
|
|
this := BillingCryptoPair{}
|
|
return &this
|
|
}
|
|
|
|
// NewBillingCryptoPairWithDefaults instantiates a new BillingCryptoPair 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 NewBillingCryptoPairWithDefaults() *BillingCryptoPair {
|
|
this := BillingCryptoPair{}
|
|
return &this
|
|
}
|
|
|
|
// GetChain returns the Chain field value if set, zero value otherwise.
|
|
func (o *BillingCryptoPair) 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 *BillingCryptoPair) 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 *BillingCryptoPair) 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 *BillingCryptoPair) SetChain(v string) {
|
|
o.Chain = &v
|
|
}
|
|
|
|
// GetToken returns the Token field value if set, zero value otherwise.
|
|
func (o *BillingCryptoPair) GetToken() string {
|
|
if o == nil || IsNil(o.Token) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Token
|
|
}
|
|
|
|
// GetTokenOk returns a tuple with the Token field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingCryptoPair) GetTokenOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Token) {
|
|
return nil, false
|
|
}
|
|
return o.Token, true
|
|
}
|
|
|
|
// HasToken returns a boolean if a field has been set.
|
|
func (o *BillingCryptoPair) HasToken() bool {
|
|
if o != nil && !IsNil(o.Token) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetToken gets a reference to the given string and assigns it to the Token field.
|
|
func (o *BillingCryptoPair) SetToken(v string) {
|
|
o.Token = &v
|
|
}
|
|
|
|
func (o BillingCryptoPair) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o BillingCryptoPair) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Chain) {
|
|
toSerialize["chain"] = o.Chain
|
|
}
|
|
if !IsNil(o.Token) {
|
|
toSerialize["token"] = o.Token
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *BillingCryptoPair) UnmarshalJSON(data []byte) (err error) {
|
|
varBillingCryptoPair := _BillingCryptoPair{}
|
|
|
|
err = json.Unmarshal(data, &varBillingCryptoPair)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = BillingCryptoPair(varBillingCryptoPair)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "chain")
|
|
delete(additionalProperties, "token")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableBillingCryptoPair struct {
|
|
value *BillingCryptoPair
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableBillingCryptoPair) Get() *BillingCryptoPair {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableBillingCryptoPair) Set(val *BillingCryptoPair) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableBillingCryptoPair) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableBillingCryptoPair) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableBillingCryptoPair(val *BillingCryptoPair) *NullableBillingCryptoPair {
|
|
return &NullableBillingCryptoPair{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableBillingCryptoPair) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableBillingCryptoPair) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|