Files
sdk/model_template.go

561 lines
15 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 Template type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Template{}
// Template struct for Template
type Template struct {
BasicConfigOptions []TemplateConfigOption `json:"basicConfigOptions,omitempty"`
CreatedTime *string `json:"createdTime,omitempty"`
Description *string `json:"description,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
EnableBasicConfig *bool `json:"enableBasicConfig,omitempty"`
Icon *string `json:"icon,omitempty"`
Manifest *string `json:"manifest,omitempty"`
Name *string `json:"name,omitempty"`
Owner *string `json:"owner,omitempty"`
Readme *string `json:"readme,omitempty"`
UpdatedTime *string `json:"updatedTime,omitempty"`
Version *string `json:"version,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Template Template
// NewTemplate instantiates a new Template 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 NewTemplate() *Template {
this := Template{}
return &this
}
// NewTemplateWithDefaults instantiates a new Template 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 NewTemplateWithDefaults() *Template {
this := Template{}
return &this
}
// GetBasicConfigOptions returns the BasicConfigOptions field value if set, zero value otherwise.
func (o *Template) GetBasicConfigOptions() []TemplateConfigOption {
if o == nil || IsNil(o.BasicConfigOptions) {
var ret []TemplateConfigOption
return ret
}
return o.BasicConfigOptions
}
// GetBasicConfigOptionsOk returns a tuple with the BasicConfigOptions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Template) GetBasicConfigOptionsOk() ([]TemplateConfigOption, bool) {
if o == nil || IsNil(o.BasicConfigOptions) {
return nil, false
}
return o.BasicConfigOptions, true
}
// HasBasicConfigOptions returns a boolean if a field has been set.
func (o *Template) HasBasicConfigOptions() bool {
if o != nil && !IsNil(o.BasicConfigOptions) {
return true
}
return false
}
// SetBasicConfigOptions gets a reference to the given []TemplateConfigOption and assigns it to the BasicConfigOptions field.
func (o *Template) SetBasicConfigOptions(v []TemplateConfigOption) {
o.BasicConfigOptions = v
}
// GetCreatedTime returns the CreatedTime field value if set, zero value otherwise.
func (o *Template) GetCreatedTime() string {
if o == nil || IsNil(o.CreatedTime) {
var ret string
return ret
}
return *o.CreatedTime
}
// GetCreatedTimeOk returns a tuple with the CreatedTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Template) GetCreatedTimeOk() (*string, bool) {
if o == nil || IsNil(o.CreatedTime) {
return nil, false
}
return o.CreatedTime, true
}
// HasCreatedTime returns a boolean if a field has been set.
func (o *Template) HasCreatedTime() bool {
if o != nil && !IsNil(o.CreatedTime) {
return true
}
return false
}
// SetCreatedTime gets a reference to the given string and assigns it to the CreatedTime field.
func (o *Template) SetCreatedTime(v string) {
o.CreatedTime = &v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *Template) 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 *Template) 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 *Template) 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 *Template) SetDescription(v string) {
o.Description = &v
}
// GetDisplayName returns the DisplayName field value if set, zero value otherwise.
func (o *Template) GetDisplayName() string {
if o == nil || IsNil(o.DisplayName) {
var ret string
return ret
}
return *o.DisplayName
}
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Template) GetDisplayNameOk() (*string, bool) {
if o == nil || IsNil(o.DisplayName) {
return nil, false
}
return o.DisplayName, true
}
// HasDisplayName returns a boolean if a field has been set.
func (o *Template) HasDisplayName() bool {
if o != nil && !IsNil(o.DisplayName) {
return true
}
return false
}
// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field.
func (o *Template) SetDisplayName(v string) {
o.DisplayName = &v
}
// GetEnableBasicConfig returns the EnableBasicConfig field value if set, zero value otherwise.
func (o *Template) GetEnableBasicConfig() bool {
if o == nil || IsNil(o.EnableBasicConfig) {
var ret bool
return ret
}
return *o.EnableBasicConfig
}
// GetEnableBasicConfigOk returns a tuple with the EnableBasicConfig field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Template) GetEnableBasicConfigOk() (*bool, bool) {
if o == nil || IsNil(o.EnableBasicConfig) {
return nil, false
}
return o.EnableBasicConfig, true
}
// HasEnableBasicConfig returns a boolean if a field has been set.
func (o *Template) HasEnableBasicConfig() bool {
if o != nil && !IsNil(o.EnableBasicConfig) {
return true
}
return false
}
// SetEnableBasicConfig gets a reference to the given bool and assigns it to the EnableBasicConfig field.
func (o *Template) SetEnableBasicConfig(v bool) {
o.EnableBasicConfig = &v
}
// GetIcon returns the Icon field value if set, zero value otherwise.
func (o *Template) GetIcon() string {
if o == nil || IsNil(o.Icon) {
var ret string
return ret
}
return *o.Icon
}
// GetIconOk returns a tuple with the Icon field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Template) GetIconOk() (*string, bool) {
if o == nil || IsNil(o.Icon) {
return nil, false
}
return o.Icon, true
}
// HasIcon returns a boolean if a field has been set.
func (o *Template) HasIcon() bool {
if o != nil && !IsNil(o.Icon) {
return true
}
return false
}
// SetIcon gets a reference to the given string and assigns it to the Icon field.
func (o *Template) SetIcon(v string) {
o.Icon = &v
}
// GetManifest returns the Manifest field value if set, zero value otherwise.
func (o *Template) GetManifest() string {
if o == nil || IsNil(o.Manifest) {
var ret string
return ret
}
return *o.Manifest
}
// GetManifestOk returns a tuple with the Manifest field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Template) GetManifestOk() (*string, bool) {
if o == nil || IsNil(o.Manifest) {
return nil, false
}
return o.Manifest, true
}
// HasManifest returns a boolean if a field has been set.
func (o *Template) HasManifest() bool {
if o != nil && !IsNil(o.Manifest) {
return true
}
return false
}
// SetManifest gets a reference to the given string and assigns it to the Manifest field.
func (o *Template) SetManifest(v string) {
o.Manifest = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *Template) 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 *Template) 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 *Template) 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 *Template) SetName(v string) {
o.Name = &v
}
// GetOwner returns the Owner field value if set, zero value otherwise.
func (o *Template) GetOwner() string {
if o == nil || IsNil(o.Owner) {
var ret string
return ret
}
return *o.Owner
}
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Template) GetOwnerOk() (*string, bool) {
if o == nil || IsNil(o.Owner) {
return nil, false
}
return o.Owner, true
}
// HasOwner returns a boolean if a field has been set.
func (o *Template) HasOwner() bool {
if o != nil && !IsNil(o.Owner) {
return true
}
return false
}
// SetOwner gets a reference to the given string and assigns it to the Owner field.
func (o *Template) SetOwner(v string) {
o.Owner = &v
}
// GetReadme returns the Readme field value if set, zero value otherwise.
func (o *Template) GetReadme() string {
if o == nil || IsNil(o.Readme) {
var ret string
return ret
}
return *o.Readme
}
// GetReadmeOk returns a tuple with the Readme field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Template) GetReadmeOk() (*string, bool) {
if o == nil || IsNil(o.Readme) {
return nil, false
}
return o.Readme, true
}
// HasReadme returns a boolean if a field has been set.
func (o *Template) HasReadme() bool {
if o != nil && !IsNil(o.Readme) {
return true
}
return false
}
// SetReadme gets a reference to the given string and assigns it to the Readme field.
func (o *Template) SetReadme(v string) {
o.Readme = &v
}
// GetUpdatedTime returns the UpdatedTime field value if set, zero value otherwise.
func (o *Template) GetUpdatedTime() string {
if o == nil || IsNil(o.UpdatedTime) {
var ret string
return ret
}
return *o.UpdatedTime
}
// GetUpdatedTimeOk returns a tuple with the UpdatedTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Template) GetUpdatedTimeOk() (*string, bool) {
if o == nil || IsNil(o.UpdatedTime) {
return nil, false
}
return o.UpdatedTime, true
}
// HasUpdatedTime returns a boolean if a field has been set.
func (o *Template) HasUpdatedTime() bool {
if o != nil && !IsNil(o.UpdatedTime) {
return true
}
return false
}
// SetUpdatedTime gets a reference to the given string and assigns it to the UpdatedTime field.
func (o *Template) SetUpdatedTime(v string) {
o.UpdatedTime = &v
}
// GetVersion returns the Version field value if set, zero value otherwise.
func (o *Template) 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 *Template) 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 *Template) 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 *Template) SetVersion(v string) {
o.Version = &v
}
func (o Template) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Template) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.BasicConfigOptions) {
toSerialize["basicConfigOptions"] = o.BasicConfigOptions
}
if !IsNil(o.CreatedTime) {
toSerialize["createdTime"] = o.CreatedTime
}
if !IsNil(o.Description) {
toSerialize["description"] = o.Description
}
if !IsNil(o.DisplayName) {
toSerialize["displayName"] = o.DisplayName
}
if !IsNil(o.EnableBasicConfig) {
toSerialize["enableBasicConfig"] = o.EnableBasicConfig
}
if !IsNil(o.Icon) {
toSerialize["icon"] = o.Icon
}
if !IsNil(o.Manifest) {
toSerialize["manifest"] = o.Manifest
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Owner) {
toSerialize["owner"] = o.Owner
}
if !IsNil(o.Readme) {
toSerialize["readme"] = o.Readme
}
if !IsNil(o.UpdatedTime) {
toSerialize["updatedTime"] = o.UpdatedTime
}
if !IsNil(o.Version) {
toSerialize["version"] = o.Version
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Template) UnmarshalJSON(data []byte) (err error) {
varTemplate := _Template{}
err = json.Unmarshal(data, &varTemplate)
if err != nil {
return err
}
*o = Template(varTemplate)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "basicConfigOptions")
delete(additionalProperties, "createdTime")
delete(additionalProperties, "description")
delete(additionalProperties, "displayName")
delete(additionalProperties, "enableBasicConfig")
delete(additionalProperties, "icon")
delete(additionalProperties, "manifest")
delete(additionalProperties, "name")
delete(additionalProperties, "owner")
delete(additionalProperties, "readme")
delete(additionalProperties, "updatedTime")
delete(additionalProperties, "version")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTemplate struct {
value *Template
isSet bool
}
func (v NullableTemplate) Get() *Template {
return v.value
}
func (v *NullableTemplate) Set(val *Template) {
v.value = val
v.isSet = true
}
func (v NullableTemplate) IsSet() bool {
return v.isSet
}
func (v *NullableTemplate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTemplate(val *Template) *NullableTemplate {
return &NullableTemplate{value: val, isSet: true}
}
func (v NullableTemplate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTemplate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}