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