bunnyshell.com/sdk@v0.16.0/model_component_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 ComponentItem type satisfies the MappedNullable interface at compile time 19 var _ MappedNullable = &ComponentItem{} 20 21 // ComponentItem A service component represents either an application or a group of applications as a single unit 22 type ComponentItem struct { 23 // Service component identifier 24 Id *string `json:"id,omitempty"` 25 // Service component name 26 Name *string `json:"name,omitempty"` 27 // Service component cluster status 28 ClusterStatus *string `json:"clusterStatus,omitempty"` 29 // Service component operation status 30 OperationStatus *string `json:"operationStatus,omitempty"` 31 // Service component URLs 32 PublicURLs []string `json:"publicURLs,omitempty"` 33 // Environment identifier. 34 Environment *string `json:"environment,omitempty"` 35 } 36 37 // NewComponentItem instantiates a new ComponentItem 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 NewComponentItem() *ComponentItem { 42 this := ComponentItem{} 43 return &this 44 } 45 46 // NewComponentItemWithDefaults instantiates a new ComponentItem 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 NewComponentItemWithDefaults() *ComponentItem { 50 this := ComponentItem{} 51 return &this 52 } 53 54 // GetId returns the Id field value if set, zero value otherwise. 55 func (o *ComponentItem) 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 *ComponentItem) 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 *ComponentItem) 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 *ComponentItem) SetId(v string) { 83 o.Id = &v 84 } 85 86 // GetName returns the Name field value if set, zero value otherwise. 87 func (o *ComponentItem) 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 *ComponentItem) 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 *ComponentItem) 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 *ComponentItem) SetName(v string) { 115 o.Name = &v 116 } 117 118 // GetClusterStatus returns the ClusterStatus field value if set, zero value otherwise. 119 func (o *ComponentItem) GetClusterStatus() string { 120 if o == nil || IsNil(o.ClusterStatus) { 121 var ret string 122 return ret 123 } 124 return *o.ClusterStatus 125 } 126 127 // GetClusterStatusOk returns a tuple with the ClusterStatus field value if set, nil otherwise 128 // and a boolean to check if the value has been set. 129 func (o *ComponentItem) GetClusterStatusOk() (*string, bool) { 130 if o == nil || IsNil(o.ClusterStatus) { 131 return nil, false 132 } 133 return o.ClusterStatus, true 134 } 135 136 // HasClusterStatus returns a boolean if a field has been set. 137 func (o *ComponentItem) HasClusterStatus() bool { 138 if o != nil && !IsNil(o.ClusterStatus) { 139 return true 140 } 141 142 return false 143 } 144 145 // SetClusterStatus gets a reference to the given string and assigns it to the ClusterStatus field. 146 func (o *ComponentItem) SetClusterStatus(v string) { 147 o.ClusterStatus = &v 148 } 149 150 // GetOperationStatus returns the OperationStatus field value if set, zero value otherwise. 151 func (o *ComponentItem) GetOperationStatus() string { 152 if o == nil || IsNil(o.OperationStatus) { 153 var ret string 154 return ret 155 } 156 return *o.OperationStatus 157 } 158 159 // GetOperationStatusOk returns a tuple with the OperationStatus field value if set, nil otherwise 160 // and a boolean to check if the value has been set. 161 func (o *ComponentItem) GetOperationStatusOk() (*string, bool) { 162 if o == nil || IsNil(o.OperationStatus) { 163 return nil, false 164 } 165 return o.OperationStatus, true 166 } 167 168 // HasOperationStatus returns a boolean if a field has been set. 169 func (o *ComponentItem) HasOperationStatus() bool { 170 if o != nil && !IsNil(o.OperationStatus) { 171 return true 172 } 173 174 return false 175 } 176 177 // SetOperationStatus gets a reference to the given string and assigns it to the OperationStatus field. 178 func (o *ComponentItem) SetOperationStatus(v string) { 179 o.OperationStatus = &v 180 } 181 182 // GetPublicURLs returns the PublicURLs field value if set, zero value otherwise. 183 func (o *ComponentItem) GetPublicURLs() []string { 184 if o == nil || IsNil(o.PublicURLs) { 185 var ret []string 186 return ret 187 } 188 return o.PublicURLs 189 } 190 191 // GetPublicURLsOk returns a tuple with the PublicURLs field value if set, nil otherwise 192 // and a boolean to check if the value has been set. 193 func (o *ComponentItem) GetPublicURLsOk() ([]string, bool) { 194 if o == nil || IsNil(o.PublicURLs) { 195 return nil, false 196 } 197 return o.PublicURLs, true 198 } 199 200 // HasPublicURLs returns a boolean if a field has been set. 201 func (o *ComponentItem) HasPublicURLs() bool { 202 if o != nil && !IsNil(o.PublicURLs) { 203 return true 204 } 205 206 return false 207 } 208 209 // SetPublicURLs gets a reference to the given []string and assigns it to the PublicURLs field. 210 func (o *ComponentItem) SetPublicURLs(v []string) { 211 o.PublicURLs = v 212 } 213 214 // GetEnvironment returns the Environment field value if set, zero value otherwise. 215 func (o *ComponentItem) GetEnvironment() string { 216 if o == nil || IsNil(o.Environment) { 217 var ret string 218 return ret 219 } 220 return *o.Environment 221 } 222 223 // GetEnvironmentOk returns a tuple with the Environment field value if set, nil otherwise 224 // and a boolean to check if the value has been set. 225 func (o *ComponentItem) GetEnvironmentOk() (*string, bool) { 226 if o == nil || IsNil(o.Environment) { 227 return nil, false 228 } 229 return o.Environment, true 230 } 231 232 // HasEnvironment returns a boolean if a field has been set. 233 func (o *ComponentItem) HasEnvironment() bool { 234 if o != nil && !IsNil(o.Environment) { 235 return true 236 } 237 238 return false 239 } 240 241 // SetEnvironment gets a reference to the given string and assigns it to the Environment field. 242 func (o *ComponentItem) SetEnvironment(v string) { 243 o.Environment = &v 244 } 245 246 func (o ComponentItem) MarshalJSON() ([]byte, error) { 247 toSerialize, err := o.ToMap() 248 if err != nil { 249 return []byte{}, err 250 } 251 return json.Marshal(toSerialize) 252 } 253 254 func (o ComponentItem) ToMap() (map[string]interface{}, error) { 255 toSerialize := map[string]interface{}{} 256 if !IsNil(o.Id) { 257 toSerialize["id"] = o.Id 258 } 259 if !IsNil(o.Name) { 260 toSerialize["name"] = o.Name 261 } 262 if !IsNil(o.ClusterStatus) { 263 toSerialize["clusterStatus"] = o.ClusterStatus 264 } 265 if !IsNil(o.OperationStatus) { 266 toSerialize["operationStatus"] = o.OperationStatus 267 } 268 if !IsNil(o.PublicURLs) { 269 toSerialize["publicURLs"] = o.PublicURLs 270 } 271 if !IsNil(o.Environment) { 272 toSerialize["environment"] = o.Environment 273 } 274 return toSerialize, nil 275 } 276 277 type NullableComponentItem struct { 278 value *ComponentItem 279 isSet bool 280 } 281 282 func (v NullableComponentItem) Get() *ComponentItem { 283 return v.value 284 } 285 286 func (v *NullableComponentItem) Set(val *ComponentItem) { 287 v.value = val 288 v.isSet = true 289 } 290 291 func (v NullableComponentItem) IsSet() bool { 292 return v.isSet 293 } 294 295 func (v *NullableComponentItem) Unset() { 296 v.value = nil 297 v.isSet = false 298 } 299 300 func NewNullableComponentItem(val *ComponentItem) *NullableComponentItem { 301 return &NullableComponentItem{value: val, isSet: true} 302 } 303 304 func (v NullableComponentItem) MarshalJSON() ([]byte, error) { 305 return json.Marshal(v.value) 306 } 307 308 func (v *NullableComponentItem) UnmarshalJSON(src []byte) error { 309 v.isSet = true 310 return json.Unmarshal(src, &v.value) 311 }