daytona_api_client 0.216.0 → 0.217.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.openapi-generator/FILES +15 -16
  3. data/lib/daytona_api_client/api/organizations_api.rb +260 -484
  4. data/lib/daytona_api_client/api/sandbox_api.rb +14 -163
  5. data/lib/daytona_api_client/api/users_api.rb +82 -90
  6. data/lib/daytona_api_client/models/account_provider.rb +48 -19
  7. data/lib/daytona_api_client/models/api_key_list.rb +14 -4
  8. data/lib/daytona_api_client/models/create_runner.rb +37 -4
  9. data/lib/daytona_api_client/models/create_runner_sandbox_class.rb +42 -0
  10. data/lib/daytona_api_client/models/daytona_configuration.rb +45 -1
  11. data/lib/daytona_api_client/models/{organization_preview_warning.rb → generate_workos_admin_portal_link.rb} +42 -20
  12. data/lib/daytona_api_client/models/{send_webhook_dto.rb → gpu_capacity.rb} +77 -43
  13. data/lib/daytona_api_client/models/{organization_sso_enabled.rb → gpu_capacity_response.rb} +48 -20
  14. data/lib/daytona_api_client/models/gpu_type.rb +2 -1
  15. data/lib/daytona_api_client/models/oidc_config.rb +65 -4
  16. data/lib/daytona_api_client/models/organization.rb +38 -1
  17. data/lib/daytona_api_client/models/sandbox_created_webhook.rb +349 -0
  18. data/lib/daytona_api_client/models/{organization_sandbox_default_limited_network_egress.rb → sandbox_identity.rb} +47 -20
  19. data/lib/daytona_api_client/models/sandbox_state_updated_webhook.rb +349 -0
  20. data/lib/daytona_api_client/models/snapshot_created_webhook.rb +349 -0
  21. data/lib/daytona_api_client/models/{create_user.rb → snapshot_removed_webhook.rb} +119 -71
  22. data/lib/daytona_api_client/models/snapshot_state_updated_webhook.rb +376 -0
  23. data/lib/daytona_api_client/models/user.rb +11 -1
  24. data/lib/daytona_api_client/models/volume_created_webhook.rb +349 -0
  25. data/lib/daytona_api_client/models/volume_state_updated_webhook.rb +376 -0
  26. data/lib/daytona_api_client/models/workos_admin_portal_intent.rb +41 -0
  27. data/lib/daytona_api_client/models/{set_snapshot_general_status_dto.rb → workos_admin_portal_link.rb} +20 -20
  28. data/lib/daytona_api_client/models/{admin_create_runner.rb → workos_sso_connection.rb} +123 -120
  29. data/lib/daytona_api_client/version.rb +1 -1
  30. data/lib/daytona_api_client.rb +15 -16
  31. metadata +16 -17
  32. data/lib/daytona_api_client/api/admin_api.rb +0 -1618
  33. data/lib/daytona_api_client/models/admin_create_organization.rb +0 -219
  34. data/lib/daytona_api_client/models/admin_get_webhook_status200_response.rb +0 -147
  35. data/lib/daytona_api_client/models/create_organization_quota.rb +0 -238
  36. data/lib/daytona_api_client/models/create_organization_region_quota.rb +0 -386
  37. data/lib/daytona_api_client/models/organization_suspension.rb +0 -221
  38. data/lib/daytona_api_client/models/paginated_sandboxes_deprecated.rb +0 -244
  39. data/lib/daytona_api_client/models/update_organization_quota.rb +0 -333
  40. data/lib/daytona_api_client/models/update_organization_region_quota.rb +0 -313
@@ -14,23 +14,24 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module DaytonaApiClient
17
- class CreateUser < ApiModelBase
18
- attr_accessor :id
19
-
20
- attr_accessor :name
21
-
22
- attr_accessor :email
17
+ class SnapshotRemovedWebhook < ApiModelBase
18
+ # Event type identifier
19
+ attr_accessor :event
23
20
 
24
- attr_accessor :personal_organization_quota
21
+ # Timestamp when the event occurred
22
+ attr_accessor :timestamp
25
23
 
26
- attr_accessor :personal_organization_default_region_id
24
+ # Snapshot ID
25
+ attr_accessor :id
27
26
 
28
- attr_accessor :role
27
+ # Snapshot name
28
+ attr_accessor :name
29
29
 
