mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
453 lines
12 KiB
Go
453 lines
12 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 MarketPool type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &MarketPool{}
|
|
|
|
// MarketPool struct for MarketPool
|
|
type MarketPool struct {
|
|
// At is the pool contract's address, lowercase.
|
|
At *string `json:"at,omitempty"`
|
|
Count *int64 `json:"count,omitempty"`
|
|
// Fee is the pool's tier in hundredths of a basis point — 3000 is 0.3%. It is the integer the contract stores, unconverted, so nothing here rounds a rate.
|
|
Fee *int64 `json:"fee,omitempty"`
|
|
Locked *string `json:"locked,omitempty"`
|
|
Token0 *MarketToken `json:"token0,omitempty"`
|
|
// Token0Price is token1 per token0, and Token1Price its reciprocal, both as the indexer computed them. Neither is a price ON anything: it is the ratio the pool's reserves stand at.
|
|
Token0Price *string `json:"token0Price,omitempty"`
|
|
Token1 *MarketToken `json:"token1,omitempty"`
|
|
Token1Price *string `json:"token1Price,omitempty"`
|
|
Volume *string `json:"volume,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _MarketPool MarketPool
|
|
|
|
// NewMarketPool instantiates a new MarketPool 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 NewMarketPool() *MarketPool {
|
|
this := MarketPool{}
|
|
return &this
|
|
}
|
|
|
|
// NewMarketPoolWithDefaults instantiates a new MarketPool 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 NewMarketPoolWithDefaults() *MarketPool {
|
|
this := MarketPool{}
|
|
return &this
|
|
}
|
|
|
|
// GetAt returns the At field value if set, zero value otherwise.
|
|
func (o *MarketPool) GetAt() string {
|
|
if o == nil || IsNil(o.At) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.At
|
|
}
|
|
|
|
// GetAtOk returns a tuple with the At field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MarketPool) GetAtOk() (*string, bool) {
|
|
if o == nil || IsNil(o.At) {
|
|
return nil, false
|
|
}
|
|
return o.At, true
|
|
}
|
|
|
|
// HasAt returns a boolean if a field has been set.
|
|
func (o *MarketPool) HasAt() bool {
|
|
if o != nil && !IsNil(o.At) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAt gets a reference to the given string and assigns it to the At field.
|
|
func (o *MarketPool) SetAt(v string) {
|
|
o.At = &v
|
|
}
|
|
|
|
// GetCount returns the Count field value if set, zero value otherwise.
|
|
func (o *MarketPool) GetCount() int64 {
|
|
if o == nil || IsNil(o.Count) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Count
|
|
}
|
|
|
|
// GetCountOk returns a tuple with the Count field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MarketPool) GetCountOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Count) {
|
|
return nil, false
|
|
}
|
|
return o.Count, true
|
|
}
|
|
|
|
// HasCount returns a boolean if a field has been set.
|
|
func (o *MarketPool) HasCount() bool {
|
|
if o != nil && !IsNil(o.Count) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCount gets a reference to the given int64 and assigns it to the Count field.
|
|
func (o *MarketPool) SetCount(v int64) {
|
|
o.Count = &v
|
|
}
|
|
|
|
// GetFee returns the Fee field value if set, zero value otherwise.
|
|
func (o *MarketPool) GetFee() int64 {
|
|
if o == nil || IsNil(o.Fee) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Fee
|
|
}
|
|
|
|
// GetFeeOk returns a tuple with the Fee field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MarketPool) GetFeeOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Fee) {
|
|
return nil, false
|
|
}
|
|
return o.Fee, true
|
|
}
|
|
|
|
// HasFee returns a boolean if a field has been set.
|
|
func (o *MarketPool) HasFee() bool {
|
|
if o != nil && !IsNil(o.Fee) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetFee gets a reference to the given int64 and assigns it to the Fee field.
|
|
func (o *MarketPool) SetFee(v int64) {
|
|
o.Fee = &v
|
|
}
|
|
|
|
// GetLocked returns the Locked field value if set, zero value otherwise.
|
|
func (o *MarketPool) GetLocked() string {
|
|
if o == nil || IsNil(o.Locked) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Locked
|
|
}
|
|
|
|
// GetLockedOk returns a tuple with the Locked field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MarketPool) GetLockedOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Locked) {
|
|
return nil, false
|
|
}
|
|
return o.Locked, true
|
|
}
|
|
|
|
// HasLocked returns a boolean if a field has been set.
|
|
func (o *MarketPool) HasLocked() bool {
|
|
if o != nil && !IsNil(o.Locked) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLocked gets a reference to the given string and assigns it to the Locked field.
|
|
func (o *MarketPool) SetLocked(v string) {
|
|
o.Locked = &v
|
|
}
|
|
|
|
// GetToken0 returns the Token0 field value if set, zero value otherwise.
|
|
func (o *MarketPool) GetToken0() MarketToken {
|
|
if o == nil || IsNil(o.Token0) {
|
|
var ret MarketToken
|
|
return ret
|
|
}
|
|
return *o.Token0
|
|
}
|
|
|
|
// GetToken0Ok returns a tuple with the Token0 field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MarketPool) GetToken0Ok() (*MarketToken, bool) {
|
|
if o == nil || IsNil(o.Token0) {
|
|
return nil, false
|
|
}
|
|
return o.Token0, true
|
|
}
|
|
|
|
// HasToken0 returns a boolean if a field has been set.
|
|
func (o *MarketPool) HasToken0() bool {
|
|
if o != nil && !IsNil(o.Token0) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetToken0 gets a reference to the given MarketToken and assigns it to the Token0 field.
|
|
func (o *MarketPool) SetToken0(v MarketToken) {
|
|
o.Token0 = &v
|
|
}
|
|
|
|
// GetToken0Price returns the Token0Price field value if set, zero value otherwise.
|
|
func (o *MarketPool) GetToken0Price() string {
|
|
if o == nil || IsNil(o.Token0Price) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Token0Price
|
|
}
|
|
|
|
// GetToken0PriceOk returns a tuple with the Token0Price field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MarketPool) GetToken0PriceOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Token0Price) {
|
|
return nil, false
|
|
}
|
|
return o.Token0Price, true
|
|
}
|
|
|
|
// HasToken0Price returns a boolean if a field has been set.
|
|
func (o *MarketPool) HasToken0Price() bool {
|
|
if o != nil && !IsNil(o.Token0Price) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetToken0Price gets a reference to the given string and assigns it to the Token0Price field.
|
|
func (o *MarketPool) SetToken0Price(v string) {
|
|
o.Token0Price = &v
|
|
}
|
|
|
|
// GetToken1 returns the Token1 field value if set, zero value otherwise.
|
|
func (o *MarketPool) GetToken1() MarketToken {
|
|
if o == nil || IsNil(o.Token1) {
|
|
var ret MarketToken
|
|
return ret
|
|
}
|
|
return *o.Token1
|
|
}
|
|
|
|
// GetToken1Ok returns a tuple with the Token1 field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MarketPool) GetToken1Ok() (*MarketToken, bool) {
|
|
if o == nil || IsNil(o.Token1) {
|
|
return nil, false
|
|
}
|
|
return o.Token1, true
|
|
}
|
|
|
|
// HasToken1 returns a boolean if a field has been set.
|
|
func (o *MarketPool) HasToken1() bool {
|
|
if o != nil && !IsNil(o.Token1) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetToken1 gets a reference to the given MarketToken and assigns it to the Token1 field.
|
|
func (o *MarketPool) SetToken1(v MarketToken) {
|
|
o.Token1 = &v
|
|
}
|
|
|
|
// GetToken1Price returns the Token1Price field value if set, zero value otherwise.
|
|
func (o *MarketPool) GetToken1Price() string {
|
|
if o == nil || IsNil(o.Token1Price) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Token1Price
|
|
}
|
|
|
|
// GetToken1PriceOk returns a tuple with the Token1Price field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MarketPool) GetToken1PriceOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Token1Price) {
|
|
return nil, false
|
|
}
|
|
return o.Token1Price, true
|
|
}
|
|
|
|
// HasToken1Price returns a boolean if a field has been set.
|
|
func (o *MarketPool) HasToken1Price() bool {
|
|
if o != nil && !IsNil(o.Token1Price) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetToken1Price gets a reference to the given string and assigns it to the Token1Price field.
|
|
func (o *MarketPool) SetToken1Price(v string) {
|
|
o.Token1Price = &v
|
|
}
|
|
|
|
// GetVolume returns the Volume field value if set, zero value otherwise.
|
|
func (o *MarketPool) GetVolume() string {
|
|
if o == nil || IsNil(o.Volume) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Volume
|
|
}
|
|
|
|
// GetVolumeOk returns a tuple with the Volume field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *MarketPool) GetVolumeOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Volume) {
|
|
return nil, false
|
|
}
|
|
return o.Volume, true
|
|
}
|
|
|
|
// HasVolume returns a boolean if a field has been set.
|
|
func (o *MarketPool) HasVolume() bool {
|
|
if o != nil && !IsNil(o.Volume) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetVolume gets a reference to the given string and assigns it to the Volume field.
|
|
func (o *MarketPool) SetVolume(v string) {
|
|
o.Volume = &v
|
|
}
|
|
|
|
func (o MarketPool) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o MarketPool) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.At) {
|
|
toSerialize["at"] = o.At
|
|
}
|
|
if !IsNil(o.Count) {
|
|
toSerialize["count"] = o.Count
|
|
}
|
|
if !IsNil(o.Fee) {
|
|
toSerialize["fee"] = o.Fee
|
|
}
|
|
if !IsNil(o.Locked) {
|
|
toSerialize["locked"] = o.Locked
|
|
}
|
|
if !IsNil(o.Token0) {
|
|
toSerialize["token0"] = o.Token0
|
|
}
|
|
if !IsNil(o.Token0Price) {
|
|
toSerialize["token0Price"] = o.Token0Price
|
|
}
|
|
if !IsNil(o.Token1) {
|
|
toSerialize["token1"] = o.Token1
|
|
}
|
|
if !IsNil(o.Token1Price) {
|
|
toSerialize["token1Price"] = o.Token1Price
|
|
}
|
|
if !IsNil(o.Volume) {
|
|
toSerialize["volume"] = o.Volume
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *MarketPool) UnmarshalJSON(data []byte) (err error) {
|
|
varMarketPool := _MarketPool{}
|
|
|
|
err = json.Unmarshal(data, &varMarketPool)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = MarketPool(varMarketPool)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "at")
|
|
delete(additionalProperties, "count")
|
|
delete(additionalProperties, "fee")
|
|
delete(additionalProperties, "locked")
|
|
delete(additionalProperties, "token0")
|
|
delete(additionalProperties, "token0Price")
|
|
delete(additionalProperties, "token1")
|
|
delete(additionalProperties, "token1Price")
|
|
delete(additionalProperties, "volume")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableMarketPool struct {
|
|
value *MarketPool
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableMarketPool) Get() *MarketPool {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableMarketPool) Set(val *MarketPool) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableMarketPool) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableMarketPool) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableMarketPool(val *MarketPool) *NullableMarketPool {
|
|
return &NullableMarketPool{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableMarketPool) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableMarketPool) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|