bunnyshell.com/sdk@v0.16.0/model_project_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 ProjectCollection type satisfies the MappedNullable interface at compile time 19 var _ MappedNullable = &ProjectCollection{} 20 21 // ProjectCollection A project holds multiple environments and shared secrets and settings. 22 type ProjectCollection struct { 23 // Project identifier. 24 Id *string `json:"id,omitempty"` 25 // Project name. 26 Name *string `json:"name,omitempty"` 27 // Environment identifier. 28 TotalEnvironments *int32 `json:"totalEnvironments,omitempty"` 29 // Organization identifier. 30 Organization *string `json:"organization,omitempty"` 31 } 32 33 // NewProjectCollection instantiates a new ProjectCollection object 34 // This constructor will assign default values to properties that have it defined, 35 // and makes sure properties required by API are set, but the set of arguments 36 // will change when the set of required properties is changed 37 func NewProjectCollection() *ProjectCollection { 38 this := ProjectCollection{} 39 return &this 40 } 41 42 // NewProjectCollectionWithDefaults instantiates a new ProjectCollection object 43 // This constructor will only assign default values to properties that have it defined, 44 // but it doesn't guarantee that properties required by API are set 45 func NewProjectCollectionWithDefaults() *ProjectCollection { 46 this := ProjectCollection{} 47 return &this 48 } 49 50 // GetId returns the Id field value if set, zero value otherwise. 51 func (o *ProjectCollection) GetId() string { 52 if o == nil || IsNil(o.Id) { 53 var ret string 54 return ret 55 } 56 return *o.Id 57 } 58 59 // GetIdOk returns a tuple with the Id field value if set, nil otherwise 60 // and a boolean to check if the value has been set. 61 func (o *ProjectCollection) GetIdOk() (*string, bool) { 62 if o == nil || IsNil(o.Id) { 63 return nil, false 64 } 65 return o.Id, true 66 } 67 68 // HasId returns a boolean if a field has been set. 69 func (o *ProjectCollection) HasId() bool { 70 if o != nil && !IsNil(o.Id) { 71 return true 72 } 73 74 return false 75 } 76 77 // SetId gets a reference to the given string and assigns it to the Id field. 78 func (o *ProjectCollection) SetId(v string) { 79 o.Id = &v 80 } 81 82 // GetName returns the Name field value if set, zero value otherwise. 83 func (o *ProjectCollection) GetName() string { 84 if o == nil || IsNil(o.Name) { 85 var ret string 86 return ret 87 } 88 return *o.Name 89 } 90 91 // GetNameOk returns a tuple with the Name field value if set, nil otherwise 92 // and a boolean to check if the value has been set. 93 func (o *ProjectCollection) GetNameOk() (*string, bool) { 94 if o == nil || IsNil(o.Name) { 95 return nil, false 96 } 97 return o.Name, true 98 } 99 100 // HasName returns a boolean if a field has been set. 101 func (o *ProjectCollection) HasName() bool { 102 if o != nil && !IsNil(o.Name) { 103 return true 104 } 105 106 return false 107 } 108 109 // SetName gets a reference to the given string and assigns it to the Name field. 110 func (o *ProjectCollection) SetName(v string) { 111 o.Name = &v 112 } 113 114 // GetTotalEnvironments returns the TotalEnvironments field value if set, zero value otherwise. 115 func (o *ProjectCollection) GetTotalEnvironments() int32 { 116 if o == nil || IsNil(o.TotalEnvironments) { 117 var ret int32 118 return ret 119 } 120 return *o.TotalEnvironments 121 } 122 123 // GetTotalEnvironmentsOk returns a tuple with the TotalEnvironments field value if set, nil otherwise 124 // and a boolean to check if the value has been set. 125 func (o *ProjectCollection) GetTotalEnvironmentsOk() (*int32, bool) { 126 if o == nil || IsNil(o.TotalEnvironments) { 127 return nil, false 128 } 129 return o.TotalEnvironments, true 130 } 131 132 // HasTotalEnvironments returns a boolean if a field has been set. 133 func (o *ProjectCollection) HasTotalEnvironments() bool { 134 if o != nil && !IsNil(o.TotalEnvironments) { 135 return true 136 } 137 138 return false 139 } 140 141 // SetTotalEnvironments gets a reference to the given int32 and assigns it to the TotalEnvironments field. 142 func (o *ProjectCollection) SetTotalEnvironments(v int32) { 143 o.TotalEnvironments = &v 144 } 145 146 // GetOrganization returns the Organization field value if set, zero value otherwise. 147 func (o *ProjectCollection) GetOrganization() string { 148 if o == nil || IsNil(o.Organization) { 149 var ret string 150 return ret 151 } 152 return *o.Organization 153 } 154 155 // GetOrganizationOk returns a tuple with the Organization field value if set, nil otherwise 156 // and a boolean to check if the value has been set. 157 func (o *ProjectCollection) GetOrganizationOk() (*string, bool) { 158 if o == nil || IsNil(o.Organization) { 159 return nil, false 160 } 161 return o.Organization, true 162 } 163 164 // HasOrganization returns a boolean if a field has been set. 165 func (o *ProjectCollection) HasOrganization() bool { 166 if o != nil && !IsNil(o.Organization) { 167 return true 168 } 169 170 return false 171 } 172 173 // SetOrganization gets a reference to the given string and assigns it to the Organization field. 174 func (o *ProjectCollection) SetOrganization(v string) { 175 o.Organization = &v 176 } 177 178 func (o ProjectCollection) MarshalJSON() ([]byte, error) { 179 toSerialize, err := o.ToMap() 180 if err != nil { 181 return []byte{}, err 182 } 183 return json.Marshal(toSerialize) 184 } 185 186 func (o ProjectCollection) ToMap() (map[string]interface{}, error) { 187 toSerialize := map[string]interface{}{} 188 if !IsNil(o.Id) { 189 toSerialize["id"] = o.Id 190 } 191 if !IsNil(o.Name) { 192 toSerialize["name"] = o.Name 193 } 194 if !IsNil(o.TotalEnvironments) { 195 toSerialize["totalEnvironments"] = o.TotalEnvironments 196 } 197 if !IsNil(o.Organization) { 198 toSerialize["organization"] = o.Organization 199 } 200 return toSerialize, nil 201 } 202 203 type NullableProjectCollection struct { 204 value *ProjectCollection 205 isSet bool 206 } 207 208 func (v NullableProjectCollection) Get() *ProjectCollection { 209 return v.value 210 } 211 212 func (v *NullableProjectCollection) Set(val *ProjectCollection) { 213 v.value = val 214 v.isSet = true 215 } 216 217 func (v NullableProjectCollection) IsSet() bool { 218 return v.isSet 219 } 220 221 func (v *NullableProjectCollection) Unset() { 222 v.value = nil 223 v.isSet = false 224 } 225 226 func NewNullableProjectCollection(val *ProjectCollection) *NullableProjectCollection { 227 return &NullableProjectCollection{value: val, isSet: true} 228 } 229 230 func (v NullableProjectCollection) MarshalJSON() ([]byte, error) { 231 return json.Marshal(v.value) 232 } 233 234 func (v *NullableProjectCollection) UnmarshalJSON(src []byte) error { 235 v.isSet = true 236 return json.Unmarshal(src, &v.value) 237 }