bunnyshell.com/sdk@v0.16.0/model_event_collection.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 EventCollection type satisfies the MappedNullable interface at compile time 19 var _ MappedNullable = &EventCollection{} 20 21 // EventCollection An event represents an operation on an environment, integration or settings 22 type EventCollection struct { 23 // Event identifier. 24 Id *string `json:"id,omitempty"` 25 // Event type. 26 Type *string `json:"type,omitempty"` 27 // Event operation status. 28 Status *string `json:"status,omitempty"` 29 // Environment identifier. 30 Environment NullableString `json:"environment,omitempty"` 31 // Organization identifier. 32 Organization *string `json:"organization,omitempty"` 33 } 34 35 // NewEventCollection instantiates a new EventCollection object 36 // This constructor will assign default values to properties that have it defined, 37 // and makes sure properties required by API are set, but the set of arguments 38 // will change when the set of required properties is changed 39 func NewEventCollection() *EventCollection { 40 this := EventCollection{} 41 return &this 42 } 43 44 // NewEventCollectionWithDefaults instantiates a new EventCollection object 45 // This constructor will only assign default values to properties that have it defined, 46 // but it doesn't guarantee that properties required by API are set 47 func NewEventCollectionWithDefaults() *EventCollection { 48 this := EventCollection{} 49 return &this 50 } 51 52 // GetId returns the Id field value if set, zero value otherwise. 53 func (o *EventCollection) GetId() string { 54 if o == nil || IsNil(o.Id) { 55 var ret string 56 return ret 57 } 58 return *o.Id 59 } 60 61 // GetIdOk returns a tuple with the Id field value if set, nil otherwise 62 // and a boolean to check if the value has been set. 63 func (o *EventCollection) GetIdOk() (*string, bool) { 64 if o == nil || IsNil(o.Id) { 65 return nil, false 66 } 67 return o.Id, true 68 } 69 70 // HasId returns a boolean if a field has been set. 71 func (o *EventCollection) HasId() bool { 72 if o != nil && !IsNil(o.Id) { 73 return true 74 } 75 76 return false 77 } 78 79 // SetId gets a reference to the given string and assigns it to the Id field. 80 func (o *EventCollection) SetId(v string) { 81 o.Id = &v 82 } 83 84 // GetType returns the Type field value if set, zero value otherwise. 85 func (o *EventCollection) GetType() string { 86 if o == nil || IsNil(o.Type) { 87 var ret string 88 return ret 89 } 90 return *o.Type 91 } 92 93 // GetTypeOk returns a tuple with the Type field value if set, nil otherwise 94 // and a boolean to check if the value has been set. 95 func (o *EventCollection) GetTypeOk() (*string, bool) { 96 if o == nil || IsNil(o.Type) { 97 return nil, false 98 } 99 return o.Type, true 100 } 101 102 // HasType returns a boolean if a field has been set. 103 func (o *EventCollection) HasType() bool { 104 if o != nil && !IsNil(o.Type) { 105 return true 106 } 107 108 return false 109 } 110 111 // SetType gets a reference to the given string and assigns it to the Type field. 112 func (o *EventCollection) SetType(v string) { 113 o.Type = &v 114 } 115 116 // GetStatus returns the Status field value if set, zero value otherwise. 117 func (o *EventCollection) GetStatus() string { 118 if o == nil || IsNil(o.Status) { 119 var ret string 120 return ret 121 } 122 return *o.Status 123 } 124 125 // GetStatusOk returns a tuple with the Status field value if set, nil otherwise 126 // and a boolean to check if the value has been set. 127 func (o *EventCollection) GetStatusOk() (*string, bool) { 128 if o == nil || IsNil(o.Status) { 129 return nil, false 130 } 131 return o.Status, true 132 } 133 134 // HasStatus returns a boolean if a field has been set. 135 func (o *EventCollection) HasStatus() bool { 136 if o != nil && !IsNil(o.Status) { 137 return true 138 } 139 140 return false 141 } 142 143 // SetStatus gets a reference to the given string and assigns it to the Status field. 144 func (o *EventCollection) SetStatus(v string) { 145 o.Status = &v 146 } 147 148 // GetEnvironment returns the Environment field value if set, zero value otherwise (both if not set or set to explicit null). 149 func (o *EventCollection) GetEnvironment() string { 150 if o == nil || IsNil(o.Environment.Get()) { 151 var ret string 152 return ret 153 } 154 return *o.Environment.Get() 155 } 156 157 // GetEnvironmentOk returns a tuple with the Environment field value if set, nil otherwise 158 // and a boolean to check if the value has been set. 159 // NOTE: If the value is an explicit nil, `nil, true` will be returned 160 func (o *EventCollection) GetEnvironmentOk() (*string, bool) { 161 if o == nil { 162 return nil, false 163 } 164 return o.Environment.Get(), o.Environment.IsSet() 165 } 166 167 // HasEnvironment returns a boolean if a field has been set. 168 func (o *EventCollection) HasEnvironment() bool { 169 if o != nil && o.Environment.IsSet() { 170 return true 171 } 172 173 return false 174 } 175 176 // SetEnvironment gets a reference to the given NullableString and assigns it to the Environment field. 177 func (o *EventCollection) SetEnvironment(v string) { 178 o.Environment.Set(&v) 179 } 180 181 // SetEnvironmentNil sets the value for Environment to be an explicit nil 182 func (o *EventCollection) SetEnvironmentNil() { 183 o.Environment.Set(nil) 184 } 185 186 // UnsetEnvironment ensures that no value is present for Environment, not even an explicit nil 187 func (o *EventCollection) UnsetEnvironment() { 188 o.Environment.Unset() 189 } 190 191 // GetOrganization returns the Organization field value if set, zero value otherwise. 192 func (o *EventCollection) GetOrganization() string { 193 if o == nil || IsNil(o.Organization) { 194 var ret string 195 return ret 196 } 197 return *o.Organization 198 } 199 200 // GetOrganizationOk returns a tuple with the Organization field value if set, nil otherwise 201 // and a boolean to check if the value has been set. 202 func (o *EventCollection) GetOrganizationOk() (*string, bool) { 203 if o == nil || IsNil(o.Organization) { 204 return nil, false 205 } 206 return o.Organization, true 207 } 208 209 // HasOrganization returns a boolean if a field has been set. 210 func (o *EventCollection) HasOrganization() bool { 211 if o != nil && !IsNil(o.Organization) { 212 return true 213 } 214 215 return false 216 } 217 218 // SetOrganization gets a reference to the given string and assigns it to the Organization field. 219 func (o *EventCollection) SetOrganization(v string) { 220 o.Organization = &v 221 } 222 223 func (o EventCollection) MarshalJSON() ([]byte, error) { 224 toSerialize, err := o.ToMap() 225 if err != nil { 226 return []byte{}, err 227 } 228 return json.Marshal(toSerialize) 229 } 230 231 func (o EventCollection) ToMap() (map[string]interface{}, error) { 232 toSerialize := map[string]interface{}{} 233 if !IsNil(o.Id) { 234 toSerialize["id"] = o.Id 235 } 236 if !IsNil(o.Type) { 237 toSerialize["type"] = o.Type 238 } 239 if !IsNil(o.Status) { 240 toSerialize["status"] = o.Status 241 } 242 if o.Environment.IsSet() { 243 toSerialize["environment"] = o.Environment.Get() 244 } 245 if !IsNil(o.Organization) { 246 toSerialize["organization"] = o.Organization 247 } 248 return toSerialize, nil 249 } 250 251 type NullableEventCollection struct { 252 value *EventCollection 253 isSet bool 254 } 255 256 func (v NullableEventCollection) Get() *EventCollection { 257 return v.value 258 } 259 260 func (v *NullableEventCollection) Set(val *EventCollection) { 261 v.value = val 262 v.isSet = true 263 } 264 265 func (v NullableEventCollection) IsSet() bool { 266 return v.isSet 267 } 268 269 func (v *NullableEventCollection) Unset() { 270 v.value = nil 271 v.isSet = false 272 } 273 274 func NewNullableEventCollection(val *EventCollection) *NullableEventCollection { 275 return &NullableEventCollection{value: val, isSet: true} 276 } 277 278 func (v NullableEventCollection) MarshalJSON() ([]byte, error) { 279 return json.Marshal(v.value) 280 } 281 282 func (v *NullableEventCollection) UnmarshalJSON(src []byte) error { 283 v.isSet = true 284 return json.Unmarshal(src, &v.value) 285 }