bunnyshell.com/sdk@v0.16.0/model_template_collection.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 TemplateCollection type satisfies the MappedNullable interface at compile time 19 var _ MappedNullable = &TemplateCollection{} 20 21 // TemplateCollection A template holds information for generating an environment. 22 type TemplateCollection struct { 23 // Template identifier. 24 Id *string `json:"id,omitempty"` 25 // Template key. 26 Key *string `json:"key,omitempty"` 27 // Template name. 28 Name *string `json:"name,omitempty"` 29 // Template git repository SHA. 30 GitSha *string `json:"gitSha,omitempty"` 31 // Template short description. 32 ShortDescription NullableString `json:"shortDescription,omitempty"` 33 // Template tags. 34 Tags []string `json:"tags,omitempty"` 35 // Organization identifier. 36 Organization NullableString `json:"organization,omitempty"` 37 // Templates repository identifier. 38 TemplatesRepository NullableString `json:"templatesRepository,omitempty"` 39 } 40 41 // NewTemplateCollection instantiates a new TemplateCollection object 42 // This constructor will assign default values to properties that have it defined, 43 // and makes sure properties required by API are set, but the set of arguments 44 // will change when the set of required properties is changed 45 func NewTemplateCollection() *TemplateCollection { 46 this := TemplateCollection{} 47 return &this 48 } 49 50 // NewTemplateCollectionWithDefaults instantiates a new TemplateCollection object 51 // This constructor will only assign default values to properties that have it defined, 52 // but it doesn't guarantee that properties required by API are set 53 func NewTemplateCollectionWithDefaults() *TemplateCollection { 54 this := TemplateCollection{} 55 return &this 56 } 57 58 // GetId returns the Id field value if set, zero value otherwise. 59 func (o *TemplateCollection) GetId() string { 60 if o == nil || IsNil(o.Id) { 61 var ret string 62 return ret 63 } 64 return *o.Id 65 } 66 67 // GetIdOk returns a tuple with the Id field value if set, nil otherwise 68 // and a boolean to check if the value has been set. 69 func (o *TemplateCollection) GetIdOk() (*string, bool) { 70 if o == nil || IsNil(o.Id) { 71 return nil, false 72 } 73 return o.Id, true 74 } 75 76 // HasId returns a boolean if a field has been set. 77 func (o *TemplateCollection) HasId() bool { 78 if o != nil && !IsNil(o.Id) { 79 return true 80 } 81 82 return false 83 } 84 85 // SetId gets a reference to the given string and assigns it to the Id field. 86 func (o *TemplateCollection) SetId(v string) { 87 o.Id = &v 88 } 89 90 // GetKey returns the Key field value if set, zero value otherwise. 91 func (o *TemplateCollection) GetKey() string { 92 if o == nil || IsNil(o.Key) { 93 var ret string 94 return ret 95 } 96 return *o.Key 97 } 98 99 // GetKeyOk returns a tuple with the Key field value if set, nil otherwise 100 // and a boolean to check if the value has been set. 101 func (o *TemplateCollection) GetKeyOk() (*string, bool) { 102 if o == nil || IsNil(o.Key) { 103 return nil, false 104 } 105 return o.Key, true 106 } 107 108 // HasKey returns a boolean if a field has been set. 109 func (o *TemplateCollection) HasKey() bool { 110 if o != nil && !IsNil(o.Key) { 111 return true 112 } 113 114 return false 115 } 116 117 // SetKey gets a reference to the given string and assigns it to the Key field. 118 func (o *TemplateCollection) SetKey(v string) { 119 o.Key = &v 120 } 121 122 // GetName returns the Name field value if set, zero value otherwise. 123 func (o *TemplateCollection) GetName() string { 124 if o == nil || IsNil(o.Name) { 125 var ret string 126 return ret 127 } 128 return *o.Name 129 } 130 131 // GetNameOk returns a tuple with the Name field value if set, nil otherwise 132 // and a boolean to check if the value has been set. 133 func (o *TemplateCollection) GetNameOk() (*string, bool) { 134 if o == nil || IsNil(o.Name) { 135 return nil, false 136 } 137 return o.Name, true 138 } 139 140 // HasName returns a boolean if a field has been set. 141 func (o *TemplateCollection) HasName() bool { 142 if o != nil && !IsNil(o.Name) { 143 return true 144 } 145 146 return false 147 } 148 149 // SetName gets a reference to the given string and assigns it to the Name field. 150 func (o *TemplateCollection) SetName(v string) { 151 o.Name = &v 152 } 153 154 // GetGitSha returns the GitSha field value if set, zero value otherwise. 155 func (o *TemplateCollection) GetGitSha() string { 156 if o == nil || IsNil(o.GitSha) { 157 var ret string 158 return ret 159 } 160 return *o.GitSha 161 } 162 163 // GetGitShaOk returns a tuple with the GitSha field value if set, nil otherwise 164 // and a boolean to check if the value has been set. 165 func (o *TemplateCollection) GetGitShaOk() (*string, bool) { 166 if o == nil || IsNil(o.GitSha) { 167 return nil, false 168 } 169 return o.GitSha, true 170 } 171 172 // HasGitSha returns a boolean if a field has been set. 173 func (o *TemplateCollection) HasGitSha() bool { 174 if o != nil && !IsNil(o.GitSha) { 175 return true 176 } 177 178 return false 179 } 180 181 // SetGitSha gets a reference to the given string and assigns it to the GitSha field. 182 func (o *TemplateCollection) SetGitSha(v string) { 183 o.GitSha = &v 184 } 185 186 // GetShortDescription returns the ShortDescription field value if set, zero value otherwise (both if not set or set to explicit null). 187 func (o *TemplateCollection) GetShortDescription() string { 188 if o == nil || IsNil(o.ShortDescription.Get()) { 189 var ret string 190 return ret 191 } 192 return *o.ShortDescription.Get() 193 } 194 195 // GetShortDescriptionOk returns a tuple with the ShortDescription field value if set, nil otherwise 196 // and a boolean to check if the value has been set. 197 // NOTE: If the value is an explicit nil, `nil, true` will be returned 198 func (o *TemplateCollection) GetShortDescriptionOk() (*string, bool) { 199 if o == nil { 200 return nil, false 201 } 202 return o.ShortDescription.Get(), o.ShortDescription.IsSet() 203 } 204 205 // HasShortDescription returns a boolean if a field has been set. 206 func (o *TemplateCollection) HasShortDescription() bool { 207 if o != nil && o.ShortDescription.IsSet() { 208 return true 209 } 210 211 return false 212 } 213 214 // SetShortDescription gets a reference to the given NullableString and assigns it to the ShortDescription field. 215 func (o *TemplateCollection) SetShortDescription(v string) { 216 o.ShortDescription.Set(&v) 217 } 218 219 // SetShortDescriptionNil sets the value for ShortDescription to be an explicit nil 220 func (o *TemplateCollection) SetShortDescriptionNil() { 221 o.ShortDescription.Set(nil) 222 } 223 224 // UnsetShortDescription ensures that no value is present for ShortDescription, not even an explicit nil 225 func (o *TemplateCollection) UnsetShortDescription() { 226 o.ShortDescription.Unset() 227 } 228 229 // GetTags returns the Tags field value if set, zero value otherwise. 230 func (o *TemplateCollection) GetTags() []string { 231 if o == nil || IsNil(o.Tags) { 232 var ret []string 233 return ret 234 } 235 return o.Tags 236 } 237 238 // GetTagsOk returns a tuple with the Tags field value if set, nil otherwise 239 // and a boolean to check if the value has been set. 240 func (o *TemplateCollection) GetTagsOk() ([]string, bool) { 241 if o == nil || IsNil(o.Tags) { 242 return nil, false 243 } 244 return o.Tags, true 245 } 246 247 // HasTags returns a boolean if a field has been set. 248 func (o *TemplateCollection) HasTags() bool { 249 if o != nil && !IsNil(o.Tags) { 250 return true 251 } 252 253 return false 254 } 255 256 // SetTags gets a reference to the given []string and assigns it to the Tags field. 257 func (o *TemplateCollection) SetTags(v []string) { 258 o.Tags = v 259 } 260 261 // GetOrganization returns the Organization field value if set, zero value otherwise (both if not set or set to explicit null). 262 func (o *TemplateCollection) GetOrganization() string { 263 if o == nil || IsNil(o.Organization.Get()) { 264 var ret string 265 return ret 266 } 267 return *o.Organization.Get() 268 } 269 270 // GetOrganizationOk returns a tuple with the Organization field value if set, nil otherwise 271 // and a boolean to check if the value has been set. 272 // NOTE: If the value is an explicit nil, `nil, true` will be returned 273 func (o *TemplateCollection) GetOrganizationOk() (*string, bool) { 274 if o == nil { 275 return nil, false 276 } 277 return o.Organization.Get(), o.Organization.IsSet() 278 } 279 280 // HasOrganization returns a boolean if a field has been set. 281 func (o *TemplateCollection) HasOrganization() bool { 282 if o != nil && o.Organization.IsSet() { 283 return true 284 } 285 286 return false 287 } 288 289 // SetOrganization gets a reference to the given NullableString and assigns it to the Organization field. 290 func (o *TemplateCollection) SetOrganization(v string) { 291 o.Organization.Set(&v) 292 } 293 294 // SetOrganizationNil sets the value for Organization to be an explicit nil 295 func (o *TemplateCollection) SetOrganizationNil() { 296 o.Organization.Set(nil) 297 } 298 299 // UnsetOrganization ensures that no value is present for Organization, not even an explicit nil 300 func (o *TemplateCollection) UnsetOrganization() { 301 o.Organization.Unset() 302 } 303 304 // GetTemplatesRepository returns the TemplatesRepository field value if set, zero value otherwise (both if not set or set to explicit null). 305 func (o *TemplateCollection) GetTemplatesRepository() string { 306 if o == nil || IsNil(o.TemplatesRepository.Get()) { 307 var ret string 308 return ret 309 } 310 return *o.TemplatesRepository.Get() 311 } 312 313 // GetTemplatesRepositoryOk returns a tuple with the TemplatesRepository field value if set, nil otherwise 314 // and a boolean to check if the value has been set. 315 // NOTE: If the value is an explicit nil, `nil, true` will be returned 316 func (o *TemplateCollection) GetTemplatesRepositoryOk() (*string, bool) { 317 if o == nil { 318 return nil, false 319 } 320 return o.TemplatesRepository.Get(), o.TemplatesRepository.IsSet() 321 } 322 323 // HasTemplatesRepository returns a boolean if a field has been set. 324 func (o *TemplateCollection) HasTemplatesRepository() bool { 325 if o != nil && o.TemplatesRepository.IsSet() { 326 return true 327 } 328 329 return false 330 } 331 332 // SetTemplatesRepository gets a reference to the given NullableString and assigns it to the TemplatesRepository field. 333 func (o *TemplateCollection) SetTemplatesRepository(v string) { 334 o.TemplatesRepository.Set(&v) 335 } 336 337 // SetTemplatesRepositoryNil sets the value for TemplatesRepository to be an explicit nil 338 func (o *TemplateCollection) SetTemplatesRepositoryNil() { 339 o.TemplatesRepository.Set(nil) 340 } 341 342 // UnsetTemplatesRepository ensures that no value is present for TemplatesRepository, not even an explicit nil 343 func (o *TemplateCollection) UnsetTemplatesRepository() { 344 o.TemplatesRepository.Unset() 345 } 346 347 func (o TemplateCollection) MarshalJSON() ([]byte, error) { 348 toSerialize, err := o.ToMap() 349 if err != nil { 350 return []byte{}, err 351 } 352 return json.Marshal(toSerialize) 353 } 354 355 func (o TemplateCollection) ToMap() (map[string]interface{}, error) { 356 toSerialize := map[string]interface{}{} 357 if !IsNil(o.Id) { 358 toSerialize["id"] = o.Id 359 } 360 if !IsNil(o.Key) { 361 toSerialize["key"] = o.Key 362 } 363 if !IsNil(o.Name) { 364 toSerialize["name"] = o.Name 365 } 366 if !IsNil(o.GitSha) { 367 toSerialize["gitSha"] = o.GitSha 368 } 369 if o.ShortDescription.IsSet() { 370 toSerialize["shortDescription"] = o.ShortDescription.Get() 371 } 372 if !IsNil(o.Tags) { 373 toSerialize["tags"] = o.Tags 374 } 375 if o.Organization.IsSet() { 376 toSerialize["organization"] = o.Organization.Get() 377 } 378 if o.TemplatesRepository.IsSet() { 379 toSerialize["templatesRepository"] = o.TemplatesRepository.Get() 380 } 381 return toSerialize, nil 382 } 383 384 type NullableTemplateCollection struct { 385 value *TemplateCollection 386 isSet bool 387 } 388 389 func (v NullableTemplateCollection) Get() *TemplateCollection { 390 return v.value 391 } 392 393 func (v *NullableTemplateCollection) Set(val *TemplateCollection) { 394 v.value = val 395 v.isSet = true 396 } 397 398 func (v NullableTemplateCollection) IsSet() bool { 399 return v.isSet 400 } 401 402 func (v *NullableTemplateCollection) Unset() { 403 v.value = nil 404 v.isSet = false 405 } 406 407 func NewNullableTemplateCollection(val *TemplateCollection) *NullableTemplateCollection { 408 return &NullableTemplateCollection{value: val, isSet: true} 409 } 410 411 func (v NullableTemplateCollection) MarshalJSON() ([]byte, error) { 412 return json.Marshal(v.value) 413 } 414 415 func (v *NullableTemplateCollection) UnmarshalJSON(src []byte) error { 416 v.isSet = true 417 return json.Unmarshal(src, &v.value) 418 }