Files
sdk/model_ai_decisions_request.go

466 lines
13 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 AiDecisionsRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AiDecisionsRequest{}
// AiDecisionsRequest struct for AiDecisionsRequest
type AiDecisionsRequest struct {
Handle *string `json:"handle,omitempty"`
Model string `json:"model"`
Observe *string `json:"observe,omitempty"`
Provider interface{} `json:"provider,omitempty"`
Questions map[string]AiDecisionsQuestion `json:"questions,omitempty"`
SessionId *string `json:"session_id,omitempty"`
State interface{} `json:"state,omitempty"`
Trace interface{} `json:"trace,omitempty"`
User *string `json:"user,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AiDecisionsRequest AiDecisionsRequest
// NewAiDecisionsRequest instantiates a new AiDecisionsRequest 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 NewAiDecisionsRequest(model string) *AiDecisionsRequest {
this := AiDecisionsRequest{}
this.Model = model
return &this
}
// NewAiDecisionsRequestWithDefaults instantiates a new AiDecisionsRequest 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 NewAiDecisionsRequestWithDefaults() *AiDecisionsRequest {
this := AiDecisionsRequest{}
return &this
}
// GetHandle returns the Handle field value if set, zero value otherwise.
func (o *AiDecisionsRequest) GetHandle() string {
if o == nil || IsNil(o.Handle) {
var ret string
return ret
}
return *o.Handle
}
// GetHandleOk returns a tuple with the Handle field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiDecisionsRequest) GetHandleOk() (*string, bool) {
if o == nil || IsNil(o.Handle) {
return nil, false
}
return o.Handle, true
}
// HasHandle returns a boolean if a field has been set.
func (o *AiDecisionsRequest) HasHandle() bool {
if o != nil && !IsNil(o.Handle) {
return true
}
return false
}
// SetHandle gets a reference to the given string and assigns it to the Handle field.
func (o *AiDecisionsRequest) SetHandle(v string) {
o.Handle = &v
}
// GetModel returns the Model field value
func (o *AiDecisionsRequest) GetModel() string {
if o == nil {
var ret string
return ret
}
return o.Model
}
// GetModelOk returns a tuple with the Model field value
// and a boolean to check if the value has been set.
func (o *AiDecisionsRequest) GetModelOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Model, true
}
// SetModel sets field value
func (o *AiDecisionsRequest) SetModel(v string) {
o.Model = v
}
// GetObserve returns the Observe field value if set, zero value otherwise.
func (o *AiDecisionsRequest) GetObserve() string {
if o == nil || IsNil(o.Observe) {
var ret string
return ret
}
return *o.Observe
}
// GetObserveOk returns a tuple with the Observe field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiDecisionsRequest) GetObserveOk() (*string, bool) {
if o == nil || IsNil(o.Observe) {
return nil, false
}
return o.Observe, true
}
// HasObserve returns a boolean if a field has been set.
func (o *AiDecisionsRequest) HasObserve() bool {
if o != nil && !IsNil(o.Observe) {
return true
}
return false
}
// SetObserve gets a reference to the given string and assigns it to the Observe field.
func (o *AiDecisionsRequest) SetObserve(v string) {
o.Observe = &v
}
// GetProvider returns the Provider field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AiDecisionsRequest) GetProvider() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Provider
}
// GetProviderOk returns a tuple with the Provider 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 *AiDecisionsRequest) GetProviderOk() (*interface{}, bool) {
if o == nil || IsNil(o.Provider) {
return nil, false
}
return &o.Provider, true
}
// HasProvider returns a boolean if a field has been set.
func (o *AiDecisionsRequest) HasProvider() bool {
if o != nil && !IsNil(o.Provider) {
return true
}
return false
}
// SetProvider gets a reference to the given interface{} and assigns it to the Provider field.
func (o *AiDecisionsRequest) SetProvider(v interface{}) {
o.Provider = v
}
// GetQuestions returns the Questions field value if set, zero value otherwise.
func (o *AiDecisionsRequest) GetQuestions() map[string]AiDecisionsQuestion {
if o == nil || IsNil(o.Questions) {
var ret map[string]AiDecisionsQuestion
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 *AiDecisionsRequest) GetQuestionsOk() (map[string]AiDecisionsQuestion, bool) {
if o == nil || IsNil(o.Questions) {
return map[string]AiDecisionsQuestion{}, false
}
return o.Questions, true
}
// HasQuestions returns a boolean if a field has been set.
func (o *AiDecisionsRequest) HasQuestions() bool {
if o != nil && !IsNil(o.Questions) {
return true
}
return false
}
// SetQuestions gets a reference to the given map[string]AiDecisionsQuestion and assigns it to the Questions field.
func (o *AiDecisionsRequest) SetQuestions(v map[string]AiDecisionsQuestion) {
o.Questions = v
}
// GetSessionId returns the SessionId field value if set, zero value otherwise.
func (o *AiDecisionsRequest) GetSessionId() string {
if o == nil || IsNil(o.SessionId) {
var ret string
return ret
}
return *o.SessionId
}
// GetSessionIdOk returns a tuple with the SessionId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiDecisionsRequest) GetSessionIdOk() (*string, bool) {
if o == nil || IsNil(o.SessionId) {
return nil, false
}
return o.SessionId, true
}
// HasSessionId returns a boolean if a field has been set.
func (o *AiDecisionsRequest) HasSessionId() bool {
if o != nil && !IsNil(o.SessionId) {
return true
}
return false
}
// SetSessionId gets a reference to the given string and assigns it to the SessionId field.
func (o *AiDecisionsRequest) SetSessionId(v string) {
o.SessionId = &v
}
// GetState returns the State field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AiDecisionsRequest) GetState() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.State
}
// GetStateOk returns a tuple with the State 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 *AiDecisionsRequest) GetStateOk() (*interface{}, bool) {
if o == nil || IsNil(o.State) {
return nil, false
}
return &o.State, true
}
// HasState returns a boolean if a field has been set.
func (o *AiDecisionsRequest) HasState() bool {
if o != nil && !IsNil(o.State) {
return true
}
return false
}
// SetState gets a reference to the given interface{} and assigns it to the State field.
func (o *AiDecisionsRequest) SetState(v interface{}) {
o.State = v
}
// GetTrace returns the Trace field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AiDecisionsRequest) GetTrace() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Trace
}
// GetTraceOk returns a tuple with the Trace 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 *AiDecisionsRequest) GetTraceOk() (*interface{}, bool) {
if o == nil || IsNil(o.Trace) {
return nil, false
}
return &o.Trace, true
}
// HasTrace returns a boolean if a field has been set.
func (o *AiDecisionsRequest) HasTrace() bool {
if o != nil && !IsNil(o.Trace) {
return true
}
return false
}
// SetTrace gets a reference to the given interface{} and assigns it to the Trace field.
func (o *AiDecisionsRequest) SetTrace(v interface{}) {
o.Trace = v
}
// GetUser returns the User field value if set, zero value otherwise.
func (o *AiDecisionsRequest) GetUser() string {
if o == nil || IsNil(o.User) {
var ret string
return ret
}
return *o.User
}
// GetUserOk returns a tuple with the User field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiDecisionsRequest) GetUserOk() (*string, bool) {
if o == nil || IsNil(o.User) {
return nil, false
}
return o.User, true
}
// HasUser returns a boolean if a field has been set.
func (o *AiDecisionsRequest) HasUser() bool {
if o != nil && !IsNil(o.User) {
return true
}
return false
}
// SetUser gets a reference to the given string and assigns it to the User field.
func (o *AiDecisionsRequest) SetUser(v string) {
o.User = &v
}
func (o AiDecisionsRequest) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AiDecisionsRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Handle) {
toSerialize["handle"] = o.Handle
}
toSerialize["model"] = o.Model
if !IsNil(o.Observe) {
toSerialize["observe"] = o.Observe
}
if o.Provider != nil {
toSerialize["provider"] = o.Provider
}
if !IsNil(o.Questions) {
toSerialize["questions"] = o.Questions
}
if !IsNil(o.SessionId) {
toSerialize["session_id"] = o.SessionId
}
if o.State != nil {
toSerialize["state"] = o.State
}
if o.Trace != nil {
toSerialize["trace"] = o.Trace
}
if !IsNil(o.User) {
toSerialize["user"] = o.User
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AiDecisionsRequest) 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{
"model",
}
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)
}
}
varAiDecisionsRequest := _AiDecisionsRequest{}
err = json.Unmarshal(data, &varAiDecisionsRequest)
if err != nil {
return err
}
*o = AiDecisionsRequest(varAiDecisionsRequest)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "handle")
delete(additionalProperties, "model")
delete(additionalProperties, "observe")
delete(additionalProperties, "provider")
delete(additionalProperties, "questions")
delete(additionalProperties, "session_id")
delete(additionalProperties, "state")
delete(additionalProperties, "trace")
delete(additionalProperties, "user")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAiDecisionsRequest struct {
value *AiDecisionsRequest
isSet bool
}
func (v NullableAiDecisionsRequest) Get() *AiDecisionsRequest {
return v.value
}
func (v *NullableAiDecisionsRequest) Set(val *AiDecisionsRequest) {
v.value = val
v.isSet = true
}
func (v NullableAiDecisionsRequest) IsSet() bool {
return v.isSet
}
func (v *NullableAiDecisionsRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAiDecisionsRequest(val *AiDecisionsRequest) *NullableAiDecisionsRequest {
return &NullableAiDecisionsRequest{value: val, isSet: true}
}
func (v NullableAiDecisionsRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAiDecisionsRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}