github.com/optim-corp/cios-golang-sdk@v0.5.1/cios/model_life_cycle_request.go (about) 1 /* 2 * Cios Openapi 3 * 4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 5 * 6 * API version: 1.0.1 7 */ 8 9 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 10 11 package cios 12 13 import ( 14 "encoding/json" 15 ) 16 17 // LifeCycleRequest struct for LifeCycleRequest 18 type LifeCycleRequest struct { 19 EventKind string `json:"event_kind"` 20 EventMode string `json:"event_mode"` 21 EventType string `json:"event_type"` 22 BeforeId *string `json:"before_id,omitempty"` 23 BeforeComponent NullableDeviceEntitiesComponent `json:"before_component,omitempty"` 24 AfterId *string `json:"after_id,omitempty"` 25 AfterComponent NullableDeviceEntitiesComponent `json:"after_component,omitempty"` 26 // ナノ秒 27 EventAt string `json:"event_at"` 28 Note *string `json:"note,omitempty"` 29 ResourceOwnerId *string `json:"resource_owner_id,omitempty"` 30 } 31 32 // NewLifeCycleRequest instantiates a new LifeCycleRequest object 33 // This constructor will assign default values to properties that have it defined, 34 // and makes sure properties required by API are set, but the set of arguments 35 // will change when the set of required properties is changed 36 func NewLifeCycleRequest(eventKind string, eventMode string, eventType string, eventAt string, ) *LifeCycleRequest { 37 this := LifeCycleRequest{} 38 this.EventKind = eventKind 39 this.EventMode = eventMode 40 this.EventType = eventType 41 this.EventAt = eventAt 42 return &this 43 } 44 45 // NewLifeCycleRequestWithDefaults instantiates a new LifeCycleRequest object 46 // This constructor will only assign default values to properties that have it defined, 47 // but it doesn't guarantee that properties required by API are set 48 func NewLifeCycleRequestWithDefaults() *LifeCycleRequest { 49 this := LifeCycleRequest{} 50 return &this 51 } 52 53 // GetEventKind returns the EventKind field value 54 func (o *LifeCycleRequest) GetEventKind() string { 55 if o == nil { 56 var ret string 57 return ret 58 } 59 60 return o.EventKind 61 } 62 63 // GetEventKindOk returns a tuple with the EventKind field value 64 // and a boolean to check if the value has been set. 65 func (o *LifeCycleRequest) GetEventKindOk() (*string, bool) { 66 if o == nil { 67 return nil, false 68 } 69 return &o.EventKind, true 70 } 71 72 // SetEventKind sets field value 73 func (o *LifeCycleRequest) SetEventKind(v string) { 74 o.EventKind = v 75 } 76 77 // GetEventMode returns the EventMode field value 78 func (o *LifeCycleRequest) GetEventMode() string { 79 if o == nil { 80 var ret string 81 return ret 82 } 83 84 return o.EventMode 85 } 86 87 // GetEventModeOk returns a tuple with the EventMode field value 88 // and a boolean to check if the value has been set. 89 func (o *LifeCycleRequest) GetEventModeOk() (*string, bool) { 90 if o == nil { 91 return nil, false 92 } 93 return &o.EventMode, true 94 } 95 96 // SetEventMode sets field value 97 func (o *LifeCycleRequest) SetEventMode(v string) { 98 o.EventMode = v 99 } 100 101 // GetEventType returns the EventType field value 102 func (o *LifeCycleRequest) GetEventType() string { 103 if o == nil { 104 var ret string 105 return ret 106 } 107 108 return o.EventType 109 } 110 111 // GetEventTypeOk returns a tuple with the EventType field value 112 // and a boolean to check if the value has been set. 113 func (o *LifeCycleRequest) GetEventTypeOk() (*string, bool) { 114 if o == nil { 115 return nil, false 116 } 117 return &o.EventType, true 118 } 119 120 // SetEventType sets field value 121 func (o *LifeCycleRequest) SetEventType(v string) { 122 o.EventType = v 123 } 124 125 // GetBeforeId returns the BeforeId field value if set, zero value otherwise. 126 func (o *LifeCycleRequest) GetBeforeId() string { 127 if o == nil || o.BeforeId == nil { 128 var ret string 129 return ret 130 } 131 return *o.BeforeId 132 } 133 134 // GetBeforeIdOk returns a tuple with the BeforeId field value if set, nil otherwise 135 // and a boolean to check if the value has been set. 136 func (o *LifeCycleRequest) GetBeforeIdOk() (*string, bool) { 137 if o == nil || o.BeforeId == nil { 138 return nil, false 139 } 140 return o.BeforeId, true 141 } 142 143 // HasBeforeId returns a boolean if a field has been set. 144 func (o *LifeCycleRequest) HasBeforeId() bool { 145 if o != nil && o.BeforeId != nil { 146 return true 147 } 148 149 return false 150 } 151 152 // SetBeforeId gets a reference to the given string and assigns it to the BeforeId field. 153 func (o *LifeCycleRequest) SetBeforeId(v string) { 154 o.BeforeId = &v 155 } 156 157 // GetBeforeComponent returns the BeforeComponent field value if set, zero value otherwise (both if not set or set to explicit null). 158 func (o *LifeCycleRequest) GetBeforeComponent() DeviceEntitiesComponent { 159 if o == nil || o.BeforeComponent.Get() == nil { 160 var ret DeviceEntitiesComponent 161 return ret 162 } 163 return *o.BeforeComponent.Get() 164 } 165 166 // GetBeforeComponentOk returns a tuple with the BeforeComponent field value if set, nil otherwise 167 // and a boolean to check if the value has been set. 168 // NOTE: If the value is an explicit nil, `nil, true` will be returned 169 func (o *LifeCycleRequest) GetBeforeComponentOk() (*DeviceEntitiesComponent, bool) { 170 if o == nil { 171 return nil, false 172 } 173 return o.BeforeComponent.Get(), o.BeforeComponent.IsSet() 174 } 175 176 // HasBeforeComponent returns a boolean if a field has been set. 177 func (o *LifeCycleRequest) HasBeforeComponent() bool { 178 if o != nil && o.BeforeComponent.IsSet() { 179 return true 180 } 181 182 return false 183 } 184 185 // SetBeforeComponent gets a reference to the given NullableDeviceEntitiesComponent and assigns it to the BeforeComponent field. 186 func (o *LifeCycleRequest) SetBeforeComponent(v DeviceEntitiesComponent) { 187 o.BeforeComponent.Set(&v) 188 } 189 // SetBeforeComponentNil sets the value for BeforeComponent to be an explicit nil 190 func (o *LifeCycleRequest) SetBeforeComponentNil() { 191 o.BeforeComponent.Set(nil) 192 } 193 194 // UnsetBeforeComponent ensures that no value is present for BeforeComponent, not even an explicit nil 195 func (o *LifeCycleRequest) UnsetBeforeComponent() { 196 o.BeforeComponent.Unset() 197 } 198 199 // GetAfterId returns the AfterId field value if set, zero value otherwise. 200 func (o *LifeCycleRequest) GetAfterId() string { 201 if o == nil || o.AfterId == nil { 202 var ret string 203 return ret 204 } 205 return *o.AfterId 206 } 207 208 // GetAfterIdOk returns a tuple with the AfterId field value if set, nil otherwise 209 // and a boolean to check if the value has been set. 210 func (o *LifeCycleRequest) GetAfterIdOk() (*string, bool) { 211 if o == nil || o.AfterId == nil { 212 return nil, false 213 } 214 return o.AfterId, true 215 } 216 217 // HasAfterId returns a boolean if a field has been set. 218 func (o *LifeCycleRequest) HasAfterId() bool { 219 if o != nil && o.AfterId != nil { 220 return true 221 } 222 223 return false 224 } 225 226 // SetAfterId gets a reference to the given string and assigns it to the AfterId field. 227 func (o *LifeCycleRequest) SetAfterId(v string) { 228 o.AfterId = &v 229 } 230 231 // GetAfterComponent returns the AfterComponent field value if set, zero value otherwise (both if not set or set to explicit null). 232 func (o *LifeCycleRequest) GetAfterComponent() DeviceEntitiesComponent { 233 if o == nil || o.AfterComponent.Get() == nil { 234 var ret DeviceEntitiesComponent 235 return ret 236 } 237 return *o.AfterComponent.Get() 238 } 239 240 // GetAfterComponentOk returns a tuple with the AfterComponent field value if set, nil otherwise 241 // and a boolean to check if the value has been set. 242 // NOTE: If the value is an explicit nil, `nil, true` will be returned 243 func (o *LifeCycleRequest) GetAfterComponentOk() (*DeviceEntitiesComponent, bool) { 244 if o == nil { 245 return nil, false 246 } 247 return o.AfterComponent.Get(), o.AfterComponent.IsSet() 248 } 249 250 // HasAfterComponent returns a boolean if a field has been set. 251 func (o *LifeCycleRequest) HasAfterComponent() bool { 252 if o != nil && o.AfterComponent.IsSet() { 253 return true 254 } 255 256 return false 257 } 258 259 // SetAfterComponent gets a reference to the given NullableDeviceEntitiesComponent and assigns it to the AfterComponent field. 260 func (o *LifeCycleRequest) SetAfterComponent(v DeviceEntitiesComponent) { 261 o.AfterComponent.Set(&v) 262 } 263 // SetAfterComponentNil sets the value for AfterComponent to be an explicit nil 264 func (o *LifeCycleRequest) SetAfterComponentNil() { 265 o.AfterComponent.Set(nil) 266 } 267 268 // UnsetAfterComponent ensures that no value is present for AfterComponent, not even an explicit nil 269 func (o *LifeCycleRequest) UnsetAfterComponent() { 270 o.AfterComponent.Unset() 271 } 272 273 // GetEventAt returns the EventAt field value 274 func (o *LifeCycleRequest) GetEventAt() string { 275 if o == nil { 276 var ret string 277 return ret 278 } 279 280 return o.EventAt 281 } 282 283 // GetEventAtOk returns a tuple with the EventAt field value 284 // and a boolean to check if the value has been set. 285 func (o *LifeCycleRequest) GetEventAtOk() (*string, bool) { 286 if o == nil { 287 return nil, false 288 } 289 return &o.EventAt, true 290 } 291 292 // SetEventAt sets field value 293 func (o *LifeCycleRequest) SetEventAt(v string) { 294 o.EventAt = v 295 } 296 297 // GetNote returns the Note field value if set, zero value otherwise. 298 func (o *LifeCycleRequest) GetNote() string { 299 if o == nil || o.Note == nil { 300 var ret string 301 return ret 302 } 303 return *o.Note 304 } 305 306 // GetNoteOk returns a tuple with the Note field value if set, nil otherwise 307 // and a boolean to check if the value has been set. 308 func (o *LifeCycleRequest) GetNoteOk() (*string, bool) { 309 if o == nil || o.Note == nil { 310 return nil, false 311 } 312 return o.Note, true 313 } 314 315 // HasNote returns a boolean if a field has been set. 316 func (o *LifeCycleRequest) HasNote() bool { 317 if o != nil && o.Note != nil { 318 return true 319 } 320 321 return false 322 } 323 324 // SetNote gets a reference to the given string and assigns it to the Note field. 325 func (o *LifeCycleRequest) SetNote(v string) { 326 o.Note = &v 327 } 328 329 // GetResourceOwnerId returns the ResourceOwnerId field value if set, zero value otherwise. 330 func (o *LifeCycleRequest) GetResourceOwnerId() string { 331 if o == nil || o.ResourceOwnerId == nil { 332 var ret string 333 return ret 334 } 335 return *o.ResourceOwnerId 336 } 337 338 // GetResourceOwnerIdOk returns a tuple with the ResourceOwnerId field value if set, nil otherwise 339 // and a boolean to check if the value has been set. 340 func (o *LifeCycleRequest) GetResourceOwnerIdOk() (*string, bool) { 341 if o == nil || o.ResourceOwnerId == nil { 342 return nil, false 343 } 344 return o.ResourceOwnerId, true 345 } 346 347 // HasResourceOwnerId returns a boolean if a field has been set. 348 func (o *LifeCycleRequest) HasResourceOwnerId() bool { 349 if o != nil && o.ResourceOwnerId != nil { 350 return true 351 } 352 353 return false 354 } 355 356 // SetResourceOwnerId gets a reference to the given string and assigns it to the ResourceOwnerId field. 357 func (o *LifeCycleRequest) SetResourceOwnerId(v string) { 358 o.ResourceOwnerId = &v 359 } 360 361 func (o LifeCycleRequest) MarshalJSON() ([]byte, error) { 362 toSerialize := map[string]interface{}{} 363 if true { 364 toSerialize["event_kind"] = o.EventKind 365 } 366 if true { 367 toSerialize["event_mode"] = o.EventMode 368 } 369 if true { 370 toSerialize["event_type"] = o.EventType 371 } 372 if o.BeforeId != nil { 373 toSerialize["before_id"] = o.BeforeId 374 } 375 if o.BeforeComponent.IsSet() { 376 toSerialize["before_component"] = o.BeforeComponent.Get() 377 } 378 if o.AfterId != nil { 379 toSerialize["after_id"] = o.AfterId 380 } 381 if o.AfterComponent.IsSet() { 382 toSerialize["after_component"] = o.AfterComponent.Get() 383 } 384 if true { 385 toSerialize["event_at"] = o.EventAt 386 } 387 if o.Note != nil { 388 toSerialize["note"] = o.Note 389 } 390 if o.ResourceOwnerId != nil { 391 toSerialize["resource_owner_id"] = o.ResourceOwnerId 392 } 393 return json.Marshal(toSerialize) 394 } 395 396 type NullableLifeCycleRequest struct { 397 value *LifeCycleRequest 398 isSet bool 399 } 400 401 func (v NullableLifeCycleRequest) Get() *LifeCycleRequest { 402 return v.value 403 } 404 405 func (v *NullableLifeCycleRequest) Set(val *LifeCycleRequest) { 406 v.value = val 407 v.isSet = true 408 } 409 410 func (v NullableLifeCycleRequest) IsSet() bool { 411 return v.isSet 412 } 413 414 func (v *NullableLifeCycleRequest) Unset() { 415 v.value = nil 416 v.isSet = false 417 } 418 419 func NewNullableLifeCycleRequest(val *LifeCycleRequest) *NullableLifeCycleRequest { 420 return &NullableLifeCycleRequest{value: val, isSet: true} 421 } 422 423 func (v NullableLifeCycleRequest) MarshalJSON() ([]byte, error) { 424 return json.Marshal(v.value) 425 } 426 427 func (v *NullableLifeCycleRequest) UnmarshalJSON(src []byte) error { 428 v.isSet = true 429 return json.Unmarshal(src, &v.value) 430 } 431 432