Files
sdk/model_template_variant.go

307 lines
7.8 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 TemplateVariant type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TemplateVariant{}
// TemplateVariant struct for TemplateVariant
type TemplateVariant struct {
// only when it differs from the template's
Framework *string `json:"framework,omitempty"`
// selector, unique within the template (\"react\", \"grid-3-fluid\")
Id *string `json:"id,omitempty"`
// the axis it varies: format | page | theme
Kind *string `json:"kind,omitempty"`
// human label for the picker
Label *string `json:"label,omitempty"`
// the repository this shape is forked from; the synthesized default shape carries the template's own
Source *string `json:"source,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TemplateVariant TemplateVariant
// NewTemplateVariant instantiates a new TemplateVariant 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 NewTemplateVariant() *TemplateVariant {
this := TemplateVariant{}
return &this
}
// NewTemplateVariantWithDefaults instantiates a new TemplateVariant 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 NewTemplateVariantWithDefaults() *TemplateVariant {
this := TemplateVariant{}
return &this
}
// GetFramework returns the Framework field value if set, zero value otherwise.
func (o *TemplateVariant) GetFramework() string {
if o == nil || IsNil(o.Framework) {
var ret string
return ret
}
return *o.Framework
}
// GetFrameworkOk returns a tuple with the Framework field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TemplateVariant) GetFrameworkOk() (*string, bool) {
if o == nil || IsNil(o.Framework) {
return nil, false
}
return o.Framework, true
}
// HasFramework returns a boolean if a field has been set.
func (o *TemplateVariant) HasFramework() bool {
if o != nil && !IsNil(o.Framework) {
return true
}
return false
}
// SetFramework gets a reference to the given string and assigns it to the Framework field.
func (o *TemplateVariant) SetFramework(v string) {
o.Framework = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *TemplateVariant) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TemplateVariant) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *TemplateVariant) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *TemplateVariant) SetId(v string) {
o.Id = &v
}
// GetKind returns the Kind field value if set, zero value otherwise.
func (o *TemplateVariant) GetKind() string {
if o == nil || IsNil(o.Kind) {
var ret string
return ret
}
return *o.Kind
}
// GetKindOk returns a tuple with the Kind field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TemplateVariant) GetKindOk() (*string, bool) {
if o == nil || IsNil(o.Kind) {
return nil, false
}
return o.Kind, true
}
// HasKind returns a boolean if a field has been set.
func (o *TemplateVariant) HasKind() bool {
if o != nil && !IsNil(o.Kind) {
return true
}
return false
}
// SetKind gets a reference to the given string and assigns it to the Kind field.
func (o *TemplateVariant) SetKind(v string) {
o.Kind = &v
}
// GetLabel returns the Label field value if set, zero value otherwise.
func (o *TemplateVariant) GetLabel() string {
if o == nil || IsNil(o.Label) {
var ret string
return ret
}
return *o.Label
}
// GetLabelOk returns a tuple with the Label field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TemplateVariant) GetLabelOk() (*string, bool) {
if o == nil || IsNil(o.Label) {
return nil, false
}
return o.Label, true
}
// HasLabel returns a boolean if a field has been set.
func (o *TemplateVariant) HasLabel() bool {
if o != nil && !IsNil(o.Label) {
return true
}
return false
}
// SetLabel gets a reference to the given string and assigns it to the Label field.
func (o *TemplateVariant) SetLabel(v string) {
o.Label = &v
}
// GetSource returns the Source field value if set, zero value otherwise.
func (o *TemplateVariant) 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 *TemplateVariant) 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 *TemplateVariant) 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 *TemplateVariant) SetSource(v string) {
o.Source = &v
}
func (o TemplateVariant) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TemplateVariant) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Framework) {
toSerialize["framework"] = o.Framework
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Kind) {
toSerialize["kind"] = o.Kind
}
if !IsNil(o.Label) {
toSerialize["label"] = o.Label
}
if !IsNil(o.Source) {
toSerialize["source"] = o.Source
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TemplateVariant) UnmarshalJSON(data []byte) (err error) {
varTemplateVariant := _TemplateVariant{}
err = json.Unmarshal(data, &varTemplateVariant)
if err != nil {
return err
}
*o = TemplateVariant(varTemplateVariant)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "framework")
delete(additionalProperties, "id")
delete(additionalProperties, "kind")
delete(additionalProperties, "label")
delete(additionalProperties, "source")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTemplateVariant struct {
value *TemplateVariant
isSet bool
}
func (v NullableTemplateVariant) Get() *TemplateVariant {
return v.value
}
func (v *NullableTemplateVariant) Set(val *TemplateVariant) {
v.value = val
v.isSet = true
}
func (v NullableTemplateVariant) IsSet() bool {
return v.isSet
}
func (v *NullableTemplateVariant) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTemplateVariant(val *TemplateVariant) *NullableTemplateVariant {
return &NullableTemplateVariant{value: val, isSet: true}
}
func (v NullableTemplateVariant) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTemplateVariant) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}