bunnyshell.com/sdk@v0.16.0/model_templates_repository_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 TemplatesRepositoryItem type satisfies the MappedNullable interface at compile time
    19  var _ MappedNullable = &TemplatesRepositoryItem{}
    20  
    21  // TemplatesRepositoryItem A templates repository holds multiple templates.
    22  type TemplatesRepositoryItem struct {
    23  	// Templates repository identifier.
    24  	Id *string `json:"id,omitempty"`
    25  	// Templates repository name.
    26  	Name *string `json:"name,omitempty"`
    27  	// Templates repository git repository URL.
    28  	GitRepositoryUrl *string `json:"gitRepositoryUrl,omitempty"`
    29  	// Templates repository git repository reference.
    30  	GitRef *string `json:"gitRef,omitempty"`
    31  	// Templates repository last synced git repository SHA.
    32  	LastSyncSha NullableString `json:"lastSyncSha,omitempty"`
    33  	// Organization identifier.
    34  	Organization NullableString `json:"organization,omitempty"`
    35  }
    36  
    37  // NewTemplatesRepositoryItem instantiates a new TemplatesRepositoryItem object
    38  // This constructor will assign default values to properties that have it defined,
    39  // and makes sure properties required by API are set, but the set of arguments
    40  // will change when the set of required properties is changed
    41  func NewTemplatesRepositoryItem() *TemplatesRepositoryItem {
    42  	this := TemplatesRepositoryItem{}
    43  	return &this
    44  }
    45  
    46  // NewTemplatesRepositoryItemWithDefaults instantiates a new TemplatesRepositoryItem object
    47  // This constructor will only assign default values to properties that have it defined,
    48  // but it doesn't guarantee that properties required by API are set
    49  func NewTemplatesRepositoryItemWithDefaults() *TemplatesRepositoryItem {
    50  	this := TemplatesRepositoryItem{}
    51  	return &this
    52  }
    53  
    54  // GetId returns the Id field value if set, zero value otherwise.
    55  func (o *TemplatesRepositoryItem) GetId() string {
    56  	if o == nil || IsNil(o.Id) {
    57  		var ret string
    58  		return ret
    59  	}
    60  	return *o.Id
    61  }
    62  
    63  // GetIdOk returns a tuple with the Id field value if set, nil otherwise
    64  // and a boolean to check if the value has been set.
    65  func (o *TemplatesRepositoryItem) GetIdOk() (*string, bool) {
    66  	if o == nil || IsNil(o.Id) {
    67  		return nil, false
    68  	}
    69  	return o.Id, true
    70  }
    71  
    72  // HasId returns a boolean if a field has been set.
    73  func (o *TemplatesRepositoryItem) HasId() bool {
    74  	if o != nil && !IsNil(o.Id) {
    75  		return true
    76  	}
    77  
    78  	return false
    79  }
    80  
    81  // SetId gets a reference to the given string and assigns it to the Id field.
    82  func (o *TemplatesRepositoryItem) SetId(v string) {
    83  	o.Id = &v
    84  }
    85  
    86  // GetName returns the Name field value if set, zero value otherwise.
    87  func (o *TemplatesRepositoryItem) GetName() string {
    88  	if o == nil || IsNil(o.Name) {
    89  		var ret string
    90  		return ret
    91  	}
    92  	return *o.Name
    93  }
    94  
    95  // GetNameOk returns a tuple with the Name field value if set, nil otherwise
    96  // and a boolean to check if the value has been set.
    97  func (o *TemplatesRepositoryItem) GetNameOk() (*string, bool) {
    98  	if o == nil || IsNil(o.Name) {
    99  		return nil, false
   100  	}
   101  	return o.Name, true
   102  }
   103  
   104  // HasName returns a boolean if a field has been set.
   105  func (o *TemplatesRepositoryItem) HasName() bool {
   106  	if o != nil && !IsNil(o.Name) {
   107  		return true
   108  	}
   109  
   110  	return false
   111  }
   112  
   113  // SetName gets a reference to the given string and assigns it to the Name field.
   114  func (o *TemplatesRepositoryItem) SetName(v string) {
   115  	o.Name = &v
   116  }
   117  
   118  // GetGitRepositoryUrl returns the GitRepositoryUrl field value if set, zero value otherwise.
   119  func (o *TemplatesRepositoryItem) GetGitRepositoryUrl() string {
   120  	if o == nil || IsNil(o.GitRepositoryUrl) {
   121  		var ret string
   122  		return ret
   123  	}
   124  	return *o.GitRepositoryUrl
   125  }
   126  
   127  // GetGitRepositoryUrlOk returns a tuple with the GitRepositoryUrl field value if set, nil otherwise
   128  // and a boolean to check if the value has been set.
   129  func (o *TemplatesRepositoryItem) GetGitRepositoryUrlOk() (*string, bool) {
   130  	if o == nil || IsNil(o.GitRepositoryUrl) {
   131  		return nil, false
   132  	}
   133  	return o.GitRepositoryUrl, true
   134  }
   135  
   136  // HasGitRepositoryUrl returns a boolean if a field has been set.
   137  func (o *TemplatesRepositoryItem) HasGitRepositoryUrl() bool {
   138  	if o != nil && !IsNil(o.GitRepositoryUrl) {
   139  		return true
   140  	}
   141  
   142  	return false
   143  }
   144  
   145  // SetGitRepositoryUrl gets a reference to the given string and assigns it to the GitRepositoryUrl field.
   146  func (o *TemplatesRepositoryItem) SetGitRepositoryUrl(v string) {
   147  	o.GitRepositoryUrl = &v
   148  }
   149  
   150  // GetGitRef returns the GitRef field value if set, zero value otherwise.
   151  func (o *TemplatesRepositoryItem) GetGitRef() string {
   152  	if o == nil || IsNil(o.GitRef) {
   153  		var ret string
   154  		return ret
   155  	}
   156  	return *o.GitRef
   157  }
   158  
   159  // GetGitRefOk returns a tuple with the GitRef field value if set, nil otherwise
   160  // and a boolean to check if the value has been set.
   161  func (o *TemplatesRepositoryItem) GetGitRefOk() (*string, bool) {
   162  	if o == nil || IsNil(o.GitRef) {
   163  		return nil, false
   164  	}
   165  	return o.GitRef, true
   166  }
   167  
   168  // HasGitRef returns a boolean if a field has been set.
   169  func (o *TemplatesRepositoryItem) HasGitRef() bool {
   170  	if o != nil && !IsNil(o.GitRef) {
   171  		return true
   172  	}
   173  
   174  	return false
   175  }
   176  
   177  // SetGitRef gets a reference to the given string and assigns it to the GitRef field.
   178  func (o *TemplatesRepositoryItem) SetGitRef(v string) {
   179  	o.GitRef = &v
   180  }
   181  
   182  // GetLastSyncSha returns the LastSyncSha field value if set, zero value otherwise (both if not set or set to explicit null).
   183  func (o *TemplatesRepositoryItem) GetLastSyncSha() string {
   184  	if o == nil || IsNil(o.LastSyncSha.Get()) {
   185  		var ret string
   186  		return ret
   187  	}
   188  	return *o.LastSyncSha.Get()
   189  }
   190  
   191  // GetLastSyncShaOk returns a tuple with the LastSyncSha field value if set, nil otherwise
   192  // and a boolean to check if the value has been set.
   193  // NOTE: If the value is an explicit nil, `nil, true` will be returned
   194  func (o *TemplatesRepositoryItem) GetLastSyncShaOk() (*string, bool) {
   195  	if o == nil {
   196  		return nil, false
   197  	}
   198  	return o.LastSyncSha.Get(), o.LastSyncSha.IsSet()
   199  }
   200  
   201  // HasLastSyncSha returns a boolean if a field has been set.
   202  func (o *TemplatesRepositoryItem) HasLastSyncSha() bool {
   203  	if o != nil && o.LastSyncSha.IsSet() {
   204  		return true
   205  	}
   206  
   207  	return false
   208  }
   209  
   210  // SetLastSyncSha gets a reference to the given NullableString and assigns it to the LastSyncSha field.
   211  func (o *TemplatesRepositoryItem) SetLastSyncSha(v string) {
   212  	o.LastSyncSha.Set(&v)
   213  }
   214  
   215  // SetLastSyncShaNil sets the value for LastSyncSha to be an explicit nil
   216  func (o *TemplatesRepositoryItem) SetLastSyncShaNil() {
   217  	o.LastSyncSha.Set(nil)
   218  }
   219  
   220  // UnsetLastSyncSha ensures that no value is present for LastSyncSha, not even an explicit nil
   221  func (o *TemplatesRepositoryItem) UnsetLastSyncSha() {
   222  	o.LastSyncSha.Unset()
   223  }
   224  
   225  // GetOrganization returns the Organization field value if set, zero value otherwise (both if not set or set to explicit null).
   226  func (o *TemplatesRepositoryItem) GetOrganization() string {
   227  	if o == nil || IsNil(o.Organization.Get()) {
   228  		var ret string
   229  		return ret
   230  	}
   231  	return *o.Organization.Get()
   232  }
   233  
   234  // GetOrganizationOk returns a tuple with the Organization field value if set, nil otherwise
   235  // and a boolean to check if the value has been set.
   236  // NOTE: If the value is an explicit nil, `nil, true` will be returned
   237  func (o *TemplatesRepositoryItem) GetOrganizationOk() (*string, bool) {
   238  	if o == nil {
   239  		return nil, false
   240  	}
   241  	return o.Organization.Get(), o.Organization.IsSet()
   242  }
   243  
   244  // HasOrganization returns a boolean if a field has been set.
   245  func (o *TemplatesRepositoryItem) HasOrganization() bool {
   246  	if o != nil && o.Organization.IsSet() {
   247  		return true
   248  	}
   249  
   250  	return false
   251  }
   252  
   253  // SetOrganization gets a reference to the given NullableString and assigns it to the Organization field.
   254  func (o *TemplatesRepositoryItem) SetOrganization(v string) {
   255  	o.Organization.Set(&v)
   256  }
   257  
   258  // SetOrganizationNil sets the value for Organization to be an explicit nil
   259  func (o *TemplatesRepositoryItem) SetOrganizationNil() {
   260  	o.Organization.Set(nil)
   261  }
   262  
   263  // UnsetOrganization ensures that no value is present for Organization, not even an explicit nil
   264  func (o *TemplatesRepositoryItem) UnsetOrganization() {
   265  	o.Organization.Unset()
   266  }
   267  
   268  func (o TemplatesRepositoryItem) MarshalJSON() ([]byte, error) {
   269  	toSerialize, err := o.ToMap()
   270  	if err != nil {
   271  		return []byte{}, err
   272  	}
   273  	return json.Marshal(toSerialize)
   274  }
   275  
   276  func (o TemplatesRepositoryItem) ToMap() (map[string]interface{}, error) {
   277  	toSerialize := map[string]interface{}{}
   278  	if !IsNil(o.Id) {
   279  		toSerialize["id"] = o.Id
   280  	}
   281  	if !IsNil(o.Name) {
   282  		toSerialize["name"] = o.Name
   283  	}
   284  	if !IsNil(o.GitRepositoryUrl) {
   285  		toSerialize["gitRepositoryUrl"] = o.GitRepositoryUrl
   286  	}
   287  	if !IsNil(o.GitRef) {
   288  		toSerialize["gitRef"] = o.GitRef
   289  	}
   290  	if o.LastSyncSha.IsSet() {
   291  		toSerialize["lastSyncSha"] = o.LastSyncSha.Get()
   292  	}
   293  	if o.Organization.IsSet() {
   294  		toSerialize["organization"] = o.Organization.Get()
   295  	}
   296  	return toSerialize, nil
   297  }
   298  
   299  type NullableTemplatesRepositoryItem struct {
   300  	value *TemplatesRepositoryItem
   301  	isSet bool
   302  }
   303  
   304  func (v NullableTemplatesRepositoryItem) Get() *TemplatesRepositoryItem {
   305  	return v.value
   306  }
   307  
   308  func (v *NullableTemplatesRepositoryItem) Set(val *TemplatesRepositoryItem) {
   309  	v.value = val
   310  	v.isSet = true
   311  }
   312  
   313  func (v NullableTemplatesRepositoryItem) IsSet() bool {
   314  	return v.isSet
   315  }
   316  
   317  func (v *NullableTemplatesRepositoryItem) Unset() {
   318  	v.value = nil
   319  	v.isSet = false
   320  }
   321  
   322  func NewNullableTemplatesRepositoryItem(val *TemplatesRepositoryItem) *NullableTemplatesRepositoryItem {
   323  	return &NullableTemplatesRepositoryItem{value: val, isSet: true}
   324  }
   325  
   326  func (v NullableTemplatesRepositoryItem) MarshalJSON() ([]byte, error) {
   327  	return json.Marshal(v.value)
   328  }
   329  
   330  func (v *NullableTemplatesRepositoryItem) UnmarshalJSON(src []byte) error {
   331  	v.isSet = true
   332  	return json.Unmarshal(src, &v.value)
   333  }