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