bunnyshell.com/sdk@v0.16.0/model_pipeline_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 PipelineItem type satisfies the MappedNullable interface at compile time 19 var _ MappedNullable = &PipelineItem{} 20 21 // PipelineItem A pipeline. 22 type PipelineItem struct { 23 // Pipeline identifier. 24 Id *string `json:"id,omitempty"` 25 // Pipeline description. 26 Description *string `json:"description,omitempty"` 27 // Pipeline status. 28 Status *string `json:"status,omitempty"` 29 // Stage identifier. 30 Stages []StageItem `json:"stages,omitempty"` 31 // Environment identifier. 32 Environment NullableString `json:"environment,omitempty"` 33 // Event identifier. 34 Event *string `json:"event,omitempty"` 35 // Pipeline web URL. 36 WebUrl *string `json:"webUrl,omitempty"` 37 // Organization identifier. 38 Organization *string `json:"organization,omitempty"` 39 } 40 41 // NewPipelineItem instantiates a new PipelineItem 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 NewPipelineItem() *PipelineItem { 46 this := PipelineItem{} 47 return &this 48 } 49 50 // NewPipelineItemWithDefaults instantiates a new PipelineItem 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 NewPipelineItemWithDefaults() *PipelineItem { 54 this := PipelineItem{} 55 return &this 56 } 57 58 // GetId returns the Id field value if set, zero value otherwise. 59 func (o *PipelineItem) 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 *PipelineItem) 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 *PipelineItem) 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 *PipelineItem) SetId(v string) { 87 o.Id = &v 88 } 89 90 // GetDescription returns the Description field value if set, zero value otherwise. 91 func (o *PipelineItem) GetDescription() string { 92 if o == nil || IsNil(o.Description) { 93 var ret string 94 return ret 95 } 96 return *o.Description 97 } 98 99 // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise 100 // and a boolean to check if the value has been set. 101 func (o *PipelineItem) GetDescriptionOk() (*string, bool) { 102 if o == nil || IsNil(o.Description) { 103 return nil, false 104 } 105 return o.Description, true 106 } 107 108 // HasDescription returns a boolean if a field has been set. 109 func (o *PipelineItem) HasDescription() bool { 110 if o != nil && !IsNil(o.Description) { 111 return true 112 } 113 114 return false 115 } 116 117 // SetDescription gets a reference to the given string and assigns it to the Description field. 118 func (o *PipelineItem) SetDescription(v string) { 119 o.Description = &v 120 } 121 122 // GetStatus returns the Status field value if set, zero value otherwise. 123 func (o *PipelineItem) GetStatus() string { 124 if o == nil || IsNil(o.Status) { 125 var ret string 126 return ret 127 } 128 return *o.Status 129 } 130 131 // GetStatusOk returns a tuple with the Status field value if set, nil otherwise 132 // and a boolean to check if the value has been set. 133 func (o *PipelineItem) GetStatusOk() (*string, bool) { 134 if o == nil || IsNil(o.Status) { 135 return nil, false 136 } 137 return o.Status, true 138 } 139 140 // HasStatus returns a boolean if a field has been set. 141 func (o *PipelineItem) HasStatus() bool { 142 if o != nil && !IsNil(o.Status) { 143 return true 144 } 145 146 return false 147 } 148 149 // SetStatus gets a reference to the given string and assigns it to the Status field. 150 func (o *PipelineItem) SetStatus(v string) { 151 o.Status = &v 152 } 153 154 // GetStages returns the Stages field value if set, zero value otherwise. 155 func (o *PipelineItem) GetStages() []StageItem { 156 if o == nil || IsNil(o.Stages) { 157 var ret []StageItem 158 return ret 159 } 160 return o.Stages 161 } 162 163 // GetStagesOk returns a tuple with the Stages field value if set, nil otherwise 164 // and a boolean to check if the value has been set. 165 func (o *PipelineItem) GetStagesOk() ([]StageItem, bool) { 166 if o == nil || IsNil(o.Stages) { 167 return nil, false 168 } 169 return o.Stages, true 170 } 171 172 // HasStages returns a boolean if a field has been set. 173 func (o *PipelineItem) HasStages() bool { 174 if o != nil && !IsNil(o.Stages) { 175 return true 176 } 177 178 return false 179 } 180 181 // SetStages gets a reference to the given []StageItem and assigns it to the Stages field. 182 func (o *PipelineItem) SetStages(v []StageItem) { 183 o.Stages = v 184 } 185 186 // GetEnvironment returns the Environment field value if set, zero value otherwise (both if not set or set to explicit null). 187 func (o *PipelineItem) GetEnvironment() string { 188 if o == nil || IsNil(o.Environment.Get()) { 189 var ret string 190 return ret 191 } 192 return *o.Environment.Get() 193 } 194 195 // GetEnvironmentOk returns a tuple with the Environment 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 *PipelineItem) GetEnvironmentOk() (*string, bool) { 199 if o == nil { 200 return nil, false 201 } 202 return o.Environment.Get(), o.Environment.IsSet() 203 } 204 205 // HasEnvironment returns a boolean if a field has been set. 206 func (o *PipelineItem) HasEnvironment() bool { 207 if o != nil && o.Environment.IsSet() { 208 return true 209 } 210 211 return false 212 } 213 214 // SetEnvironment gets a reference to the given NullableString and assigns it to the Environment field. 215 func (o *PipelineItem) SetEnvironment(v string) { 216 o.Environment.Set(&v) 217 } 218 219 // SetEnvironmentNil sets the value for Environment to be an explicit nil 220 func (o *PipelineItem) SetEnvironmentNil() { 221 o.Environment.Set(nil) 222 } 223 224 // UnsetEnvironment ensures that no value is present for Environment, not even an explicit nil 225 func (o *PipelineItem) UnsetEnvironment() { 226 o.Environment.Unset() 227 } 228 229 // GetEvent returns the Event field value if set, zero value otherwise. 230 func (o *PipelineItem) GetEvent() string { 231 if o == nil || IsNil(o.Event) { 232 var ret string 233 return ret 234 } 235 return *o.Event 236 } 237 238 // GetEventOk returns a tuple with the Event field value if set, nil otherwise 239 // and a boolean to check if the value has been set. 240 func (o *PipelineItem) GetEventOk() (*string, bool) { 241 if o == nil || IsNil(o.Event) { 242 return nil, false 243 } 244 return o.Event, true 245 } 246 247 // HasEvent returns a boolean if a field has been set. 248 func (o *PipelineItem) HasEvent() bool { 249 if o != nil && !IsNil(o.Event) { 250 return true 251 } 252 253 return false 254 } 255 256 // SetEvent gets a reference to the given string and assigns it to the Event field. 257 func (o *PipelineItem) SetEvent(v string) { 258 o.Event = &v 259 } 260 261 // GetWebUrl returns the WebUrl field value if set, zero value otherwise. 262 func (o *PipelineItem) GetWebUrl() string { 263 if o == nil || IsNil(o.WebUrl) { 264 var ret string 265 return ret 266 } 267 return *o.WebUrl 268 } 269 270 // GetWebUrlOk returns a tuple with the WebUrl field value if set, nil otherwise 271 // and a boolean to check if the value has been set. 272 func (o *PipelineItem) GetWebUrlOk() (*string, bool) { 273 if o == nil || IsNil(o.WebUrl) { 274 return nil, false 275 } 276 return o.WebUrl, true 277 } 278 279 // HasWebUrl returns a boolean if a field has been set. 280 func (o *PipelineItem) HasWebUrl() bool { 281 if o != nil && !IsNil(o.WebUrl) { 282 return true 283 } 284 285 return false 286 } 287 288 // SetWebUrl gets a reference to the given string and assigns it to the WebUrl field. 289 func (o *PipelineItem) SetWebUrl(v string) { 290 o.WebUrl = &v 291 } 292 293 // GetOrganization returns the Organization field value if set, zero value otherwise. 294 func (o *PipelineItem) GetOrganization() string { 295 if o == nil || IsNil(o.Organization) { 296 var ret string 297 return ret 298 } 299 return *o.Organization 300 } 301 302 // GetOrganizationOk returns a tuple with the Organization field value if set, nil otherwise 303 // and a boolean to check if the value has been set. 304 func (o *PipelineItem) GetOrganizationOk() (*string, bool) { 305 if o == nil || IsNil(o.Organization) { 306 return nil, false 307 } 308 return o.Organization, true 309 } 310 311 // HasOrganization returns a boolean if a field has been set. 312 func (o *PipelineItem) HasOrganization() bool { 313 if o != nil && !IsNil(o.Organization) { 314 return true 315 } 316 317 return false 318 } 319 320 // SetOrganization gets a reference to the given string and assigns it to the Organization field. 321 func (o *PipelineItem) SetOrganization(v string) { 322 o.Organization = &v 323 } 324 325 func (o PipelineItem) MarshalJSON() ([]byte, error) { 326 toSerialize, err := o.ToMap() 327 if err != nil { 328 return []byte{}, err 329 } 330 return json.Marshal(toSerialize) 331 } 332 333 func (o PipelineItem) ToMap() (map[string]interface{}, error) { 334 toSerialize := map[string]interface{}{} 335 if !IsNil(o.Id) { 336 toSerialize["id"] = o.Id 337 } 338 if !IsNil(o.Description) { 339 toSerialize["description"] = o.Description 340 } 341 if !IsNil(o.Status) { 342 toSerialize["status"] = o.Status 343 } 344 if !IsNil(o.Stages) { 345 toSerialize["stages"] = o.Stages 346 } 347 if o.Environment.IsSet() { 348 toSerialize["environment"] = o.Environment.Get() 349 } 350 if !IsNil(o.Event) { 351 toSerialize["event"] = o.Event 352 } 353 if !IsNil(o.WebUrl) { 354 toSerialize["webUrl"] = o.WebUrl 355 } 356 if !IsNil(o.Organization) { 357 toSerialize["organization"] = o.Organization 358 } 359 return toSerialize, nil 360 } 361 362 type NullablePipelineItem struct { 363 value *PipelineItem 364 isSet bool 365 } 366 367 func (v NullablePipelineItem) Get() *PipelineItem { 368 return v.value 369 } 370 371 func (v *NullablePipelineItem) Set(val *PipelineItem) { 372 v.value = val 373 v.isSet = true 374 } 375 376 func (v NullablePipelineItem) IsSet() bool { 377 return v.isSet 378 } 379 380 func (v *NullablePipelineItem) Unset() { 381 v.value = nil 382 v.isSet = false 383 } 384 385 func NewNullablePipelineItem(val *PipelineItem) *NullablePipelineItem { 386 return &NullablePipelineItem{value: val, isSet: true} 387 } 388 389 func (v NullablePipelineItem) MarshalJSON() ([]byte, error) { 390 return json.Marshal(v.value) 391 } 392 393 func (v *NullablePipelineItem) UnmarshalJSON(src []byte) error { 394 v.isSet = true 395 return json.Unmarshal(src, &v.value) 396 }