Files
sdk/model_books_extracted.go

421 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 BooksExtracted type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BooksExtracted{}
// BooksExtracted struct for BooksExtracted
type BooksExtracted struct {
// Category is the expense bucket the SCANNER guessed, as a slug — a hint only. Vendor rules override it whenever they know better, so this is the model's reading and not the account the entry will land on.
Category *string `json:"category,omitempty"`
// Currency is the ISO code the document is denominated in.
Currency *string `json:"currency,omitempty"`
// IssuedAt is the document's OWN date as YYYY-MM-DD — when the bill was issued, which is not when it was uploaded or when it will post.
IssuedAt *string `json:"issuedAt,omitempty"`
// LineItems are the individual lines read off the document, where it had any. They need not sum to totalCents: a document may carry lines the scanner could not read, and the total is taken from the total.
LineItems []BooksLineItem `json:"lineItems,omitempty"`
// Merchant is the supplier as printed on the document.
Merchant *string `json:"merchant,omitempty"`
// Note is anything else worth carrying from the document that has no field of its own.
Note *string `json:"note,omitempty"`
// TaxCents is how much of that total is tax, in cents. It is part of totalCents, not additional to it.
TaxCents *int64 `json:"taxCents,omitempty"`
// TotalCents is the document total in whole cents, tax INCLUDED.
TotalCents *int64 `json:"totalCents,omitempty"`
AdditionalProperties map[string]interface{}
}
type _BooksExtracted BooksExtracted
// NewBooksExtracted instantiates a new BooksExtracted 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 NewBooksExtracted() *BooksExtracted {
this := BooksExtracted{}
return &this
}
// NewBooksExtractedWithDefaults instantiates a new BooksExtracted 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 NewBooksExtractedWithDefaults() *BooksExtracted {
this := BooksExtracted{}
return &this
}
// GetCategory returns the Category field value if set, zero value otherwise.
func (o *BooksExtracted) 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 *BooksExtracted) 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 *BooksExtracted) 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 *BooksExtracted) SetCategory(v string) {
o.Category = &v
}
// GetCurrency returns the Currency field value if set, zero value otherwise.
func (o *BooksExtracted) 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 *BooksExtracted) 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 *BooksExtracted) 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 *BooksExtracted) SetCurrency(v string) {
o.Currency = &v
}
// GetIssuedAt returns the IssuedAt field value if set, zero value otherwise.
func (o *BooksExtracted) 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 *BooksExtracted) 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 *BooksExtracted) 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 *BooksExtracted) SetIssuedAt(v string) {
o.IssuedAt = &v
}
// GetLineItems returns the LineItems field value if set, zero value otherwise.
func (o *BooksExtracted) GetLineItems() []BooksLineItem {
if o == nil || IsNil(o.LineItems) {
var ret []BooksLineItem
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 *BooksExtracted) GetLineItemsOk() ([]BooksLineItem, 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 *BooksExtracted) HasLineItems() bool {
if o != nil && !IsNil(o.LineItems) {
return true
}
return false
}
// SetLineItems gets a reference to the given []BooksLineItem and assigns it to the LineItems field.
func (o *BooksExtracted) SetLineItems(v []BooksLineItem) {
o.LineItems = v
}
// GetMerchant returns the Merchant field value if set, zero value otherwise.
func (o *BooksExtracted) 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 *BooksExtracted) 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 *BooksExtracted) 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 *BooksExtracted) SetMerchant(v string) {
o.Merchant = &v
}
// GetNote returns the Note field value if set, zero value otherwise.
func (o *BooksExtracted) 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 *BooksExtracted) 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 *BooksExtracted) 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 *BooksExtracted) SetNote(v string) {
o.Note = &v
}
// GetTaxCents returns the TaxCents field value if set, zero value otherwise.
func (o *BooksExtracted) GetTaxCents() int64 {
if o == nil || IsNil(o.TaxCents) {
var ret int64
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 *BooksExtracted) GetTaxCentsOk() (*int64, 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 *BooksExtracted) HasTaxCents() bool {
if o != nil && !IsNil(o.TaxCents) {
return true
}
return false
}
// SetTaxCents gets a reference to the given int64 and assigns it to the TaxCents field.
func (o *BooksExtracted) SetTaxCents(v int64) {
o.TaxCents = &v
}
// GetTotalCents returns the TotalCents field value if set, zero value otherwise.
func (o *BooksExtracted) GetTotalCents() int64 {
if o == nil || IsNil(o.TotalCents) {
var ret int64
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 *BooksExtracted) GetTotalCentsOk() (*int64, 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 *BooksExtracted) HasTotalCents() bool {
if o != nil && !IsNil(o.TotalCents) {
return true
}
return false
}
// SetTotalCents gets a reference to the given int64 and assigns it to the TotalCents field.
func (o *BooksExtracted) SetTotalCents(v int64) {
o.TotalCents = &v
}
func (o BooksExtracted) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BooksExtracted) 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 *BooksExtracted) UnmarshalJSON(data []byte) (err error) {
varBooksExtracted := _BooksExtracted{}
err = json.Unmarshal(data, &varBooksExtracted)
if err != nil {
return err
}
*o = BooksExtracted(varBooksExtracted)
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 NullableBooksExtracted struct {
value *BooksExtracted
isSet bool
}
func (v NullableBooksExtracted) Get() *BooksExtracted {
return v.value
}
func (v *NullableBooksExtracted) Set(val *BooksExtracted) {
v.value = val
v.isSet = true
}
func (v NullableBooksExtracted) IsSet() bool {
return v.isSet
}
func (v *NullableBooksExtracted) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBooksExtracted(val *BooksExtracted) *NullableBooksExtracted {
return &NullableBooksExtracted{value: val, isSet: true}
}
func (v NullableBooksExtracted) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBooksExtracted) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}