30
- attr_accessor :email_verified
30
+ # Organization ID
31
+ attr_accessor :organization_id
31
32
 
32
- # Provenance of the email verification. Defaults to auth0 when emailVerified is true and unset.
33
- attr_accessor :email_verified_source
33
+ # When the snapshot was removed
34
+ attr_accessor :removed_at
34
35
 
35
36
  class EnumAttributeValidator
36
37
  attr_reader :datatype
@@ -57,14 +58,12 @@ module DaytonaApiClient
57
58
  # Attribute mapping from ruby-style variable name to JSON key.
58
59
  def self.attribute_map
59
60
  {
61
+ :'event' => :'event',
62
+ :'timestamp' => :'timestamp',
60
63
  :'id' => :'id',
61
64
  :'name' => :'name',
62
- :'email' => :'email',
63
- :'personal_organization_quota' => :'personalOrganizationQuota',
64
- :'personal_organization_default_region_id' => :'personalOrganizationDefaultRegionId',
65
- :'role' => :'role',
66
- :'email_verified' => :'emailVerified',
67
- :'email_verified_source' => :'emailVerifiedSource'
65
+ :'organization_id' => :'organizationId',
66
+ :'removed_at' => :'removedAt'
68
67
  }
69
68
  end
70
69
 
@@ -81,14 +80,12 @@ module DaytonaApiClient
81
80
  # Attribute type mapping.
82
81
  def self.openapi_types
83
82
  {
83
+ :'event' => :'WebhookEvent',
84
+ :'timestamp' => :'Time',
84
85
  :'id' => :'String',
85
86
  :'name' => :'String',
86
- :'email' => :'String',
87
- :'personal_organization_quota' => :'CreateOrganizationQuota',
88
- :'personal_organization_default_region_id' => :'String',
89
- :'role' => :'String',
90
- :'email_verified' => :'Boolean',
91
- :'email_verified_source' => :'String'
87
+ :'organization_id' => :'String',
88
+ :'removed_at' => :'Time'
92
89
  }
93
90
  end
94
91
 
@@ -102,20 +99,34 @@ module DaytonaApiClient
102
99
  # @param [Hash] attributes Model attributes in the form of hash
103
100
  def initialize(attributes = {})
104
101
  if (!attributes.is_a?(Hash))
105
- fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::CreateUser` initialize method"
102
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::SnapshotRemovedWebhook` initialize method"
106
103
  end
107
104
 
108
105
  # check to see if the attribute exists and convert string to symbol for hash key
109
106
  acceptable_attribute_map = self.class.acceptable_attribute_map
110
107
  attributes = attributes.each_with_object({}) { |(k, v), h|
111
108
  if (!acceptable_attribute_map.key?(k.to_sym))
112
- fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::CreateUser`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
109
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::SnapshotRemovedWebhook`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
113
110
  end
114
111
  h[k.to_sym] = v
115
112
  }
116
113
 
114
+ if attributes.key?(:'event')
115
+ self.event = attributes[:'event']
116
+ else
117
+ self.event = nil
118
+ end
119
+
120
+ if attributes.key?(:'timestamp')
121
+ self.timestamp = attributes[:'timestamp']
122
+ else
123
+ self.timestamp = nil
124
+ end
125
+
117
126
  if attributes.key?(:'id')
118
127
  self.id = attributes[:'id']
128
+ else
129
+ self.id = nil
119
130
  end
120
131
 
121
132
  if attributes.key?(:'name')
@@ -124,28 +135,16 @@ module DaytonaApiClient
124
135
  self.name = nil
125
136
  end
126
137
 
127
- if attributes.key?(:'email')
128
- self.email = attributes[:'email']
129
- end
130
-
131
- if attributes.key?(:'personal_organization_quota')
132
- self.personal_organization_quota = attributes[:'personal_organization_quota']
133
- end
134
-
135
- if attributes.key?(:'personal_organization_default_region_id')
136
- self.personal_organization_default_region_id = attributes[:'personal_organization_default_region_id']
137
- end
138
-
139
- if attributes.key?(:'role')
140
- self.role = attributes[:'role']
141
- end
142
-
143
- if attributes.key?(:'email_verified')
144
- self.email_verified = attributes[:'email_verified']
138
+ if attributes.key?(:'organization_id')
139
+ self.organization_id = attributes[:'organization_id']
140
+ else
141
+ self.organization_id = nil
145
142
  end
