Files
sdk/model_scan_draft.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 ScanDraft type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ScanDraft{}
// ScanDraft struct for ScanDraft
type ScanDraft struct {
Balanced *bool `json:"balanced,omitempty"`
Category *string `json:"category,omitempty"`
Confidence *string `json:"confidence,omitempty"`
Extracted *Extracted `json:"extracted,omitempty"`
Questions []Question `json:"questions,omitempty"`
ScanId *string `json:"scanId,omitempty"`
Vendor *string `json:"vendor,omitempty"`
Voucher *Voucher `json:"voucher,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ScanDraft ScanDraft
// NewScanDraft instantiates a new ScanDraft 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 NewScanDraft() *ScanDraft {
this := ScanDraft{}
return &this
}
// NewScanDraftWithDefaults instantiates a new ScanDraft 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 NewScanDraftWithDefaults() *ScanDraft {
this := ScanDraft{}
return &this
}
// GetBalanced returns the Balanced field value if set, zero value otherwise.
func (o *ScanDraft) GetBalanced() bool {
if o == nil || IsNil(o.Balanced) {
var ret bool
return ret
}
return *o.Balanced
}
// GetBalancedOk returns a tuple with the Balanced field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ScanDraft) GetBalancedOk() (*bool, bool) {
if o == nil || IsNil(o.Balanced) {
return nil, false
}
return o.Balanced, true
}
// HasBalanced returns a boolean if a field has been set.
func (o *ScanDraft) HasBalanced() bool {
if o != nil && !IsNil(o.Balanced) {
return true
}
return false
}
// SetBalanced gets a reference to the given bool and assigns it to the Balanced field.
func (o *ScanDraft) SetBalanced(v bool) {
o.Balanced = &v
}
// GetCategory returns the Category field value if set, zero value otherwise.
func (o *ScanDraft) 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 *ScanDraft) 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 *ScanDraft) 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 *ScanDraft) SetCategory(v string) {
o.Category = &v
}
// GetConfidence returns the Confidence field value if set, zero value otherwise.
func (o *ScanDraft) GetConfidence() string {
if o == nil || IsNil(o.Confidence) {
var ret string
return ret
}
return *o.Confidence
}
// GetConfidenceOk returns a tuple with the Confidence field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ScanDraft) GetConfidenceOk() (*string, bool) {
if o == nil || IsNil(o.Confidence) {
return nil, false
}
return o.Confidence, true
}
// HasConfidence returns a boolean if a field has been set.
func (o *ScanDraft) HasConfidence() bool {
if o != nil && !IsNil(o.Confidence) {
return true
}
return false
}
// SetConfidence gets a reference to the given string and assigns it to the Confidence field.
func (o *ScanDraft) SetConfidence(v string) {
o.Confidence = &v
}
// GetExtracted returns the Extracted field value if set, zero value otherwise.
func (o *ScanDraft) GetExtracted() Extracted {
if o == nil || IsNil(o.Extracted) {
var ret Extracted
return ret
}
return *o.Extracted
}
// GetExtractedOk returns a tuple with the Extracted field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ScanDraft) GetExtractedOk() (*Extracted, bool) {
if o == nil || IsNil(o.Extracted) {
return nil, false
}
return o.Extracted, true
}
// HasExtracted returns a boolean if a field has been set.
func (o *ScanDraft) HasExtracted() bool {
if o != nil && !IsNil(o.Extracted) {
return true
}
return false
}
// SetExtracted gets a reference to the given Extracted and assigns it to the Extracted field.
func (o *ScanDraft) SetExtracted(v Extracted) {
o.Extracted = &v
}
// GetQuestions returns the Questions field value if set, zero value otherwise.
func (o *ScanDraft) GetQuestions() []Question {
if o == nil || IsNil(o.Questions) {
var ret []Question
return ret
}
return o.Questions
}
// GetQuestionsOk returns a tuple with the Questions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ScanDraft) GetQuestionsOk() ([]Question, bool) {
if o == nil || IsNil(o.Questions) {
return nil, false
}
return o.Questions, true
}
// HasQuestions returns a boolean if a field has been set.
func (o *ScanDraft) HasQuestions() bool {
if o != nil && !IsNil(o.Questions) {
return true
}
return false
}
// SetQuestions gets a reference to the given []Question and assigns it to the Questions field.
func (o *ScanDraft) SetQuestions(v []Question) {
o.Questions = v
}
// GetScanId returns the ScanId field value if set, zero value otherwise.
func (o *ScanDraft) 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 *ScanDraft) 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 *ScanDraft) 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 *ScanDraft) SetScanId(v string) {
o.ScanId = &v
}
// GetVendor returns the Vendor field value if set, zero value otherwise.
func (o *ScanDraft) GetVendor() string {
if o == nil || IsNil(o.Vendor) {
var ret string
return ret
}
return *o.Vendor
}
// GetVendorOk returns a tuple with the Vendor field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ScanDraft) GetVendorOk() (*string, bool) {
if o == nil || IsNil(o.Vendor) {
return nil, false
}
return o.Vendor, true
}
// HasVendor returns a boolean if a field has been set.
func (o *ScanDraft) HasVendor() bool {
if o != nil && !IsNil(o.Vendor) {
return true
}
return false
}
// SetVendor gets a reference to the given string and assigns it to the Vendor field.
func (o *ScanDraft) SetVendor(v string) {
o.Vendor = &v
}
// GetVoucher returns the Voucher field value if set, zero value otherwise.
func (o *ScanDraft) GetVoucher() Voucher {
if o == nil || IsNil(o.Voucher) {
var ret Voucher
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 *ScanDraft) GetVoucherOk() (*Voucher, 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 *ScanDraft) HasVoucher() bool {
if o != nil && !IsNil(o.Voucher) {
return true
}
return false
}
// SetVoucher gets a reference to the given Voucher and assigns it to the Voucher field.
func (o *ScanDraft) SetVoucher(v Voucher) {
o.Voucher = &v
}
func (o ScanDraft) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ScanDraft) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Balanced) {
toSerialize["balanced"] = o.Balanced
}
if !IsNil(o.Category) {
toSerialize["category"] = o.Category
}
if !IsNil(o.Confidence) {
toSerialize["confidence"] = o.Confidence
}
if !IsNil(o.Extracted) {
toSerialize["extracted"] = o.Extracted
}
if !IsNil(o.Questions) {
toSerialize["questions"] = o.Questions
}
if !IsNil(o.ScanId) {
toSerialize["scanId"] = o.ScanId
}
if !IsNil(o.Vendor) {
toSerialize["vendor"] = o.Vendor
}
if !IsNil(o.Voucher) {
toSerialize["voucher"] = o.Voucher
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ScanDraft) UnmarshalJSON(data []byte) (err error) {
varScanDraft := _ScanDraft{}
err = json.Unmarshal(data, &varScanDraft)
if err != nil {
return err
}
*o = ScanDraft(varScanDraft)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "balanced")
delete(additionalProperties, "category")
delete(additionalProperties, "confidence")
delete(additionalProperties, "extracted")
delete(additionalProperties, "questions")
delete(additionalProperties, "scanId")
delete(additionalProperties, "vendor")
delete(additionalProperties, "voucher")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableScanDraft struct {
value *ScanDraft
isSet bool
}
func (v NullableScanDraft) Get() *ScanDraft {
return v.value
}
func (v *NullableScanDraft) Set(val *ScanDraft) {
v.value = val
v.isSet = true
}
func (v NullableScanDraft) IsSet() bool {
return v.isSet
}
func (v *NullableScanDraft) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableScanDraft(val *ScanDraft) *NullableScanDraft {
return &NullableScanDraft{value: val, isSet: true}
}
func (v NullableScanDraft) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableScanDraft) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}