Files
sdk/model_billing_charged.go

307 lines
8.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 BillingCharged type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BillingCharged{}
// BillingCharged struct for BillingCharged
type BillingCharged struct {
// BalanceCents is the subject's balance AFTER the charge settled, in cents, so a caller does not have to re-read to show the new number.
BalanceCents *int64 `json:"balanceCents,omitempty"`
// ProcessorRef is the payment processor's own reference. It is the only field that proves money moved at the GATEWAY rather than merely in our ledger, which is why it is answered and not only logged. Absent where the processor returned none.
ProcessorRef *string `json:"processorRef,omitempty"`
// Status is how the charge ended. Read it rather than inferring success from the HTTP status: the call succeeded whenever this field is present, and what the PROCESSOR did is what this says.
Status *string `json:"status,omitempty"`
// Test states which bucket was credited — sandbox money or real money — so no reader has to guess whether a receipt is real. Sandbox and live funds are physically separate ledgers, and a reader that conflates them restates the company's revenue.
Test *bool `json:"test,omitempty"`
// TransactionID is the ledger entry this charge created. It is the handle a later read or a refund names, and it is minted by the ledger rather than by the caller.
TransactionId *string `json:"transactionId,omitempty"`
AdditionalProperties map[string]interface{}
}
type _BillingCharged BillingCharged
// NewBillingCharged instantiates a new BillingCharged 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 NewBillingCharged() *BillingCharged {
this := BillingCharged{}
return &this
}
// NewBillingChargedWithDefaults instantiates a new BillingCharged 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 NewBillingChargedWithDefaults() *BillingCharged {
this := BillingCharged{}
return &this
}
// GetBalanceCents returns the BalanceCents field value if set, zero value otherwise.
func (o *BillingCharged) GetBalanceCents() int64 {
if o == nil || IsNil(o.BalanceCents) {
var ret int64
return ret
}
return *o.BalanceCents
}
// GetBalanceCentsOk returns a tuple with the BalanceCents field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingCharged) GetBalanceCentsOk() (*int64, bool) {
if o == nil || IsNil(o.BalanceCents) {
return nil, false
}
return o.BalanceCents, true
}
// HasBalanceCents returns a boolean if a field has been set.
func (o *BillingCharged) HasBalanceCents() bool {
if o != nil && !IsNil(o.BalanceCents) {
return true
}
return false
}
// SetBalanceCents gets a reference to the given int64 and assigns it to the BalanceCents field.
func (o *BillingCharged) SetBalanceCents(v int64) {
o.BalanceCents = &v
}
// GetProcessorRef returns the ProcessorRef field value if set, zero value otherwise.
func (o *BillingCharged) 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 *BillingCharged) 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 *BillingCharged) 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 *BillingCharged) SetProcessorRef(v string) {
o.ProcessorRef = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *BillingCharged) GetStatus() string {
if o == nil || IsNil(o.Status) {
var ret string
return ret
}
return *o.Status
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingCharged) GetStatusOk() (*string, bool) {
if o == nil || IsNil(o.Status) {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *BillingCharged) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *BillingCharged) SetStatus(v string) {
o.Status = &v
}
// GetTest returns the Test field value if set, zero value otherwise.
func (o *BillingCharged) GetTest() bool {
if o == nil || IsNil(o.Test) {
var ret bool
return ret
}
return *o.Test
}
// GetTestOk returns a tuple with the Test field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingCharged) GetTestOk() (*bool, bool) {
if o == nil || IsNil(o.Test) {
return nil, false
}
return o.Test, true
}
// HasTest returns a boolean if a field has been set.
func (o *BillingCharged) HasTest() bool {
if o != nil && !IsNil(o.Test) {
return true
}
return false
}
// SetTest gets a reference to the given bool and assigns it to the Test field.
func (o *BillingCharged) SetTest(v bool) {
o.Test = &v
}
// GetTransactionId returns the TransactionId field value if set, zero value otherwise.
func (o *BillingCharged) GetTransactionId() string {
if o == nil || IsNil(o.TransactionId) {
var ret string
return ret
}
return *o.TransactionId
}
// GetTransactionIdOk returns a tuple with the TransactionId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingCharged) GetTransactionIdOk() (*string, bool) {
if o == nil || IsNil(o.TransactionId) {
return nil, false
}
return o.TransactionId, true
}
// HasTransactionId returns a boolean if a field has been set.
func (o *BillingCharged) HasTransactionId() bool {
if o != nil && !IsNil(o.TransactionId) {
return true
}
return false
}
// SetTransactionId gets a reference to the given string and assigns it to the TransactionId field.
func (o *BillingCharged) SetTransactionId(v string) {
o.TransactionId = &v
}
func (o BillingCharged) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BillingCharged) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.BalanceCents) {
toSerialize["balanceCents"] = o.BalanceCents
}
if !IsNil(o.ProcessorRef) {
toSerialize["processorRef"] = o.ProcessorRef
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.Test) {
toSerialize["test"] = o.Test
}
if !IsNil(o.TransactionId) {
toSerialize["transactionId"] = o.TransactionId
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *BillingCharged) UnmarshalJSON(data []byte) (err error) {
varBillingCharged := _BillingCharged{}
err = json.Unmarshal(data, &varBillingCharged)
if err != nil {
return err
}
*o = BillingCharged(varBillingCharged)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "balanceCents")
delete(additionalProperties, "processorRef")
delete(additionalProperties, "status")
delete(additionalProperties, "test")
delete(additionalProperties, "transactionId")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableBillingCharged struct {
value *BillingCharged
isSet bool
}
func (v NullableBillingCharged) Get() *BillingCharged {
return v.value
}
func (v *NullableBillingCharged) Set(val *BillingCharged) {
v.value = val
v.isSet = true
}
func (v NullableBillingCharged) IsSet() bool {
return v.isSet
}
func (v *NullableBillingCharged) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBillingCharged(val *BillingCharged) *NullableBillingCharged {
return &NullableBillingCharged{value: val, isSet: true}
}
func (v NullableBillingCharged) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBillingCharged) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}