146
143
 
147
- if attributes.key?(:'email_verified_source')
148
- self.email_verified_source = attributes[:'email_verified_source']
144
+ if attributes.key?(:'removed_at')
145
+ self.removed_at = attributes[:'removed_at']
146
+ else
147
+ self.removed_at = nil
149
148
  end
150
149
  end
151
150
 
@@ -154,10 +153,30 @@ module DaytonaApiClient
154
153
  def list_invalid_properties
155
154
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
156
155
  invalid_properties = Array.new
156
+ if @event.nil?
157
+ invalid_properties.push('invalid value for "event", event cannot be nil.')
158
+ end
159
+
160
+ if @timestamp.nil?
161
+ invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.')
162
+ end
163
+
164
+ if @id.nil?
165
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
166
+ end
167
+
157
168
  if @name.nil?
158
169
  invalid_properties.push('invalid value for "name", name cannot be nil.')
159
170
  end
160
171
 
172
+ if @organization_id.nil?
173
+ invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.')
174
+ end
175
+
176
+ if @removed_at.nil?
177
+ invalid_properties.push('invalid value for "removed_at", removed_at cannot be nil.')
178
+ end
179
+
161
180
  invalid_properties
162
181
  end
163
182
 
@@ -165,14 +184,45 @@ module DaytonaApiClient
165
184
  # @return true if the model is valid
166
185
  def valid?
167
186
  warn '[DEPRECATED] the `valid?` method is obsolete'
187
+ return false if @event.nil?
188
+ return false if @timestamp.nil?
189
+ return false if @id.nil?
168
190
  return false if @name.nil?
169
- role_validator = EnumAttributeValidator.new('String', ["admin", "user", "unknown_default_open_api"])
170
- return false unless role_validator.valid?(@role)
171
- email_verified_source_validator = EnumAttributeValidator.new('String', ["auth0", "admin", "sso", "unknown_default_open_api"])
172
- return false unless email_verified_source_validator.valid?(@email_verified_source)
191
+ return false if @organization_id.nil?
192
+ return false if @removed_at.nil?
173
193
  true
174
194
  end
175
195
 
196
+ # Custom attribute writer method with validation
197
+ # @param [Object] event Value to be assigned
198
+ def event=(event)
199
+ if event.nil?
200
+ fail ArgumentError, 'event cannot be nil'
201
+ end
202
+
203
+ @event = event
204
+ end
205
+
206
+ # Custom attribute writer method with validation
207
+ # @param [Object] timestamp Value to be assigned
208
+ def timestamp=(timestamp)
209
+ if timestamp.nil?
210
+ fail ArgumentError, 'timestamp cannot be nil'
211
+ end
212
+
213
+ @timestamp = timestamp
214
+ end
215
+
216
+ # Custom attribute writer method with validation
217
+ # @param [Object] id Value to be assigned
218
+ def id=(id)
219
+ if id.nil?
220
+ fail ArgumentError, 'id cannot be nil'
221
+ end
222
+
223
+ @id = id
224
+ end
225
+
176
226
  # Custom attribute writer method with validation
177
227
  # @param [Object] name Value to be assigned
178
228
  def name=(name)
@@ -183,24 +233,24 @@ module DaytonaApiClient
183
233
  @name = name
184
234
  end
185
235
 
186
- # Custom attribute writer method checking allowed values (enum).
187
- # @param [Object] role Object to be assigned
188
- def role=(role)
189
- validator = EnumAttributeValidator.new('String', ["admin", "user", "unknown_default_open_api"])
190
- unless validator.valid?(role)
191
- fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}."
236
+ # Custom attribute writer method with validation
237
+ # @param [Object] organization_id Value to be assigned
238
+ def organization_id=(organization_id)
239
+ if organization_id.nil?
240
+ fail ArgumentError, 'organization_id cannot be nil'
192
241
  end
193
- @role = role
242
+
243
+ @organization_id = organization_id
194
244
  end
195
245
 
196
- # Custom attribute writer method checking allowed values (enum).
197
- # @param [Object] email_verified_source Object to be assigned
198
- def email_verified_source=(email_verified_source)
199
- validator = EnumAttributeValidator.new('String', ["auth0", "admin", "sso", "unknown_default_open_api"])
200
- unless validator.valid?(email_verified_source)
201
- fail ArgumentError, "invalid value for \"email_verified_source\", must be one of #{validator.allowable_values}."
246
+ # Custom attribute writer method with validation
247
+ # @param [Object] removed_at Value to be assigned
248
+ def removed_at=(removed_at)
249
+ if removed_at.nil?
250
+ fail ArgumentError, 'removed_at cannot be nil'
202
251
  end
