Files
sdk/model_ai_decisions_boolean.go

279 lines
7.5 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"
"fmt"
)
// checks if the AiDecisionsBoolean type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AiDecisionsBoolean{}
// AiDecisionsBoolean struct for AiDecisionsBoolean
type AiDecisionsBoolean struct {
Criteria *AiDecisionSides `json:"criteria,omitempty"`
Instructions interface{} `json:"instructions,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Type string `json:"type"`
AdditionalProperties map[string]interface{}
}
type _AiDecisionsBoolean AiDecisionsBoolean
// NewAiDecisionsBoolean instantiates a new AiDecisionsBoolean 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 NewAiDecisionsBoolean(type_ string) *AiDecisionsBoolean {
this := AiDecisionsBoolean{}
this.Type = type_
return &this
}
// NewAiDecisionsBooleanWithDefaults instantiates a new AiDecisionsBoolean 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 NewAiDecisionsBooleanWithDefaults() *AiDecisionsBoolean {
this := AiDecisionsBoolean{}
return &this
}
// GetCriteria returns the Criteria field value if set, zero value otherwise.
func (o *AiDecisionsBoolean) GetCriteria() AiDecisionSides {
if o == nil || IsNil(o.Criteria) {
var ret AiDecisionSides
return ret
}
return *o.Criteria
}
// GetCriteriaOk returns a tuple with the Criteria field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiDecisionsBoolean) GetCriteriaOk() (*AiDecisionSides, bool) {
if o == nil || IsNil(o.Criteria) {
return nil, false
}
return o.Criteria, true
}
// HasCriteria returns a boolean if a field has been set.
func (o *AiDecisionsBoolean) HasCriteria() bool {
if o != nil && !IsNil(o.Criteria) {
return true
}
return false
}
// SetCriteria gets a reference to the given AiDecisionSides and assigns it to the Criteria field.
func (o *AiDecisionsBoolean) SetCriteria(v AiDecisionSides) {
o.Criteria = &v
}
// GetInstructions returns the Instructions field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AiDecisionsBoolean) GetInstructions() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Instructions
}
// GetInstructionsOk returns a tuple with the Instructions 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 *AiDecisionsBoolean) GetInstructionsOk() (*interface{}, bool) {
if o == nil || IsNil(o.Instructions) {
return nil, false
}
return &o.Instructions, true
}
// HasInstructions returns a boolean if a field has been set.
func (o *AiDecisionsBoolean) HasInstructions() bool {
if o != nil && !IsNil(o.Instructions) {
return true
}
return false
}
// SetInstructions gets a reference to the given interface{} and assigns it to the Instructions field.
func (o *AiDecisionsBoolean) SetInstructions(v interface{}) {
o.Instructions = v
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *AiDecisionsBoolean) GetLabels() map[string]string {
if o == nil || IsNil(o.Labels) {
var ret map[string]string
return ret
}
return o.Labels
}
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiDecisionsBoolean) GetLabelsOk() (map[string]string, bool) {
if o == nil || IsNil(o.Labels) {
return map[string]string{}, false
}
return o.Labels, true
}
// HasLabels returns a boolean if a field has been set.
func (o *AiDecisionsBoolean) HasLabels() bool {
if o != nil && !IsNil(o.Labels) {
return true
}
return false
}
// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field.
func (o *AiDecisionsBoolean) SetLabels(v map[string]string) {
o.Labels = v
}
// GetType returns the Type field value
func (o *AiDecisionsBoolean) GetType() string {
if o == nil {
var ret string
return ret
}
return o.Type
}
// GetTypeOk returns a tuple with the Type field value
// and a boolean to check if the value has been set.
func (o *AiDecisionsBoolean) GetTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Type, true
}
// SetType sets field value
func (o *AiDecisionsBoolean) SetType(v string) {
o.Type = v
}
func (o AiDecisionsBoolean) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AiDecisionsBoolean) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Criteria) {
toSerialize["criteria"] = o.Criteria
}
if o.Instructions != nil {
toSerialize["instructions"] = o.Instructions
}
if !IsNil(o.Labels) {
toSerialize["labels"] = o.Labels
}
toSerialize["type"] = o.Type
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AiDecisionsBoolean) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"type",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varAiDecisionsBoolean := _AiDecisionsBoolean{}
err = json.Unmarshal(data, &varAiDecisionsBoolean)
if err != nil {
return err
}
*o = AiDecisionsBoolean(varAiDecisionsBoolean)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "criteria")
delete(additionalProperties, "instructions")
delete(additionalProperties, "labels")
delete(additionalProperties, "type")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAiDecisionsBoolean struct {
value *AiDecisionsBoolean
isSet bool
}
func (v NullableAiDecisionsBoolean) Get() *AiDecisionsBoolean {
return v.value
}
func (v *NullableAiDecisionsBoolean) Set(val *AiDecisionsBoolean) {
v.value = val
v.isSet = true
}
func (v NullableAiDecisionsBoolean) IsSet() bool {
return v.isSet
}
func (v *NullableAiDecisionsBoolean) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAiDecisionsBoolean(val *AiDecisionsBoolean) *NullableAiDecisionsBoolean {
return &NullableAiDecisionsBoolean{value: val, isSet: true}
}
func (v NullableAiDecisionsBoolean) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAiDecisionsBoolean) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}