Files
sdk/model_tool_tool_call.go

193 lines
4.9 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 ToolToolCall type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ToolToolCall{}
// ToolToolCall struct for ToolToolCall
type ToolToolCall struct {
// Arguments is the tool's own input object, passed through verbatim to whichever source owns it.
Arguments map[string]interface{} `json:"arguments,omitempty"`
// Name is the tool to run, exactly as GET /v1/tool reports it.
Name *string `json:"name,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ToolToolCall ToolToolCall
// NewToolToolCall instantiates a new ToolToolCall 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 NewToolToolCall() *ToolToolCall {
this := ToolToolCall{}
return &this
}
// NewToolToolCallWithDefaults instantiates a new ToolToolCall 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 NewToolToolCallWithDefaults() *ToolToolCall {
this := ToolToolCall{}
return &this
}
// GetArguments returns the Arguments field value if set, zero value otherwise.
func (o *ToolToolCall) GetArguments() map[string]interface{} {
if o == nil || IsNil(o.Arguments) {
var ret map[string]interface{}
return ret
}
return o.Arguments
}
// GetArgumentsOk returns a tuple with the Arguments field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ToolToolCall) GetArgumentsOk() (map[string]interface{}, bool) {
if o == nil || IsNil(o.Arguments) {
return map[string]interface{}{}, false
}
return o.Arguments, true
}
// HasArguments returns a boolean if a field has been set.
func (o *ToolToolCall) HasArguments() bool {
if o != nil && !IsNil(o.Arguments) {
return true
}
return false
}
// SetArguments gets a reference to the given map[string]interface{} and assigns it to the Arguments field.
func (o *ToolToolCall) SetArguments(v map[string]interface{}) {
o.Arguments = v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *ToolToolCall) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ToolToolCall) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *ToolToolCall) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *ToolToolCall) SetName(v string) {
o.Name = &v
}
func (o ToolToolCall) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ToolToolCall) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Arguments) {
toSerialize["arguments"] = o.Arguments
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ToolToolCall) UnmarshalJSON(data []byte) (err error) {
varToolToolCall := _ToolToolCall{}
err = json.Unmarshal(data, &varToolToolCall)
if err != nil {
return err
}
*o = ToolToolCall(varToolToolCall)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "arguments")
delete(additionalProperties, "name")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableToolToolCall struct {
value *ToolToolCall
isSet bool
}
func (v NullableToolToolCall) Get() *ToolToolCall {
return v.value
}
func (v *NullableToolToolCall) Set(val *ToolToolCall) {
v.value = val
v.isSet = true
}
func (v NullableToolToolCall) IsSet() bool {
return v.isSet
}
func (v *NullableToolToolCall) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableToolToolCall(val *ToolToolCall) *NullableToolToolCall {
return &NullableToolToolCall{value: val, isSet: true}
}
func (v NullableToolToolCall) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableToolToolCall) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}