bunnyshell.com/sdk@v0.16.0/model_from_template.go (about) 1 /* 2 API Bunnyshell Environments 3 4 Interact with Bunnyshell Platform 5 6 API version: 1.1.0 7 Contact: osi+support@bunnyshell.com 8 */ 9 10 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 11 12 package sdk 13 14 import ( 15 "encoding/json" 16 ) 17 18 // checks if the FromTemplate type satisfies the MappedNullable interface at compile time 19 var _ MappedNullable = &FromTemplate{} 20 21 // FromTemplate struct for FromTemplate 22 type FromTemplate struct { 23 Type *string `json:"type,omitempty"` 24 Variables *map[string]FromTemplateVariablesValue `json:"variables,omitempty"` 25 Template *string `json:"template,omitempty"` 26 } 27 28 // NewFromTemplate instantiates a new FromTemplate object 29 // This constructor will assign default values to properties that have it defined, 30 // and makes sure properties required by API are set, but the set of arguments 31 // will change when the set of required properties is changed 32 func NewFromTemplate() *FromTemplate { 33 this := FromTemplate{} 34 var type_ string = "template" 35 this.Type = &type_ 36 return &this 37 } 38 39 // NewFromTemplateWithDefaults instantiates a new FromTemplate object 40 // This constructor will only assign default values to properties that have it defined, 41 // but it doesn't guarantee that properties required by API are set 42 func NewFromTemplateWithDefaults() *FromTemplate { 43 this := FromTemplate{} 44 var type_ string = "template" 45 this.Type = &type_ 46 return &this 47 } 48 49 // GetType returns the Type field value if set, zero value otherwise. 50 func (o *FromTemplate) GetType() string { 51 if o == nil || IsNil(o.Type) { 52 var ret string 53 return ret 54 } 55 return *o.Type 56 } 57 58 // GetTypeOk returns a tuple with the Type field value if set, nil otherwise 59 // and a boolean to check if the value has been set. 60 func (o *FromTemplate) GetTypeOk() (*string, bool) { 61 if o == nil || IsNil(o.Type) { 62 return nil, false 63 } 64 return o.Type, true 65 } 66 67 // HasType returns a boolean if a field has been set. 68 func (o *FromTemplate) HasType() bool { 69 if o != nil && !IsNil(o.Type) { 70 return true 71 } 72 73 return false 74 } 75 76 // SetType gets a reference to the given string and assigns it to the Type field. 77 func (o *FromTemplate) SetType(v string) { 78 o.Type = &v 79 } 80 81 // GetVariables returns the Variables field value if set, zero value otherwise. 82 func (o *FromTemplate) GetVariables() map[string]FromTemplateVariablesValue { 83 if o == nil || IsNil(o.Variables) { 84 var ret map[string]FromTemplateVariablesValue 85 return ret 86 } 87 return *o.Variables 88 } 89 90 // GetVariablesOk returns a tuple with the Variables field value if set, nil otherwise 91 // and a boolean to check if the value has been set. 92 func (o *FromTemplate) GetVariablesOk() (*map[string]FromTemplateVariablesValue, bool) { 93 if o == nil || IsNil(o.Variables) { 94 return nil, false 95 } 96 return o.Variables, true 97 } 98 99 // HasVariables returns a boolean if a field has been set. 100 func (o *FromTemplate) HasVariables() bool { 101 if o != nil && !IsNil(o.Variables) { 102 return true 103 } 104 105 return false 106 } 107 108 // SetVariables gets a reference to the given map[string]FromTemplateVariablesValue and assigns it to the Variables field. 109 func (o *FromTemplate) SetVariables(v map[string]FromTemplateVariablesValue) { 110 o.Variables = &v 111 } 112 113 // GetTemplate returns the Template field value if set, zero value otherwise. 114 func (o *FromTemplate) GetTemplate() string { 115 if o == nil || IsNil(o.Template) { 116 var ret string 117 return ret 118 } 119 return *o.Template 120 } 121 122 // GetTemplateOk returns a tuple with the Template field value if set, nil otherwise 123 // and a boolean to check if the value has been set. 124 func (o *FromTemplate) GetTemplateOk() (*string, bool) { 125 if o == nil || IsNil(o.Template) { 126 return nil, false 127 } 128 return o.Template, true 129 } 130 131 // HasTemplate returns a boolean if a field has been set. 132 func (o *FromTemplate) HasTemplate() bool { 133 if o != nil && !IsNil(o.Template) { 134 return true 135 } 136 137 return false 138 } 139 140 // SetTemplate gets a reference to the given string and assigns it to the Template field. 141 func (o *FromTemplate) SetTemplate(v string) { 142 o.Template = &v 143 } 144 145 func (o FromTemplate) MarshalJSON() ([]byte, error) { 146 toSerialize, err := o.ToMap() 147 if err != nil { 148 return []byte{}, err 149 } 150 return json.Marshal(toSerialize) 151 } 152 153 func (o FromTemplate) ToMap() (map[string]interface{}, error) { 154 toSerialize := map[string]interface{}{} 155 if !IsNil(o.Type) { 156 toSerialize["type"] = o.Type 157 } 158 if !IsNil(o.Variables) { 159 toSerialize["variables"] = o.Variables 160 } 161 if !IsNil(o.Template) { 162 toSerialize["template"] = o.Template 163 } 164 return toSerialize, nil 165 } 166 167 type NullableFromTemplate struct { 168 value *FromTemplate 169 isSet bool 170 } 171 172 func (v NullableFromTemplate) Get() *FromTemplate { 173 return v.value 174 } 175 176 func (v *NullableFromTemplate) Set(val *FromTemplate) { 177 v.value = val 178 v.isSet = true 179 } 180 181 func (v NullableFromTemplate) IsSet() bool { 182 return v.isSet 183 } 184 185 func (v *NullableFromTemplate) Unset() { 186 v.value = nil 187 v.isSet = false 188 } 189 190 func NewNullableFromTemplate(val *FromTemplate) *NullableFromTemplate { 191 return &NullableFromTemplate{value: val, isSet: true} 192 } 193 194 func (v NullableFromTemplate) MarshalJSON() ([]byte, error) { 195 return json.Marshal(v.value) 196 } 197 198 func (v *NullableFromTemplate) UnmarshalJSON(src []byte) error { 199 v.isSet = true 200 return json.Unmarshal(src, &v.value) 201 }