Files
sdk/model_tool_mcp_package.go

307 lines
8.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 ToolMCPPackage type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ToolMCPPackage{}
// ToolMCPPackage struct for ToolMCPPackage
type ToolMCPPackage struct {
// Identifier is the package name or download URL.
Identifier *string `json:"identifier,omitempty"`
// Registry is where the package is fetched from: npm, pypi, oci, nuget, mcpb.
Registry *string `json:"registry,omitempty"`
// Runtime is the publisher's hint for what launches it: npx, uvx, docker.
Runtime *string `json:"runtime,omitempty"`
// Transport is what the launched process speaks: usually \"stdio\".
Transport *string `json:"transport,omitempty"`
// Version is the exact published package version.
Version *string `json:"version,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ToolMCPPackage ToolMCPPackage
// NewToolMCPPackage instantiates a new ToolMCPPackage 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 NewToolMCPPackage() *ToolMCPPackage {
this := ToolMCPPackage{}
return &this
}
// NewToolMCPPackageWithDefaults instantiates a new ToolMCPPackage 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 NewToolMCPPackageWithDefaults() *ToolMCPPackage {
this := ToolMCPPackage{}
return &this
}
// GetIdentifier returns the Identifier field value if set, zero value otherwise.
func (o *ToolMCPPackage) GetIdentifier() string {
if o == nil || IsNil(o.Identifier) {
var ret string
return ret
}
return *o.Identifier
}
// GetIdentifierOk returns a tuple with the Identifier field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ToolMCPPackage) GetIdentifierOk() (*string, bool) {
if o == nil || IsNil(o.Identifier) {
return nil, false
}
return o.Identifier, true
}
// HasIdentifier returns a boolean if a field has been set.
func (o *ToolMCPPackage) HasIdentifier() bool {
if o != nil && !IsNil(o.Identifier) {
return true
}
return false
}
// SetIdentifier gets a reference to the given string and assigns it to the Identifier field.
func (o *ToolMCPPackage) SetIdentifier(v string) {
o.Identifier = &v
}
// GetRegistry returns the Registry field value if set, zero value otherwise.
func (o *ToolMCPPackage) GetRegistry() string {
if o == nil || IsNil(o.Registry) {
var ret string
return ret
}
return *o.Registry
}
// GetRegistryOk returns a tuple with the Registry field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ToolMCPPackage) GetRegistryOk() (*string, bool) {
if o == nil || IsNil(o.Registry) {
return nil, false
}
return o.Registry, true
}
// HasRegistry returns a boolean if a field has been set.
func (o *ToolMCPPackage) HasRegistry() bool {
if o != nil && !IsNil(o.Registry) {
return true
}
return false
}
// SetRegistry gets a reference to the given string and assigns it to the Registry field.
func (o *ToolMCPPackage) SetRegistry(v string) {
o.Registry = &v
}
// GetRuntime returns the Runtime field value if set, zero value otherwise.
func (o *ToolMCPPackage) GetRuntime() string {
if o == nil || IsNil(o.Runtime) {
var ret string
return ret
}
return *o.Runtime
}
// GetRuntimeOk returns a tuple with the Runtime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ToolMCPPackage) GetRuntimeOk() (*string, bool) {
if o == nil || IsNil(o.Runtime) {
return nil, false
}
return o.Runtime, true
}
// HasRuntime returns a boolean if a field has been set.
func (o *ToolMCPPackage) HasRuntime() bool {
if o != nil && !IsNil(o.Runtime) {
return true
}
return false
}
// SetRuntime gets a reference to the given string and assigns it to the Runtime field.
func (o *ToolMCPPackage) SetRuntime(v string) {
o.Runtime = &v
}
// GetTransport returns the Transport field value if set, zero value otherwise.
func (o *ToolMCPPackage) GetTransport() string {
if o == nil || IsNil(o.Transport) {
var ret string
return ret
}
return *o.Transport
}
// GetTransportOk returns a tuple with the Transport field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ToolMCPPackage) GetTransportOk() (*string, bool) {
if o == nil || IsNil(o.Transport) {
return nil, false
}
return o.Transport, true
}
// HasTransport returns a boolean if a field has been set.
func (o *ToolMCPPackage) HasTransport() bool {
if o != nil && !IsNil(o.Transport) {
return true
}
return false
}
// SetTransport gets a reference to the given string and assigns it to the Transport field.
func (o *ToolMCPPackage) SetTransport(v string) {
o.Transport = &v
}
// GetVersion returns the Version field value if set, zero value otherwise.
func (o *ToolMCPPackage) GetVersion() string {
if o == nil || IsNil(o.Version) {
var ret string
return ret
}
return *o.Version
}
// GetVersionOk returns a tuple with the Version field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ToolMCPPackage) GetVersionOk() (*string, bool) {
if o == nil || IsNil(o.Version) {
return nil, false
}
return o.Version, true
}
// HasVersion returns a boolean if a field has been set.
func (o *ToolMCPPackage) HasVersion() bool {
if o != nil && !IsNil(o.Version) {
return true
}
return false
}
// SetVersion gets a reference to the given string and assigns it to the Version field.
func (o *ToolMCPPackage) SetVersion(v string) {
o.Version = &v
}
func (o ToolMCPPackage) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ToolMCPPackage) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Identifier) {
toSerialize["identifier"] = o.Identifier
}
if !IsNil(o.Registry) {
toSerialize["registry"] = o.Registry
}
if !IsNil(o.Runtime) {
toSerialize["runtime"] = o.Runtime
}
if !IsNil(o.Transport) {
toSerialize["transport"] = o.Transport
}
if !IsNil(o.Version) {
toSerialize["version"] = o.Version
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ToolMCPPackage) UnmarshalJSON(data []byte) (err error) {
varToolMCPPackage := _ToolMCPPackage{}
err = json.Unmarshal(data, &varToolMCPPackage)
if err != nil {
return err
}
*o = ToolMCPPackage(varToolMCPPackage)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "identifier")
delete(additionalProperties, "registry")
delete(additionalProperties, "runtime")
delete(additionalProperties, "transport")
delete(additionalProperties, "version")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableToolMCPPackage struct {
value *ToolMCPPackage
isSet bool
}
func (v NullableToolMCPPackage) Get() *ToolMCPPackage {
return v.value
}
func (v *NullableToolMCPPackage) Set(val *ToolMCPPackage) {
v.value = val
v.isSet = true
}
func (v NullableToolMCPPackage) IsSet() bool {
return v.isSet
}
func (v *NullableToolMCPPackage) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableToolMCPPackage(val *ToolMCPPackage) *NullableToolMCPPackage {
return &NullableToolMCPPackage{value: val, isSet: true}
}
func (v NullableToolMCPPackage) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableToolMCPPackage) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}