mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
265 lines
6.6 KiB
Go
265 lines
6.6 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 OpenaiToolCall type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &OpenaiToolCall{}
|
|
|
|
// OpenaiToolCall struct for OpenaiToolCall
|
|
type OpenaiToolCall struct {
|
|
Function *OpenaiFunctionCall `json:"function,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
Index *int32 `json:"index,omitempty"`
|
|
Type *string `json:"type,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _OpenaiToolCall OpenaiToolCall
|
|
|
|
// NewOpenaiToolCall instantiates a new OpenaiToolCall 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 NewOpenaiToolCall() *OpenaiToolCall {
|
|
this := OpenaiToolCall{}
|
|
return &this
|
|
}
|
|
|
|
// NewOpenaiToolCallWithDefaults instantiates a new OpenaiToolCall 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 NewOpenaiToolCallWithDefaults() *OpenaiToolCall {
|
|
this := OpenaiToolCall{}
|
|
return &this
|
|
}
|
|
|
|
// GetFunction returns the Function field value if set, zero value otherwise.
|
|
func (o *OpenaiToolCall) GetFunction() OpenaiFunctionCall {
|
|
if o == nil || IsNil(o.Function) {
|
|
var ret OpenaiFunctionCall
|
|
return ret
|
|
}
|
|
return *o.Function
|
|
}
|
|
|
|
// GetFunctionOk returns a tuple with the Function field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *OpenaiToolCall) GetFunctionOk() (*OpenaiFunctionCall, bool) {
|
|
if o == nil || IsNil(o.Function) {
|
|
return nil, false
|
|
}
|
|
return o.Function, true
|
|
}
|
|
|
|
// HasFunction returns a boolean if a field has been set.
|
|
func (o *OpenaiToolCall) HasFunction() bool {
|
|
if o != nil && !IsNil(o.Function) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetFunction gets a reference to the given OpenaiFunctionCall and assigns it to the Function field.
|
|
func (o *OpenaiToolCall) SetFunction(v OpenaiFunctionCall) {
|
|
o.Function = &v
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *OpenaiToolCall) GetId() string {
|
|
if o == nil || IsNil(o.Id) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Id
|
|
}
|
|
|
|
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *OpenaiToolCall) GetIdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Id) {
|
|
return nil, false
|
|
}
|
|
return o.Id, true
|
|
}
|
|
|
|
// HasId returns a boolean if a field has been set.
|
|
func (o *OpenaiToolCall) HasId() bool {
|
|
if o != nil && !IsNil(o.Id) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetId gets a reference to the given string and assigns it to the Id field.
|
|
func (o *OpenaiToolCall) SetId(v string) {
|
|
o.Id = &v
|
|
}
|
|
|
|
// GetIndex returns the Index field value if set, zero value otherwise.
|
|
func (o *OpenaiToolCall) GetIndex() int32 {
|
|
if o == nil || IsNil(o.Index) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.Index
|
|
}
|
|
|
|
// GetIndexOk returns a tuple with the Index field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *OpenaiToolCall) GetIndexOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.Index) {
|
|
return nil, false
|
|
}
|
|
return o.Index, true
|
|
}
|
|
|
|
// HasIndex returns a boolean if a field has been set.
|
|
func (o *OpenaiToolCall) HasIndex() bool {
|
|
if o != nil && !IsNil(o.Index) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetIndex gets a reference to the given int32 and assigns it to the Index field.
|
|
func (o *OpenaiToolCall) SetIndex(v int32) {
|
|
o.Index = &v
|
|
}
|
|
|
|
// GetType returns the Type field value if set, zero value otherwise.
|
|
func (o *OpenaiToolCall) GetType() string {
|
|
if o == nil || IsNil(o.Type) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Type
|
|
}
|
|
|
|
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *OpenaiToolCall) GetTypeOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Type) {
|
|
return nil, false
|
|
}
|
|
return o.Type, true
|
|
}
|
|
|
|
// HasType returns a boolean if a field has been set.
|
|
func (o *OpenaiToolCall) HasType() bool {
|
|
if o != nil && !IsNil(o.Type) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetType gets a reference to the given string and assigns it to the Type field.
|
|
func (o *OpenaiToolCall) SetType(v string) {
|
|
o.Type = &v
|
|
}
|
|
|
|
func (o OpenaiToolCall) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o OpenaiToolCall) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Function) {
|
|
toSerialize["function"] = o.Function
|
|
}
|
|
if !IsNil(o.Id) {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if !IsNil(o.Index) {
|
|
toSerialize["index"] = o.Index
|
|
}
|
|
if !IsNil(o.Type) {
|
|
toSerialize["type"] = o.Type
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *OpenaiToolCall) UnmarshalJSON(data []byte) (err error) {
|
|
varOpenaiToolCall := _OpenaiToolCall{}
|
|
|
|
err = json.Unmarshal(data, &varOpenaiToolCall)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = OpenaiToolCall(varOpenaiToolCall)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "function")
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "index")
|
|
delete(additionalProperties, "type")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableOpenaiToolCall struct {
|
|
value *OpenaiToolCall
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableOpenaiToolCall) Get() *OpenaiToolCall {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableOpenaiToolCall) Set(val *OpenaiToolCall) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableOpenaiToolCall) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableOpenaiToolCall) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableOpenaiToolCall(val *OpenaiToolCall) *NullableOpenaiToolCall {
|
|
return &NullableOpenaiToolCall{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableOpenaiToolCall) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableOpenaiToolCall) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|