Files
sdk/model_billing_collected.go

383 lines
11 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 BillingCollected type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BillingCollected{}
// BillingCollected struct for BillingCollected
type BillingCollected struct {
// BalanceUsedCents is how much was covered by prepaid balance.
BalanceUsedCents *int64 `json:"balanceUsedCents,omitempty"`
// CardChargedCents is how much was charged to the card on file.
CardChargedCents *int64 `json:"cardChargedCents,omitempty"`
// CreditUsedCents is how much was covered by credit grants.
CreditUsedCents *int64 `json:"creditUsedCents,omitempty"`
// Invoice is the invoice AFTER the attempt — its status is the authority on what happened, not this struct's other fields.
Invoice *BillingInvoice `json:"invoice,omitempty"`
// Paid reports whether the invoice is now settled in full. A false here with no error is a DECLINE: the invoice stays open and may be collected again.
Paid *bool `json:"paid,omitempty"`
// ProcessorRef is the processor's reference for any card charge — the field that proves money moved at the gateway rather than only in our ledger.
ProcessorRef *string `json:"processorRef,omitempty"`
// Reason explains a decline or partial collection. Empty on success.
Reason *string `json:"reason,omitempty"`
AdditionalProperties map[string]interface{}
}
type _BillingCollected BillingCollected
// NewBillingCollected instantiates a new BillingCollected 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 NewBillingCollected() *BillingCollected {
this := BillingCollected{}
return &this
}
// NewBillingCollectedWithDefaults instantiates a new BillingCollected 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 NewBillingCollectedWithDefaults() *BillingCollected {
this := BillingCollected{}
return &this
}
// GetBalanceUsedCents returns the BalanceUsedCents field value if set, zero value otherwise.
func (o *BillingCollected) GetBalanceUsedCents() int64 {
if o == nil || IsNil(o.BalanceUsedCents) {
var ret int64
return ret
}
return *o.BalanceUsedCents
}
// GetBalanceUsedCentsOk returns a tuple with the BalanceUsedCents field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingCollected) GetBalanceUsedCentsOk() (*int64, bool) {
if o == nil || IsNil(o.BalanceUsedCents) {
return nil, false
}
return o.BalanceUsedCents, true
}
// HasBalanceUsedCents returns a boolean if a field has been set.
func (o *BillingCollected) HasBalanceUsedCents() bool {
if o != nil && !IsNil(o.BalanceUsedCents) {
return true
}
return false
}
// SetBalanceUsedCents gets a reference to the given int64 and assigns it to the BalanceUsedCents field.
func (o *BillingCollected) SetBalanceUsedCents(v int64) {
o.BalanceUsedCents = &v
}
// GetCardChargedCents returns the CardChargedCents field value if set, zero value otherwise.
func (o *BillingCollected) GetCardChargedCents() int64 {
if o == nil || IsNil(o.CardChargedCents) {
var ret int64
return ret
}
return *o.CardChargedCents
}
// GetCardChargedCentsOk returns a tuple with the CardChargedCents field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingCollected) GetCardChargedCentsOk() (*int64, bool) {
if o == nil || IsNil(o.CardChargedCents) {
return nil, false
}
return o.CardChargedCents, true
}
// HasCardChargedCents returns a boolean if a field has been set.
func (o *BillingCollected) HasCardChargedCents() bool {
if o != nil && !IsNil(o.CardChargedCents) {
return true
}
return false
}
// SetCardChargedCents gets a reference to the given int64 and assigns it to the CardChargedCents field.
func (o *BillingCollected) SetCardChargedCents(v int64) {
o.CardChargedCents = &v
}
// GetCreditUsedCents returns the CreditUsedCents field value if set, zero value otherwise.
func (o *BillingCollected) GetCreditUsedCents() int64 {
if o == nil || IsNil(o.CreditUsedCents) {
var ret int64
return ret
}
return *o.CreditUsedCents
}
// GetCreditUsedCentsOk returns a tuple with the CreditUsedCents field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingCollected) GetCreditUsedCentsOk() (*int64, bool) {
if o == nil || IsNil(o.CreditUsedCents) {
return nil, false
}
return o.CreditUsedCents, true
}
// HasCreditUsedCents returns a boolean if a field has been set.
func (o *BillingCollected) HasCreditUsedCents() bool {
if o != nil && !IsNil(o.CreditUsedCents) {
return true
}
return false
}
// SetCreditUsedCents gets a reference to the given int64 and assigns it to the CreditUsedCents field.
func (o *BillingCollected) SetCreditUsedCents(v int64) {
o.CreditUsedCents = &v
}
// GetInvoice returns the Invoice field value if set, zero value otherwise.
func (o *BillingCollected) GetInvoice() BillingInvoice {
if o == nil || IsNil(o.Invoice) {
var ret BillingInvoice
return ret
}
return *o.Invoice
}
// GetInvoiceOk returns a tuple with the Invoice field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingCollected) GetInvoiceOk() (*BillingInvoice, bool) {
if o == nil || IsNil(o.Invoice) {
return nil, false
}
return o.Invoice, true
}
// HasInvoice returns a boolean if a field has been set.
func (o *BillingCollected) HasInvoice() bool {
if o != nil && !IsNil(o.Invoice) {
return true
}
return false
}
// SetInvoice gets a reference to the given BillingInvoice and assigns it to the Invoice field.
func (o *BillingCollected) SetInvoice(v BillingInvoice) {
o.Invoice = &v
}
// GetPaid returns the Paid field value if set, zero value otherwise.
func (o *BillingCollected) GetPaid() bool {
if o == nil || IsNil(o.Paid) {
var ret bool
return ret
}
return *o.Paid
}
// GetPaidOk returns a tuple with the Paid field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingCollected) GetPaidOk() (*bool, bool) {
if o == nil || IsNil(o.Paid) {
return nil, false
}
return o.Paid, true
}
// HasPaid returns a boolean if a field has been set.
func (o *BillingCollected) HasPaid() bool {
if o != nil && !IsNil(o.Paid) {
return true
}
return false
}
// SetPaid gets a reference to the given bool and assigns it to the Paid field.
func (o *BillingCollected) SetPaid(v bool) {
o.Paid = &v
}
// GetProcessorRef returns the ProcessorRef field value if set, zero value otherwise.
func (o *BillingCollected) GetProcessorRef() string {
if o == nil || IsNil(o.ProcessorRef) {
var ret string
return ret
}
return *o.ProcessorRef
}
// GetProcessorRefOk returns a tuple with the ProcessorRef field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingCollected) GetProcessorRefOk() (*string, bool) {
if o == nil || IsNil(o.ProcessorRef) {
return nil, false
}
return o.ProcessorRef, true
}
// HasProcessorRef returns a boolean if a field has been set.
func (o *BillingCollected) HasProcessorRef() bool {
if o != nil && !IsNil(o.ProcessorRef) {
return true
}
return false
}
// SetProcessorRef gets a reference to the given string and assigns it to the ProcessorRef field.
func (o *BillingCollected) SetProcessorRef(v string) {
o.ProcessorRef = &v
}
// GetReason returns the Reason field value if set, zero value otherwise.
func (o *BillingCollected) GetReason() string {
if o == nil || IsNil(o.Reason) {
var ret string
return ret
}
return *o.Reason
}
// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingCollected) GetReasonOk() (*string, bool) {
if o == nil || IsNil(o.Reason) {
return nil, false
}
return o.Reason, true
}
// HasReason returns a boolean if a field has been set.
func (o *BillingCollected) HasReason() bool {
if o != nil && !IsNil(o.Reason) {
return true
}
return false
}
// SetReason gets a reference to the given string and assigns it to the Reason field.
func (o *BillingCollected) SetReason(v string) {
o.Reason = &v
}
func (o BillingCollected) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BillingCollected) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.BalanceUsedCents) {
toSerialize["balanceUsedCents"] = o.BalanceUsedCents
}
if !IsNil(o.CardChargedCents) {
toSerialize["cardChargedCents"] = o.CardChargedCents
}
if !IsNil(o.CreditUsedCents) {
toSerialize["creditUsedCents"] = o.CreditUsedCents
}
if !IsNil(o.Invoice) {
toSerialize["invoice"] = o.Invoice
}
if !IsNil(o.Paid) {
toSerialize["paid"] = o.Paid
}
if !IsNil(o.ProcessorRef) {
toSerialize["processorRef"] = o.ProcessorRef
}
if !IsNil(o.Reason) {
toSerialize["reason"] = o.Reason
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *BillingCollected) UnmarshalJSON(data []byte) (err error) {
varBillingCollected := _BillingCollected{}
err = json.Unmarshal(data, &varBillingCollected)
if err != nil {
return err
}
*o = BillingCollected(varBillingCollected)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "balanceUsedCents")
delete(additionalProperties, "cardChargedCents")
delete(additionalProperties, "creditUsedCents")
delete(additionalProperties, "invoice")
delete(additionalProperties, "paid")
delete(additionalProperties, "processorRef")
delete(additionalProperties, "reason")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableBillingCollected struct {
value *BillingCollected
isSet bool
}
func (v NullableBillingCollected) Get() *BillingCollected {
return v.value
}
func (v *NullableBillingCollected) Set(val *BillingCollected) {
v.value = val
v.isSet = true
}
func (v NullableBillingCollected) IsSet() bool {
return v.isSet
}
func (v *NullableBillingCollected) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBillingCollected(val *BillingCollected) *NullableBillingCollected {
return &NullableBillingCollected{value: val, isSet: true}
}
func (v NullableBillingCollected) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBillingCollected) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}