Files
sdk/model_ai_decision.go

193 lines
4.8 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 AiDecision type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AiDecision{}
// AiDecision struct for AiDecision
type AiDecision struct {
Decision interface{} `json:"decision,omitempty"`
// Receipt says which model served the decision and who paid for it.
Receipt *AiReceipt `json:"receipt,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AiDecision AiDecision
// NewAiDecision instantiates a new AiDecision 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 NewAiDecision() *AiDecision {
this := AiDecision{}
return &this
}
// NewAiDecisionWithDefaults instantiates a new AiDecision 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 NewAiDecisionWithDefaults() *AiDecision {
this := AiDecision{}
return &this
}
// GetDecision returns the Decision field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AiDecision) GetDecision() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Decision
}
// GetDecisionOk returns a tuple with the Decision field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *AiDecision) GetDecisionOk() (*interface{}, bool) {
if o == nil || IsNil(o.Decision) {
return nil, false
}
return &o.Decision, true
}
// HasDecision returns a boolean if a field has been set.
func (o *AiDecision) HasDecision() bool {
if o != nil && !IsNil(o.Decision) {
return true
}
return false
}
// SetDecision gets a reference to the given interface{} and assigns it to the Decision field.
func (o *AiDecision) SetDecision(v interface{}) {
o.Decision = v
}
// GetReceipt returns the Receipt field value if set, zero value otherwise.
func (o *AiDecision) GetReceipt() AiReceipt {
if o == nil || IsNil(o.Receipt) {
var ret AiReceipt
return ret
}
return *o.Receipt
}
// GetReceiptOk returns a tuple with the Receipt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiDecision) GetReceiptOk() (*AiReceipt, bool) {
if o == nil || IsNil(o.Receipt) {
return nil, false
}
return o.Receipt, true
}
// HasReceipt returns a boolean if a field has been set.
func (o *AiDecision) HasReceipt() bool {
if o != nil && !IsNil(o.Receipt) {
return true
}
return false
}
// SetReceipt gets a reference to the given AiReceipt and assigns it to the Receipt field.
func (o *AiDecision) SetReceipt(v AiReceipt) {
o.Receipt = &v
}
func (o AiDecision) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AiDecision) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.Decision != nil {
toSerialize["decision"] = o.Decision
}
if !IsNil(o.Receipt) {
toSerialize["receipt"] = o.Receipt
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AiDecision) UnmarshalJSON(data []byte) (err error) {
varAiDecision := _AiDecision{}
err = json.Unmarshal(data, &varAiDecision)
if err != nil {
return err
}
*o = AiDecision(varAiDecision)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "decision")
delete(additionalProperties, "receipt")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAiDecision struct {
value *AiDecision
isSet bool
}
func (v NullableAiDecision) Get() *AiDecision {
return v.value
}
func (v *NullableAiDecision) Set(val *AiDecision) {
v.value = val
v.isSet = true
}
func (v NullableAiDecision) IsSet() bool {
return v.isSet
}
func (v *NullableAiDecision) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAiDecision(val *AiDecision) *NullableAiDecision {
return &NullableAiDecision{value: val, isSet: true}
}
func (v NullableAiDecision) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAiDecision) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}