Files
sdk/model_tax_amount.go

231 lines
5.4 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 TaxAmount type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TaxAmount{}
// TaxAmount struct for TaxAmount
type TaxAmount struct {
// Box is the box number, e.g. \"1a\".
Box *string `json:"box,omitempty"`
// Cents is the amount in cents.
Cents *int64 `json:"cents,omitempty"`
// Label is the box's caption on the form.
Label *string `json:"label,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TaxAmount TaxAmount
// NewTaxAmount instantiates a new TaxAmount 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 NewTaxAmount() *TaxAmount {
this := TaxAmount{}
return &this
}
// NewTaxAmountWithDefaults instantiates a new TaxAmount 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 NewTaxAmountWithDefaults() *TaxAmount {
this := TaxAmount{}
return &this
}
// GetBox returns the Box field value if set, zero value otherwise.
func (o *TaxAmount) GetBox() string {
if o == nil || IsNil(o.Box) {
var ret string
return ret
}
return *o.Box
}
// GetBoxOk returns a tuple with the Box field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TaxAmount) GetBoxOk() (*string, bool) {
if o == nil || IsNil(o.Box) {
return nil, false
}
return o.Box, true
}
// HasBox returns a boolean if a field has been set.
func (o *TaxAmount) HasBox() bool {
if o != nil && !IsNil(o.Box) {
return true
}
return false
}
// SetBox gets a reference to the given string and assigns it to the Box field.
func (o *TaxAmount) SetBox(v string) {
o.Box = &v
}
// GetCents returns the Cents field value if set, zero value otherwise.
func (o *TaxAmount) GetCents() int64 {
if o == nil || IsNil(o.Cents) {
var ret int64
return ret
}
return *o.Cents
}
// GetCentsOk returns a tuple with the Cents field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TaxAmount) GetCentsOk() (*int64, bool) {
if o == nil || IsNil(o.Cents) {
return nil, false
}
return o.Cents, true
}
// HasCents returns a boolean if a field has been set.
func (o *TaxAmount) HasCents() bool {
if o != nil && !IsNil(o.Cents) {
return true
}
return false
}
// SetCents gets a reference to the given int64 and assigns it to the Cents field.
func (o *TaxAmount) SetCents(v int64) {
o.Cents = &v
}
// GetLabel returns the Label field value if set, zero value otherwise.
func (o *TaxAmount) GetLabel() string {
if o == nil || IsNil(o.Label) {
var ret string
return ret
}
return *o.Label
}
// GetLabelOk returns a tuple with the Label field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TaxAmount) GetLabelOk() (*string, bool) {
if o == nil || IsNil(o.Label) {
return nil, false
}
return o.Label, true
}
// HasLabel returns a boolean if a field has been set.
func (o *TaxAmount) HasLabel() bool {
if o != nil && !IsNil(o.Label) {
return true
}
return false
}
// SetLabel gets a reference to the given string and assigns it to the Label field.
func (o *TaxAmount) SetLabel(v string) {
o.Label = &v
}
func (o TaxAmount) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TaxAmount) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Box) {
toSerialize["box"] = o.Box
}
if !IsNil(o.Cents) {
toSerialize["cents"] = o.Cents
}
if !IsNil(o.Label) {
toSerialize["label"] = o.Label
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TaxAmount) UnmarshalJSON(data []byte) (err error) {
varTaxAmount := _TaxAmount{}
err = json.Unmarshal(data, &varTaxAmount)
if err != nil {
return err
}
*o = TaxAmount(varTaxAmount)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "box")
delete(additionalProperties, "cents")
delete(additionalProperties, "label")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTaxAmount struct {
value *TaxAmount
isSet bool
}
func (v NullableTaxAmount) Get() *TaxAmount {
return v.value
}
func (v *NullableTaxAmount) Set(val *TaxAmount) {
v.value = val
v.isSet = true
}
func (v NullableTaxAmount) IsSet() bool {
return v.isSet
}
func (v *NullableTaxAmount) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTaxAmount(val *TaxAmount) *NullableTaxAmount {
return &NullableTaxAmount{value: val, isSet: true}
}
func (v NullableTaxAmount) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTaxAmount) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}