Files
sdk/model_billing_crypto_options.go

266 lines
7.3 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 BillingCryptoOptions type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BillingCryptoOptions{}
// BillingCryptoOptions struct for BillingCryptoOptions
type BillingCryptoOptions struct {
// Assets is every (chain, token) pair the deposit-address rail accepts. Chains and Tokens are its two axes: a chain and a token each on offer are not a pair on offer, so a picker that crosses them can name an asset the rail will refuse.
Assets []BillingCryptoPair `json:"assets,omitempty"`
Chains []string `json:"chains,omitempty"`
Gateway []string `json:"gateway,omitempty"`
Tokens []string `json:"tokens,omitempty"`
AdditionalProperties map[string]interface{}
}
type _BillingCryptoOptions BillingCryptoOptions
// NewBillingCryptoOptions instantiates a new BillingCryptoOptions 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 NewBillingCryptoOptions() *BillingCryptoOptions {
this := BillingCryptoOptions{}
return &this
}
// NewBillingCryptoOptionsWithDefaults instantiates a new BillingCryptoOptions 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 NewBillingCryptoOptionsWithDefaults() *BillingCryptoOptions {
this := BillingCryptoOptions{}
return &this
}
// GetAssets returns the Assets field value if set, zero value otherwise.
func (o *BillingCryptoOptions) GetAssets() []BillingCryptoPair {
if o == nil || IsNil(o.Assets) {
var ret []BillingCryptoPair
return ret
}
return o.Assets
}
// GetAssetsOk returns a tuple with the Assets field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingCryptoOptions) GetAssetsOk() ([]BillingCryptoPair, bool) {
if o == nil || IsNil(o.Assets) {
return nil, false
}
return o.Assets, true
}
// HasAssets returns a boolean if a field has been set.
func (o *BillingCryptoOptions) HasAssets() bool {
if o != nil && !IsNil(o.Assets) {
return true
}
return false
}
// SetAssets gets a reference to the given []BillingCryptoPair and assigns it to the Assets field.
func (o *BillingCryptoOptions) SetAssets(v []BillingCryptoPair) {
o.Assets = v
}
// GetChains returns the Chains field value if set, zero value otherwise.
func (o *BillingCryptoOptions) GetChains() []string {
if o == nil || IsNil(o.Chains) {
var ret []string
return ret
}
return o.Chains
}
// GetChainsOk returns a tuple with the Chains field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingCryptoOptions) GetChainsOk() ([]string, bool) {
if o == nil || IsNil(o.Chains) {
return nil, false
}
return o.Chains, true
}
// HasChains returns a boolean if a field has been set.
func (o *BillingCryptoOptions) HasChains() bool {
if o != nil && !IsNil(o.Chains) {
return true
}
return false
}
// SetChains gets a reference to the given []string and assigns it to the Chains field.
func (o *BillingCryptoOptions) SetChains(v []string) {
o.Chains = v
}
// GetGateway returns the Gateway field value if set, zero value otherwise.
func (o *BillingCryptoOptions) GetGateway() []string {
if o == nil || IsNil(o.Gateway) {
var ret []string
return ret
}
return o.Gateway
}
// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingCryptoOptions) GetGatewayOk() ([]string, bool) {
if o == nil || IsNil(o.Gateway) {
return nil, false
}
return o.Gateway, true
}
// HasGateway returns a boolean if a field has been set.
func (o *BillingCryptoOptions) HasGateway() bool {
if o != nil && !IsNil(o.Gateway) {
return true
}
return false
}
// SetGateway gets a reference to the given []string and assigns it to the Gateway field.
func (o *BillingCryptoOptions) SetGateway(v []string) {
o.Gateway = v
}
// GetTokens returns the Tokens field value if set, zero value otherwise.
func (o *BillingCryptoOptions) GetTokens() []string {
if o == nil || IsNil(o.Tokens) {
var ret []string
return ret
}
return o.Tokens
}
// GetTokensOk returns a tuple with the Tokens field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingCryptoOptions) GetTokensOk() ([]string, bool) {
if o == nil || IsNil(o.Tokens) {
return nil, false
}
return o.Tokens, true
}
// HasTokens returns a boolean if a field has been set.
func (o *BillingCryptoOptions) HasTokens() bool {
if o != nil && !IsNil(o.Tokens) {
return true
}
return false
}
// SetTokens gets a reference to the given []string and assigns it to the Tokens field.
func (o *BillingCryptoOptions) SetTokens(v []string) {
o.Tokens = v
}
func (o BillingCryptoOptions) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BillingCryptoOptions) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Assets) {
toSerialize["assets"] = o.Assets
}
if !IsNil(o.Chains) {
toSerialize["chains"] = o.Chains
}
if !IsNil(o.Gateway) {
toSerialize["gateway"] = o.Gateway
}
if !IsNil(o.Tokens) {
toSerialize["tokens"] = o.Tokens
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *BillingCryptoOptions) UnmarshalJSON(data []byte) (err error) {
varBillingCryptoOptions := _BillingCryptoOptions{}
err = json.Unmarshal(data, &varBillingCryptoOptions)
if err != nil {
return err
}
*o = BillingCryptoOptions(varBillingCryptoOptions)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "assets")
delete(additionalProperties, "chains")
delete(additionalProperties, "gateway")
delete(additionalProperties, "tokens")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableBillingCryptoOptions struct {
value *BillingCryptoOptions
isSet bool
}
func (v NullableBillingCryptoOptions) Get() *BillingCryptoOptions {
return v.value
}
func (v *NullableBillingCryptoOptions) Set(val *BillingCryptoOptions) {
v.value = val
v.isSet = true
}
func (v NullableBillingCryptoOptions) IsSet() bool {
return v.isSet
}
func (v *NullableBillingCryptoOptions) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBillingCryptoOptions(val *BillingCryptoOptions) *NullableBillingCryptoOptions {
return &NullableBillingCryptoOptions{value: val, isSet: true}
}
func (v NullableBillingCryptoOptions) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBillingCryptoOptions) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}