Files
sdk/model_tool_mcp_server_list.go

155 lines
4.1 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 ToolMcpServerList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ToolMcpServerList{}
// ToolMcpServerList struct for ToolMcpServerList
type ToolMcpServerList struct {
// Servers is every external MCP server this org has registered. No secret VALUE is ever included — only whether one is set.
Servers []ToolMCPServer `json:"servers,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ToolMcpServerList ToolMcpServerList
// NewToolMcpServerList instantiates a new ToolMcpServerList 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 NewToolMcpServerList() *ToolMcpServerList {
this := ToolMcpServerList{}
return &this
}
// NewToolMcpServerListWithDefaults instantiates a new ToolMcpServerList 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 NewToolMcpServerListWithDefaults() *ToolMcpServerList {
this := ToolMcpServerList{}
return &this
}
// GetServers returns the Servers field value if set, zero value otherwise.
func (o *ToolMcpServerList) GetServers() []ToolMCPServer {
if o == nil || IsNil(o.Servers) {
var ret []ToolMCPServer
return ret
}
return o.Servers
}
// GetServersOk returns a tuple with the Servers field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ToolMcpServerList) GetServersOk() ([]ToolMCPServer, bool) {
if o == nil || IsNil(o.Servers) {
return nil, false
}
return o.Servers, true
}
// HasServers returns a boolean if a field has been set.
func (o *ToolMcpServerList) HasServers() bool {
if o != nil && !IsNil(o.Servers) {
return true
}
return false
}
// SetServers gets a reference to the given []ToolMCPServer and assigns it to the Servers field.
func (o *ToolMcpServerList) SetServers(v []ToolMCPServer) {
o.Servers = v
}
func (o ToolMcpServerList) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ToolMcpServerList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Servers) {
toSerialize["servers"] = o.Servers
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ToolMcpServerList) UnmarshalJSON(data []byte) (err error) {
varToolMcpServerList := _ToolMcpServerList{}
err = json.Unmarshal(data, &varToolMcpServerList)
if err != nil {
return err
}
*o = ToolMcpServerList(varToolMcpServerList)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "servers")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableToolMcpServerList struct {
value *ToolMcpServerList
isSet bool
}
func (v NullableToolMcpServerList) Get() *ToolMcpServerList {
return v.value
}
func (v *NullableToolMcpServerList) Set(val *ToolMcpServerList) {
v.value = val
v.isSet = true
}
func (v NullableToolMcpServerList) IsSet() bool {
return v.isSet
}
func (v *NullableToolMcpServerList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableToolMcpServerList(val *ToolMcpServerList) *NullableToolMcpServerList {
return &NullableToolMcpServerList{value: val, isSet: true}
}
func (v NullableToolMcpServerList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableToolMcpServerList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}