Files
sdk/model_tool_tool.go

383 lines
10 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 ToolTool type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ToolTool{}
// ToolTool struct for ToolTool
type ToolTool struct {
// Activated is filled by the registry from the activation store for the requesting (org,project); providers leave it zero. An unactivated tool is discoverable but refused 403 at dispatch.
Activated *bool `json:"activated,omitempty"`
// Description is the prose a model reads to decide whether to call the tool.
Description *string `json:"description,omitempty"`
// Dispatchable is whether the tool can be CALLED. False for a listing-only entry: a skill is activated and attached to an agent, never called.
Dispatchable *bool `json:"dispatchable,omitempty"`
InputSchema interface{} `json:"inputSchema,omitempty"`
// Name is the tool's id in the flat, fleet-wide tool namespace — the value a tools/call passes. Unique across sources: a collision is resolved by source precedence before the caller ever sees it.
Name *string `json:"name,omitempty"`
// Price is what a call costs and who is paid, absent for a free tool. Enforcement is the x402 settlement client; this is the declaration.
Price *ToolPrice `json:"price,omitempty"`
// Source is where the tool comes from: connector, function, zap-service, agent, skill or mcp.
Source *string `json:"source,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ToolTool ToolTool
// NewToolTool instantiates a new ToolTool 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 NewToolTool() *ToolTool {
this := ToolTool{}
return &this
}
// NewToolToolWithDefaults instantiates a new ToolTool 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 NewToolToolWithDefaults() *ToolTool {
this := ToolTool{}
return &this
}
// GetActivated returns the Activated field value if set, zero value otherwise.
func (o *ToolTool) GetActivated() bool {
if o == nil || IsNil(o.Activated) {
var ret bool
return ret
}
return *o.Activated
}
// GetActivatedOk returns a tuple with the Activated field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ToolTool) GetActivatedOk() (*bool, bool) {
if o == nil || IsNil(o.Activated) {
return nil, false
}
return o.Activated, true
}
// HasActivated returns a boolean if a field has been set.
func (o *ToolTool) HasActivated() bool {
if o != nil && !IsNil(o.Activated) {
return true
}
return false
}
// SetActivated gets a reference to the given bool and assigns it to the Activated field.
func (o *ToolTool) SetActivated(v bool) {
o.Activated = &v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *ToolTool) GetDescription() string {
if o == nil || IsNil(o.Description) {
var ret string
return ret
}
return *o.Description
}
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ToolTool) GetDescriptionOk() (*string, bool) {
if o == nil || IsNil(o.Description) {
return nil, false
}
return o.Description, true
}
// HasDescription returns a boolean if a field has been set.
func (o *ToolTool) HasDescription() bool {
if o != nil && !IsNil(o.Description) {
return true
}
return false
}
// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *ToolTool) SetDescription(v string) {
o.Description = &v
}
// GetDispatchable returns the Dispatchable field value if set, zero value otherwise.
func (o *ToolTool) GetDispatchable() bool {
if o == nil || IsNil(o.Dispatchable) {
var ret bool
return ret
}
return *o.Dispatchable
}
// GetDispatchableOk returns a tuple with the Dispatchable field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ToolTool) GetDispatchableOk() (*bool, bool) {
if o == nil || IsNil(o.Dispatchable) {
return nil, false
}
return o.Dispatchable, true
}
// HasDispatchable returns a boolean if a field has been set.
func (o *ToolTool) HasDispatchable() bool {
if o != nil && !IsNil(o.Dispatchable) {
return true
}
return false
}
// SetDispatchable gets a reference to the given bool and assigns it to the Dispatchable field.
func (o *ToolTool) SetDispatchable(v bool) {
o.Dispatchable = &v
}
// GetInputSchema returns the InputSchema field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ToolTool) GetInputSchema() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.InputSchema
}
// GetInputSchemaOk returns a tuple with the InputSchema 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 *ToolTool) GetInputSchemaOk() (*interface{}, bool) {
if o == nil || IsNil(o.InputSchema) {
return nil, false
}
return &o.InputSchema, true
}
// HasInputSchema returns a boolean if a field has been set.
func (o *ToolTool) HasInputSchema() bool {
if o != nil && !IsNil(o.InputSchema) {
return true
}
return false
}
// SetInputSchema gets a reference to the given interface{} and assigns it to the InputSchema field.
func (o *ToolTool) SetInputSchema(v interface{}) {
o.InputSchema = v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *ToolTool) 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 *ToolTool) 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 *ToolTool) 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 *ToolTool) SetName(v string) {
o.Name = &v
}
// GetPrice returns the Price field value if set, zero value otherwise.
func (o *ToolTool) GetPrice() ToolPrice {
if o == nil || IsNil(o.Price) {
var ret ToolPrice
return ret
}
return *o.Price
}
// GetPriceOk returns a tuple with the Price field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ToolTool) GetPriceOk() (*ToolPrice, bool) {
if o == nil || IsNil(o.Price) {
return nil, false
}
return o.Price, true
}
// HasPrice returns a boolean if a field has been set.
func (o *ToolTool) HasPrice() bool {
if o != nil && !IsNil(o.Price) {
return true
}
return false
}
// SetPrice gets a reference to the given ToolPrice and assigns it to the Price field.
func (o *ToolTool) SetPrice(v ToolPrice) {
o.Price = &v
}
// GetSource returns the Source field value if set, zero value otherwise.
func (o *ToolTool) GetSource() string {
if o == nil || IsNil(o.Source) {
var ret string
return ret
}
return *o.Source
}
// GetSourceOk returns a tuple with the Source field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ToolTool) GetSourceOk() (*string, bool) {
if o == nil || IsNil(o.Source) {
return nil, false
}
return o.Source, true
}
// HasSource returns a boolean if a field has been set.
func (o *ToolTool) HasSource() bool {
if o != nil && !IsNil(o.Source) {
return true
}
return false
}
// SetSource gets a reference to the given string and assigns it to the Source field.
func (o *ToolTool) SetSource(v string) {
o.Source = &v
}
func (o ToolTool) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ToolTool) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Activated) {
toSerialize["activated"] = o.Activated
}
if !IsNil(o.Description) {
toSerialize["description"] = o.Description
}
if !IsNil(o.Dispatchable) {
toSerialize["dispatchable"] = o.Dispatchable
}
if o.InputSchema != nil {
toSerialize["inputSchema"] = o.InputSchema
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Price) {
toSerialize["price"] = o.Price
}
if !IsNil(o.Source) {
toSerialize["source"] = o.Source
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ToolTool) UnmarshalJSON(data []byte) (err error) {
varToolTool := _ToolTool{}
err = json.Unmarshal(data, &varToolTool)
if err != nil {
return err
}
*o = ToolTool(varToolTool)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "activated")
delete(additionalProperties, "description")
delete(additionalProperties, "dispatchable")
delete(additionalProperties, "inputSchema")
delete(additionalProperties, "name")
delete(additionalProperties, "price")
delete(additionalProperties, "source")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableToolTool struct {
value *ToolTool
isSet bool
}
func (v NullableToolTool) Get() *ToolTool {
return v.value
}
func (v *NullableToolTool) Set(val *ToolTool) {
v.value = val
v.isSet = true
}
func (v NullableToolTool) IsSet() bool {
return v.isSet
}
func (v *NullableToolTool) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableToolTool(val *ToolTool) *NullableToolTool {
return &NullableToolTool{value: val, isSet: true}
}
func (v NullableToolTool) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableToolTool) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}