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
@@ -1,244 +0,0 @@
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 PaginatedSandboxesDeprecated < ApiModelBase
18
- attr_accessor :items
19
-
20
- attr_accessor :total
21
-
22
- attr_accessor :page
23
-
24
- attr_accessor :total_pages
25
-
26
- # Attribute mapping from ruby-style variable name to JSON key.
27
- def self.attribute_map
28
- {
29
- :'items' => :'items',
30
- :'total' => :'total',
31
- :'page' => :'page',
32
- :'total_pages' => :'totalPages'
33
- }
34
- end
35
-
36
- # Returns attribute mapping this model knows about
37
- def self.acceptable_attribute_map
38
- attribute_map
39
- end
40
-
41
- # Returns all the JSON keys this model knows about
42
- def self.acceptable_attributes
43
- acceptable_attribute_map.values
44
- end
45
-
46
- # Attribute type mapping.
47
- def self.openapi_types
48
- {
49
- :'items' => :'Array<Sandbox>',
50
- :'total' => :'Integer',
51
- :'page' => :'Integer',
52
- :'total_pages' => :'Integer'
53
- }
54
- end
55
-
56
- # List of attributes with nullable: true
57
- def self.openapi_nullable
58
- Set.new([
59
- ])
60
- end
61
-
62
- # Initializes the object
63
- # @param [Hash] attributes Model attributes in the form of hash
64
- def initialize(attributes = {})
65
- if (!attributes.is_a?(Hash))
66
- fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::PaginatedSandboxesDeprecated` initialize method"
67
- end
68
-
69
- # check to see if the attribute exists and convert string to symbol for hash key
70
- acceptable_attribute_map = self.class.acceptable_attribute_map
71
- attributes = attributes.each_with_object({}) { |(k, v), h|
72
- if (!acceptable_attribute_map.key?(k.to_sym))
73
- fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::PaginatedSandboxesDeprecated`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
- end
75
- h[k.to_sym] = v
76
- }
77
-
78
- if attributes.key?(:'items')
79
- if (value = attributes[:'items']).is_a?(Array)
80
- self.items = value
81
- end
82
- else
83
- self.items = nil
84
- end
85
-
86
- if attributes.key?(:'total')
87
- self.total = attributes[:'total']
88
- else
89
- self.total = nil
90
- end
91
-
92
- if attributes.key?(:'page')
93
- self.page = attributes[:'page']
94
- else
95
- self.page = nil
96
- end
97
-
98
- if attributes.key?(:'total_pages')
99
- self.total_pages = attributes[:'total_pages']
100
- else
101
- self.total_pages = nil
102
- end
103
- end
104
-
105
- # Show invalid properties with the reasons. Usually used together with valid?
106
- # @return Array for valid properties with the reasons
107
- def list_invalid_properties
108
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
109
- invalid_properties = Array.new
110
- if @items.nil?
111
- invalid_properties.push('invalid value for "items", items cannot be nil.')
112
- end
113
-
114
- if @total.nil?
115
- invalid_properties.push('invalid value for "total", total cannot be nil.')
116
- end
117
-
118
- if @page.nil?
119
- invalid_properties.push('invalid value for "page", page cannot be nil.')
120
- end
121
-
122
- if @total_pages.nil?
123
- invalid_properties.push('invalid value for "total_pages", total_pages cannot be nil.')
124
- end
125
-
126
- invalid_properties
127
- end
128
-
129
- # Check to see if the all the properties in the model are valid
130
- # @return true if the model is valid
131
- def valid?
132
- warn '[DEPRECATED] the `valid?` method is obsolete'
133
- return false if @items.nil?
134
- return false if @total.nil?
135
- return false if @page.nil?
136
- return false if @total_pages.nil?
137
- true
138
- end
139
-
140
- # Custom attribute writer method with validation
141
- # @param [Object] items Value to be assigned
142
- def items=(items)
143
- if items.nil?
144
- fail ArgumentError, 'items cannot be nil'
145
- end
146
-
147
- @items = items
148
- end
149
-
150
- # Custom attribute writer method with validation
151
- # @param [Object] total Value to be assigned
152
- def total=(total)
153
- if total.nil?
154
- fail ArgumentError, 'total cannot be nil'
155
- end
156
-
157
- @total = total
158
- end
159
-
160
- # Custom attribute writer method with validation
161
- # @param [Object] page Value to be assigned
162
- def page=(page)
163
- if page.nil?
164
- fail ArgumentError, 'page cannot be nil'
165
- end
166
-
167
- @page = page
168
- end
169
-
170
- # Custom attribute writer method with validation
171
- # @param [Object] total_pages Value to be assigned
172
- def total_pages=(total_pages)
173
- if total_pages.nil?
174
- fail ArgumentError, 'total_pages cannot be nil'
175
- end
176
-
177
- @total_pages = total_pages
178
- end
179
-
180
- # Checks equality by comparing each attribute.
181
- # @param [Object] Object to be compared
182
- def ==(o)
183
- return true if self.equal?(o)
184
- self.class == o.class &&
185
- items == o.items &&
186
- total == o.total &&
187
- page == o.page &&
188
- total_pages == o.total_pages
189
- end
190
-
191
- # @see the `==` method
192
- # @param [Object] Object to be compared
193
- def eql?(o)
194
- self == o
195
- end
196
-
197
- # Calculates hash code according to all attributes.
198
- # @return [Integer] Hash code
199
- def hash
200
- [items, total, page, total_pages].hash
201
- end
202
-
203
- # Builds the object from hash
204
- # @param [Hash] attributes Model attributes in the form of hash
205
- # @return [Object] Returns the model itself
206
- def self.build_from_hash(attributes)
207
- return nil unless attributes.is_a?(Hash)
208
- attributes = attributes.transform_keys(&:to_sym)
209
- transformed_hash = {}
210
- openapi_types.each_pair do |key, type|
211
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
212
- transformed_hash["#{key}"] = nil
213
- elsif type =~ /\AArray<(.*)>/i
214
- # check to ensure the input is an array given that the attribute
215
- # is documented as an array but the input is not
216
- if attributes[attribute_map[key]].is_a?(Array)
217
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
218
- end
219
- elsif !attributes[attribute_map[key]].nil?
220
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
221
- end
222
- end
223
- new(transformed_hash)
224
- end
225
-
226
- # Returns the object in the form of hash
227
- # @return [Hash] Returns the object in the form of hash
228
- def to_hash
229
- hash = {}
230
- self.class.attribute_map.each_pair do |attr, param|
231
- value = self.send(attr)
232
- if value.nil?
233
- is_nullable = self.class.openapi_nullable.include?(attr)
234
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
235
- end
236
-
237
- hash[param] = _to_hash(value)
238
- end
239
- hash
240
- end
241
-
242
- end
243
-
244
- end
@@ -1,333 +0,0 @@
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 UpdateOrganizationQuota < ApiModelBase
18
- attr_accessor :max_cpu_per_sandbox
19
-
20
- attr_accessor :max_memory_per_sandbox
21
-
22
- attr_accessor :max_disk_per_sandbox
23
-
24
- attr_accessor :snapshot_quota
25
-
26
- attr_accessor :max_snapshot_size
27
-
28
- attr_accessor :volume_quota
29
-
30
- attr_accessor :secret_quota
31
-
32
- # Maximum number of secrets that can be mounted to a single sandbox
33
- attr_accessor :max_secrets_per_sandbox
34
-
35
- attr_accessor :authenticated_rate_limit
36
-
37
- attr_accessor :sandbox_create_rate_limit
38
-
39
- attr_accessor :sandbox_lifecycle_rate_limit
40
-
41
- attr_accessor :authenticated_rate_limit_ttl_seconds
42
-
43
- attr_accessor :sandbox_create_rate_limit_ttl_seconds
44
-
45
- attr_accessor :sandbox_lifecycle_rate_limit_ttl_seconds
46
-
47
- # Time in minutes before an unused snapshot is deactivated
48
- attr_accessor :snapshot_deactivation_timeout_minutes
49
-
50
- # Maximum number of snapshots an organization can process (building or pulling) concurrently. Excess are queued. <= 0 means unlimited.
51
- attr_accessor :max_concurrent_snapshot_processing
52
-
53
- # Attribute mapping from ruby-style variable name to JSON key.
54
- def self.attribute_map
55
- {
56
- :'max_cpu_per_sandbox' => :'maxCpuPerSandbox',
57
- :'max_memory_per_sandbox' => :'maxMemoryPerSandbox',
58
- :'max_disk_per_sandbox' => :'maxDiskPerSandbox',
59
- :'snapshot_quota' => :'snapshotQuota',
60
- :'max_snapshot_size' => :'maxSnapshotSize',
61
- :'volume_quota' => :'volumeQuota',
62
- :'secret_quota' => :'secretQuota',
63
- :'max_secrets_per_sandbox' => :'maxSecretsPerSandbox',
64
- :'authenticated_rate_limit' => :'authenticatedRateLimit',
65
- :'sandbox_create_rate_limit' => :'sandboxCreateRateLimit',
66
- :'sandbox_lifecycle_rate_limit' => :'sandboxLifecycleRateLimit',
67
- :'authenticated_rate_limit_ttl_seconds' => :'authenticatedRateLimitTtlSeconds',
68
- :'sandbox_create_rate_limit_ttl_seconds' => :'sandboxCreateRateLimitTtlSeconds',
69
- :'sandbox_lifecycle_rate_limit_ttl_seconds' => :'sandboxLifecycleRateLimitTtlSeconds',
70
- :'snapshot_deactivation_timeout_minutes' => :'snapshotDeactivationTimeoutMinutes',
71
- :'max_concurrent_snapshot_processing' => :'maxConcurrentSnapshotProcessing'
72
- }
73
- end
74
-
75
- # Returns attribute mapping this model knows about
76
- def self.acceptable_attribute_map
77
- attribute_map
78
- end
79
-
80
- # Returns all the JSON keys this model knows about
81
- def self.acceptable_attributes
82
- acceptable_attribute_map.values
83
- end
84
-
85
- # Attribute type mapping.
86
- def self.openapi_types
87
- {
88
- :'max_cpu_per_sandbox' => :'Float',
89
- :'max_memory_per_sandbox' => :'Float',
90
- :'max_disk_per_sandbox' => :'Float',
91
- :'snapshot_quota' => :'Float',
92
- :'max_snapshot_size' => :'Float',
93
- :'volume_quota' => :'Float',
94
- :'secret_quota' => :'Float',
95
- :'max_secrets_per_sandbox' => :'Float',
96
- :'authenticated_rate_limit' => :'Float',
97
- :'sandbox_create_rate_limit' => :'Float',
98
- :'sandbox_lifecycle_rate_limit' => :'Float',
99
- :'authenticated_rate_limit_ttl_seconds' => :'Float',
100
- :'sandbox_create_rate_limit_ttl_seconds' => :'Float',
101
- :'sandbox_lifecycle_rate_limit_ttl_seconds' => :'Float',
102
- :'snapshot_deactivation_timeout_minutes' => :'Float',
103
- :'max_concurrent_snapshot_processing' => :'Float'
104
- }
105
- end
106
-
107
- # List of attributes with nullable: true
108
- def self.openapi_nullable
109
- Set.new([
110
- :'max_cpu_per_sandbox',
111
- :'max_memory_per_sandbox',
112
- :'max_disk_per_sandbox',
113
- :'snapshot_quota',
114
- :'max_snapshot_size',
115
- :'volume_quota',
116
- :'secret_quota',
117
- :'max_secrets_per_sandbox',
118
- :'authenticated_rate_limit',
119
- :'sandbox_create_rate_limit',
120
- :'sandbox_lifecycle_rate_limit',
121
- :'authenticated_rate_limit_ttl_seconds',
122
- :'sandbox_create_rate_limit_ttl_seconds',
123
- :'sandbox_lifecycle_rate_limit_ttl_seconds',
124
- :'snapshot_deactivation_timeout_minutes',
125
- :'max_concurrent_snapshot_processing'
126
- ])
127
- end
128
-
129
- # Initializes the object
130
- # @param [Hash] attributes Model attributes in the form of hash
131
- def initialize(attributes = {})
132
- if (!attributes.is_a?(Hash))
133
- fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::UpdateOrganizationQuota` initialize method"
134
- end
135
-
136
- # check to see if the attribute exists and convert string to symbol for hash key
137
- acceptable_attribute_map = self.class.acceptable_attribute_map
138
- attributes = attributes.each_with_object({}) { |(k, v), h|
139
- if (!acceptable_attribute_map.key?(k.to_sym))
140
- fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::UpdateOrganizationQuota`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
141
- end
142
- h[k.to_sym] = v
143
- }
144
-
145
- if attributes.key?(:'max_cpu_per_sandbox')
146
- self.max_cpu_per_sandbox = attributes[:'max_cpu_per_sandbox']
147
- else
148
- self.max_cpu_per_sandbox = nil
149
- end
150
-
151
- if attributes.key?(:'max_memory_per_sandbox')
152
- self.max_memory_per_sandbox = attributes[:'max_memory_per_sandbox']
153
- else
154
- self.max_memory_per_sandbox = nil
155
- end
156
-
157
- if attributes.key?(:'max_disk_per_sandbox')
158
- self.max_disk_per_sandbox = attributes[:'max_disk_per_sandbox']
159
- else
160
- self.max_disk_per_sandbox = nil
161
- end
162
-
163
- if attributes.key?(:'snapshot_quota')
164
- self.snapshot_quota = attributes[:'snapshot_quota']
165
- else
166
- self.snapshot_quota = nil
167
- end
168
-
169
- if attributes.key?(:'max_snapshot_size')
170
- self.max_snapshot_size = attributes[:'max_snapshot_size']
171
- else
172
- self.max_snapshot_size = nil
173
- end
174
-
175
- if attributes.key?(:'volume_quota')
176
- self.volume_quota = attributes[:'volume_quota']
177
- else
178
- self.volume_quota = nil
179
- end
180
-
181
- if attributes.key?(:'secret_quota')
182
- self.secret_quota = attributes[:'secret_quota']
183
- else
184
- self.secret_quota = nil
185
- end
186
-
187
- if attributes.key?(:'max_secrets_per_sandbox')
188
- self.max_secrets_per_sandbox = attributes[:'max_secrets_per_sandbox']
189
- else
190
- self.max_secrets_per_sandbox = nil
191
- end
192
-
193
- if attributes.key?(:'authenticated_rate_limit')
194
- self.authenticated_rate_limit = attributes[:'authenticated_rate_limit']
195
- else
196
- self.authenticated_rate_limit = nil
197
- end
198
-
199
- if attributes.key?(:'sandbox_create_rate_limit')
200
- self.sandbox_create_rate_limit = attributes[:'sandbox_create_rate_limit']
201
- else
202
- self.sandbox_create_rate_limit = nil
203
- end
204
-
205
- if attributes.key?(:'sandbox_lifecycle_rate_limit')
206
- self.sandbox_lifecycle_rate_limit = attributes[:'sandbox_lifecycle_rate_limit']
207
- else
208
- self.sandbox_lifecycle_rate_limit = nil
209
- end
210
-
211
- if attributes.key?(:'authenticated_rate_limit_ttl_seconds')
212
- self.authenticated_rate_limit_ttl_seconds = attributes[:'authenticated_rate_limit_ttl_seconds']
213
- else
214
- self.authenticated_rate_limit_ttl_seconds = nil
215
- end
216
-
217
- if attributes.key?(:'sandbox_create_rate_limit_ttl_seconds')
218
- self.sandbox_create_rate_limit_ttl_seconds = attributes[:'sandbox_create_rate_limit_ttl_seconds']
219
- else
220
- self.sandbox_create_rate_limit_ttl_seconds = nil
221
- end
222
-
223
- if attributes.key?(:'sandbox_lifecycle_rate_limit_ttl_seconds')
224
- self.sandbox_lifecycle_rate_limit_ttl_seconds = attributes[:'sandbox_lifecycle_rate_limit_ttl_seconds']
225
- else
226
- self.sandbox_lifecycle_rate_limit_ttl_seconds = nil
227
- end
228
-
229
- if attributes.key?(:'snapshot_deactivation_timeout_minutes')
230
- self.snapshot_deactivation_timeout_minutes = attributes[:'snapshot_deactivation_timeout_minutes']
231
- else
232
- self.snapshot_deactivation_timeout_minutes = nil
233
- end
234
-
235
- if attributes.key?(:'max_concurrent_snapshot_processing')
236
- self.max_concurrent_snapshot_processing = attributes[:'max_concurrent_snapshot_processing']
237
- else
238
- self.max_concurrent_snapshot_processing = nil
239
- end
240
- end
241
-
242
- # Show invalid properties with the reasons. Usually used together with valid?
243
- # @return Array for valid properties with the reasons
244
- def list_invalid_properties
245
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
246
- invalid_properties = Array.new
247
- invalid_properties
248
- end
249
-
250
- # Check to see if the all the properties in the model are valid
251
- # @return true if the model is valid
252
- def valid?
253
- warn '[DEPRECATED] the `valid?` method is obsolete'
254
- true
255
- end
256
-
257
- # Checks equality by comparing each attribute.
258
- # @param [Object] Object to be compared
259
- def ==(o)
260
- return true if self.equal?(o)
261
- self.class == o.class &&
262
- max_cpu_per_sandbox == o.max_cpu_per_sandbox &&
263
- max_memory_per_sandbox == o.max_memory_per_sandbox &&
264
- max_disk_per_sandbox == o.max_disk_per_sandbox &&
265
- snapshot_quota == o.snapshot_quota &&
266
- max_snapshot_size == o.max_snapshot_size &&
267
- volume_quota == o.volume_quota &&
268
- secret_quota == o.secret_quota &&
269
- max_secrets_per_sandbox == o.max_secrets_per_sandbox &&
270
- authenticated_rate_limit == o.authenticated_rate_limit &&
271
- sandbox_create_rate_limit == o.sandbox_create_rate_limit &&
272
- sandbox_lifecycle_rate_limit == o.sandbox_lifecycle_rate_limit &&
273
- authenticated_rate_limit_ttl_seconds == o.authenticated_rate_limit_ttl_seconds &&
274
- sandbox_create_rate_limit_ttl_seconds == o.sandbox_create_rate_limit_ttl_seconds &&
275
- sandbox_lifecycle_rate_limit_ttl_seconds == o.sandbox_lifecycle_rate_limit_ttl_seconds &&
276
- snapshot_deactivation_timeout_minutes == o.snapshot_deactivation_timeout_minutes &&
277
- max_concurrent_snapshot_processing == o.max_concurrent_snapshot_processing
278
- end
279
-
280
- # @see the `==` method
281
- # @param [Object] Object to be compared
282
- def eql?(o)
283
- self == o
284
- end
285
-
286
- # Calculates hash code according to all attributes.
287
- # @return [Integer] Hash code
288
- def hash
289
- [max_cpu_per_sandbox, max_memory_per_sandbox, max_disk_per_sandbox, snapshot_quota, max_snapshot_size, volume_quota, secret_quota, max_secrets_per_sandbox, authenticated_rate_limit, sandbox_create_rate_limit, sandbox_lifecycle_rate_limit, authenticated_rate_limit_ttl_seconds, sandbox_create_rate_limit_ttl_seconds, sandbox_lifecycle_rate_limit_ttl_seconds, snapshot_deactivation_timeout_minutes, max_concurrent_snapshot_processing].hash
290
- end
291
-
292
- # Builds the object from hash
293
- # @param [Hash] attributes Model attributes in the form of hash
294
- # @return [Object] Returns the model itself
295
- def self.build_from_hash(attributes)
296
- return nil unless attributes.is_a?(Hash)
297
- attributes = attributes.transform_keys(&:to_sym)
298
- transformed_hash = {}
299
- openapi_types.each_pair do |key, type|
300
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
301
- transformed_hash["#{key}"] = nil
302
- elsif type =~ /\AArray<(.*)>/i
303
- # check to ensure the input is an array given that the attribute
304
- # is documented as an array but the input is not
305
- if attributes[attribute_map[key]].is_a?(Array)
306
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
307
- end
308
- elsif !attributes[attribute_map[key]].nil?
309
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
310
- end
311
- end
312
- new(transformed_hash)
313
- end
314
-
315
- # Returns the object in the form of hash
316
- # @return [Hash] Returns the object in the form of hash
317
- def to_hash
318
- hash = {}
319
- self.class.attribute_map.each_pair do |attr, param|
320
- value = self.send(attr)
321
- if value.nil?
322
- is_nullable = self.class.openapi_nullable.include?(attr)
323
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
324
- end
325
-
326
- hash[param] = _to_hash(value)
327
- end
328
- hash
329
- end
330
-
331
- end
332
-
333
- end