mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
370 lines
9.4 KiB
Go
370 lines
9.4 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 AiDecisionsResponse type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &AiDecisionsResponse{}
|
|
|
|
// AiDecisionsResponse struct for AiDecisionsResponse
|
|
type AiDecisionsResponse struct {
|
|
Answers map[string]AiDecisionsAnswer `json:"answers"`
|
|
Id string `json:"id"`
|
|
LatencyMs float32 `json:"latency_ms"`
|
|
Model string `json:"model"`
|
|
Provider string `json:"provider"`
|
|
Routing AiDecisionsRouting `json:"routing"`
|
|
StateHash string `json:"state_hash"`
|
|
Usage AiDecisionsUsage `json:"usage"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _AiDecisionsResponse AiDecisionsResponse
|
|
|
|
// NewAiDecisionsResponse instantiates a new AiDecisionsResponse 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 NewAiDecisionsResponse(answers map[string]AiDecisionsAnswer, id string, latencyMs float32, model string, provider string, routing AiDecisionsRouting, stateHash string, usage AiDecisionsUsage) *AiDecisionsResponse {
|
|
this := AiDecisionsResponse{}
|
|
this.Answers = answers
|
|
this.Id = id
|
|
this.LatencyMs = latencyMs
|
|
this.Model = model
|
|
this.Provider = provider
|
|
this.Routing = routing
|
|
this.StateHash = stateHash
|
|
this.Usage = usage
|
|
return &this
|
|
}
|
|
|
|
// NewAiDecisionsResponseWithDefaults instantiates a new AiDecisionsResponse 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 NewAiDecisionsResponseWithDefaults() *AiDecisionsResponse {
|
|
this := AiDecisionsResponse{}
|
|
return &this
|
|
}
|
|
|
|
// GetAnswers returns the Answers field value
|
|
func (o *AiDecisionsResponse) GetAnswers() map[string]AiDecisionsAnswer {
|
|
if o == nil {
|
|
var ret map[string]AiDecisionsAnswer
|
|
return ret
|
|
}
|
|
|
|
return o.Answers
|
|
}
|
|
|
|
// GetAnswersOk returns a tuple with the Answers field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiDecisionsResponse) GetAnswersOk() (map[string]AiDecisionsAnswer, bool) {
|
|
if o == nil {
|
|
return map[string]AiDecisionsAnswer{}, false
|
|
}
|
|
return o.Answers, true
|
|
}
|
|
|
|
// SetAnswers sets field value
|
|
func (o *AiDecisionsResponse) SetAnswers(v map[string]AiDecisionsAnswer) {
|
|
o.Answers = v
|
|
}
|
|
|
|
// GetId returns the Id field value
|
|
func (o *AiDecisionsResponse) GetId() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Id
|
|
}
|
|
|
|
// GetIdOk returns a tuple with the Id field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiDecisionsResponse) GetIdOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Id, true
|
|
}
|
|
|
|
// SetId sets field value
|
|
func (o *AiDecisionsResponse) SetId(v string) {
|
|
o.Id = v
|
|
}
|
|
|
|
// GetLatencyMs returns the LatencyMs field value
|
|
func (o *AiDecisionsResponse) GetLatencyMs() float32 {
|
|
if o == nil {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
|
|
return o.LatencyMs
|
|
}
|
|
|
|
// GetLatencyMsOk returns a tuple with the LatencyMs field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiDecisionsResponse) GetLatencyMsOk() (*float32, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.LatencyMs, true
|
|
}
|
|
|
|
// SetLatencyMs sets field value
|
|
func (o *AiDecisionsResponse) SetLatencyMs(v float32) {
|
|
o.LatencyMs = v
|
|
}
|
|
|
|
// GetModel returns the Model field value
|
|
func (o *AiDecisionsResponse) 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 *AiDecisionsResponse) GetModelOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Model, true
|
|
}
|
|
|
|
// SetModel sets field value
|
|
func (o *AiDecisionsResponse) SetModel(v string) {
|
|
o.Model = v
|
|
}
|
|
|
|
// GetProvider returns the Provider field value
|
|
func (o *AiDecisionsResponse) GetProvider() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Provider
|
|
}
|
|
|
|
// GetProviderOk returns a tuple with the Provider field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiDecisionsResponse) GetProviderOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Provider, true
|
|
}
|
|
|
|
// SetProvider sets field value
|
|
func (o *AiDecisionsResponse) SetProvider(v string) {
|
|
o.Provider = v
|
|
}
|
|
|
|
// GetRouting returns the Routing field value
|
|
func (o *AiDecisionsResponse) GetRouting() AiDecisionsRouting {
|
|
if o == nil {
|
|
var ret AiDecisionsRouting
|
|
return ret
|
|
}
|
|
|
|
return o.Routing
|
|
}
|
|
|
|
// GetRoutingOk returns a tuple with the Routing field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiDecisionsResponse) GetRoutingOk() (*AiDecisionsRouting, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Routing, true
|
|
}
|
|
|
|
// SetRouting sets field value
|
|
func (o *AiDecisionsResponse) SetRouting(v AiDecisionsRouting) {
|
|
o.Routing = v
|
|
}
|
|
|
|
// GetStateHash returns the StateHash field value
|
|
func (o *AiDecisionsResponse) GetStateHash() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.StateHash
|
|
}
|
|
|
|
// GetStateHashOk returns a tuple with the StateHash field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiDecisionsResponse) GetStateHashOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.StateHash, true
|
|
}
|
|
|
|
// SetStateHash sets field value
|
|
func (o *AiDecisionsResponse) SetStateHash(v string) {
|
|
o.StateHash = v
|
|
}
|
|
|
|
// GetUsage returns the Usage field value
|
|
func (o *AiDecisionsResponse) GetUsage() AiDecisionsUsage {
|
|
if o == nil {
|
|
var ret AiDecisionsUsage
|
|
return ret
|
|
}
|
|
|
|
return o.Usage
|
|
}
|
|
|
|
// GetUsageOk returns a tuple with the Usage field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiDecisionsResponse) GetUsageOk() (*AiDecisionsUsage, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Usage, true
|
|
}
|
|
|
|
// SetUsage sets field value
|
|
func (o *AiDecisionsResponse) SetUsage(v AiDecisionsUsage) {
|
|
o.Usage = v
|
|
}
|
|
|
|
func (o AiDecisionsResponse) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o AiDecisionsResponse) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
toSerialize["answers"] = o.Answers
|
|
toSerialize["id"] = o.Id
|
|
toSerialize["latency_ms"] = o.LatencyMs
|
|
toSerialize["model"] = o.Model
|
|
toSerialize["provider"] = o.Provider
|
|
toSerialize["routing"] = o.Routing
|
|
toSerialize["state_hash"] = o.StateHash
|
|
toSerialize["usage"] = o.Usage
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *AiDecisionsResponse) 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{
|
|
"answers",
|
|
"id",
|
|
"latency_ms",
|
|
"model",
|
|
"provider",
|
|
"routing",
|
|
"state_hash",
|
|
"usage",
|
|
}
|
|
|
|
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)
|
|
}
|
|
}
|
|
|
|
varAiDecisionsResponse := _AiDecisionsResponse{}
|
|
|
|
err = json.Unmarshal(data, &varAiDecisionsResponse)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = AiDecisionsResponse(varAiDecisionsResponse)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "answers")
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "latency_ms")
|
|
delete(additionalProperties, "model")
|
|
delete(additionalProperties, "provider")
|
|
delete(additionalProperties, "routing")
|
|
delete(additionalProperties, "state_hash")
|
|
delete(additionalProperties, "usage")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableAiDecisionsResponse struct {
|
|
value *AiDecisionsResponse
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableAiDecisionsResponse) Get() *AiDecisionsResponse {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableAiDecisionsResponse) Set(val *AiDecisionsResponse) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableAiDecisionsResponse) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableAiDecisionsResponse) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableAiDecisionsResponse(val *AiDecisionsResponse) *NullableAiDecisionsResponse {
|
|
return &NullableAiDecisionsResponse{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableAiDecisionsResponse) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableAiDecisionsResponse) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|