mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
234 lines
6.1 KiB
Go
234 lines
6.1 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 AiDecisionsScore type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &AiDecisionsScore{}
|
|
|
|
// AiDecisionsScore struct for AiDecisionsScore
|
|
type AiDecisionsScore struct {
|
|
Criteria []interface{} `json:"criteria"`
|
|
Instructions interface{} `json:"instructions,omitempty"`
|
|
Type string `json:"type"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _AiDecisionsScore AiDecisionsScore
|
|
|
|
// NewAiDecisionsScore instantiates a new AiDecisionsScore 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 NewAiDecisionsScore(criteria []interface{}, type_ string) *AiDecisionsScore {
|
|
this := AiDecisionsScore{}
|
|
this.Criteria = criteria
|
|
this.Type = type_
|
|
return &this
|
|
}
|
|
|
|
// NewAiDecisionsScoreWithDefaults instantiates a new AiDecisionsScore 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 NewAiDecisionsScoreWithDefaults() *AiDecisionsScore {
|
|
this := AiDecisionsScore{}
|
|
return &this
|
|
}
|
|
|
|
// GetCriteria returns the Criteria field value
|
|
func (o *AiDecisionsScore) GetCriteria() []interface{} {
|
|
if o == nil {
|
|
var ret []interface{}
|
|
return ret
|
|
}
|
|
|
|
return o.Criteria
|
|
}
|
|
|
|
// GetCriteriaOk returns a tuple with the Criteria field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiDecisionsScore) GetCriteriaOk() ([]interface{}, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return o.Criteria, true
|
|
}
|
|
|
|
// SetCriteria sets field value
|
|
func (o *AiDecisionsScore) SetCriteria(v []interface{}) {
|
|
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 *AiDecisionsScore) 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 *AiDecisionsScore) 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 *AiDecisionsScore) 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 *AiDecisionsScore) SetInstructions(v interface{}) {
|
|
o.Instructions = v
|
|
}
|
|
|
|
// GetType returns the Type field value
|
|
func (o *AiDecisionsScore) 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 *AiDecisionsScore) GetTypeOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Type, true
|
|
}
|
|
|
|
// SetType sets field value
|
|
func (o *AiDecisionsScore) SetType(v string) {
|
|
o.Type = v
|
|
}
|
|
|
|
func (o AiDecisionsScore) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o AiDecisionsScore) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
toSerialize["criteria"] = o.Criteria
|
|
if o.Instructions != nil {
|
|
toSerialize["instructions"] = o.Instructions
|
|
}
|
|
toSerialize["type"] = o.Type
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *AiDecisionsScore) 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{
|
|
"criteria",
|
|
"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)
|
|
}
|
|
}
|
|
|
|
varAiDecisionsScore := _AiDecisionsScore{}
|
|
|
|
err = json.Unmarshal(data, &varAiDecisionsScore)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = AiDecisionsScore(varAiDecisionsScore)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "criteria")
|
|
delete(additionalProperties, "instructions")
|
|
delete(additionalProperties, "type")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableAiDecisionsScore struct {
|
|
value *AiDecisionsScore
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableAiDecisionsScore) Get() *AiDecisionsScore {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableAiDecisionsScore) Set(val *AiDecisionsScore) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableAiDecisionsScore) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableAiDecisionsScore) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableAiDecisionsScore(val *AiDecisionsScore) *NullableAiDecisionsScore {
|
|
return &NullableAiDecisionsScore{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableAiDecisionsScore) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableAiDecisionsScore) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|