bunnyshell.com/sdk@v0.16.0/model_event_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  	"time"
    17  )
    18  
    19  // checks if the EventItem type satisfies the MappedNullable interface at compile time
    20  var _ MappedNullable = &EventItem{}
    21  
    22  // EventItem An event represents an operation on an environment, integration or settings
    23  type EventItem struct {
    24  	// Event identifier.
    25  	Id *string `json:"id,omitempty"`
    26  	// Event type.
    27  	Type *string `json:"type,omitempty"`
    28  	// Event operation status.
    29  	Status *string `json:"status,omitempty"`
    30  	// Environment identifier.
    31  	Environment NullableString `json:"environment,omitempty"`
    32  	// Organization identifier.
    33  	Organization *string `json:"organization,omitempty"`
    34  	// Event creation time.
    35  	CreatedAt *time.Time `json:"createdAt,omitempty"`
    36  	// Event last update time.
    37  	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
    38  	// Event identifier.
    39  	Delegated NullableString `json:"delegated,omitempty"`
    40  }
    41  
    42  // NewEventItem instantiates a new EventItem object
    43  // This constructor will assign default values to properties that have it defined,
    44  // and makes sure properties required by API are set, but the set of arguments
    45  // will change when the set of required properties is changed
    46  func NewEventItem() *EventItem {
    47  	this := EventItem{}
    48  	return &this
    49  }
    50  
    51  // NewEventItemWithDefaults instantiates a new EventItem object
    52  // This constructor will only assign default values to properties that have it defined,
    53  // but it doesn't guarantee that properties required by API are set
    54  func NewEventItemWithDefaults() *EventItem {
    55  	this := EventItem{}
    56  	return &this
    57  }
    58  
    59  // GetId returns the Id field value if set, zero value otherwise.
    60  func (o *EventItem) GetId() string {
    61  	if o == nil || IsNil(o.Id) {
    62  		var ret string
    63  		return ret
    64  	}
    65  	return *o.Id
    66  }
    67  
    68  // GetIdOk returns a tuple with the Id field value if set, nil otherwise
    69  // and a boolean to check if the value has been set.
    70  func (o *EventItem) GetIdOk() (*string, bool) {
    71  	if o == nil || IsNil(o.Id) {
    72  		return nil, false
    73  	}
    74  	return o.Id, true
    75  }
    76  
    77  // HasId returns a boolean if a field has been set.
    78  func (o *EventItem) HasId() bool {
    79  	if o != nil && !IsNil(o.Id) {
    80  		return true
    81  	}
    82  
    83  	return false
    84  }
    85  
    86  // SetId gets a reference to the given string and assigns it to the Id field.
    87  func (o *EventItem) SetId(v string) {
    88  	o.Id = &v
    89  }
    90  
    91  // GetType returns the Type field value if set, zero value otherwise.
    92  func (o *EventItem) GetType() string {
    93  	if o == nil || IsNil(o.Type) {
    94  		var ret string
    95  		return ret
    96  	}
    97  	return *o.Type
    98  }
    99  
   100  // GetTypeOk returns a tuple with the Type field value if set, nil otherwise
   101  // and a boolean to check if the value has been set.
   102  func (o *EventItem) GetTypeOk() (*string, bool) {
   103  	if o == nil || IsNil(o.Type) {
   104  		return nil, false
   105  	}
   106  	return o.Type, true
   107  }
   108  
   109  // HasType returns a boolean if a field has been set.
   110  func (o *EventItem) HasType() bool {
   111  	if o != nil && !IsNil(o.Type) {
   112  		return true
   113  	}
   114  
   115  	return false
   116  }
   117  
   118  // SetType gets a reference to the given string and assigns it to the Type field.
   119  func (o *EventItem) SetType(v string) {
   120  	o.Type = &v
   121  }
   122  
   123  // GetStatus returns the Status field value if set, zero value otherwise.
   124  func (o *EventItem) GetStatus() string {
   125  	if o == nil || IsNil(o.Status) {
   126  		var ret string
   127  		return ret
   128  	}
   129  	return *o.Status
   130  }
   131  
   132  // GetStatusOk returns a tuple with the Status field value if set, nil otherwise
   133  // and a boolean to check if the value has been set.
   134  func (o *EventItem) GetStatusOk() (*string, bool) {
   135  	if o == nil || IsNil(o.Status) {
   136  		return nil, false
   137  	}
   138  	return o.Status, true
   139  }
   140  
   141  // HasStatus returns a boolean if a field has been set.
   142  func (o *EventItem) HasStatus() bool {
   143  	if o != nil && !IsNil(o.Status) {
   144  		return true
   145  	}
   146  
   147  	return false
   148  }
   149  
   150  // SetStatus gets a reference to the given string and assigns it to the Status field.
   151  func (o *EventItem) SetStatus(v string) {
   152  	o.Status = &v
   153  }
   154  
   155  // GetEnvironment returns the Environment field value if set, zero value otherwise (both if not set or set to explicit null).
   156  func (o *EventItem) GetEnvironment() string {
   157  	if o == nil || IsNil(o.Environment.Get()) {
   158  		var ret string
   159  		return ret
   160  	}
   161  	return *o.Environment.Get()
   162  }
   163  
   164  // GetEnvironmentOk returns a tuple with the Environment field value if set, nil otherwise
   165  // and a boolean to check if the value has been set.
   166  // NOTE: If the value is an explicit nil, `nil, true` will be returned
   167  func (o *EventItem) GetEnvironmentOk() (*string, bool) {
   168  	if o == nil {
   169  		return nil, false
   170  	}
   171  	return o.Environment.Get(), o.Environment.IsSet()
   172  }
   173  
   174  // HasEnvironment returns a boolean if a field has been set.
   175  func (o *EventItem) HasEnvironment() bool {
   176  	if o != nil && o.Environment.IsSet() {
   177  		return true
   178  	}
   179  
   180  	return false
   181  }
   182  
   183  // SetEnvironment gets a reference to the given NullableString and assigns it to the Environment field.
   184  func (o *EventItem) SetEnvironment(v string) {
   185  	o.Environment.Set(&v)
   186  }
   187  
   188  // SetEnvironmentNil sets the value for Environment to be an explicit nil
   189  func (o *EventItem) SetEnvironmentNil() {
   190  	o.Environment.Set(nil)
   191  }
   192  
   193  // UnsetEnvironment ensures that no value is present for Environment, not even an explicit nil
   194  func (o *EventItem) UnsetEnvironment() {
   195  	o.Environment.Unset()
   196  }
   197  
   198  // GetOrganization returns the Organization field value if set, zero value otherwise.
   199  func (o *EventItem) GetOrganization() string {
   200  	if o == nil || IsNil(o.Organization) {
   201  		var ret string
   202  		return ret
   203  	}
   204  	return *o.Organization
   205  }
   206  
   207  // GetOrganizationOk returns a tuple with the Organization field value if set, nil otherwise
   208  // and a boolean to check if the value has been set.
   209  func (o *EventItem) GetOrganizationOk() (*string, bool) {
   210  	if o == nil || IsNil(o.Organization) {
   211  		return nil, false
   212  	}
   213  	return o.Organization, true
   214  }
   215  
   216  // HasOrganization returns a boolean if a field has been set.
   217  func (o *EventItem) HasOrganization() bool {
   218  	if o != nil && !IsNil(o.Organization) {
   219  		return true
   220  	}
   221  
   222  	return false
   223  }
   224  
   225  // SetOrganization gets a reference to the given string and assigns it to the Organization field.
   226  func (o *EventItem) SetOrganization(v string) {
   227  	o.Organization = &v
   228  }
   229  
   230  // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
   231  func (o *EventItem) GetCreatedAt() time.Time {
   232  	if o == nil || IsNil(o.CreatedAt) {
   233  		var ret time.Time
   234  		return ret
   235  	}
   236  	return *o.CreatedAt
   237  }
   238  
   239  // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
   240  // and a boolean to check if the value has been set.
   241  func (o *EventItem) GetCreatedAtOk() (*time.Time, bool) {
   242  	if o == nil || IsNil(o.CreatedAt) {
   243  		return nil, false
   244  	}
   245  	return o.CreatedAt, true
   246  }
   247  
   248  // HasCreatedAt returns a boolean if a field has been set.
   249  func (o *EventItem) HasCreatedAt() bool {
   250  	if o != nil && !IsNil(o.CreatedAt) {
   251  		return true
   252  	}
   253  
   254  	return false
   255  }
   256  
   257  // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field.
   258  func (o *EventItem) SetCreatedAt(v time.Time) {
   259  	o.CreatedAt = &v
   260  }
   261  
   262  // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
   263  func (o *EventItem) GetUpdatedAt() time.Time {
   264  	if o == nil || IsNil(o.UpdatedAt) {
   265  		var ret time.Time
   266  		return ret
   267  	}
   268  	return *o.UpdatedAt
   269  }
   270  
   271  // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
   272  // and a boolean to check if the value has been set.
   273  func (o *EventItem) GetUpdatedAtOk() (*time.Time, bool) {
   274  	if o == nil || IsNil(o.UpdatedAt) {
   275  		return nil, false
   276  	}
   277  	return o.UpdatedAt, true
   278  }
   279  
   280  // HasUpdatedAt returns a boolean if a field has been set.
   281  func (o *EventItem) HasUpdatedAt() bool {
   282  	if o != nil && !IsNil(o.UpdatedAt) {
   283  		return true
   284  	}
   285  
   286  	return false
   287  }
   288  
   289  // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field.
   290  func (o *EventItem) SetUpdatedAt(v time.Time) {
   291  	o.UpdatedAt = &v
   292  }
   293  
   294  // GetDelegated returns the Delegated field value if set, zero value otherwise (both if not set or set to explicit null).
   295  func (o *EventItem) GetDelegated() string {
   296  	if o == nil || IsNil(o.Delegated.Get()) {
   297  		var ret string
   298  		return ret
   299  	}
   300  	return *o.Delegated.Get()
   301  }
   302  
   303  // GetDelegatedOk returns a tuple with the Delegated field value if set, nil otherwise
   304  // and a boolean to check if the value has been set.
   305  // NOTE: If the value is an explicit nil, `nil, true` will be returned
   306  func (o *EventItem) GetDelegatedOk() (*string, bool) {
   307  	if o == nil {
   308  		return nil, false
   309  	}
   310  	return o.Delegated.Get(), o.Delegated.IsSet()
   311  }
   312  
   313  // HasDelegated returns a boolean if a field has been set.
   314  func (o *EventItem) HasDelegated() bool {
   315  	if o != nil && o.Delegated.IsSet() {
   316  		return true
   317  	}
   318  
   319  	return false
   320  }
   321  
   322  // SetDelegated gets a reference to the given NullableString and assigns it to the Delegated field.
   323  func (o *EventItem) SetDelegated(v string) {
   324  	o.Delegated.Set(&v)
   325  }
   326  
   327  // SetDelegatedNil sets the value for Delegated to be an explicit nil
   328  func (o *EventItem) SetDelegatedNil() {
   329  	o.Delegated.Set(nil)
   330  }
   331  
   332  // UnsetDelegated ensures that no value is present for Delegated, not even an explicit nil
   333  func (o *EventItem) UnsetDelegated() {
   334  	o.Delegated.Unset()
   335  }
   336  
   337  func (o EventItem) MarshalJSON() ([]byte, error) {
   338  	toSerialize, err := o.ToMap()
   339  	if err != nil {
   340  		return []byte{}, err
   341  	}
   342  	return json.Marshal(toSerialize)
   343  }
   344  
   345  func (o EventItem) ToMap() (map[string]interface{}, error) {
   346  	toSerialize := map[string]interface{}{}
   347  	if !IsNil(o.Id) {
   348  		toSerialize["id"] = o.Id
   349  	}
   350  	if !IsNil(o.Type) {
   351  		toSerialize["type"] = o.Type
   352  	}
   353  	if !IsNil(o.Status) {
   354  		toSerialize["status"] = o.Status
   355  	}
   356  	if o.Environment.IsSet() {
   357  		toSerialize["environment"] = o.Environment.Get()
   358  	}
   359  	if !IsNil(o.Organization) {
   360  		toSerialize["organization"] = o.Organization
   361  	}
   362  	if !IsNil(o.CreatedAt) {
   363  		toSerialize["createdAt"] = o.CreatedAt
   364  	}
   365  	if !IsNil(o.UpdatedAt) {
   366  		toSerialize["updatedAt"] = o.UpdatedAt
   367  	}
   368  	if o.Delegated.IsSet() {
   369  		toSerialize["delegated"] = o.Delegated.Get()
   370  	}
   371  	return toSerialize, nil
   372  }
   373  
   374  type NullableEventItem struct {
   375  	value *EventItem
   376  	isSet bool
   377  }
   378  
   379  func (v NullableEventItem) Get() *EventItem {
   380  	return v.value
   381  }
   382  
   383  func (v *NullableEventItem) Set(val *EventItem) {
   384  	v.value = val
   385  	v.isSet = true
   386  }
   387  
   388  func (v NullableEventItem) IsSet() bool {
   389  	return v.isSet
   390  }
   391  
   392  func (v *NullableEventItem) Unset() {
   393  	v.value = nil
   394  	v.isSet = false
   395  }
   396  
   397  func NewNullableEventItem(val *EventItem) *NullableEventItem {
   398  	return &NullableEventItem{value: val, isSet: true}
   399  }
   400  
   401  func (v NullableEventItem) MarshalJSON() ([]byte, error) {
   402  	return json.Marshal(v.value)
   403  }
   404  
   405  func (v *NullableEventItem) UnmarshalJSON(src []byte) error {
   406  	v.isSet = true
   407  	return json.Unmarshal(src, &v.value)
   408  }