bunnyshell.com/sdk@v0.16.0/model_component_git_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 ComponentGitItem type satisfies the MappedNullable interface at compile time 19 var _ MappedNullable = &ComponentGitItem{} 20 21 // ComponentGitItem Git info 22 type ComponentGitItem struct { 23 // Service component identifier 24 Id *string `json:"id,omitempty"` 25 // Service component name 26 Name *string `json:"name,omitempty"` 27 // Git repository 28 Repository *string `json:"repository,omitempty"` 29 // Git ref name 30 RefName *string `json:"refName,omitempty"` 31 // Git application path 32 Path NullableString `json:"path,omitempty"` 33 // Git ref sha 34 RefSha NullableString `json:"refSha,omitempty"` 35 // Git deployed sha 36 DeployedSha NullableString `json:"deployedSha,omitempty"` 37 // Environment identifier. 38 Environment *string `json:"environment,omitempty"` 39 } 40 41 // NewComponentGitItem instantiates a new ComponentGitItem 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 NewComponentGitItem() *ComponentGitItem { 46 this := ComponentGitItem{} 47 return &this 48 } 49 50 // NewComponentGitItemWithDefaults instantiates a new ComponentGitItem 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 NewComponentGitItemWithDefaults() *ComponentGitItem { 54 this := ComponentGitItem{} 55 return &this 56 } 57 58 // GetId returns the Id field value if set, zero value otherwise. 59 func (o *ComponentGitItem) 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 *ComponentGitItem) 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 *ComponentGitItem) 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 *ComponentGitItem) SetId(v string) { 87 o.Id = &v 88 } 89 90 // GetName returns the Name field value if set, zero value otherwise. 91 func (o *ComponentGitItem) 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 *ComponentGitItem) 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 *ComponentGitItem) 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 *ComponentGitItem) SetName(v string) { 119 o.Name = &v 120 } 121 122 // GetRepository returns the Repository field value if set, zero value otherwise. 123 func (o *ComponentGitItem) GetRepository() string { 124 if o == nil || IsNil(o.Repository) { 125 var ret string 126 return ret 127 } 128 return *o.Repository 129 } 130 131 // GetRepositoryOk returns a tuple with the Repository field value if set, nil otherwise 132 // and a boolean to check if the value has been set. 133 func (o *ComponentGitItem) GetRepositoryOk() (*string, bool) { 134 if o == nil || IsNil(o.Repository) { 135 return nil, false 136 } 137 return o.Repository, true 138 } 139 140 // HasRepository returns a boolean if a field has been set. 141 func (o *ComponentGitItem) HasRepository() bool { 142 if o != nil && !IsNil(o.Repository) { 143 return true 144 } 145 146 return false 147 } 148 149 // SetRepository gets a reference to the given string and assigns it to the Repository field. 150 func (o *ComponentGitItem) SetRepository(v string) { 151 o.Repository = &v 152 } 153 154 // GetRefName returns the RefName field value if set, zero value otherwise. 155 func (o *ComponentGitItem) GetRefName() string { 156 if o == nil || IsNil(o.RefName) { 157 var ret string 158 return ret 159 } 160 return *o.RefName 161 } 162 163 // GetRefNameOk returns a tuple with the RefName field value if set, nil otherwise 164 // and a boolean to check if the value has been set. 165 func (o *ComponentGitItem) GetRefNameOk() (*string, bool) { 166 if o == nil || IsNil(o.RefName) { 167 return nil, false 168 } 169 return o.RefName, true 170 } 171 172 // HasRefName returns a boolean if a field has been set. 173 func (o *ComponentGitItem) HasRefName() bool { 174 if o != nil && !IsNil(o.RefName) { 175 return true 176 } 177 178 return false 179 } 180 181 // SetRefName gets a reference to the given string and assigns it to the RefName field. 182 func (o *ComponentGitItem) SetRefName(v string) { 183 o.RefName = &v 184 } 185 186 // GetPath returns the Path field value if set, zero value otherwise (both if not set or set to explicit null). 187 func (o *ComponentGitItem) GetPath() string { 188 if o == nil || IsNil(o.Path.Get()) { 189 var ret string 190 return ret 191 } 192 return *o.Path.Get() 193 } 194 195 // GetPathOk returns a tuple with the Path field value if set, nil otherwise 196 // and a boolean to check if the value has been set. 197 // NOTE: If the value is an explicit nil, `nil, true` will be returned 198 func (o *ComponentGitItem) GetPathOk() (*string, bool) { 199 if o == nil { 200 return nil, false 201 } 202 return o.Path.Get(), o.Path.IsSet() 203 } 204 205 // HasPath returns a boolean if a field has been set. 206 func (o *ComponentGitItem) HasPath() bool { 207 if o != nil && o.Path.IsSet() { 208 return true 209 } 210 211 return false 212 } 213 214 // SetPath gets a reference to the given NullableString and assigns it to the Path field. 215 func (o *ComponentGitItem) SetPath(v string) { 216 o.Path.Set(&v) 217 } 218 219 // SetPathNil sets the value for Path to be an explicit nil 220 func (o *ComponentGitItem) SetPathNil() { 221 o.Path.Set(nil) 222 } 223 224 // UnsetPath ensures that no value is present for Path, not even an explicit nil 225 func (o *ComponentGitItem) UnsetPath() { 226 o.Path.Unset() 227 } 228 229 // GetRefSha returns the RefSha field value if set, zero value otherwise (both if not set or set to explicit null). 230 func (o *ComponentGitItem) GetRefSha() string { 231 if o == nil || IsNil(o.RefSha.Get()) { 232 var ret string 233 return ret 234 } 235 return *o.RefSha.Get() 236 } 237 238 // GetRefShaOk returns a tuple with the RefSha field value if set, nil otherwise 239 // and a boolean to check if the value has been set. 240 // NOTE: If the value is an explicit nil, `nil, true` will be returned 241 func (o *ComponentGitItem) GetRefShaOk() (*string, bool) { 242 if o == nil { 243 return nil, false 244 } 245 return o.RefSha.Get(), o.RefSha.IsSet() 246 } 247 248 // HasRefSha returns a boolean if a field has been set. 249 func (o *ComponentGitItem) HasRefSha() bool { 250 if o != nil && o.RefSha.IsSet() { 251 return true 252 } 253 254 return false 255 } 256 257 // SetRefSha gets a reference to the given NullableString and assigns it to the RefSha field. 258 func (o *ComponentGitItem) SetRefSha(v string) { 259 o.RefSha.Set(&v) 260 } 261 262 // SetRefShaNil sets the value for RefSha to be an explicit nil 263 func (o *ComponentGitItem) SetRefShaNil() { 264 o.RefSha.Set(nil) 265 } 266 267 // UnsetRefSha ensures that no value is present for RefSha, not even an explicit nil 268 func (o *ComponentGitItem) UnsetRefSha() { 269 o.RefSha.Unset() 270 } 271 272 // GetDeployedSha returns the DeployedSha field value if set, zero value otherwise (both if not set or set to explicit null). 273 func (o *ComponentGitItem) GetDeployedSha() string { 274 if o == nil || IsNil(o.DeployedSha.Get()) { 275 var ret string 276 return ret 277 } 278 return *o.DeployedSha.Get() 279 } 280 281 // GetDeployedShaOk returns a tuple with the DeployedSha field value if set, nil otherwise 282 // and a boolean to check if the value has been set. 283 // NOTE: If the value is an explicit nil, `nil, true` will be returned 284 func (o *ComponentGitItem) GetDeployedShaOk() (*string, bool) { 285 if o == nil { 286 return nil, false 287 } 288 return o.DeployedSha.Get(), o.DeployedSha.IsSet() 289 } 290 291 // HasDeployedSha returns a boolean if a field has been set. 292 func (o *ComponentGitItem) HasDeployedSha() bool { 293 if o != nil && o.DeployedSha.IsSet() { 294 return true 295 } 296 297 return false 298 } 299 300 // SetDeployedSha gets a reference to the given NullableString and assigns it to the DeployedSha field. 301 func (o *ComponentGitItem) SetDeployedSha(v string) { 302 o.DeployedSha.Set(&v) 303 } 304 305 // SetDeployedShaNil sets the value for DeployedSha to be an explicit nil 306 func (o *ComponentGitItem) SetDeployedShaNil() { 307 o.DeployedSha.Set(nil) 308 } 309 310 // UnsetDeployedSha ensures that no value is present for DeployedSha, not even an explicit nil 311 func (o *ComponentGitItem) UnsetDeployedSha() { 312 o.DeployedSha.Unset() 313 } 314 315 // GetEnvironment returns the Environment field value if set, zero value otherwise. 316 func (o *ComponentGitItem) GetEnvironment() string { 317 if o == nil || IsNil(o.Environment) { 318 var ret string 319 return ret 320 } 321 return *o.Environment 322 } 323 324 // GetEnvironmentOk returns a tuple with the Environment field value if set, nil otherwise 325 // and a boolean to check if the value has been set. 326 func (o *ComponentGitItem) GetEnvironmentOk() (*string, bool) { 327 if o == nil || IsNil(o.Environment) { 328 return nil, false 329 } 330 return o.Environment, true 331 } 332 333 // HasEnvironment returns a boolean if a field has been set. 334 func (o *ComponentGitItem) HasEnvironment() bool { 335 if o != nil && !IsNil(o.Environment) { 336 return true 337 } 338 339 return false 340 } 341 342 // SetEnvironment gets a reference to the given string and assigns it to the Environment field. 343 func (o *ComponentGitItem) SetEnvironment(v string) { 344 o.Environment = &v 345 } 346 347 func (o ComponentGitItem) MarshalJSON() ([]byte, error) { 348 toSerialize, err := o.ToMap() 349 if err != nil { 350 return []byte{}, err 351 } 352 return json.Marshal(toSerialize) 353 } 354 355 func (o ComponentGitItem) ToMap() (map[string]interface{}, error) { 356 toSerialize := map[string]interface{}{} 357 if !IsNil(o.Id) { 358 toSerialize["id"] = o.Id 359 } 360 if !IsNil(o.Name) { 361 toSerialize["name"] = o.Name 362 } 363 if !IsNil(o.Repository) { 364 toSerialize["repository"] = o.Repository 365 } 366 if !IsNil(o.RefName) { 367 toSerialize["refName"] = o.RefName 368 } 369 if o.Path.IsSet() { 370 toSerialize["path"] = o.Path.Get() 371 } 372 if o.RefSha.IsSet() { 373 toSerialize["refSha"] = o.RefSha.Get() 374 } 375 if o.DeployedSha.IsSet() { 376 toSerialize["deployedSha"] = o.DeployedSha.Get() 377 } 378 if !IsNil(o.Environment) { 379 toSerialize["environment"] = o.Environment 380 } 381 return toSerialize, nil 382 } 383 384 type NullableComponentGitItem struct { 385 value *ComponentGitItem 386 isSet bool 387 } 388 389 func (v NullableComponentGitItem) Get() *ComponentGitItem { 390 return v.value 391 } 392 393 func (v *NullableComponentGitItem) Set(val *ComponentGitItem) { 394 v.value = val 395 v.isSet = true 396 } 397 398 func (v NullableComponentGitItem) IsSet() bool { 399 return v.isSet 400 } 401 402 func (v *NullableComponentGitItem) Unset() { 403 v.value = nil 404 v.isSet = false 405 } 406 407 func NewNullableComponentGitItem(val *ComponentGitItem) *NullableComponentGitItem { 408 return &NullableComponentGitItem{value: val, isSet: true} 409 } 410 411 func (v NullableComponentGitItem) MarshalJSON() ([]byte, error) { 412 return json.Marshal(v.value) 413 } 414 415 func (v *NullableComponentGitItem) UnmarshalJSON(src []byte) error { 416 v.isSet = true 417 return json.Unmarshal(src, &v.value) 418 }