mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
307 lines
8.7 KiB
Go
307 lines
8.7 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 ToolCreateServerReq type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &ToolCreateServerReq{}
|
|
|
|
// ToolCreateServerReq struct for ToolCreateServerReq
|
|
type ToolCreateServerReq struct {
|
|
// AuthHeader is the request header the credential is injected into, e.g. \"Authorization\". Empty means the server needs no credential.
|
|
AuthHeader *string `json:"authHeader,omitempty"`
|
|
// Listing enables a CATALOG entry instead — the id from GET /v1/tool/catalog. The endpoint is the listing's own streamable-http remote, so a listing that only ships a stdio package is refused: there is nothing to reach yet.
|
|
Listing *string `json:"listing,omitempty"`
|
|
// Name labels the server for the org. Required with URL; with Listing it defaults to the listing's own title.
|
|
Name *string `json:"name,omitempty"`
|
|
// Secret is the credential VALUE. It is sealed into KMS under a per-org ref and never stored in SQLite, never listed, and never returned.
|
|
Secret *string `json:"secret,omitempty"`
|
|
// URL is the server's JSON-RPC endpoint. It must be an http(s) URL naming a PUBLIC host: loopback, link-local, private and cloud-metadata addresses are refused here and again when the dialer connects. A URL carrying a credential (user:password@) is refused: the credential is the secret.
|
|
Url *string `json:"url,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _ToolCreateServerReq ToolCreateServerReq
|
|
|
|
// NewToolCreateServerReq instantiates a new ToolCreateServerReq 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 NewToolCreateServerReq() *ToolCreateServerReq {
|
|
this := ToolCreateServerReq{}
|
|
return &this
|
|
}
|
|
|
|
// NewToolCreateServerReqWithDefaults instantiates a new ToolCreateServerReq 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 NewToolCreateServerReqWithDefaults() *ToolCreateServerReq {
|
|
this := ToolCreateServerReq{}
|
|
return &this
|
|
}
|
|
|
|
// GetAuthHeader returns the AuthHeader field value if set, zero value otherwise.
|
|
func (o *ToolCreateServerReq) GetAuthHeader() string {
|
|
if o == nil || IsNil(o.AuthHeader) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.AuthHeader
|
|
}
|
|
|
|
// GetAuthHeaderOk returns a tuple with the AuthHeader field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ToolCreateServerReq) GetAuthHeaderOk() (*string, bool) {
|
|
if o == nil || IsNil(o.AuthHeader) {
|
|
return nil, false
|
|
}
|
|
return o.AuthHeader, true
|
|
}
|
|
|
|
// HasAuthHeader returns a boolean if a field has been set.
|
|
func (o *ToolCreateServerReq) HasAuthHeader() bool {
|
|
if o != nil && !IsNil(o.AuthHeader) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAuthHeader gets a reference to the given string and assigns it to the AuthHeader field.
|
|
func (o *ToolCreateServerReq) SetAuthHeader(v string) {
|
|
o.AuthHeader = &v
|
|
}
|
|
|
|
// GetListing returns the Listing field value if set, zero value otherwise.
|
|
func (o *ToolCreateServerReq) GetListing() string {
|
|
if o == nil || IsNil(o.Listing) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Listing
|
|
}
|
|
|
|
// GetListingOk returns a tuple with the Listing field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ToolCreateServerReq) GetListingOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Listing) {
|
|
return nil, false
|
|
}
|
|
return o.Listing, true
|
|
}
|
|
|
|
// HasListing returns a boolean if a field has been set.
|
|
func (o *ToolCreateServerReq) HasListing() bool {
|
|
if o != nil && !IsNil(o.Listing) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetListing gets a reference to the given string and assigns it to the Listing field.
|
|
func (o *ToolCreateServerReq) SetListing(v string) {
|
|
o.Listing = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *ToolCreateServerReq) 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 *ToolCreateServerReq) 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 *ToolCreateServerReq) 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 *ToolCreateServerReq) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetSecret returns the Secret field value if set, zero value otherwise.
|
|
func (o *ToolCreateServerReq) GetSecret() string {
|
|
if o == nil || IsNil(o.Secret) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Secret
|
|
}
|
|
|
|
// GetSecretOk returns a tuple with the Secret field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ToolCreateServerReq) GetSecretOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Secret) {
|
|
return nil, false
|
|
}
|
|
return o.Secret, true
|
|
}
|
|
|
|
// HasSecret returns a boolean if a field has been set.
|
|
func (o *ToolCreateServerReq) HasSecret() bool {
|
|
if o != nil && !IsNil(o.Secret) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSecret gets a reference to the given string and assigns it to the Secret field.
|
|
func (o *ToolCreateServerReq) SetSecret(v string) {
|
|
o.Secret = &v
|
|
}
|
|
|
|
// GetUrl returns the Url field value if set, zero value otherwise.
|
|
func (o *ToolCreateServerReq) GetUrl() string {
|
|
if o == nil || IsNil(o.Url) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Url
|
|
}
|
|
|
|
// GetUrlOk returns a tuple with the Url field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ToolCreateServerReq) GetUrlOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Url) {
|
|
return nil, false
|
|
}
|
|
return o.Url, true
|
|
}
|
|
|
|
// HasUrl returns a boolean if a field has been set.
|
|
func (o *ToolCreateServerReq) HasUrl() bool {
|
|
if o != nil && !IsNil(o.Url) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUrl gets a reference to the given string and assigns it to the Url field.
|
|
func (o *ToolCreateServerReq) SetUrl(v string) {
|
|
o.Url = &v
|
|
}
|
|
|
|
func (o ToolCreateServerReq) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o ToolCreateServerReq) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.AuthHeader) {
|
|
toSerialize["authHeader"] = o.AuthHeader
|
|
}
|
|
if !IsNil(o.Listing) {
|
|
toSerialize["listing"] = o.Listing
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Secret) {
|
|
toSerialize["secret"] = o.Secret
|
|
}
|
|
if !IsNil(o.Url) {
|
|
toSerialize["url"] = o.Url
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *ToolCreateServerReq) UnmarshalJSON(data []byte) (err error) {
|
|
varToolCreateServerReq := _ToolCreateServerReq{}
|
|
|
|
err = json.Unmarshal(data, &varToolCreateServerReq)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = ToolCreateServerReq(varToolCreateServerReq)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "authHeader")
|
|
delete(additionalProperties, "listing")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "secret")
|
|
delete(additionalProperties, "url")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableToolCreateServerReq struct {
|
|
value *ToolCreateServerReq
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableToolCreateServerReq) Get() *ToolCreateServerReq {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableToolCreateServerReq) Set(val *ToolCreateServerReq) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableToolCreateServerReq) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableToolCreateServerReq) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableToolCreateServerReq(val *ToolCreateServerReq) *NullableToolCreateServerReq {
|
|
return &NullableToolCreateServerReq{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableToolCreateServerReq) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableToolCreateServerReq) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|