Files
sdk/model_extracted.go

413 lines
10 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 Extracted type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Extracted{}
// Extracted struct for Extracted
type Extracted struct {
Category *string `json:"category,omitempty"`
Currency *string `json:"currency,omitempty"`
IssuedAt *string `json:"issuedAt,omitempty"`
LineItems []LineItem `json:"lineItems,omitempty"`
Merchant *string `json:"merchant,omitempty"`
Note *string `json:"note,omitempty"`
TaxCents *int32 `json:"taxCents,omitempty"`
TotalCents *int32 `json:"totalCents,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Extracted Extracted
// NewExtracted instantiates a new Extracted 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 NewExtracted() *Extracted {
this := Extracted{}
return &this
}
// NewExtractedWithDefaults instantiates a new Extracted 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 NewExtractedWithDefaults() *Extracted {
this := Extracted{}
return &this
}
// GetCategory returns the Category field value if set, zero value otherwise.
func (o *Extracted) GetCategory() string {
if o == nil || IsNil(o.Category) {
var ret string
return ret
}
return *o.Category
}
// GetCategoryOk returns a tuple with the Category field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Extracted) GetCategoryOk() (*string, bool) {
if o == nil || IsNil(o.Category) {
return nil, false
}
return o.Category, true
}
// HasCategory returns a boolean if a field has been set.
func (o *Extracted) HasCategory() bool {
if o != nil && !IsNil(o.Category) {
return true
}
return false
}
// SetCategory gets a reference to the given string and assigns it to the Category field.
func (o *Extracted) SetCategory(v string) {
o.Category = &v
}
// GetCurrency returns the Currency field value if set, zero value otherwise.
func (o *Extracted) 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 *Extracted) 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 *Extracted) 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 *Extracted) SetCurrency(v string) {
o.Currency = &v
}
// GetIssuedAt returns the IssuedAt field value if set, zero value otherwise.
func (o *Extracted) GetIssuedAt() string {
if o == nil || IsNil(o.IssuedAt) {
var ret string
return ret
}
return *o.IssuedAt
}
// GetIssuedAtOk returns a tuple with the IssuedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Extracted) GetIssuedAtOk() (*string, bool) {
if o == nil || IsNil(o.IssuedAt) {
return nil, false
}
return o.IssuedAt, true
}
// HasIssuedAt returns a boolean if a field has been set.
func (o *Extracted) HasIssuedAt() bool {
if o != nil && !IsNil(o.IssuedAt) {
return true
}
return false
}
// SetIssuedAt gets a reference to the given string and assigns it to the IssuedAt field.
func (o *Extracted) SetIssuedAt(v string) {
o.IssuedAt = &v
}
// GetLineItems returns the LineItems field value if set, zero value otherwise.
func (o *Extracted) GetLineItems() []LineItem {
if o == nil || IsNil(o.LineItems) {
var ret []LineItem
return ret
}
return o.LineItems
}
// GetLineItemsOk returns a tuple with the LineItems field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Extracted) GetLineItemsOk() ([]LineItem, bool) {
if o == nil || IsNil(o.LineItems) {
return nil, false
}
return o.LineItems, true
}
// HasLineItems returns a boolean if a field has been set.
func (o *Extracted) HasLineItems() bool {
if o != nil && !IsNil(o.LineItems) {
return true
}
return false
}
// SetLineItems gets a reference to the given []LineItem and assigns it to the LineItems field.
func (o *Extracted) SetLineItems(v []LineItem) {
o.LineItems = v
}
// GetMerchant returns the Merchant field value if set, zero value otherwise.
func (o *Extracted) GetMerchant() string {
if o == nil || IsNil(o.Merchant) {
var ret string
return ret
}
return *o.Merchant
}
// GetMerchantOk returns a tuple with the Merchant field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Extracted) GetMerchantOk() (*string, bool) {
if o == nil || IsNil(o.Merchant) {
return nil, false
}
return o.Merchant, true
}
// HasMerchant returns a boolean if a field has been set.
func (o *Extracted) HasMerchant() bool {
if o != nil && !IsNil(o.Merchant) {
return true
}
return false
}
// SetMerchant gets a reference to the given string and assigns it to the Merchant field.
func (o *Extracted) SetMerchant(v string) {
o.Merchant = &v
}
// GetNote returns the Note field value if set, zero value otherwise.
func (o *Extracted) GetNote() string {
if o == nil || IsNil(o.Note) {
var ret string
return ret
}
return *o.Note
}
// GetNoteOk returns a tuple with the Note field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Extracted) GetNoteOk() (*string, bool) {
if o == nil || IsNil(o.Note) {
return nil, false
}
return o.Note, true
}
// HasNote returns a boolean if a field has been set.
func (o *Extracted) HasNote() bool {
if o != nil && !IsNil(o.Note) {
return true
}
return false
}
// SetNote gets a reference to the given string and assigns it to the Note field.
func (o *Extracted) SetNote(v string) {
o.Note = &v
}
// GetTaxCents returns the TaxCents field value if set, zero value otherwise.
func (o *Extracted) GetTaxCents() int32 {
if o == nil || IsNil(o.TaxCents) {
var ret int32
return ret
}
return *o.TaxCents
}
// GetTaxCentsOk returns a tuple with the TaxCents field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Extracted) GetTaxCentsOk() (*int32, bool) {
if o == nil || IsNil(o.TaxCents) {
return nil, false
}
return o.TaxCents, true
}
// HasTaxCents returns a boolean if a field has been set.
func (o *Extracted) HasTaxCents() bool {
if o != nil && !IsNil(o.TaxCents) {
return true
}
return false
}
// SetTaxCents gets a reference to the given int32 and assigns it to the TaxCents field.
func (o *Extracted) SetTaxCents(v int32) {
o.TaxCents = &v
}
// GetTotalCents returns the TotalCents field value if set, zero value otherwise.
func (o *Extracted) GetTotalCents() int32 {
if o == nil || IsNil(o.TotalCents) {
var ret int32
return ret
}
return *o.TotalCents
}
// GetTotalCentsOk returns a tuple with the TotalCents field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Extracted) GetTotalCentsOk() (*int32, bool) {
if o == nil || IsNil(o.TotalCents) {
return nil, false
}
return o.TotalCents, true
}
// HasTotalCents returns a boolean if a field has been set.
func (o *Extracted) HasTotalCents() bool {
if o != nil && !IsNil(o.TotalCents) {
return true
}
return false
}
// SetTotalCents gets a reference to the given int32 and assigns it to the TotalCents field.
func (o *Extracted) SetTotalCents(v int32) {
o.TotalCents = &v
}
func (o Extracted) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Extracted) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Category) {
toSerialize["category"] = o.Category
}
if !IsNil(o.Currency) {
toSerialize["currency"] = o.Currency
}
if !IsNil(o.IssuedAt) {
toSerialize["issuedAt"] = o.IssuedAt
}
if !IsNil(o.LineItems) {
toSerialize["lineItems"] = o.LineItems
}
if !IsNil(o.Merchant) {
toSerialize["merchant"] = o.Merchant
}
if !IsNil(o.Note) {
toSerialize["note"] = o.Note
}
if !IsNil(o.TaxCents) {
toSerialize["taxCents"] = o.TaxCents
}
if !IsNil(o.TotalCents) {
toSerialize["totalCents"] = o.TotalCents
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Extracted) UnmarshalJSON(data []byte) (err error) {
varExtracted := _Extracted{}
err = json.Unmarshal(data, &varExtracted)
if err != nil {
return err
}
*o = Extracted(varExtracted)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "category")
delete(additionalProperties, "currency")
delete(additionalProperties, "issuedAt")
delete(additionalProperties, "lineItems")
delete(additionalProperties, "merchant")
delete(additionalProperties, "note")
delete(additionalProperties, "taxCents")
delete(additionalProperties, "totalCents")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableExtracted struct {
value *Extracted
isSet bool
}
func (v NullableExtracted) Get() *Extracted {
return v.value
}
func (v *NullableExtracted) Set(val *Extracted) {
v.value = val
v.isSet = true
}
func (v NullableExtracted) IsSet() bool {
return v.isSet
}
func (v *NullableExtracted) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableExtracted(val *Extracted) *NullableExtracted {
return &NullableExtracted{value: val, isSet: true}
}
func (v NullableExtracted) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableExtracted) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}