Files
sdk/model_billing_usage_receipt.go

269 lines
7.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 BillingUsageReceipt type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BillingUsageReceipt{}
// BillingUsageReceipt struct for BillingUsageReceipt
type BillingUsageReceipt struct {
// Account is the wallet the debit drew from, the same key GET /v1/billing/balance reports for this caller.
Account *string `json:"account,omitempty"`
// Amount is the debit, exactly as recorded.
Amount *BillingMoney `json:"amount,omitempty"`
// ID is the act's name, echoed.
Id *string `json:"id,omitempty"`
// Org is the organization whose ledger holds the debit.
Org *string `json:"org,omitempty"`
AdditionalProperties map[string]interface{}
}
type _BillingUsageReceipt BillingUsageReceipt
// NewBillingUsageReceipt instantiates a new BillingUsageReceipt 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 NewBillingUsageReceipt() *BillingUsageReceipt {
this := BillingUsageReceipt{}
return &this
}
// NewBillingUsageReceiptWithDefaults instantiates a new BillingUsageReceipt 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 NewBillingUsageReceiptWithDefaults() *BillingUsageReceipt {
this := BillingUsageReceipt{}
return &this
}
// GetAccount returns the Account field value if set, zero value otherwise.
func (o *BillingUsageReceipt) GetAccount() string {
if o == nil || IsNil(o.Account) {
var ret string
return ret
}
return *o.Account
}
// GetAccountOk returns a tuple with the Account field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingUsageReceipt) GetAccountOk() (*string, bool) {
if o == nil || IsNil(o.Account) {
return nil, false
}
return o.Account, true
}
// HasAccount returns a boolean if a field has been set.
func (o *BillingUsageReceipt) HasAccount() bool {
if o != nil && !IsNil(o.Account) {
return true
}
return false
}
// SetAccount gets a reference to the given string and assigns it to the Account field.
func (o *BillingUsageReceipt) SetAccount(v string) {
o.Account = &v
}
// GetAmount returns the Amount field value if set, zero value otherwise.
func (o *BillingUsageReceipt) GetAmount() BillingMoney {
if o == nil || IsNil(o.Amount) {
var ret BillingMoney
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.
func (o *BillingUsageReceipt) GetAmountOk() (*BillingMoney, 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 *BillingUsageReceipt) HasAmount() bool {
if o != nil && !IsNil(o.Amount) {
return true
}
return false
}
// SetAmount gets a reference to the given BillingMoney and assigns it to the Amount field.
func (o *BillingUsageReceipt) SetAmount(v BillingMoney) {
o.Amount = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *BillingUsageReceipt) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingUsageReceipt) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *BillingUsageReceipt) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *BillingUsageReceipt) SetId(v string) {
o.Id = &v
}
// GetOrg returns the Org field value if set, zero value otherwise.
func (o *BillingUsageReceipt) GetOrg() string {
if o == nil || IsNil(o.Org) {
var ret string
return ret
}
return *o.Org
}
// GetOrgOk returns a tuple with the Org field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingUsageReceipt) GetOrgOk() (*string, bool) {
if o == nil || IsNil(o.Org) {
return nil, false
}
return o.Org, true
}
// HasOrg returns a boolean if a field has been set.
func (o *BillingUsageReceipt) HasOrg() bool {
if o != nil && !IsNil(o.Org) {
return true
}
return false
}
// SetOrg gets a reference to the given string and assigns it to the Org field.
func (o *BillingUsageReceipt) SetOrg(v string) {
o.Org = &v
}
func (o BillingUsageReceipt) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BillingUsageReceipt) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Account) {
toSerialize["account"] = o.Account
}
if !IsNil(o.Amount) {
toSerialize["amount"] = o.Amount
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Org) {
toSerialize["org"] = o.Org
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *BillingUsageReceipt) UnmarshalJSON(data []byte) (err error) {
varBillingUsageReceipt := _BillingUsageReceipt{}
err = json.Unmarshal(data, &varBillingUsageReceipt)
if err != nil {
return err
}
*o = BillingUsageReceipt(varBillingUsageReceipt)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "account")
delete(additionalProperties, "amount")
delete(additionalProperties, "id")
delete(additionalProperties, "org")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableBillingUsageReceipt struct {
value *BillingUsageReceipt
isSet bool
}
func (v NullableBillingUsageReceipt) Get() *BillingUsageReceipt {
return v.value
}
func (v *NullableBillingUsageReceipt) Set(val *BillingUsageReceipt) {
v.value = val
v.isSet = true
}
func (v NullableBillingUsageReceipt) IsSet() bool {
return v.isSet
}
func (v *NullableBillingUsageReceipt) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBillingUsageReceipt(val *BillingUsageReceipt) *NullableBillingUsageReceipt {
return &NullableBillingUsageReceipt{value: val, isSet: true}
}
func (v NullableBillingUsageReceipt) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBillingUsageReceipt) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}