Files
sdk/model_billing_invoice.go

573 lines
16 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 BillingInvoice type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BillingInvoice{}
// BillingInvoice struct for BillingInvoice
type BillingInvoice struct {
// AmountDueCents is what remains collectible.
AmountDueCents *int64 `json:"amountDueCents,omitempty"`
// AmountPaidCents is what has been collected so far.
AmountPaidCents *int64 `json:"amountPaidCents,omitempty"`
// CreatedAt is when the draft was raised, RFC3339.
CreatedAt *string `json:"createdAt,omitempty"`
// Currency is the ISO 4217 code.
Currency *string `json:"currency,omitempty"`
// CustomerEmail is where it is sent.
CustomerEmail *string `json:"customerEmail,omitempty"`
// ID is the invoice id — what the issue, collect and void ops address.
Id *string `json:"id,omitempty"`
// Lines are the charges on the invoice.
Lines []BillingInvoiceLine `json:"lines,omitempty"`
// Number is the human-facing invoice number, e.g. \"INV-0042\". A draft has none; issuing assigns it.
Number *string `json:"number,omitempty"`
// PaymentRef is the processor reference for the collection, once paid.
PaymentRef *string `json:"paymentRef,omitempty"`
// Status is draft, open, paid, void or uncollectible. A draft is not collectible; issuing moves it to open.
Status *string `json:"status,omitempty"`
// SubtotalCents is the sum of the lines.
SubtotalCents *int64 `json:"subtotalCents,omitempty"`
// UserID is the customer billed.
UserId *string `json:"userId,omitempty"`
AdditionalProperties map[string]interface{}
}
type _BillingInvoice BillingInvoice
// NewBillingInvoice instantiates a new BillingInvoice 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 NewBillingInvoice() *BillingInvoice {
this := BillingInvoice{}
return &this
}
// NewBillingInvoiceWithDefaults instantiates a new BillingInvoice 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 NewBillingInvoiceWithDefaults() *BillingInvoice {
this := BillingInvoice{}
return &this
}
// GetAmountDueCents returns the AmountDueCents field value if set, zero value otherwise.
func (o *BillingInvoice) GetAmountDueCents() int64 {
if o == nil || IsNil(o.AmountDueCents) {
var ret int64
return ret
}
return *o.AmountDueCents
}
// GetAmountDueCentsOk returns a tuple with the AmountDueCents field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingInvoice) GetAmountDueCentsOk() (*int64, bool) {
if o == nil || IsNil(o.AmountDueCents) {
return nil, false
}
return o.AmountDueCents, true
}
// HasAmountDueCents returns a boolean if a field has been set.
func (o *BillingInvoice) HasAmountDueCents() bool {
if o != nil && !IsNil(o.AmountDueCents) {
return true
}
return false
}
// SetAmountDueCents gets a reference to the given int64 and assigns it to the AmountDueCents field.
func (o *BillingInvoice) SetAmountDueCents(v int64) {
o.AmountDueCents = &v
}
// GetAmountPaidCents returns the AmountPaidCents field value if set, zero value otherwise.
func (o *BillingInvoice) GetAmountPaidCents() int64 {
if o == nil || IsNil(o.AmountPaidCents) {
var ret int64
return ret
}
return *o.AmountPaidCents
}
// GetAmountPaidCentsOk returns a tuple with the AmountPaidCents field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingInvoice) GetAmountPaidCentsOk() (*int64, bool) {
if o == nil || IsNil(o.AmountPaidCents) {
return nil, false
}
return o.AmountPaidCents, true
}
// HasAmountPaidCents returns a boolean if a field has been set.
func (o *BillingInvoice) HasAmountPaidCents() bool {
if o != nil && !IsNil(o.AmountPaidCents) {
return true
}
return false
}
// SetAmountPaidCents gets a reference to the given int64 and assigns it to the AmountPaidCents field.
func (o *BillingInvoice) SetAmountPaidCents(v int64) {
o.AmountPaidCents = &v
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *BillingInvoice) 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 *BillingInvoice) 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 *BillingInvoice) 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 *BillingInvoice) SetCreatedAt(v string) {
o.CreatedAt = &v
}
// GetCurrency returns the Currency field value if set, zero value otherwise.
func (o *BillingInvoice) 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 *BillingInvoice) 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 *BillingInvoice) 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 *BillingInvoice) SetCurrency(v string) {
o.Currency = &v
}
// GetCustomerEmail returns the CustomerEmail field value if set, zero value otherwise.
func (o *BillingInvoice) GetCustomerEmail() string {
if o == nil || IsNil(o.CustomerEmail) {
var ret string
return ret
}
return *o.CustomerEmail
}
// GetCustomerEmailOk returns a tuple with the CustomerEmail field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingInvoice) GetCustomerEmailOk() (*string, bool) {
if o == nil || IsNil(o.CustomerEmail) {
return nil, false
}
return o.CustomerEmail, true
}
// HasCustomerEmail returns a boolean if a field has been set.
func (o *BillingInvoice) HasCustomerEmail() bool {
if o != nil && !IsNil(o.CustomerEmail) {
return true
}
return false
}
// SetCustomerEmail gets a reference to the given string and assigns it to the CustomerEmail field.
func (o *BillingInvoice) SetCustomerEmail(v string) {
o.CustomerEmail = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *BillingInvoice) 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 *BillingInvoice) 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 *BillingInvoice) 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 *BillingInvoice) SetId(v string) {
o.Id = &v
}
// GetLines returns the Lines field value if set, zero value otherwise.
func (o *BillingInvoice) GetLines() []BillingInvoiceLine {
if o == nil || IsNil(o.Lines) {
var ret []BillingInvoiceLine
return ret
}
return o.Lines
}
// GetLinesOk returns a tuple with the Lines field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingInvoice) GetLinesOk() ([]BillingInvoiceLine, bool) {
if o == nil || IsNil(o.Lines) {
return nil, false
}
return o.Lines, true
}
// HasLines returns a boolean if a field has been set.
func (o *BillingInvoice) HasLines() bool {
if o != nil && !IsNil(o.Lines) {
return true
}
return false
}
// SetLines gets a reference to the given []BillingInvoiceLine and assigns it to the Lines field.
func (o *BillingInvoice) SetLines(v []BillingInvoiceLine) {
o.Lines = v
}
// GetNumber returns the Number field value if set, zero value otherwise.
func (o *BillingInvoice) GetNumber() string {
if o == nil || IsNil(o.Number) {
var ret string
return ret
}
return *o.Number
}
// GetNumberOk returns a tuple with the Number field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingInvoice) GetNumberOk() (*string, bool) {
if o == nil || IsNil(o.Number) {
return nil, false
}
return o.Number, true
}
// HasNumber returns a boolean if a field has been set.
func (o *BillingInvoice) HasNumber() bool {
if o != nil && !IsNil(o.Number) {
return true
}
return false
}
// SetNumber gets a reference to the given string and assigns it to the Number field.
func (o *BillingInvoice) SetNumber(v string) {
o.Number = &v
}
// GetPaymentRef returns the PaymentRef field value if set, zero value otherwise.
func (o *BillingInvoice) GetPaymentRef() string {
if o == nil || IsNil(o.PaymentRef) {
var ret string
return ret
}
return *o.PaymentRef
}
// GetPaymentRefOk returns a tuple with the PaymentRef field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingInvoice) GetPaymentRefOk() (*string, bool) {
if o == nil || IsNil(o.PaymentRef) {
return nil, false
}
return o.PaymentRef, true
}
// HasPaymentRef returns a boolean if a field has been set.
func (o *BillingInvoice) HasPaymentRef() bool {
if o != nil && !IsNil(o.PaymentRef) {
return true
}
return false
}
// SetPaymentRef gets a reference to the given string and assigns it to the PaymentRef field.
func (o *BillingInvoice) SetPaymentRef(v string) {
o.PaymentRef = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *BillingInvoice) 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 *BillingInvoice) 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 *BillingInvoice) 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 *BillingInvoice) SetStatus(v string) {
o.Status = &v
}
// GetSubtotalCents returns the SubtotalCents field value if set, zero value otherwise.
func (o *BillingInvoice) GetSubtotalCents() int64 {
if o == nil || IsNil(o.SubtotalCents) {
var ret int64
return ret
}
return *o.SubtotalCents
}
// GetSubtotalCentsOk returns a tuple with the SubtotalCents field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingInvoice) GetSubtotalCentsOk() (*int64, bool) {
if o == nil || IsNil(o.SubtotalCents) {
return nil, false
}
return o.SubtotalCents, true
}
// HasSubtotalCents returns a boolean if a field has been set.
func (o *BillingInvoice) HasSubtotalCents() bool {
if o != nil && !IsNil(o.SubtotalCents) {
return true
}
return false
}
// SetSubtotalCents gets a reference to the given int64 and assigns it to the SubtotalCents field.
func (o *BillingInvoice) SetSubtotalCents(v int64) {
o.SubtotalCents = &v
}
// GetUserId returns the UserId field value if set, zero value otherwise.
func (o *BillingInvoice) GetUserId() string {
if o == nil || IsNil(o.UserId) {
var ret string
return ret
}
return *o.UserId
}
// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BillingInvoice) GetUserIdOk() (*string, bool) {
if o == nil || IsNil(o.UserId) {
return nil, false
}
return o.UserId, true
}
// HasUserId returns a boolean if a field has been set.
func (o *BillingInvoice) HasUserId() bool {
if o != nil && !IsNil(o.UserId) {
return true
}
return false
}
// SetUserId gets a reference to the given string and assigns it to the UserId field.
func (o *BillingInvoice) SetUserId(v string) {
o.UserId = &v
}
func (o BillingInvoice) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BillingInvoice) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.AmountDueCents) {
toSerialize["amountDueCents"] = o.AmountDueCents
}
if !IsNil(o.AmountPaidCents) {
toSerialize["amountPaidCents"] = o.AmountPaidCents
}
if !IsNil(o.CreatedAt) {
toSerialize["createdAt"] = o.CreatedAt
}
if !IsNil(o.Currency) {
toSerialize["currency"] = o.Currency
}
if !IsNil(o.CustomerEmail) {
toSerialize["customerEmail"] = o.CustomerEmail
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Lines) {
toSerialize["lines"] = o.Lines
}
if !IsNil(o.Number) {
toSerialize["number"] = o.Number
}
if !IsNil(o.PaymentRef) {
toSerialize["paymentRef"] = o.PaymentRef
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.SubtotalCents) {
toSerialize["subtotalCents"] = o.SubtotalCents
}
if !IsNil(o.UserId) {
toSerialize["userId"] = o.UserId
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *BillingInvoice) UnmarshalJSON(data []byte) (err error) {
varBillingInvoice := _BillingInvoice{}
err = json.Unmarshal(data, &varBillingInvoice)
if err != nil {
return err
}
*o = BillingInvoice(varBillingInvoice)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "amountDueCents")
delete(additionalProperties, "amountPaidCents")
delete(additionalProperties, "createdAt")
delete(additionalProperties, "currency")
delete(additionalProperties, "customerEmail")
delete(additionalProperties, "id")
delete(additionalProperties, "lines")
delete(additionalProperties, "number")
delete(additionalProperties, "paymentRef")
delete(additionalProperties, "status")
delete(additionalProperties, "subtotalCents")
delete(additionalProperties, "userId")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableBillingInvoice struct {
value *BillingInvoice
isSet bool
}
func (v NullableBillingInvoice) Get() *BillingInvoice {
return v.value
}
func (v *NullableBillingInvoice) Set(val *BillingInvoice) {
v.value = val
v.isSet = true
}
func (v NullableBillingInvoice) IsSet() bool {
return v.isSet
}
func (v *NullableBillingInvoice) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBillingInvoice(val *BillingInvoice) *NullableBillingInvoice {
return &NullableBillingInvoice{value: val, isSet: true}
}
func (v NullableBillingInvoice) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBillingInvoice) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}