mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
231 lines
6.4 KiB
Go
231 lines
6.4 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 BooksBookRequest type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &BooksBookRequest{}
|
|
|
|
// BooksBookRequest struct for BooksBookRequest
|
|
type BooksBookRequest struct {
|
|
// Override books this bill even when one of the SAME economic identity (vendor, total, issue date) already posted — the explicit human confirmation that a same-looking bill is a genuine second spend, not the same receipt re-scanned.
|
|
Override *bool `json:"override,omitempty"`
|
|
// ScanID is the scanned document's file hash, as GET /v1/books/inbox and the scan draft report it. It is the idempotency key: re-booking the same scan writes nothing.
|
|
ScanId *string `json:"scanId,omitempty"`
|
|
// Voucher is the reviewed voucher to post. Its source is FORCED to (scan, scanId) server-side, so it can never be booked under another source's key.
|
|
Voucher *BooksVoucher `json:"voucher,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _BooksBookRequest BooksBookRequest
|
|
|
|
// NewBooksBookRequest instantiates a new BooksBookRequest 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 NewBooksBookRequest() *BooksBookRequest {
|
|
this := BooksBookRequest{}
|
|
return &this
|
|
}
|
|
|
|
// NewBooksBookRequestWithDefaults instantiates a new BooksBookRequest 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 NewBooksBookRequestWithDefaults() *BooksBookRequest {
|
|
this := BooksBookRequest{}
|
|
return &this
|
|
}
|
|
|
|
// GetOverride returns the Override field value if set, zero value otherwise.
|
|
func (o *BooksBookRequest) GetOverride() bool {
|
|
if o == nil || IsNil(o.Override) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Override
|
|
}
|
|
|
|
// GetOverrideOk returns a tuple with the Override field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BooksBookRequest) GetOverrideOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Override) {
|
|
return nil, false
|
|
}
|
|
return o.Override, true
|
|
}
|
|
|
|
// HasOverride returns a boolean if a field has been set.
|
|
func (o *BooksBookRequest) HasOverride() bool {
|
|
if o != nil && !IsNil(o.Override) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetOverride gets a reference to the given bool and assigns it to the Override field.
|
|
func (o *BooksBookRequest) SetOverride(v bool) {
|
|
o.Override = &v
|
|
}
|
|
|
|
// GetScanId returns the ScanId field value if set, zero value otherwise.
|
|
func (o *BooksBookRequest) GetScanId() string {
|
|
if o == nil || IsNil(o.ScanId) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.ScanId
|
|
}
|
|
|
|
// GetScanIdOk returns a tuple with the ScanId field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BooksBookRequest) GetScanIdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.ScanId) {
|
|
return nil, false
|
|
}
|
|
return o.ScanId, true
|
|
}
|
|
|
|
// HasScanId returns a boolean if a field has been set.
|
|
func (o *BooksBookRequest) HasScanId() bool {
|
|
if o != nil && !IsNil(o.ScanId) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetScanId gets a reference to the given string and assigns it to the ScanId field.
|
|
func (o *BooksBookRequest) SetScanId(v string) {
|
|
o.ScanId = &v
|
|
}
|
|
|
|
// GetVoucher returns the Voucher field value if set, zero value otherwise.
|
|
func (o *BooksBookRequest) GetVoucher() BooksVoucher {
|
|
if o == nil || IsNil(o.Voucher) {
|
|
var ret BooksVoucher
|
|
return ret
|
|
}
|
|
return *o.Voucher
|
|
}
|
|
|
|
// GetVoucherOk returns a tuple with the Voucher field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BooksBookRequest) GetVoucherOk() (*BooksVoucher, bool) {
|
|
if o == nil || IsNil(o.Voucher) {
|
|
return nil, false
|
|
}
|
|
return o.Voucher, true
|
|
}
|
|
|
|
// HasVoucher returns a boolean if a field has been set.
|
|
func (o *BooksBookRequest) HasVoucher() bool {
|
|
if o != nil && !IsNil(o.Voucher) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetVoucher gets a reference to the given BooksVoucher and assigns it to the Voucher field.
|
|
func (o *BooksBookRequest) SetVoucher(v BooksVoucher) {
|
|
o.Voucher = &v
|
|
}
|
|
|
|
func (o BooksBookRequest) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o BooksBookRequest) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Override) {
|
|
toSerialize["override"] = o.Override
|
|
}
|
|
if !IsNil(o.ScanId) {
|
|
toSerialize["scanId"] = o.ScanId
|
|
}
|
|
if !IsNil(o.Voucher) {
|
|
toSerialize["voucher"] = o.Voucher
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *BooksBookRequest) UnmarshalJSON(data []byte) (err error) {
|
|
varBooksBookRequest := _BooksBookRequest{}
|
|
|
|
err = json.Unmarshal(data, &varBooksBookRequest)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = BooksBookRequest(varBooksBookRequest)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "override")
|
|
delete(additionalProperties, "scanId")
|
|
delete(additionalProperties, "voucher")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableBooksBookRequest struct {
|
|
value *BooksBookRequest
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableBooksBookRequest) Get() *BooksBookRequest {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableBooksBookRequest) Set(val *BooksBookRequest) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableBooksBookRequest) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableBooksBookRequest) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableBooksBookRequest(val *BooksBookRequest) *NullableBooksBookRequest {
|
|
return &NullableBooksBookRequest{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableBooksBookRequest) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableBooksBookRequest) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|