mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
451 lines
12 KiB
Go
451 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 BillingTransaction type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &BillingTransaction{}
|
|
|
|
// BillingTransaction struct for BillingTransaction
|
|
type BillingTransaction struct {
|
|
Amount *int64 `json:"amount,omitempty"`
|
|
CreatedAt *string `json:"createdAt,omitempty"`
|
|
Currency *string `json:"currency,omitempty"`
|
|
ExpiresAt *string `json:"expiresAt,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
Metadata interface{} `json:"metadata,omitempty"`
|
|
Notes *string `json:"notes,omitempty"`
|
|
Tags *string `json:"tags,omitempty"`
|
|
Type *string `json:"type,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _BillingTransaction BillingTransaction
|
|
|
|
// NewBillingTransaction instantiates a new BillingTransaction 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 NewBillingTransaction() *BillingTransaction {
|
|
this := BillingTransaction{}
|
|
return &this
|
|
}
|
|
|
|
// NewBillingTransactionWithDefaults instantiates a new BillingTransaction 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 NewBillingTransactionWithDefaults() *BillingTransaction {
|
|
this := BillingTransaction{}
|
|
return &this
|
|
}
|
|
|
|
// GetAmount returns the Amount field value if set, zero value otherwise.
|
|
func (o *BillingTransaction) GetAmount() int64 {
|
|
if o == nil || IsNil(o.Amount) {
|
|
var ret int64
|
|
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 *BillingTransaction) GetAmountOk() (*int64, 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 *BillingTransaction) HasAmount() bool {
|
|
if o != nil && !IsNil(o.Amount) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAmount gets a reference to the given int64 and assigns it to the Amount field.
|
|
func (o *BillingTransaction) SetAmount(v int64) {
|
|
o.Amount = &v
|
|
}
|
|
|
|
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
|
|
func (o *BillingTransaction) GetCreatedAt() string {
|
|
if o == nil || IsNil(o.CreatedAt) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.CreatedAt
|
|
}
|
|
|
|
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingTransaction) GetCreatedAtOk() (*string, bool) {
|
|
if o == nil || IsNil(o.CreatedAt) {
|
|
return nil, false
|
|
}
|
|
return o.CreatedAt, true
|
|
}
|
|
|
|
// HasCreatedAt returns a boolean if a field has been set.
|
|
func (o *BillingTransaction) HasCreatedAt() bool {
|
|
if o != nil && !IsNil(o.CreatedAt) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field.
|
|
func (o *BillingTransaction) SetCreatedAt(v string) {
|
|
o.CreatedAt = &v
|
|
}
|
|
|
|
// GetCurrency returns the Currency field value if set, zero value otherwise.
|
|
func (o *BillingTransaction) 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 *BillingTransaction) 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 *BillingTransaction) 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 *BillingTransaction) SetCurrency(v string) {
|
|
o.Currency = &v
|
|
}
|
|
|
|
// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise.
|
|
func (o *BillingTransaction) GetExpiresAt() string {
|
|
if o == nil || IsNil(o.ExpiresAt) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.ExpiresAt
|
|
}
|
|
|
|
// GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingTransaction) GetExpiresAtOk() (*string, bool) {
|
|
if o == nil || IsNil(o.ExpiresAt) {
|
|
return nil, false
|
|
}
|
|
return o.ExpiresAt, true
|
|
}
|
|
|
|
// HasExpiresAt returns a boolean if a field has been set.
|
|
func (o *BillingTransaction) HasExpiresAt() bool {
|
|
if o != nil && !IsNil(o.ExpiresAt) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetExpiresAt gets a reference to the given string and assigns it to the ExpiresAt field.
|
|
func (o *BillingTransaction) SetExpiresAt(v string) {
|
|
o.ExpiresAt = &v
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *BillingTransaction) 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 *BillingTransaction) 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 *BillingTransaction) 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 *BillingTransaction) SetId(v string) {
|
|
o.Id = &v
|
|
}
|
|
|
|
// GetMetadata returns the Metadata field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *BillingTransaction) GetMetadata() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
return ret
|
|
}
|
|
return o.Metadata
|
|
}
|
|
|
|
// GetMetadataOk returns a tuple with the Metadata 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 *BillingTransaction) GetMetadataOk() (*interface{}, bool) {
|
|
if o == nil || IsNil(o.Metadata) {
|
|
return nil, false
|
|
}
|
|
return &o.Metadata, true
|
|
}
|
|
|
|
// HasMetadata returns a boolean if a field has been set.
|
|
func (o *BillingTransaction) HasMetadata() bool {
|
|
if o != nil && !IsNil(o.Metadata) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMetadata gets a reference to the given interface{} and assigns it to the Metadata field.
|
|
func (o *BillingTransaction) SetMetadata(v interface{}) {
|
|
o.Metadata = v
|
|
}
|
|
|
|
// GetNotes returns the Notes field value if set, zero value otherwise.
|
|
func (o *BillingTransaction) GetNotes() string {
|
|
if o == nil || IsNil(o.Notes) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Notes
|
|
}
|
|
|
|
// GetNotesOk returns a tuple with the Notes field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingTransaction) GetNotesOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Notes) {
|
|
return nil, false
|
|
}
|
|
return o.Notes, true
|
|
}
|
|
|
|
// HasNotes returns a boolean if a field has been set.
|
|
func (o *BillingTransaction) HasNotes() bool {
|
|
if o != nil && !IsNil(o.Notes) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetNotes gets a reference to the given string and assigns it to the Notes field.
|
|
func (o *BillingTransaction) SetNotes(v string) {
|
|
o.Notes = &v
|
|
}
|
|
|
|
// GetTags returns the Tags field value if set, zero value otherwise.
|
|
func (o *BillingTransaction) GetTags() string {
|
|
if o == nil || IsNil(o.Tags) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Tags
|
|
}
|
|
|
|
// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingTransaction) GetTagsOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Tags) {
|
|
return nil, false
|
|
}
|
|
return o.Tags, true
|
|
}
|
|
|
|
// HasTags returns a boolean if a field has been set.
|
|
func (o *BillingTransaction) HasTags() bool {
|
|
if o != nil && !IsNil(o.Tags) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTags gets a reference to the given string and assigns it to the Tags field.
|
|
func (o *BillingTransaction) SetTags(v string) {
|
|
o.Tags = &v
|
|
}
|
|
|
|
// GetType returns the Type field value if set, zero value otherwise.
|
|
func (o *BillingTransaction) GetType() string {
|
|
if o == nil || IsNil(o.Type) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Type
|
|
}
|
|
|
|
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BillingTransaction) GetTypeOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Type) {
|
|
return nil, false
|
|
}
|
|
return o.Type, true
|
|
}
|
|
|
|
// HasType returns a boolean if a field has been set.
|
|
func (o *BillingTransaction) HasType() bool {
|
|
if o != nil && !IsNil(o.Type) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetType gets a reference to the given string and assigns it to the Type field.
|
|
func (o *BillingTransaction) SetType(v string) {
|
|
o.Type = &v
|
|
}
|
|
|
|
func (o BillingTransaction) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o BillingTransaction) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Amount) {
|
|
toSerialize["amount"] = o.Amount
|
|
}
|
|
if !IsNil(o.CreatedAt) {
|
|
toSerialize["createdAt"] = o.CreatedAt
|
|
}
|
|
if !IsNil(o.Currency) {
|
|
toSerialize["currency"] = o.Currency
|
|
}
|
|
if !IsNil(o.ExpiresAt) {
|
|
toSerialize["expiresAt"] = o.ExpiresAt
|
|
}
|
|
if !IsNil(o.Id) {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if o.Metadata != nil {
|
|
toSerialize["metadata"] = o.Metadata
|
|
}
|
|
if !IsNil(o.Notes) {
|
|
toSerialize["notes"] = o.Notes
|
|
}
|
|
if !IsNil(o.Tags) {
|
|
toSerialize["tags"] = o.Tags
|
|
}
|
|
if !IsNil(o.Type) {
|
|
toSerialize["type"] = o.Type
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *BillingTransaction) UnmarshalJSON(data []byte) (err error) {
|
|
varBillingTransaction := _BillingTransaction{}
|
|
|
|
err = json.Unmarshal(data, &varBillingTransaction)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = BillingTransaction(varBillingTransaction)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "amount")
|
|
delete(additionalProperties, "createdAt")
|
|
delete(additionalProperties, "currency")
|
|
delete(additionalProperties, "expiresAt")
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "metadata")
|
|
delete(additionalProperties, "notes")
|
|
delete(additionalProperties, "tags")
|
|
delete(additionalProperties, "type")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableBillingTransaction struct {
|
|
value *BillingTransaction
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableBillingTransaction) Get() *BillingTransaction {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableBillingTransaction) Set(val *BillingTransaction) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableBillingTransaction) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableBillingTransaction) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableBillingTransaction(val *BillingTransaction) *NullableBillingTransaction {
|
|
return &NullableBillingTransaction{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableBillingTransaction) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableBillingTransaction) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|