daytona_api_client 0.171.0 → 1.0.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.
- checksums.yaml +4 -4
- data/Gemfile +9 -0
- data/Gemfile.lock +101 -0
- data/daytona_api_client.gemspec +2 -2
- data/lib/daytona_api_client/api/api_keys_api.rb +2 -2
- data/lib/daytona_api_client/api/audit_api.rb +140 -10
- data/lib/daytona_api_client/api/config_api.rb +1 -1
- data/lib/daytona_api_client/api/docker_registry_api.rb +67 -6
- data/lib/daytona_api_client/api/health_api.rb +3 -54
- data/lib/daytona_api_client/api/object_storage_api.rb +1 -1
- data/lib/daytona_api_client/api/organizations_api.rb +163 -954
- data/lib/daytona_api_client/api/preview_api.rb +8 -77
- data/lib/daytona_api_client/api/runners_api.rb +22 -412
- data/lib/daytona_api_client/api/sandbox_api.rb +292 -1620
- data/lib/daytona_api_client/api/snapshots_api.rb +113 -39
- data/lib/daytona_api_client/api/toolbox_api.rb +741 -741
- data/lib/daytona_api_client/api/users_api.rb +239 -2
- data/lib/daytona_api_client/api/volumes_api.rb +2 -2
- data/lib/daytona_api_client/api/webhooks_api.rb +268 -5
- data/lib/daytona_api_client/api/workspace_api.rb +6 -6
- data/lib/daytona_api_client/api_client.rb +4 -8
- data/lib/daytona_api_client/api_error.rb +1 -1
- data/lib/daytona_api_client/configuration.rb +2 -5
- data/lib/daytona_api_client/models/account_provider.rb +74 -3
- data/lib/daytona_api_client/models/announcement.rb +74 -3
- data/lib/daytona_api_client/models/api_key_list.rb +74 -3
- data/lib/daytona_api_client/models/api_key_response.rb +74 -3
- data/lib/daytona_api_client/models/audit_log.rb +75 -22
- data/lib/daytona_api_client/models/build_info.rb +78 -34
- data/lib/daytona_api_client/models/command.rb +74 -3
- data/lib/daytona_api_client/models/completion_context.rb +74 -3
- data/lib/daytona_api_client/models/completion_item.rb +74 -3
- data/lib/daytona_api_client/models/completion_list.rb +74 -3
- data/lib/daytona_api_client/models/compressed_screenshot_response.rb +74 -3
- data/lib/daytona_api_client/models/computer_use_start_response.rb +74 -3
- data/lib/daytona_api_client/models/computer_use_status_response.rb +76 -5
- data/lib/daytona_api_client/models/computer_use_stop_response.rb +74 -3
- data/lib/daytona_api_client/models/create_api_key.rb +75 -4
- data/lib/daytona_api_client/models/create_audit_log.rb +350 -0
- data/lib/daytona_api_client/models/create_build_info.rb +74 -3
- data/lib/daytona_api_client/models/create_docker_registry.rb +139 -7
- data/lib/daytona_api_client/models/create_linked_account.rb +74 -3
- data/lib/daytona_api_client/models/create_organization.rb +78 -34
- data/lib/daytona_api_client/models/create_organization_invitation.rb +76 -5
- data/lib/daytona_api_client/models/create_organization_quota.rb +74 -3
- data/lib/daytona_api_client/models/create_organization_role.rb +74 -3
- data/lib/daytona_api_client/models/create_runner.rb +389 -34
- data/lib/daytona_api_client/models/create_sandbox.rb +77 -16
- data/lib/daytona_api_client/models/create_session_request.rb +74 -3
- data/lib/daytona_api_client/models/create_snapshot.rb +88 -17
- data/lib/daytona_api_client/models/create_user.rb +77 -15
- data/lib/daytona_api_client/models/create_volume.rb +74 -3
- data/lib/daytona_api_client/models/create_workspace.rb +78 -7
- data/lib/daytona_api_client/models/daytona_configuration.rb +78 -54
- data/lib/daytona_api_client/models/display_info_response.rb +74 -3
- data/lib/daytona_api_client/models/docker_registry.rb +76 -5
- data/lib/daytona_api_client/models/download_files.rb +74 -3
- data/lib/daytona_api_client/models/execute_request.rb +74 -3
- data/lib/daytona_api_client/models/execute_response.rb +74 -3
- data/lib/daytona_api_client/models/file_info.rb +74 -3
- data/lib/daytona_api_client/models/file_status.rb +74 -3
- data/lib/daytona_api_client/models/git_add_request.rb +74 -3
- data/lib/daytona_api_client/models/git_branch_request.rb +74 -3
- data/lib/daytona_api_client/models/git_checkout_request.rb +74 -3
- data/lib/daytona_api_client/models/git_clone_request.rb +74 -3
- data/lib/daytona_api_client/models/git_commit_info.rb +74 -3
- data/lib/daytona_api_client/models/git_commit_request.rb +74 -3
- data/lib/daytona_api_client/models/git_commit_response.rb +74 -3
- data/lib/daytona_api_client/models/git_delete_branch_request.rb +74 -3
- data/lib/daytona_api_client/models/git_repo_request.rb +74 -3
- data/lib/daytona_api_client/models/git_status.rb +74 -3
- data/lib/daytona_api_client/models/health_controller_check200_response.rb +74 -3
- data/lib/daytona_api_client/models/health_controller_check200_response_info_value.rb +74 -3
- data/lib/daytona_api_client/models/health_controller_check503_response.rb +74 -3
- data/lib/daytona_api_client/models/keyboard_hotkey_request.rb +74 -3
- data/lib/daytona_api_client/models/keyboard_press_request.rb +74 -3
- data/lib/daytona_api_client/models/keyboard_type_request.rb +74 -3
- data/lib/daytona_api_client/models/list_branch_response.rb +74 -3
- data/lib/daytona_api_client/models/lsp_completion_params.rb +74 -3
- data/lib/daytona_api_client/models/lsp_document_request.rb +74 -3
- data/lib/daytona_api_client/models/lsp_location.rb +74 -3
- data/lib/daytona_api_client/models/lsp_server_request.rb +74 -3
- data/lib/daytona_api_client/models/lsp_symbol.rb +74 -3
- data/lib/daytona_api_client/models/match.rb +74 -3
- data/lib/daytona_api_client/models/mouse_click_request.rb +74 -3
- data/lib/daytona_api_client/models/mouse_click_response.rb +74 -3
- data/lib/daytona_api_client/models/mouse_drag_request.rb +74 -3
- data/lib/daytona_api_client/models/mouse_drag_response.rb +74 -3
- data/lib/daytona_api_client/models/mouse_move_request.rb +74 -3
- data/lib/daytona_api_client/models/mouse_move_response.rb +74 -3
- data/lib/daytona_api_client/models/mouse_position.rb +74 -3
- data/lib/daytona_api_client/models/mouse_scroll_request.rb +74 -3
- data/lib/daytona_api_client/models/mouse_scroll_response.rb +74 -3
- data/lib/daytona_api_client/models/oidc_config.rb +74 -3
- data/lib/daytona_api_client/models/organization.rb +159 -149
- data/lib/daytona_api_client/models/organization_invitation.rb +78 -7
- data/lib/daytona_api_client/models/organization_role.rb +74 -3
- data/lib/daytona_api_client/models/organization_sandbox_default_limited_network_egress.rb +74 -3
- data/lib/daytona_api_client/models/organization_suspension.rb +79 -10
- data/lib/daytona_api_client/models/organization_usage_overview.rb +220 -21
- data/lib/daytona_api_client/models/organization_user.rb +76 -5
- data/lib/daytona_api_client/models/paginated_audit_logs.rb +78 -17
- data/lib/daytona_api_client/models/paginated_sandboxes.rb +74 -3
- data/lib/daytona_api_client/models/paginated_snapshots.rb +74 -3
- data/lib/daytona_api_client/models/{paginated_logs.rb → paginated_snapshots_dto.rb} +77 -10
- data/lib/daytona_api_client/models/port_preview_url.rb +88 -34
- data/lib/daytona_api_client/models/position.rb +74 -3
- data/lib/daytona_api_client/models/posthog_config.rb +74 -3
- data/lib/daytona_api_client/models/process_errors_response.rb +74 -3
- data/lib/daytona_api_client/models/process_logs_response.rb +74 -3
- data/lib/daytona_api_client/models/process_restart_response.rb +74 -3
- data/lib/daytona_api_client/models/process_status_response.rb +74 -3
- data/lib/daytona_api_client/models/project_dir_response.rb +74 -3
- data/lib/daytona_api_client/models/pty_create_request.rb +74 -3
- data/lib/daytona_api_client/models/pty_create_response.rb +74 -3
- data/lib/daytona_api_client/models/pty_list_response.rb +74 -3
- data/lib/daytona_api_client/models/pty_resize_request.rb +74 -3
- data/lib/daytona_api_client/models/pty_session_info.rb +74 -3
- data/lib/daytona_api_client/models/range.rb +74 -3
- data/lib/daytona_api_client/models/region.rb +78 -181
- data/lib/daytona_api_client/models/region_screenshot_response.rb +74 -3
- data/lib/daytona_api_client/models/registry_push_access_dto.rb +74 -3
- data/lib/daytona_api_client/models/replace_request.rb +74 -3
- data/lib/daytona_api_client/models/replace_result.rb +74 -3
- data/lib/daytona_api_client/models/runner.rb +191 -109
- data/lib/daytona_api_client/models/runner_snapshot_dto.rb +91 -3
- data/lib/daytona_api_client/models/runner_state.rb +3 -4
- data/lib/daytona_api_client/models/sandbox.rb +92 -95
- data/lib/daytona_api_client/models/sandbox_class.rb +3 -4
- data/lib/daytona_api_client/models/sandbox_desired_state.rb +3 -4
- data/lib/daytona_api_client/models/sandbox_info.rb +74 -3
- data/lib/daytona_api_client/models/sandbox_labels.rb +74 -3
- data/lib/daytona_api_client/models/sandbox_state.rb +3 -7
- data/lib/daytona_api_client/models/sandbox_volume.rb +78 -17
- data/lib/daytona_api_client/models/screenshot_response.rb +74 -3
- data/lib/daytona_api_client/models/search_files_response.rb +74 -3
- data/lib/daytona_api_client/models/send_webhook_dto.rb +75 -26
- data/lib/daytona_api_client/models/session.rb +74 -3
- data/lib/daytona_api_client/models/session_execute_request.rb +74 -3
- data/lib/daytona_api_client/models/session_execute_response.rb +74 -3
- data/lib/daytona_api_client/models/set_snapshot_general_status_dto.rb +74 -3
- data/lib/daytona_api_client/models/snapshot_dto.rb +78 -39
- data/lib/daytona_api_client/models/snapshot_state.rb +6 -4
- data/lib/daytona_api_client/models/ssh_access_dto.rb +78 -34
- data/lib/daytona_api_client/models/ssh_access_validation_dto.rb +98 -7
- data/lib/daytona_api_client/models/storage_access_dto.rb +74 -3
- data/lib/daytona_api_client/models/update_docker_registry.rb +74 -3
- data/lib/daytona_api_client/models/update_organization_invitation.rb +76 -5
- data/lib/daytona_api_client/models/update_organization_member_access.rb +76 -5
- data/lib/daytona_api_client/models/update_organization_quota.rb +115 -93
- data/lib/daytona_api_client/models/update_organization_role.rb +74 -3
- data/lib/daytona_api_client/models/update_sandbox_state_dto.rb +80 -29
- data/lib/daytona_api_client/models/user.rb +74 -3
- data/lib/daytona_api_client/models/user_home_dir_response.rb +74 -3
- data/lib/daytona_api_client/models/user_public_key.rb +74 -3
- data/lib/daytona_api_client/models/volume_dto.rb +74 -3
- data/lib/daytona_api_client/models/volume_state.rb +3 -4
- data/lib/daytona_api_client/models/webhook_app_portal_access.rb +75 -31
- data/lib/daytona_api_client/models/{admin_get_webhook_status200_response.rb → webhook_controller_get_status200_response.rb} +76 -5
- data/lib/daytona_api_client/models/webhook_initialization_status.rb +74 -3
- data/lib/daytona_api_client/models/windows_response.rb +74 -3
- data/lib/daytona_api_client/models/work_dir_response.rb +74 -3
- data/lib/daytona_api_client/models/workspace.rb +107 -83
- data/lib/daytona_api_client/version.rb +2 -2
- data/lib/daytona_api_client.rb +3 -49
- data/project.json +11 -42
- metadata +6 -56
- data/.gitignore +0 -39
- data/.openapi-generator/FILES +0 -211
- data/.openapi-generator/VERSION +0 -1
- data/.openapi-generator-ignore +0 -31
- data/.rspec +0 -2
- data/.rubocop.yml +0 -148
- data/fix-gemspec.sh +0 -11
- data/lib/daytona_api_client/api/admin_api.rb +0 -1151
- data/lib/daytona_api_client/api/jobs_api.rb +0 -299
- data/lib/daytona_api_client/api/regions_api.rb +0 -77
- data/lib/daytona_api_client/api_model_base.rb +0 -88
- data/lib/daytona_api_client/models/admin_create_runner.rb +0 -314
- data/lib/daytona_api_client/models/create_region.rb +0 -198
- data/lib/daytona_api_client/models/create_region_response.rb +0 -209
- data/lib/daytona_api_client/models/create_runner_response.rb +0 -192
- data/lib/daytona_api_client/models/create_sandbox_snapshot.rb +0 -165
- data/lib/daytona_api_client/models/fork_sandbox.rb +0 -148
- data/lib/daytona_api_client/models/job.rb +0 -366
- data/lib/daytona_api_client/models/job_status.rb +0 -43
- data/lib/daytona_api_client/models/job_type.rb +0 -53
- data/lib/daytona_api_client/models/log_entry.rb +0 -334
- data/lib/daytona_api_client/models/metric_data_point.rb +0 -192
- data/lib/daytona_api_client/models/metric_series.rb +0 -194
- data/lib/daytona_api_client/models/metrics_response.rb +0 -167
- data/lib/daytona_api_client/models/otel_config.rb +0 -178
- data/lib/daytona_api_client/models/paginated_jobs.rb +0 -244
- data/lib/daytona_api_client/models/paginated_traces.rb +0 -248
- data/lib/daytona_api_client/models/poll_jobs_response.rb +0 -167
- data/lib/daytona_api_client/models/rate_limit_config.rb +0 -178
- data/lib/daytona_api_client/models/rate_limit_entry.rb +0 -158
- data/lib/daytona_api_client/models/regenerate_api_key_response.rb +0 -165
- data/lib/daytona_api_client/models/region_quota.rb +0 -316
- data/lib/daytona_api_client/models/region_type.rb +0 -42
- data/lib/daytona_api_client/models/region_usage_overview.rb +0 -368
- data/lib/daytona_api_client/models/resize_sandbox.rb +0 -225
- data/lib/daytona_api_client/models/runner_class.rb +0 -41
- data/lib/daytona_api_client/models/runner_full.rb +0 -735
- data/lib/daytona_api_client/models/runner_health_metrics.rb +0 -462
- data/lib/daytona_api_client/models/runner_healthcheck.rb +0 -217
- data/lib/daytona_api_client/models/runner_service_health.rb +0 -202
- data/lib/daytona_api_client/models/signed_port_preview_url.rb +0 -246
- data/lib/daytona_api_client/models/snapshot_manager_credentials.rb +0 -192
- data/lib/daytona_api_client/models/toolbox_proxy_url.rb +0 -165
- data/lib/daytona_api_client/models/trace_span.rb +0 -332
- data/lib/daytona_api_client/models/trace_summary.rb +0 -310
- data/lib/daytona_api_client/models/update_job_status.rb +0 -207
- data/lib/daytona_api_client/models/update_organization_default_region.rb +0 -165
- data/lib/daytona_api_client/models/update_organization_region_quota.rb +0 -214
- data/lib/daytona_api_client/models/update_region.rb +0 -171
- data/lib/daytona_api_client/models/update_sandbox_network_settings.rb +0 -158
- data/lib/daytona_api_client/models/url.rb +0 -165
- data/lib/daytona_api_client/models/webhook_event.rb +0 -46
- data/lib/daytona_api_client/models/workspace_port_preview_url.rb +0 -192
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 1.0
|
|
7
7
|
Contact: support@daytona.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.12.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module DaytonaApiClient
|
|
17
|
-
class OrganizationSandboxDefaultLimitedNetworkEgress
|
|
17
|
+
class OrganizationSandboxDefaultLimitedNetworkEgress
|
|
18
18
|
# Sandbox default limited network egress
|
|
19
19
|
attr_accessor :sandbox_default_limited_network_egress
|
|
20
20
|
|
|
@@ -144,6 +144,61 @@ module DaytonaApiClient
|
|
|
144
144
|
new(transformed_hash)
|
|
145
145
|
end
|
|
146
146
|
|
|
147
|
+
# Deserializes the data based on type
|
|
148
|
+
# @param string type Data type
|
|
149
|
+
# @param string value Value to be deserialized
|
|
150
|
+
# @return [Object] Deserialized data
|
|
151
|
+
def self._deserialize(type, value)
|
|
152
|
+
case type.to_sym
|
|
153
|
+
when :Time
|
|
154
|
+
Time.parse(value)
|
|
155
|
+
when :Date
|
|
156
|
+
Date.parse(value)
|
|
157
|
+
when :String
|
|
158
|
+
value.to_s
|
|
159
|
+
when :Integer
|
|
160
|
+
value.to_i
|
|
161
|
+
when :Float
|
|
162
|
+
value.to_f
|
|
163
|
+
when :Boolean
|
|
164
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
165
|
+
true
|
|
166
|
+
else
|
|
167
|
+
false
|
|
168
|
+
end
|
|
169
|
+
when :Object
|
|
170
|
+
# generic object (usually a Hash), return directly
|
|
171
|
+
value
|
|
172
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
173
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
174
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
175
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
176
|
+
k_type = Regexp.last_match[:k_type]
|
|
177
|
+
v_type = Regexp.last_match[:v_type]
|
|
178
|
+
{}.tap do |hash|
|
|
179
|
+
value.each do |k, v|
|
|
180
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
else # model
|
|
184
|
+
# models (e.g. Pet) or oneOf
|
|
185
|
+
klass = DaytonaApiClient.const_get(type)
|
|
186
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
187
|
+
end
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Returns the string representation of the object
|
|
191
|
+
# @return [String] String presentation of the object
|
|
192
|
+
def to_s
|
|
193
|
+
to_hash.to_s
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
197
|
+
# @return [Hash] Returns the object in the form of hash
|
|
198
|
+
def to_body
|
|
199
|
+
to_hash
|
|
200
|
+
end
|
|
201
|
+
|
|
147
202
|
# Returns the object in the form of hash
|
|
148
203
|
# @return [Hash] Returns the object in the form of hash
|
|
149
204
|
def to_hash
|
|
@@ -160,6 +215,22 @@ module DaytonaApiClient
|
|
|
160
215
|
hash
|
|
161
216
|
end
|
|
162
217
|
|
|
218
|
+
# Outputs non-array value in the form of hash
|
|
219
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
220
|
+
# @param [Object] value Any valid value
|
|
221
|
+
# @return [Hash] Returns the value in the form of hash
|
|
222
|
+
def _to_hash(value)
|
|
223
|
+
if value.is_a?(Array)
|
|
224
|
+
value.compact.map { |v| _to_hash(v) }
|
|
225
|
+
elsif value.is_a?(Hash)
|
|
226
|
+
{}.tap do |hash|
|
|
227
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
228
|
+
end
|
|
229
|
+
elsif value.respond_to? :to_hash
|
|
230
|
+
value.to_hash
|
|
231
|
+
else
|
|
232
|
+
value
|
|
233
|
+
end
|
|
234
|
+
end
|
|
163
235
|
end
|
|
164
|
-
|
|
165
236
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 1.0
|
|
7
7
|
Contact: support@daytona.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.12.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module DaytonaApiClient
|
|
17
|
-
class OrganizationSuspension
|
|
17
|
+
class OrganizationSuspension
|
|
18
18
|
# Suspension reason
|
|
19
19
|
attr_accessor :reason
|
|
20
20
|
|
|
@@ -88,6 +88,8 @@ module DaytonaApiClient
|
|
|
88
88
|
|
|
89
89
|
if attributes.key?(:'suspension_cleanup_grace_period_hours')
|
|
90
90
|
self.suspension_cleanup_grace_period_hours = attributes[:'suspension_cleanup_grace_period_hours']
|
|
91
|
+
else
|
|
92
|
+
self.suspension_cleanup_grace_period_hours = nil
|
|
91
93
|
end
|
|
92
94
|
end
|
|
93
95
|
|
|
@@ -104,8 +106,8 @@ module DaytonaApiClient
|
|
|
104
106
|
invalid_properties.push('invalid value for "_until", _until cannot be nil.')
|
|
105
107
|
end
|
|
106
108
|
|
|
107
|
-
if
|
|
108
|
-
invalid_properties.push('invalid value for "suspension_cleanup_grace_period_hours",
|
|
109
|
+
if @suspension_cleanup_grace_period_hours.nil?
|
|
110
|
+
invalid_properties.push('invalid value for "suspension_cleanup_grace_period_hours", suspension_cleanup_grace_period_hours cannot be nil.')
|
|
109
111
|
end
|
|
110
112
|
|
|
111
113
|
invalid_properties
|
|
@@ -117,7 +119,7 @@ module DaytonaApiClient
|
|
|
117
119
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
118
120
|
return false if @reason.nil?
|
|
119
121
|
return false if @_until.nil?
|
|
120
|
-
return false if
|
|
122
|
+
return false if @suspension_cleanup_grace_period_hours.nil?
|
|
121
123
|
true
|
|
122
124
|
end
|
|
123
125
|
|
|
@@ -148,10 +150,6 @@ module DaytonaApiClient
|
|
|
148
150
|
fail ArgumentError, 'suspension_cleanup_grace_period_hours cannot be nil'
|
|
149
151
|
end
|
|
150
152
|
|
|
151
|
-
if suspension_cleanup_grace_period_hours < 0
|
|
152
|
-
fail ArgumentError, 'invalid value for "suspension_cleanup_grace_period_hours", must be greater than or equal to 0.'
|
|
153
|
-
end
|
|
154
|
-
|
|
155
153
|
@suspension_cleanup_grace_period_hours = suspension_cleanup_grace_period_hours
|
|
156
154
|
end
|
|
157
155
|
|
|
@@ -200,6 +198,61 @@ module DaytonaApiClient
|
|
|
200
198
|
new(transformed_hash)
|
|
201
199
|
end
|
|
202
200
|
|
|
201
|
+
# Deserializes the data based on type
|
|
202
|
+
# @param string type Data type
|
|
203
|
+
# @param string value Value to be deserialized
|
|
204
|
+
# @return [Object] Deserialized data
|
|
205
|
+
def self._deserialize(type, value)
|
|
206
|
+
case type.to_sym
|
|
207
|
+
when :Time
|
|
208
|
+
Time.parse(value)
|
|
209
|
+
when :Date
|
|
210
|
+
Date.parse(value)
|
|
211
|
+
when :String
|
|
212
|
+
value.to_s
|
|
213
|
+
when :Integer
|
|
214
|
+
value.to_i
|
|
215
|
+
when :Float
|
|
216
|
+
value.to_f
|
|
217
|
+
when :Boolean
|
|
218
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
219
|
+
true
|
|
220
|
+
else
|
|
221
|
+
false
|
|
222
|
+
end
|
|
223
|
+
when :Object
|
|
224
|
+
# generic object (usually a Hash), return directly
|
|
225
|
+
value
|
|
226
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
227
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
228
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
229
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
230
|
+
k_type = Regexp.last_match[:k_type]
|
|
231
|
+
v_type = Regexp.last_match[:v_type]
|
|
232
|
+
{}.tap do |hash|
|
|
233
|
+
value.each do |k, v|
|
|
234
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
235
|
+
end
|
|
236
|
+
end
|
|
237
|
+
else # model
|
|
238
|
+
# models (e.g. Pet) or oneOf
|
|
239
|
+
klass = DaytonaApiClient.const_get(type)
|
|
240
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
241
|
+
end
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
# Returns the string representation of the object
|
|
245
|
+
# @return [String] String presentation of the object
|
|
246
|
+
def to_s
|
|
247
|
+
to_hash.to_s
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
251
|
+
# @return [Hash] Returns the object in the form of hash
|
|
252
|
+
def to_body
|
|
253
|
+
to_hash
|
|
254
|
+
end
|
|
255
|
+
|
|
203
256
|
# Returns the object in the form of hash
|
|
204
257
|
# @return [Hash] Returns the object in the form of hash
|
|
205
258
|
def to_hash
|
|
@@ -216,6 +269,22 @@ module DaytonaApiClient
|
|
|
216
269
|
hash
|
|
217
270
|
end
|
|
218
271
|
|
|
272
|
+
# Outputs non-array value in the form of hash
|
|
273
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
274
|
+
# @param [Object] value Any valid value
|
|
275
|
+
# @return [Hash] Returns the value in the form of hash
|
|
276
|
+
def _to_hash(value)
|
|
277
|
+
if value.is_a?(Array)
|
|
278
|
+
value.compact.map { |v| _to_hash(v) }
|
|
279
|
+
elsif value.is_a?(Hash)
|
|
280
|
+
{}.tap do |hash|
|
|
281
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
282
|
+
end
|
|
283
|
+
elsif value.respond_to? :to_hash
|
|
284
|
+
value.to_hash
|
|
285
|
+
else
|
|
286
|
+
value
|
|
287
|
+
end
|
|
288
|
+
end
|
|
219
289
|
end
|
|
220
|
-
|
|
221
290
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 1.0
|
|
7
7
|
Contact: support@daytona.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.12.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -14,8 +14,18 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module DaytonaApiClient
|
|
17
|
-
class OrganizationUsageOverview
|
|
18
|
-
attr_accessor :
|
|
17
|
+
class OrganizationUsageOverview
|
|
18
|
+
attr_accessor :total_cpu_quota
|
|
19
|
+
|
|
20
|
+
attr_accessor :total_memory_quota
|
|
21
|
+
|
|
22
|
+
attr_accessor :total_disk_quota
|
|
23
|
+
|
|
24
|
+
attr_accessor :current_cpu_usage
|
|
25
|
+
|
|
26
|
+
attr_accessor :current_memory_usage
|
|
27
|
+
|
|
28
|
+
attr_accessor :current_disk_usage
|
|
19
29
|
|
|
20
30
|
attr_accessor :total_snapshot_quota
|
|
21
31
|
|
|
@@ -28,7 +38,12 @@ module DaytonaApiClient
|
|
|
28
38
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
39
|
def self.attribute_map
|
|
30
40
|
{
|
|
31
|
-
:'
|
|
41
|
+
:'total_cpu_quota' => :'totalCpuQuota',
|
|
42
|
+
:'total_memory_quota' => :'totalMemoryQuota',
|
|
43
|
+
:'total_disk_quota' => :'totalDiskQuota',
|
|
44
|
+
:'current_cpu_usage' => :'currentCpuUsage',
|
|
45
|
+
:'current_memory_usage' => :'currentMemoryUsage',
|
|
46
|
+
:'current_disk_usage' => :'currentDiskUsage',
|
|
32
47
|
:'total_snapshot_quota' => :'totalSnapshotQuota',
|
|
33
48
|
:'current_snapshot_usage' => :'currentSnapshotUsage',
|
|
34
49
|
:'total_volume_quota' => :'totalVolumeQuota',
|
|
@@ -49,7 +64,12 @@ module DaytonaApiClient
|
|
|
49
64
|
# Attribute type mapping.
|
|
50
65
|
def self.openapi_types
|
|
51
66
|
{
|
|
52
|
-
:'
|
|
67
|
+
:'total_cpu_quota' => :'Float',
|
|
68
|
+
:'total_memory_quota' => :'Float',
|
|
69
|
+
:'total_disk_quota' => :'Float',
|
|
70
|
+
:'current_cpu_usage' => :'Float',
|
|
71
|
+
:'current_memory_usage' => :'Float',
|
|
72
|
+
:'current_disk_usage' => :'Float',
|
|
53
73
|
:'total_snapshot_quota' => :'Float',
|
|
54
74
|
:'current_snapshot_usage' => :'Float',
|
|
55
75
|
:'total_volume_quota' => :'Float',
|
|
@@ -79,12 +99,40 @@ module DaytonaApiClient
|
|
|
79
99
|
h[k.to_sym] = v
|
|
80
100
|
}
|
|
81
101
|
|
|
82
|
-
if attributes.key?(:'
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
102
|
+
if attributes.key?(:'total_cpu_quota')
|
|
103
|
+
self.total_cpu_quota = attributes[:'total_cpu_quota']
|
|
104
|
+
else
|
|
105
|
+
self.total_cpu_quota = nil
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'total_memory_quota')
|
|
109
|
+
self.total_memory_quota = attributes[:'total_memory_quota']
|
|
110
|
+
else
|
|
111
|
+
self.total_memory_quota = nil
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'total_disk_quota')
|
|
115
|
+
self.total_disk_quota = attributes[:'total_disk_quota']
|
|
116
|
+
else
|
|
117
|
+
self.total_disk_quota = nil
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'current_cpu_usage')
|
|
121
|
+
self.current_cpu_usage = attributes[:'current_cpu_usage']
|
|
122
|
+
else
|
|
123
|
+
self.current_cpu_usage = nil
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if attributes.key?(:'current_memory_usage')
|
|
127
|
+
self.current_memory_usage = attributes[:'current_memory_usage']
|
|
86
128
|
else
|
|
87
|
-
self.
|
|
129
|
+
self.current_memory_usage = nil
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'current_disk_usage')
|
|
133
|
+
self.current_disk_usage = attributes[:'current_disk_usage']
|
|
134
|
+
else
|
|
135
|
+
self.current_disk_usage = nil
|
|
88
136
|
end
|
|
89
137
|
|
|
90
138
|
if attributes.key?(:'total_snapshot_quota')
|
|
@@ -117,8 +165,28 @@ module DaytonaApiClient
|
|
|
117
165
|
def list_invalid_properties
|
|
118
166
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
119
167
|
invalid_properties = Array.new
|
|
120
|
-
if @
|
|
121
|
-
invalid_properties.push('invalid value for "
|
|
168
|
+
if @total_cpu_quota.nil?
|
|
169
|
+
invalid_properties.push('invalid value for "total_cpu_quota", total_cpu_quota cannot be nil.')
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
if @total_memory_quota.nil?
|
|
173
|
+
invalid_properties.push('invalid value for "total_memory_quota", total_memory_quota cannot be nil.')
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
if @total_disk_quota.nil?
|
|
177
|
+
invalid_properties.push('invalid value for "total_disk_quota", total_disk_quota cannot be nil.')
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
if @current_cpu_usage.nil?
|
|
181
|
+
invalid_properties.push('invalid value for "current_cpu_usage", current_cpu_usage cannot be nil.')
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
if @current_memory_usage.nil?
|
|
185
|
+
invalid_properties.push('invalid value for "current_memory_usage", current_memory_usage cannot be nil.')
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
if @current_disk_usage.nil?
|
|
189
|
+
invalid_properties.push('invalid value for "current_disk_usage", current_disk_usage cannot be nil.')
|
|
122
190
|
end
|
|
123
191
|
|
|
124
192
|
if @total_snapshot_quota.nil?
|
|
@@ -144,7 +212,12 @@ module DaytonaApiClient
|
|
|
144
212
|
# @return true if the model is valid
|
|
145
213
|
def valid?
|
|
146
214
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
147
|
-
return false if @
|
|
215
|
+
return false if @total_cpu_quota.nil?
|
|
216
|
+
return false if @total_memory_quota.nil?
|
|
217
|
+
return false if @total_disk_quota.nil?
|
|
218
|
+
return false if @current_cpu_usage.nil?
|
|
219
|
+
return false if @current_memory_usage.nil?
|
|
220
|
+
return false if @current_disk_usage.nil?
|
|
148
221
|
return false if @total_snapshot_quota.nil?
|
|
149
222
|
return false if @current_snapshot_usage.nil?
|
|
150
223
|
return false if @total_volume_quota.nil?
|
|
@@ -153,13 +226,63 @@ module DaytonaApiClient
|
|
|
153
226
|
end
|
|
154
227
|
|
|
155
228
|
# Custom attribute writer method with validation
|
|
156
|
-
# @param [Object]
|
|
157
|
-
def
|
|
158
|
-
if
|
|
159
|
-
fail ArgumentError, '
|
|
229
|
+
# @param [Object] total_cpu_quota Value to be assigned
|
|
230
|
+
def total_cpu_quota=(total_cpu_quota)
|
|
231
|
+
if total_cpu_quota.nil?
|
|
232
|
+
fail ArgumentError, 'total_cpu_quota cannot be nil'
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
@total_cpu_quota = total_cpu_quota
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# Custom attribute writer method with validation
|
|
239
|
+
# @param [Object] total_memory_quota Value to be assigned
|
|
240
|
+
def total_memory_quota=(total_memory_quota)
|
|
241
|
+
if total_memory_quota.nil?
|
|
242
|
+
fail ArgumentError, 'total_memory_quota cannot be nil'
|
|
160
243
|
end
|
|
161
244
|
|
|
162
|
-
@
|
|
245
|
+
@total_memory_quota = total_memory_quota
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
# Custom attribute writer method with validation
|
|
249
|
+
# @param [Object] total_disk_quota Value to be assigned
|
|
250
|
+
def total_disk_quota=(total_disk_quota)
|
|
251
|
+
if total_disk_quota.nil?
|
|
252
|
+
fail ArgumentError, 'total_disk_quota cannot be nil'
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
@total_disk_quota = total_disk_quota
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# Custom attribute writer method with validation
|
|
259
|
+
# @param [Object] current_cpu_usage Value to be assigned
|
|
260
|
+
def current_cpu_usage=(current_cpu_usage)
|
|
261
|
+
if current_cpu_usage.nil?
|
|
262
|
+
fail ArgumentError, 'current_cpu_usage cannot be nil'
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
@current_cpu_usage = current_cpu_usage
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
# Custom attribute writer method with validation
|
|
269
|
+
# @param [Object] current_memory_usage Value to be assigned
|
|
270
|
+
def current_memory_usage=(current_memory_usage)
|
|
271
|
+
if current_memory_usage.nil?
|
|
272
|
+
fail ArgumentError, 'current_memory_usage cannot be nil'
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
@current_memory_usage = current_memory_usage
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
# Custom attribute writer method with validation
|
|
279
|
+
# @param [Object] current_disk_usage Value to be assigned
|
|
280
|
+
def current_disk_usage=(current_disk_usage)
|
|
281
|
+
if current_disk_usage.nil?
|
|
282
|
+
fail ArgumentError, 'current_disk_usage cannot be nil'
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
@current_disk_usage = current_disk_usage
|
|
163
286
|
end
|
|
164
287
|
|
|
165
288
|
# Custom attribute writer method with validation
|
|
@@ -207,7 +330,12 @@ module DaytonaApiClient
|
|
|
207
330
|
def ==(o)
|
|
208
331
|
return true if self.equal?(o)
|
|
209
332
|
self.class == o.class &&
|
|
210
|
-
|
|
333
|
+
total_cpu_quota == o.total_cpu_quota &&
|
|
334
|
+
total_memory_quota == o.total_memory_quota &&
|
|
335
|
+
total_disk_quota == o.total_disk_quota &&
|
|
336
|
+
current_cpu_usage == o.current_cpu_usage &&
|
|
337
|
+
current_memory_usage == o.current_memory_usage &&
|
|
338
|
+
current_disk_usage == o.current_disk_usage &&
|
|
211
339
|
total_snapshot_quota == o.total_snapshot_quota &&
|
|
212
340
|
current_snapshot_usage == o.current_snapshot_usage &&
|
|
213
341
|
total_volume_quota == o.total_volume_quota &&
|
|
@@ -223,7 +351,7 @@ module DaytonaApiClient
|
|
|
223
351
|
# Calculates hash code according to all attributes.
|
|
224
352
|
# @return [Integer] Hash code
|
|
225
353
|
def hash
|
|
226
|
-
[
|
|
354
|
+
[total_cpu_quota, total_memory_quota, total_disk_quota, current_cpu_usage, current_memory_usage, current_disk_usage, total_snapshot_quota, current_snapshot_usage, total_volume_quota, current_volume_usage].hash
|
|
227
355
|
end
|
|
228
356
|
|
|
229
357
|
# Builds the object from hash
|
|
@@ -249,6 +377,61 @@ module DaytonaApiClient
|
|
|
249
377
|
new(transformed_hash)
|
|
250
378
|
end
|
|
251
379
|
|
|
380
|
+
# Deserializes the data based on type
|
|
381
|
+
# @param string type Data type
|
|
382
|
+
# @param string value Value to be deserialized
|
|
383
|
+
# @return [Object] Deserialized data
|
|
384
|
+
def self._deserialize(type, value)
|
|
385
|
+
case type.to_sym
|
|
386
|
+
when :Time
|
|
387
|
+
Time.parse(value)
|
|
388
|
+
when :Date
|
|
389
|
+
Date.parse(value)
|
|
390
|
+
when :String
|
|
391
|
+
value.to_s
|
|
392
|
+
when :Integer
|
|
393
|
+
value.to_i
|
|
394
|
+
when :Float
|
|
395
|
+
value.to_f
|
|
396
|
+
when :Boolean
|
|
397
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
398
|
+
true
|
|
399
|
+
else
|
|
400
|
+
false
|
|
401
|
+
end
|
|
402
|
+
when :Object
|
|
403
|
+
# generic object (usually a Hash), return directly
|
|
404
|
+
value
|
|
405
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
406
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
407
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
408
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
409
|
+
k_type = Regexp.last_match[:k_type]
|
|
410
|
+
v_type = Regexp.last_match[:v_type]
|
|
411
|
+
{}.tap do |hash|
|
|
412
|
+
value.each do |k, v|
|
|
413
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
414
|
+
end
|
|
415
|
+
end
|
|
416
|
+
else # model
|
|
417
|
+
# models (e.g. Pet) or oneOf
|
|
418
|
+
klass = DaytonaApiClient.const_get(type)
|
|
419
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
420
|
+
end
|
|
421
|
+
end
|
|
422
|
+
|
|
423
|
+
# Returns the string representation of the object
|
|
424
|
+
# @return [String] String presentation of the object
|
|
425
|
+
def to_s
|
|
426
|
+
to_hash.to_s
|
|
427
|
+
end
|
|
428
|
+
|
|
429
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
430
|
+
# @return [Hash] Returns the object in the form of hash
|
|
431
|
+
def to_body
|
|
432
|
+
to_hash
|
|
433
|
+
end
|
|
434
|
+
|
|
252
435
|
# Returns the object in the form of hash
|
|
253
436
|
# @return [Hash] Returns the object in the form of hash
|
|
254
437
|
def to_hash
|
|
@@ -265,6 +448,22 @@ module DaytonaApiClient
|
|
|
265
448
|
hash
|
|
266
449
|
end
|
|
267
450
|
|
|
451
|
+
# Outputs non-array value in the form of hash
|
|
452
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
453
|
+
# @param [Object] value Any valid value
|
|
454
|
+
# @return [Hash] Returns the value in the form of hash
|
|
455
|
+
def _to_hash(value)
|
|
456
|
+
if value.is_a?(Array)
|
|
457
|
+
value.compact.map { |v| _to_hash(v) }
|
|
458
|
+
elsif value.is_a?(Hash)
|
|
459
|
+
{}.tap do |hash|
|
|
460
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
461
|
+
end
|
|
462
|
+
elsif value.respond_to? :to_hash
|
|
463
|
+
value.to_hash
|
|
464
|
+
else
|
|
465
|
+
value
|
|
466
|
+
end
|
|
467
|
+
end
|
|
268
468
|
end
|
|
269
|
-
|
|
270
469
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 1.0
|
|
7
7
|
Contact: support@daytona.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.12.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module DaytonaApiClient
|
|
17
|
-
class OrganizationUser
|
|
17
|
+
class OrganizationUser
|
|
18
18
|
# User ID
|
|
19
19
|
attr_accessor :user_id
|
|
20
20
|
|
|
@@ -221,7 +221,7 @@ module DaytonaApiClient
|
|
|
221
221
|
return false if @name.nil?
|
|
222
222
|
return false if @email.nil?
|
|
223
223
|
return false if @role.nil?
|
|
224
|
-
role_validator = EnumAttributeValidator.new('String', ["owner", "member"
|
|
224
|
+
role_validator = EnumAttributeValidator.new('String', ["owner", "member"])
|
|
225
225
|
return false unless role_validator.valid?(@role)
|
|
226
226
|
return false if @assigned_roles.nil?
|
|
227
227
|
return false if @created_at.nil?
|
|
@@ -272,7 +272,7 @@ module DaytonaApiClient
|
|
|
272
272
|
# Custom attribute writer method checking allowed values (enum).
|
|
273
273
|
# @param [Object] role Object to be assigned
|
|
274
274
|
def role=(role)
|
|
275
|
-
validator = EnumAttributeValidator.new('String', ["owner", "member"
|
|
275
|
+
validator = EnumAttributeValidator.new('String', ["owner", "member"])
|
|
276
276
|
unless validator.valid?(role)
|
|
277
277
|
fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}."
|
|
278
278
|
end
|
|
@@ -359,6 +359,61 @@ module DaytonaApiClient
|
|
|
359
359
|
new(transformed_hash)
|
|
360
360
|
end
|
|
361
361
|
|
|
362
|
+
# Deserializes the data based on type
|
|
363
|
+
# @param string type Data type
|
|
364
|
+
# @param string value Value to be deserialized
|
|
365
|
+
# @return [Object] Deserialized data
|
|
366
|
+
def self._deserialize(type, value)
|
|
367
|
+
case type.to_sym
|
|
368
|
+
when :Time
|
|
369
|
+
Time.parse(value)
|
|
370
|
+
when :Date
|
|
371
|
+
Date.parse(value)
|
|
372
|
+
when :String
|
|
373
|
+
value.to_s
|
|
374
|
+
when :Integer
|
|
375
|
+
value.to_i
|
|
376
|
+
when :Float
|
|
377
|
+
value.to_f
|
|
378
|
+
when :Boolean
|
|
379
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
380
|
+
true
|
|
381
|
+
else
|
|
382
|
+
false
|
|
383
|
+
end
|
|
384
|
+
when :Object
|
|
385
|
+
# generic object (usually a Hash), return directly
|
|
386
|
+
value
|
|
387
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
388
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
389
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
390
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
391
|
+
k_type = Regexp.last_match[:k_type]
|
|
392
|
+
v_type = Regexp.last_match[:v_type]
|
|
393
|
+
{}.tap do |hash|
|
|
394
|
+
value.each do |k, v|
|
|
395
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
396
|
+
end
|
|
397
|
+
end
|
|
398
|
+
else # model
|
|
399
|
+
# models (e.g. Pet) or oneOf
|
|
400
|
+
klass = DaytonaApiClient.const_get(type)
|
|
401
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
402
|
+
end
|
|
403
|
+
end
|
|
404
|
+
|
|
405
|
+
# Returns the string representation of the object
|
|
406
|
+
# @return [String] String presentation of the object
|
|
407
|
+
def to_s
|
|
408
|
+
to_hash.to_s
|
|
409
|
+
end
|
|
410
|
+
|
|
411
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
412
|
+
# @return [Hash] Returns the object in the form of hash
|
|
413
|
+
def to_body
|
|
414
|
+
to_hash
|
|
415
|
+
end
|
|
416
|
+
|
|
362
417
|
# Returns the object in the form of hash
|
|
363
418
|
# @return [Hash] Returns the object in the form of hash
|
|
364
419
|
def to_hash
|
|
@@ -375,6 +430,22 @@ module DaytonaApiClient
|
|
|
375
430
|
hash
|
|
376
431
|
end
|
|
377
432
|
|
|
433
|
+
# Outputs non-array value in the form of hash
|
|
434
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
435
|
+
# @param [Object] value Any valid value
|
|
436
|
+
# @return [Hash] Returns the value in the form of hash
|
|
437
|
+
def _to_hash(value)
|
|
438
|
+
if value.is_a?(Array)
|
|
439
|
+
value.compact.map { |v| _to_hash(v) }
|
|
440
|
+
elsif value.is_a?(Hash)
|
|
441
|
+
{}.tap do |hash|
|
|
442
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
443
|
+
end
|
|
444
|
+
elsif value.respond_to? :to_hash
|
|
445
|
+
value.to_hash
|
|
446
|
+
else
|
|
447
|
+
value
|
|
448
|
+
end
|
|
449
|
+
end
|
|
378
450
|
end
|
|
379
|
-
|
|
380
451
|
end
|