Files
sdk/model_tool_build_request.go

269 lines
7.2 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 ToolBuildRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ToolBuildRequest{}
// ToolBuildRequest struct for ToolBuildRequest
type ToolBuildRequest struct {
// Name is the plugin's name: one lowercase path segment (a-z0-9, _ or -), and the id the runtime loads it by.
Name *string `json:"name,omitempty"`
// Provider is the connectors provider whose credential the plugin reads at run time. Empty for a plugin that needs none.
Provider *string `json:"provider,omitempty"`
// Source is TypeScript to build as-is. Exactly one of Source or Spec.
Source *string `json:"source,omitempty"`
// Spec is API documentation — an OpenAPI document, or prose describing the endpoints — that the generator turns into Source. The generated source is returned in the response, so a caller can read what will run before it runs.
Spec *string `json:"spec,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ToolBuildRequest ToolBuildRequest
// NewToolBuildRequest instantiates a new ToolBuildRequest 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 NewToolBuildRequest() *ToolBuildRequest {
this := ToolBuildRequest{}
return &this
}
// NewToolBuildRequestWithDefaults instantiates a new ToolBuildRequest 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 NewToolBuildRequestWithDefaults() *ToolBuildRequest {
this := ToolBuildRequest{}
return &this
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *ToolBuildRequest) 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 *ToolBuildRequest) 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 *ToolBuildRequest) 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 *ToolBuildRequest) SetName(v string) {
o.Name = &v
}
// GetProvider returns the Provider field value if set, zero value otherwise.
func (o *ToolBuildRequest) GetProvider() string {
if o == nil || IsNil(o.Provider) {
var ret string
return ret
}
return *o.Provider
}
// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ToolBuildRequest) GetProviderOk() (*string, bool) {
if o == nil || IsNil(o.Provider) {
return nil, false
}
return o.Provider, true
}
// HasProvider returns a boolean if a field has been set.
func (o *ToolBuildRequest) HasProvider() bool {
if o != nil && !IsNil(o.Provider) {
return true
}
return false
}
// SetProvider gets a reference to the given string and assigns it to the Provider field.
func (o *ToolBuildRequest) SetProvider(v string) {
o.Provider = &v
}
// GetSource returns the Source field value if set, zero value otherwise.
func (o *ToolBuildRequest) 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 *ToolBuildRequest) 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 *ToolBuildRequest) 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 *ToolBuildRequest) SetSource(v string) {
o.Source = &v
}
// GetSpec returns the Spec field value if set, zero value otherwise.
func (o *ToolBuildRequest) GetSpec() string {
if o == nil || IsNil(o.Spec) {
var ret string
return ret
}
return *o.Spec
}
// GetSpecOk returns a tuple with the Spec field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ToolBuildRequest) GetSpecOk() (*string, bool) {
if o == nil || IsNil(o.Spec) {
return nil, false
}
return o.Spec, true
}
// HasSpec returns a boolean if a field has been set.
func (o *ToolBuildRequest) HasSpec() bool {
if o != nil && !IsNil(o.Spec) {
return true
}
return false
}
// SetSpec gets a reference to the given string and assigns it to the Spec field.
func (o *ToolBuildRequest) SetSpec(v string) {
o.Spec = &v
}
func (o ToolBuildRequest) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ToolBuildRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Provider) {
toSerialize["provider"] = o.Provider
}
if !IsNil(o.Source) {
toSerialize["source"] = o.Source
}
if !IsNil(o.Spec) {
toSerialize["spec"] = o.Spec
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ToolBuildRequest) UnmarshalJSON(data []byte) (err error) {
varToolBuildRequest := _ToolBuildRequest{}
err = json.Unmarshal(data, &varToolBuildRequest)
if err != nil {
return err
}
*o = ToolBuildRequest(varToolBuildRequest)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "name")
delete(additionalProperties, "provider")
delete(additionalProperties, "source")
delete(additionalProperties, "spec")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableToolBuildRequest struct {
value *ToolBuildRequest
isSet bool
}
func (v NullableToolBuildRequest) Get() *ToolBuildRequest {
return v.value
}
func (v *NullableToolBuildRequest) Set(val *ToolBuildRequest) {
v.value = val
v.isSet = true
}
func (v NullableToolBuildRequest) IsSet() bool {
return v.isSet
}
func (v *NullableToolBuildRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableToolBuildRequest(val *ToolBuildRequest) *NullableToolBuildRequest {
return &NullableToolBuildRequest{value: val, isSet: true}
}
func (v NullableToolBuildRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableToolBuildRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}