Files
sdk/model_template_config_option.go

339 lines
9.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 TemplateConfigOption type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TemplateConfigOption{}
// TemplateConfigOption struct for TemplateConfigOption
type TemplateConfigOption struct {
Default *string `json:"default,omitempty"`
Description *string `json:"description,omitempty"`
Options []string `json:"options,omitempty"`
Parameter *string `json:"parameter,omitempty"`
Required *bool `json:"required,omitempty"`
Type *string `json:"type,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TemplateConfigOption TemplateConfigOption
// NewTemplateConfigOption instantiates a new TemplateConfigOption 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 NewTemplateConfigOption() *TemplateConfigOption {
this := TemplateConfigOption{}
return &this
}
// NewTemplateConfigOptionWithDefaults instantiates a new TemplateConfigOption 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 NewTemplateConfigOptionWithDefaults() *TemplateConfigOption {
this := TemplateConfigOption{}
return &this
}
// GetDefault returns the Default field value if set, zero value otherwise.
func (o *TemplateConfigOption) GetDefault() string {
if o == nil || IsNil(o.Default) {
var ret string
return ret
}
return *o.Default
}
// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TemplateConfigOption) GetDefaultOk() (*string, bool) {
if o == nil || IsNil(o.Default) {
return nil, false
}
return o.Default, true
}
// HasDefault returns a boolean if a field has been set.
func (o *TemplateConfigOption) HasDefault() bool {
if o != nil && !IsNil(o.Default) {
return true
}
return false
}
// SetDefault gets a reference to the given string and assigns it to the Default field.
func (o *TemplateConfigOption) SetDefault(v string) {
o.Default = &v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *TemplateConfigOption) 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 *TemplateConfigOption) 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 *TemplateConfigOption) 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 *TemplateConfigOption) SetDescription(v string) {
o.Description = &v
}
// GetOptions returns the Options field value if set, zero value otherwise.
func (o *TemplateConfigOption) GetOptions() []string {
if o == nil || IsNil(o.Options) {
var ret []string
return ret
}
return o.Options
}
// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TemplateConfigOption) GetOptionsOk() ([]string, bool) {
if o == nil || IsNil(o.Options) {
return nil, false
}
return o.Options, true
}
// HasOptions returns a boolean if a field has been set.
func (o *TemplateConfigOption) HasOptions() bool {
if o != nil && !IsNil(o.Options) {
return true
}
return false
}
// SetOptions gets a reference to the given []string and assigns it to the Options field.
func (o *TemplateConfigOption) SetOptions(v []string) {
o.Options = v
}
// GetParameter returns the Parameter field value if set, zero value otherwise.
func (o *TemplateConfigOption) GetParameter() string {
if o == nil || IsNil(o.Parameter) {
var ret string
return ret
}
return *o.Parameter
}
// GetParameterOk returns a tuple with the Parameter field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TemplateConfigOption) GetParameterOk() (*string, bool) {
if o == nil || IsNil(o.Parameter) {
return nil, false
}
return o.Parameter, true
}
// HasParameter returns a boolean if a field has been set.
func (o *TemplateConfigOption) HasParameter() bool {
if o != nil && !IsNil(o.Parameter) {
return true
}
return false
}
// SetParameter gets a reference to the given string and assigns it to the Parameter field.
func (o *TemplateConfigOption) SetParameter(v string) {
o.Parameter = &v
}
// GetRequired returns the Required field value if set, zero value otherwise.
func (o *TemplateConfigOption) GetRequired() bool {
if o == nil || IsNil(o.Required) {
var ret bool
return ret
}
return *o.Required
}
// GetRequiredOk returns a tuple with the Required field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TemplateConfigOption) GetRequiredOk() (*bool, bool) {
if o == nil || IsNil(o.Required) {
return nil, false
}
return o.Required, true
}
// HasRequired returns a boolean if a field has been set.
func (o *TemplateConfigOption) HasRequired() bool {
if o != nil && !IsNil(o.Required) {
return true
}
return false
}
// SetRequired gets a reference to the given bool and assigns it to the Required field.
func (o *TemplateConfigOption) SetRequired(v bool) {
o.Required = &v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *TemplateConfigOption) GetType() string {
if o == nil || IsNil(o.Type) {
var ret string
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TemplateConfigOption) GetTypeOk() (*string, bool) {
if o == nil || IsNil(o.Type) {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *TemplateConfigOption) HasType() bool {
if o != nil && !IsNil(o.Type) {
return true
}
return false
}
// SetType gets a reference to the given string and assigns it to the Type field.
func (o *TemplateConfigOption) SetType(v string) {
o.Type = &v
}
func (o TemplateConfigOption) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TemplateConfigOption) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Default) {
toSerialize["default"] = o.Default
}
if !IsNil(o.Description) {
toSerialize["description"] = o.Description
}
if !IsNil(o.Options) {
toSerialize["options"] = o.Options
}
if !IsNil(o.Parameter) {
toSerialize["parameter"] = o.Parameter
}
if !IsNil(o.Required) {
toSerialize["required"] = o.Required
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TemplateConfigOption) UnmarshalJSON(data []byte) (err error) {
varTemplateConfigOption := _TemplateConfigOption{}
err = json.Unmarshal(data, &varTemplateConfigOption)
if err != nil {
return err
}
*o = TemplateConfigOption(varTemplateConfigOption)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "default")
delete(additionalProperties, "description")
delete(additionalProperties, "options")
delete(additionalProperties, "parameter")
delete(additionalProperties, "required")
delete(additionalProperties, "type")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTemplateConfigOption struct {
value *TemplateConfigOption
isSet bool
}
func (v NullableTemplateConfigOption) Get() *TemplateConfigOption {
return v.value
}
func (v *NullableTemplateConfigOption) Set(val *TemplateConfigOption) {
v.value = val
v.isSet = true
}
func (v NullableTemplateConfigOption) IsSet() bool {
return v.isSet
}
func (v *NullableTemplateConfigOption) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTemplateConfigOption(val *TemplateConfigOption) *NullableTemplateConfigOption {
return &NullableTemplateConfigOption{value: val, isSet: true}
}
func (v NullableTemplateConfigOption) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTemplateConfigOption) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}