bunnyshell.com/sdk@v0.16.0/model_organization_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 OrganizationItem type satisfies the MappedNullable interface at compile time
    19  var _ MappedNullable = &OrganizationItem{}
    20  
    21  // OrganizationItem An organization holds multiple projects and all the integrations used by environments
    22  type OrganizationItem struct {
    23  	// Organization identifier.
    24  	Id *string `json:"id,omitempty"`
    25  	// Organization name as defined in Bunnyshell UI.
    26  	Name *string `json:"name,omitempty"`
    27  	// Organization timezone as defined in Bunnyshell UI.
    28  	Timezone *string `json:"timezone,omitempty"`
    29  	// Organization total users.
    30  	TotalUsers *int32 `json:"totalUsers,omitempty"`
    31  	// Organization total projects.
    32  	TotalProjects *int32 `json:"totalProjects,omitempty"`
    33  	// Organization total available registry integrations.
    34  	AvailableRegistries *int32 `json:"availableRegistries,omitempty"`
    35  	// Organization total available cluster integrations.
    36  	AvailableClusters *int32 `json:"availableClusters,omitempty"`
    37  	// Organization total available git integrations.
    38  	AvailableGitIntegration *int32 `json:"availableGitIntegration,omitempty"`
    39  }
    40  
    41  // NewOrganizationItem instantiates a new OrganizationItem 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 NewOrganizationItem() *OrganizationItem {
    46  	this := OrganizationItem{}
    47  	return &this
    48  }
    49  
    50  // NewOrganizationItemWithDefaults instantiates a new OrganizationItem 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 NewOrganizationItemWithDefaults() *OrganizationItem {
    54  	this := OrganizationItem{}
    55  	return &this
    56  }
    57  
    58  // GetId returns the Id field value if set, zero value otherwise.
    59  func (o *OrganizationItem) 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 *OrganizationItem) 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 *OrganizationItem) 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 *OrganizationItem) SetId(v string) {
    87  	o.Id = &v
    88  }
    89  
    90  // GetName returns the Name field value if set, zero value otherwise.
    91  func (o *OrganizationItem) GetName() string {
    92  	if o == nil || IsNil(o.Name) {
    93  		var ret string
    94  		return ret
    95  	}
    96  	return *o.Name
    97  }
    98  
    99  // GetNameOk returns a tuple with the Name field value if set, nil otherwise
   100  // and a boolean to check if the value has been set.
   101  func (o *OrganizationItem) GetNameOk() (*string, bool) {
   102  	if o == nil || IsNil(o.Name) {
   103  		return nil, false
   104  	}
   105  	return o.Name, true
   106  }
   107  
   108  // HasName returns a boolean if a field has been set.
   109  func (o *OrganizationItem) HasName() bool {
   110  	if o != nil && !IsNil(o.Name) {
   111  		return true
   112  	}
   113  
   114  	return false
   115  }
   116  
   117  // SetName gets a reference to the given string and assigns it to the Name field.
   118  func (o *OrganizationItem) SetName(v string) {
   119  	o.Name = &v
   120  }
   121  
   122  // GetTimezone returns the Timezone field value if set, zero value otherwise.
   123  func (o *OrganizationItem) GetTimezone() string {
   124  	if o == nil || IsNil(o.Timezone) {
   125  		var ret string
   126  		return ret
   127  	}
   128  	return *o.Timezone
   129  }
   130  
   131  // GetTimezoneOk returns a tuple with the Timezone field value if set, nil otherwise
   132  // and a boolean to check if the value has been set.
   133  func (o *OrganizationItem) GetTimezoneOk() (*string, bool) {
   134  	if o == nil || IsNil(o.Timezone) {
   135  		return nil, false
   136  	}
   137  	return o.Timezone, true
   138  }
   139  
   140  // HasTimezone returns a boolean if a field has been set.
   141  func (o *OrganizationItem) HasTimezone() bool {
   142  	if o != nil && !IsNil(o.Timezone) {
   143  		return true
   144  	}
   145  
   146  	return false
   147  }
   148  
   149  // SetTimezone gets a reference to the given string and assigns it to the Timezone field.
   150  func (o *OrganizationItem) SetTimezone(v string) {
   151  	o.Timezone = &v
   152  }
   153  
   154  // GetTotalUsers returns the TotalUsers field value if set, zero value otherwise.
   155  func (o *OrganizationItem) GetTotalUsers() int32 {
   156  	if o == nil || IsNil(o.TotalUsers) {
   157  		var ret int32
   158  		return ret
   159  	}
   160  	return *o.TotalUsers
   161  }
   162  
   163  // GetTotalUsersOk returns a tuple with the TotalUsers field value if set, nil otherwise
   164  // and a boolean to check if the value has been set.
   165  func (o *OrganizationItem) GetTotalUsersOk() (*int32, bool) {
   166  	if o == nil || IsNil(o.TotalUsers) {
   167  		return nil, false
   168  	}
   169  	return o.TotalUsers, true
   170  }
   171  
   172  // HasTotalUsers returns a boolean if a field has been set.
   173  func (o *OrganizationItem) HasTotalUsers() bool {
   174  	if o != nil && !IsNil(o.TotalUsers) {
   175  		return true
   176  	}
   177  
   178  	return false
   179  }
   180  
   181  // SetTotalUsers gets a reference to the given int32 and assigns it to the TotalUsers field.
   182  func (o *OrganizationItem) SetTotalUsers(v int32) {
   183  	o.TotalUsers = &v
   184  }
   185  
   186  // GetTotalProjects returns the TotalProjects field value if set, zero value otherwise.
   187  func (o *OrganizationItem) GetTotalProjects() int32 {
   188  	if o == nil || IsNil(o.TotalProjects) {
   189  		var ret int32
   190  		return ret
   191  	}
   192  	return *o.TotalProjects
   193  }
   194  
   195  // GetTotalProjectsOk returns a tuple with the TotalProjects field value if set, nil otherwise
   196  // and a boolean to check if the value has been set.
   197  func (o *OrganizationItem) GetTotalProjectsOk() (*int32, bool) {
   198  	if o == nil || IsNil(o.TotalProjects) {
   199  		return nil, false
   200  	}
   201  	return o.TotalProjects, true
   202  }
   203  
   204  // HasTotalProjects returns a boolean if a field has been set.
   205  func (o *OrganizationItem) HasTotalProjects() bool {
   206  	if o != nil && !IsNil(o.TotalProjects) {
   207  		return true
   208  	}
   209  
   210  	return false
   211  }
   212  
   213  // SetTotalProjects gets a reference to the given int32 and assigns it to the TotalProjects field.
   214  func (o *OrganizationItem) SetTotalProjects(v int32) {
   215  	o.TotalProjects = &v
   216  }
   217  
   218  // GetAvailableRegistries returns the AvailableRegistries field value if set, zero value otherwise.
   219  func (o *OrganizationItem) GetAvailableRegistries() int32 {
   220  	if o == nil || IsNil(o.AvailableRegistries) {
   221  		var ret int32
   222  		return ret
   223  	}
   224  	return *o.AvailableRegistries
   225  }
   226  
   227  // GetAvailableRegistriesOk returns a tuple with the AvailableRegistries field value if set, nil otherwise
   228  // and a boolean to check if the value has been set.
   229  func (o *OrganizationItem) GetAvailableRegistriesOk() (*int32, bool) {
   230  	if o == nil || IsNil(o.AvailableRegistries) {
   231  		return nil, false
   232  	}
   233  	return o.AvailableRegistries, true
   234  }
   235  
   236  // HasAvailableRegistries returns a boolean if a field has been set.
   237  func (o *OrganizationItem) HasAvailableRegistries() bool {
   238  	if o != nil && !IsNil(o.AvailableRegistries) {
   239  		return true
   240  	}
   241  
   242  	return false
   243  }
   244  
   245  // SetAvailableRegistries gets a reference to the given int32 and assigns it to the AvailableRegistries field.
   246  func (o *OrganizationItem) SetAvailableRegistries(v int32) {
   247  	o.AvailableRegistries = &v
   248  }
   249  
   250  // GetAvailableClusters returns the AvailableClusters field value if set, zero value otherwise.
   251  func (o *OrganizationItem) GetAvailableClusters() int32 {
   252  	if o == nil || IsNil(o.AvailableClusters) {
   253  		var ret int32
   254  		return ret
   255  	}
   256  	return *o.AvailableClusters
   257  }
   258  
   259  // GetAvailableClustersOk returns a tuple with the AvailableClusters field value if set, nil otherwise
   260  // and a boolean to check if the value has been set.
   261  func (o *OrganizationItem) GetAvailableClustersOk() (*int32, bool) {
   262  	if o == nil || IsNil(o.AvailableClusters) {
   263  		return nil, false
   264  	}
   265  	return o.AvailableClusters, true
   266  }
   267  
   268  // HasAvailableClusters returns a boolean if a field has been set.
   269  func (o *OrganizationItem) HasAvailableClusters() bool {
   270  	if o != nil && !IsNil(o.AvailableClusters) {
   271  		return true
   272  	}
   273  
   274  	return false
   275  }
   276  
   277  // SetAvailableClusters gets a reference to the given int32 and assigns it to the AvailableClusters field.
   278  func (o *OrganizationItem) SetAvailableClusters(v int32) {
   279  	o.AvailableClusters = &v
   280  }
   281  
   282  // GetAvailableGitIntegration returns the AvailableGitIntegration field value if set, zero value otherwise.
   283  func (o *OrganizationItem) GetAvailableGitIntegration() int32 {
   284  	if o == nil || IsNil(o.AvailableGitIntegration) {
   285  		var ret int32
   286  		return ret
   287  	}
   288  	return *o.AvailableGitIntegration
   289  }
   290  
   291  // GetAvailableGitIntegrationOk returns a tuple with the AvailableGitIntegration field value if set, nil otherwise
   292  // and a boolean to check if the value has been set.
   293  func (o *OrganizationItem) GetAvailableGitIntegrationOk() (*int32, bool) {
   294  	if o == nil || IsNil(o.AvailableGitIntegration) {
   295  		return nil, false
   296  	}
   297  	return o.AvailableGitIntegration, true
   298  }
   299  
   300  // HasAvailableGitIntegration returns a boolean if a field has been set.
   301  func (o *OrganizationItem) HasAvailableGitIntegration() bool {
   302  	if o != nil && !IsNil(o.AvailableGitIntegration) {
   303  		return true
   304  	}
   305  
   306  	return false
   307  }
   308  
   309  // SetAvailableGitIntegration gets a reference to the given int32 and assigns it to the AvailableGitIntegration field.
   310  func (o *OrganizationItem) SetAvailableGitIntegration(v int32) {
   311  	o.AvailableGitIntegration = &v
   312  }
   313  
   314  func (o OrganizationItem) MarshalJSON() ([]byte, error) {
   315  	toSerialize, err := o.ToMap()
   316  	if err != nil {
   317  		return []byte{}, err
   318  	}
   319  	return json.Marshal(toSerialize)
   320  }
   321  
   322  func (o OrganizationItem) ToMap() (map[string]interface{}, error) {
   323  	toSerialize := map[string]interface{}{}
   324  	if !IsNil(o.Id) {
   325  		toSerialize["id"] = o.Id
   326  	}
   327  	if !IsNil(o.Name) {
   328  		toSerialize["name"] = o.Name
   329  	}
   330  	if !IsNil(o.Timezone) {
   331  		toSerialize["timezone"] = o.Timezone
   332  	}
   333  	if !IsNil(o.TotalUsers) {
   334  		toSerialize["totalUsers"] = o.TotalUsers
   335  	}
   336  	if !IsNil(o.TotalProjects) {
   337  		toSerialize["totalProjects"] = o.TotalProjects
   338  	}
   339  	if !IsNil(o.AvailableRegistries) {
   340  		toSerialize["availableRegistries"] = o.AvailableRegistries
   341  	}
   342  	if !IsNil(o.AvailableClusters) {
   343  		toSerialize["availableClusters"] = o.AvailableClusters
   344  	}
   345  	if !IsNil(o.AvailableGitIntegration) {
   346  		toSerialize["availableGitIntegration"] = o.AvailableGitIntegration
   347  	}
   348  	return toSerialize, nil
   349  }
   350  
   351  type NullableOrganizationItem struct {
   352  	value *OrganizationItem
   353  	isSet bool
   354  }
   355  
   356  func (v NullableOrganizationItem) Get() *OrganizationItem {
   357  	return v.value
   358  }
   359  
   360  func (v *NullableOrganizationItem) Set(val *OrganizationItem) {
   361  	v.value = val
   362  	v.isSet = true
   363  }
   364  
   365  func (v NullableOrganizationItem) IsSet() bool {
   366  	return v.isSet
   367  }
   368  
   369  func (v *NullableOrganizationItem) Unset() {
   370  	v.value = nil
   371  	v.isSet = false
   372  }
   373  
   374  func NewNullableOrganizationItem(val *OrganizationItem) *NullableOrganizationItem {
   375  	return &NullableOrganizationItem{value: val, isSet: true}
   376  }
   377  
   378  func (v NullableOrganizationItem) MarshalJSON() ([]byte, error) {
   379  	return json.Marshal(v.value)
   380  }
   381  
   382  func (v *NullableOrganizationItem) UnmarshalJSON(src []byte) error {
   383  	v.isSet = true
   384  	return json.Unmarshal(src, &v.value)
   385  }