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