Files
sdk/model_tool_price.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 ToolPrice type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ToolPrice{}
// ToolPrice struct for ToolPrice
type ToolPrice struct {
Amount interface{} `json:"amount,omitempty"`
// Currency is the ISO 4217 code, e.g. \"USD\". Empty means USD.
Currency *string `json:"currency,omitempty"`
// Recipient is the payout wallet ref the marketplace seller is paid at.
Recipient *string `json:"recipient,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ToolPrice ToolPrice
// NewToolPrice instantiates a new ToolPrice 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 NewToolPrice() *ToolPrice {
this := ToolPrice{}
return &this
}
// NewToolPriceWithDefaults instantiates a new ToolPrice 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 NewToolPriceWithDefaults() *ToolPrice {
this := ToolPrice{}
return &this
}
// GetAmount returns the Amount field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ToolPrice) GetAmount() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Amount
}
// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ToolPrice) GetAmountOk() (*interface{}, bool) {
if o == nil || IsNil(o.Amount) {
return nil, false
}
return &o.Amount, true
}
// HasAmount returns a boolean if a field has been set.
func (o *ToolPrice) HasAmount() bool {
if o != nil && !IsNil(o.Amount) {
return true
}
return false
}
// SetAmount gets a reference to the given interface{} and assigns it to the Amount field.
func (o *ToolPrice) SetAmount(v interface{}) {
o.Amount = v
}
// GetCurrency returns the Currency field value if set, zero value otherwise.
func (o *ToolPrice) GetCurrency() string {
if o == nil || IsNil(o.Currency) {
var ret string
return ret
}
return *o.Currency
}
// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ToolPrice) GetCurrencyOk() (*string, bool) {
if o == nil || IsNil(o.Currency) {
return nil, false
}
return o.Currency, true
}
// HasCurrency returns a boolean if a field has been set.
func (o *ToolPrice) HasCurrency() bool {
if o != nil && !IsNil(o.Currency) {
return true
}
return false
}
// SetCurrency gets a reference to the given string and assigns it to the Currency field.
func (o *ToolPrice) SetCurrency(v string) {
o.Currency = &v
}
// GetRecipient returns the Recipient field value if set, zero value otherwise.
func (o *ToolPrice) GetRecipient() string {
if o == nil || IsNil(o.Recipient) {
var ret string
return ret
}
return *o.Recipient
}
// GetRecipientOk returns a tuple with the Recipient field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ToolPrice) GetRecipientOk() (*string, bool) {
if o == nil || IsNil(o.Recipient) {
return nil, false
}
return o.Recipient, true
}
// HasRecipient returns a boolean if a field has been set.
func (o *ToolPrice) HasRecipient() bool {
if o != nil && !IsNil(o.Recipient) {
return true
}
return false
}
// SetRecipient gets a reference to the given string and assigns it to the Recipient field.
func (o *ToolPrice) SetRecipient(v string) {
o.Recipient = &v
}
func (o ToolPrice) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ToolPrice) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.Amount != nil {
toSerialize["amount"] = o.Amount
}
if !IsNil(o.Currency) {
toSerialize["currency"] = o.Currency
}
if !IsNil(o.Recipient) {
toSerialize["recipient"] = o.Recipient
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ToolPrice) UnmarshalJSON(data []byte) (err error) {
varToolPrice := _ToolPrice{}
err = json.Unmarshal(data, &varToolPrice)
if err != nil {
return err
}
*o = ToolPrice(varToolPrice)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "amount")
delete(additionalProperties, "currency")
delete(additionalProperties, "recipient")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableToolPrice struct {
value *ToolPrice
isSet bool
}
func (v NullableToolPrice) Get() *ToolPrice {
return v.value
}
func (v *NullableToolPrice) Set(val *ToolPrice) {
v.value = val
v.isSet = true
}
func (v NullableToolPrice) IsSet() bool {
return v.isSet
}
func (v *NullableToolPrice) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableToolPrice(val *ToolPrice) *NullableToolPrice {
return &NullableToolPrice{value: val, isSet: true}
}
func (v NullableToolPrice) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableToolPrice) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}