203
- @email_verified_source = email_verified_source
252
+
253
+ @removed_at = removed_at
204
254
  end
205
255
 
206
256
  # Checks equality by comparing each attribute.
@@ -208,14 +258,12 @@ module DaytonaApiClient
208
258
  def ==(o)
209
259
  return true if self.equal?(o)
210
260
  self.class == o.class &&
261
+ event == o.event &&
262
+ timestamp == o.timestamp &&
211
263
  id == o.id &&
212
264
  name == o.name &&
213
- email == o.email &&
214
- personal_organization_quota == o.personal_organization_quota &&
215
- personal_organization_default_region_id == o.personal_organization_default_region_id &&
216
- role == o.role &&
217
- email_verified == o.email_verified &&
218
- email_verified_source == o.email_verified_source
265
+ organization_id == o.organization_id &&
266
+ removed_at == o.removed_at
219
267
  end
220
268
 
221
269
  # @see the `==` method
@@ -227,7 +275,7 @@ module DaytonaApiClient
227
275
  # Calculates hash code according to all attributes.
228
276
  # @return [Integer] Hash code
229
277
  def hash
230
- [id, name, email, personal_organization_quota, personal_organization_default_region_id, role, email_verified, email_verified_source].hash
278
+ [event, timestamp, id, name, organization_id, removed_at].hash
231
279
  end
232
280
 
233
281
  # Builds the object from hash
@@ -0,0 +1,376 @@
1
+ =begin
2
+ #Daytona
3
+
4
+ #Daytona AI platform API Docs
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@daytona.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.21.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DaytonaApiClient
17
+ class SnapshotStateUpdatedWebhook < ApiModelBase
18
+ # Event type identifier
19
+ attr_accessor :event
20
+
21
+ # Timestamp when the event occurred
22
+ attr_accessor :timestamp
23
+
24
+ # Snapshot ID
25
+ attr_accessor :id
26
+
27
+ # Snapshot name
28
+ attr_accessor :name
29
+
30
+ # Organization ID
31
+ attr_accessor :organization_id
32
+
33
+ # Previous state
34
+ attr_accessor :old_state
35
+
36
+ # New state
37
+ attr_accessor :new_state
38
+
39
+ # When the snapshot was last updated
40
+ attr_accessor :updated_at
41
+
42
+ class EnumAttributeValidator
43
+ attr_reader :datatype
44
+ attr_reader :allowable_values
45
+
46
+ def initialize(datatype, allowable_values)
47
+ @allowable_values = allowable_values.map do |value|
48
+ case datatype.to_s
49
+ when /Integer/i
50
+ value.to_i
51
+ when /Float/i
52
+ value.to_f
53
+ else
54
+ value
55
+ end
56
+ end
57
+ end
58
+
59
+ def valid?(value)
60
+ !value || allowable_values.include?(value)
61
+ end
62
+ end
63
+
64
+ # Attribute mapping from ruby-style variable name to JSON key.
65
+ def self.attribute_map
66
+ {
67
+ :'event' => :'event',
68
+ :'timestamp' => :'timestamp',
69
+ :'id' => :'id',
70
+ :'name' => :'name',
71
+ :'organization_id' => :'organizationId',
72
+ :'old_state' => :'oldState',
73
+ :'new_state' => :'newState',
74
+ :'updated_at' => :'updatedAt'
75
+ }
76
+ end
77
+
78
+ # Returns attribute mapping this model knows about
79
+ def self.acceptable_attribute_map
80
+ attribute_map
81
+ end
82
+
83
+ # Returns all the JSON keys this model knows about
84
+ def self.acceptable_attributes
85
+ acceptable_attribute_map.values
86
+ end
87
+
88
+ # Attribute type mapping.
89
+ def self.openapi_types
90
+ {
91
+ :'event' => :'WebhookEvent',
92
+ :'timestamp' => :'Time',
93
+ :'id' => :'String',
94
+ :'name' => :'String',
95
+ :'organization_id' => :'String',
96
+ :'old_state' => :'SnapshotState',
97
+ :'new_state' => :'SnapshotState',
98
+ :'updated_at' => :'Time'
99
+ }
100
+ end
101
+
102
+ # List of attributes with nullable: true
103
+ def self.openapi_nullable
104
+ Set.new([
105
+ ])
106
+ end
107
+
108
+ # Initializes the object
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ def initialize(attributes = {})
111
+ if (!attributes.is_a?(Hash))
112
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::SnapshotStateUpdatedWebhook` initialize method"
113
+ end
114
+
115
+ # check to see if the attribute exists and convert string to symbol for hash key
116
+ acceptable_attribute_map = self.class.acceptable_attribute_map
117
+ attributes = attributes.each_with_object({}) { |(k, v), h|
118
+ if (!acceptable_attribute_map.key?(k.to_sym))
119
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::SnapshotStateUpdatedWebhook`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
120
+ end
121
+ h[k.to_sym] = v
122
+ }
123
+
124
+ if attributes.key?(:'event')
125
+ self.event = attributes[:'event']
126
+ else
127
+ self.event = nil
128
+ end
129
+
130
+ if attributes.key?(:'timestamp')
131
+ self.timestamp = attributes[:'timestamp']
132
+ else
133
+ self.timestamp = nil
134
+ end
135
+
136
+ if attributes.key?(:'id')
137
+ self.id = attributes[:'id']
138
+ else
139
+ self.id = nil
140
+ end
141
+
142
+ if attributes.key?(:'name')
143
+ self.name = attributes[:'name']
144
+ else
145
+ self.name = nil
146
+ end
147
+
148
+ if attributes.key?(:'organization_id')
149
+ self.organization_id = attributes[:'organization_id']
150
+ else
151
+ self.organization_id = nil
152
+ end
153
+
154
+ if attributes.key?(:'old_state')
155
+ self.old_state = attributes[:'old_state']
156
+ else
157
+ self.old_state = nil
158
+ end
159
+
160
+ if attributes.key?(:'new_state')
161
+ self.new_state = attributes[:'new_state']
162
+ else
163
+ self.new_state = nil
164
+ end
165
+
166
+ if attributes.key?(:'updated_at')
167
+ self.updated_at = attributes[:'updated_at']
168
+ else
169
+ self.updated_at = nil
170
+ end
171
+ end
172
+
173
+ # Show invalid properties with the reasons. Usually used together with valid?
174
+ # @return Array for valid properties with the reasons
175
+ def list_invalid_properties
176
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
177
+ invalid_properties = Array.new
178
+ if @event.nil?
179
+ invalid_properties.push('invalid value for "event", event cannot be nil.')
180
+ end
181
+
182
+ if @timestamp.nil?
183
+ invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.')
184
+ end
185
+
186
+ if @id.nil?
187
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
188
+ end
189
+
190
+ if @name.nil?
191
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
192
+ end
193
+
194
+ if @organization_id.nil?
195
+ invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.')
196
+ end
197
+
198
+ if @old_state.nil?
199
+ invalid_properties.push('invalid value for "old_state", old_state cannot be nil.')
200
+ end
201
+
202
+ if @new_state.nil?
203
+ invalid_properties.push('invalid value for "new_state", new_state cannot be nil.')
204
+ end
205
+
206
+ if @updated_at.nil?
207
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
208
+ end
209
+
210
+ invalid_properties
211
+ end
212
+
213
+ # Check to see if the all the properties in the model are valid
214
+ # @return true if the model is valid
215
+ def valid?
216
+ warn '[DEPRECATED] the `valid?` method is obsolete'
217
+ return false if @event.nil?
218
+ return false if @timestamp.nil?
219
+ return false if @id.nil?
220
+ return false if @name.nil?
221
+ return false if @organization_id.nil?
222
+ return false if @old_state.nil?
223
+ return false if @new_state.nil?
224
+ return false if @updated_at.nil?
225
+ true
226
+ end
227
+
228
+ # Custom attribute writer method with validation
229
+ # @param [Object] event Value to be assigned
230
+ def event=(event)
231
+ if event.nil?
232
+ fail ArgumentError, 'event cannot be nil'
233
+ end
234
+
235
+ @event = event
236
+ end
237
+
238
+ # Custom attribute writer method with validation
239
+ # @param [Object] timestamp Value to be assigned
240
+ def timestamp=(timestamp)
241
+ if timestamp.nil?
242
+ fail ArgumentError, 'timestamp cannot be nil'
243
+ end
244
+
245
+ @timestamp = timestamp
246
+ end
247
+
248
+ # Custom attribute writer method with validation
249
+ # @param [Object] id Value to be assigned
250
+ def id=(id)
251
+ if id.nil?
252
+ fail ArgumentError, 'id cannot be nil'
253
+ end
254
+
255
+ @id = id
256
+ end
257
+
258
+ # Custom attribute writer method with validation
259
+ # @param [Object] name Value to be assigned
260
+ def name=(name)
261
+ if name.nil?
262
+ fail ArgumentError, 'name cannot be nil'
263
+ end
264
+
265
+ @name = name
266
+ end
267
+
268
+ # Custom attribute writer method with validation
269
+ # @param [Object] organization_id Value to be assigned
270
+ def organization_id=(organization_id)
271
+ if organization_id.nil?
272
+ fail ArgumentError, 'organization_id cannot be nil'
273
+ end
274
+
275
+ @organization_id = organization_id
276
+ end
277
+
278
+ # Custom attribute writer method with validation
279
+ # @param [Object] old_state Value to be assigned
280
+ def old_state=(old_state)
281
+ if old_state.nil?
282
+ fail ArgumentError, 'old_state cannot be nil'
283
+ end
284
+
285
+ @old_state = old_state
286
+ end
287
+
288
+ # Custom attribute writer method with validation
289
+ # @param [Object] new_state Value to be assigned
290
+ def new_state=(new_state)
291
+ if new_state.nil?
292
+ fail ArgumentError, 'new_state cannot be nil'
293
+ end
294
+
295
+ @new_state = new_state
296
+ end
297
+
298
+ # Custom attribute writer method with validation
299
+ # @param [Object] updated_at Value to be assigned
300
+ def updated_at=(updated_at)
301
+ if updated_at.nil?
302
+ fail ArgumentError, 'updated_at cannot be nil'
303
+ end
304
+
305
+ @updated_at = updated_at
306
+ end
307
+
308
+ # Checks equality by comparing each attribute.
309
+ # @param [Object] Object to be compared
310
+ def ==(o)
311
+ return true if self.equal?(o)
312
+ self.class == o.class &&
313
+ event == o.event &&
314
+ timestamp == o.timestamp &&
315
+ id == o.id &&
316
+ name == o.name &&
317
+ organization_id == o.organization_id &&
318
+ old_state == o.old_state &&
319
+ new_state == o.new_state &&
320
+ updated_at == o.updated_at
321
+ end
322
+
323
+ # @see the `==` method
324
+ # @param [Object] Object to be compared
325
+ def eql?(o)
326
+ self == o
327
+ end
328
+
329
+ # Calculates hash code according to all attributes.
330
+ # @return [Integer] Hash code
331
+ def hash
332
+ [event, timestamp, id, name, organization_id, old_state, new_state, updated_at].hash
333
+ end
334
+
335
+ # Builds the object from hash
336
+ # @param [Hash] attributes Model attributes in the form of hash
337
+ # @return [Object] Returns the model itself
338
+ def self.build_from_hash(attributes)
339
+ return nil unless attributes.is_a?(Hash)
340
+ attributes = attributes.transform_keys(&:to_sym)
341
+ transformed_hash = {}
342
+ openapi_types.each_pair do |key, type|
343
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
344
+ transformed_hash["#{key}"] = nil
345
+ elsif type =~ /\AArray<(.*)>/i
346
+ # check to ensure the input is an array given that the attribute
347
+ # is documented as an array but the input is not
348
+ if attributes[attribute_map[key]].is_a?(Array)
349
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
350
+ end
351
+ elsif !attributes[attribute_map[key]].nil?
352
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
353
+ end
354
+ end
355
+ new(transformed_hash)
356
+ end
357
+
358
+ # Returns the object in the form of hash
359
+ # @return [Hash] Returns the object in the form of hash
360
+ def to_hash
361
+ hash = {}
362
+ self.class.attribute_map.each_pair do |attr, param|
363
+ value = self.send(attr)
364
+ if value.nil?
365
+ is_nullable = self.class.openapi_nullable.include?(attr)
366
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
367
+ end
368
+
369
+ hash[param] = _to_hash(value)
370
+ end
371
+ hash
372
+ end
373
+
374
+ end
375
+
376
+ end