daytona_api_client 0.216.1 → 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 +4 -4
- data/lib/daytona_api_client/api/api_keys_api.rb +2 -2
- data/lib/daytona_api_client/api/audit_api.rb +102 -59
- 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 +279 -1591
- data/lib/daytona_api_client/api/preview_api.rb +8 -202
- data/lib/daytona_api_client/api/runners_api.rb +22 -470
- data/lib/daytona_api_client/api/sandbox_api.rb +429 -2200
- data/lib/daytona_api_client/api/snapshots_api.rb +117 -46
- data/lib/daytona_api_client/api/toolbox_api.rb +5108 -0
- data/lib/daytona_api_client/api/users_api.rb +172 -100
- data/lib/daytona_api_client/api/volumes_api.rb +2 -2
- data/lib/daytona_api_client/api/webhooks_api.rb +164 -27
- data/lib/daytona_api_client/api/workspace_api.rb +955 -0
- 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 +93 -51
- data/lib/daytona_api_client/models/announcement.rb +74 -3
- data/lib/daytona_api_client/models/api_key_list.rb +78 -17
- 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/{create_runner_response.rb → command.rb} +104 -23
- data/lib/daytona_api_client/models/completion_context.rb +244 -0
- data/lib/daytona_api_client/models/completion_item.rb +289 -0
- data/lib/daytona_api_client/models/{paginated_traces.rb → completion_list.rb} +106 -91
- data/lib/daytona_api_client/models/compressed_screenshot_response.rb +256 -0
- data/lib/daytona_api_client/models/computer_use_start_response.rb +263 -0
- data/lib/daytona_api_client/models/{audit_target_scenario.rb → computer_use_status_response.rb} +96 -44
- data/lib/daytona_api_client/models/computer_use_stop_response.rb +263 -0
- 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 +290 -0
- data/lib/daytona_api_client/models/create_organization_role.rb +74 -3
- data/lib/daytona_api_client/models/create_runner.rb +361 -51
- data/lib/daytona_api_client/models/create_sandbox.rb +117 -108
- data/lib/daytona_api_client/models/{signed_port_preview_url.rb → create_session_request.rb} +93 -103
- data/lib/daytona_api_client/models/create_snapshot.rb +88 -61
- data/lib/daytona_api_client/models/{volume_created_webhook.rb → create_user.rb} +113 -131
- data/lib/daytona_api_client/models/create_volume.rb +74 -3
- data/lib/daytona_api_client/models/create_workspace.rb +411 -0
- data/lib/daytona_api_client/models/daytona_configuration.rb +78 -140
- data/lib/daytona_api_client/models/{runner_service_health.rb → display_info_response.rb} +95 -59
- data/lib/daytona_api_client/models/docker_registry.rb +76 -5
- data/lib/daytona_api_client/models/{oidc_id_p_config.rb → download_files.rb} +95 -86
- data/lib/daytona_api_client/models/{create_warm_pool.rb → execute_request.rb} +106 -62
- data/lib/daytona_api_client/models/{metric_data_point.rb → execute_response.rb} +109 -38
- data/lib/daytona_api_client/models/file_info.rb +417 -0
- data/lib/daytona_api_client/models/{snapshot_removed_webhook.rb → file_status.rb} +133 -142
- data/lib/daytona_api_client/models/git_add_request.rb +264 -0
- data/lib/daytona_api_client/models/{create_secret.rb → git_branch_request.rb} +106 -59
- data/lib/daytona_api_client/models/git_checkout_request.rb +261 -0
- data/lib/daytona_api_client/models/{toolbox_proxy_url.rb → git_clone_request.rb} +142 -10
- data/lib/daytona_api_client/models/{snapshot_created_webhook.rb → git_commit_info.rb} +151 -161
- data/lib/daytona_api_client/models/git_commit_request.rb +325 -0
- data/lib/daytona_api_client/models/{runner_healthcheck.rb → git_commit_response.rb} +92 -74
- data/lib/daytona_api_client/models/{create_region.rb → git_delete_branch_request.rb} +106 -54
- data/lib/daytona_api_client/models/{snapshot_manager_credentials.rb → git_repo_request.rb} +96 -35
- data/lib/daytona_api_client/models/git_status.rb +290 -0
- 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/{oidc_id_p_config_response.rb → keyboard_hotkey_request.rb} +93 -59
- data/lib/daytona_api_client/models/{create_region_response.rb → keyboard_press_request.rb} +102 -63
- data/lib/daytona_api_client/models/keyboard_type_request.rb +246 -0
- data/lib/daytona_api_client/models/list_branch_response.rb +237 -0
- data/lib/daytona_api_client/models/lsp_completion_params.rb +325 -0
- data/lib/daytona_api_client/models/lsp_document_request.rb +290 -0
- data/lib/daytona_api_client/models/lsp_location.rb +261 -0
- data/lib/daytona_api_client/models/{gpu_capacity.rb → lsp_server_request.rb} +109 -104
- data/lib/daytona_api_client/models/{secret.rb → lsp_symbol.rb} +121 -146
- data/lib/daytona_api_client/models/match.rb +287 -0
- data/lib/daytona_api_client/models/mouse_click_request.rb +283 -0
- data/lib/daytona_api_client/models/mouse_click_response.rb +263 -0
- data/lib/daytona_api_client/models/mouse_drag_request.rb +327 -0
- data/lib/daytona_api_client/models/mouse_drag_response.rb +263 -0
- data/lib/daytona_api_client/models/mouse_move_request.rb +263 -0
- data/lib/daytona_api_client/models/mouse_move_response.rb +263 -0
- data/lib/daytona_api_client/models/{available_sandbox_class.rb → mouse_position.rb} +109 -95
- data/lib/daytona_api_client/models/mouse_scroll_request.rb +300 -0
- data/lib/daytona_api_client/models/{test_identity_provider_connection_response.rb → mouse_scroll_response.rb} +81 -30
- data/lib/daytona_api_client/models/oidc_config.rb +78 -68
- data/lib/daytona_api_client/models/organization.rb +159 -307
- 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 +236 -0
- data/lib/daytona_api_client/models/organization_suspension.rb +290 -0
- 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 +80 -19
- data/lib/daytona_api_client/models/{paginated_jobs.rb → paginated_sandboxes.rb} +80 -9
- data/lib/daytona_api_client/models/paginated_snapshots.rb +77 -6
- data/lib/daytona_api_client/models/{paginated_logs.rb → paginated_snapshots_dto.rb} +80 -13
- data/lib/daytona_api_client/models/port_preview_url.rb +88 -34
- data/lib/daytona_api_client/models/position.rb +261 -0
- data/lib/daytona_api_client/models/posthog_config.rb +74 -3
- data/lib/daytona_api_client/models/process_errors_response.rb +263 -0
- data/lib/daytona_api_client/models/process_logs_response.rb +263 -0
- data/lib/daytona_api_client/models/process_restart_response.rb +263 -0
- data/lib/daytona_api_client/models/process_status_response.rb +263 -0
- data/lib/daytona_api_client/models/{update_last_activity.rb → project_dir_response.rb} +83 -13
- data/lib/daytona_api_client/models/{pending_sso_link.rb → pty_create_request.rb} +114 -109
- data/lib/daytona_api_client/models/pty_create_response.rb +236 -0
- data/lib/daytona_api_client/models/{sandbox_identity.rb → pty_list_response.rb} +95 -49
- data/lib/daytona_api_client/models/pty_resize_request.rb +263 -0
- data/lib/daytona_api_client/models/pty_session_info.rb +425 -0
- data/lib/daytona_api_client/models/range.rb +261 -0
- data/lib/daytona_api_client/models/region.rb +78 -192
- data/lib/daytona_api_client/models/{regenerate_api_key_response.rb → region_screenshot_response.rb} +113 -22
- data/lib/daytona_api_client/models/registry_push_access_dto.rb +74 -3
- data/lib/daytona_api_client/models/replace_request.rb +289 -0
- data/lib/daytona_api_client/models/replace_result.rb +236 -0
- data/lib/daytona_api_client/models/runner.rb +215 -155
- 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 +105 -210
- data/lib/daytona_api_client/models/sandbox_class.rb +6 -8
- data/lib/daytona_api_client/models/sandbox_desired_state.rb +3 -5
- data/lib/daytona_api_client/models/{create_sandbox_snapshot.rb → sandbox_info.rb} +113 -17
- data/lib/daytona_api_client/models/sandbox_labels.rb +74 -3
- data/lib/daytona_api_client/models/sandbox_state.rb +3 -10
- data/lib/daytona_api_client/models/sandbox_volume.rb +79 -18
- data/lib/daytona_api_client/models/screenshot_response.rb +256 -0
- data/lib/daytona_api_client/models/{gpu_capacity_response.rb → search_files_response.rb} +93 -49
- data/lib/daytona_api_client/models/send_webhook_dto.rb +273 -0
- data/lib/daytona_api_client/models/session.rb +251 -0
- data/lib/daytona_api_client/models/{list_sandboxes_response.rb → session_execute_request.rb} +110 -34
- data/lib/daytona_api_client/models/session_execute_response.rb +239 -0
- data/lib/daytona_api_client/models/{generate_workos_admin_portal_link.rb → set_snapshot_general_status_dto.rb} +93 -44
- data/lib/daytona_api_client/models/snapshot_dto.rb +78 -84
- data/lib/daytona_api_client/models/snapshot_state.rb +6 -5
- 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 +78 -34
- 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 +317 -0
- 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 +75 -51
- data/lib/daytona_api_client/models/{list_secrets_response.rb → user_home_dir_response.rb} +83 -72
- 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/{preview_warning.rb → webhook_controller_get_status200_response.rb} +76 -23
- data/lib/daytona_api_client/models/webhook_initialization_status.rb +74 -3
- data/lib/daytona_api_client/models/windows_response.rb +265 -0
- data/lib/daytona_api_client/models/{update_job_status.rb → work_dir_response.rb} +83 -72
- data/lib/daytona_api_client/models/{sandbox_list_item.rb → workspace.rb} +303 -226
- data/lib/daytona_api_client/version.rb +2 -2
- data/lib/daytona_api_client.rb +83 -93
- data/project.json +13 -38
- metadata +88 -102
- data/.gitignore +0 -39
- data/.openapi-generator/FILES +0 -175
- 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/jobs_api.rb +0 -299
- data/lib/daytona_api_client/api/regions_api.rb +0 -77
- data/lib/daytona_api_client/api/secret_api.rb +0 -441
- data/lib/daytona_api_client/api/warm_pools_api.rb +0 -286
- data/lib/daytona_api_client/api_model_base.rb +0 -88
- data/lib/daytona_api_client/models/audit_scenarios.rb +0 -167
- data/lib/daytona_api_client/models/create_identity_provider.rb +0 -269
- data/lib/daytona_api_client/models/create_runner_sandbox_class.rb +0 -42
- data/lib/daytona_api_client/models/date_filter.rb +0 -178
- data/lib/daytona_api_client/models/fork_sandbox.rb +0 -148
- data/lib/daytona_api_client/models/gpu_type.rb +0 -45
- data/lib/daytona_api_client/models/identity_provider.rb +0 -439
- data/lib/daytona_api_client/models/int_filter.rb +0 -222
- 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 -55
- data/lib/daytona_api_client/models/log_entry.rb +0 -334
- 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 -188
- data/lib/daytona_api_client/models/poll_jobs_response.rb +0 -167
- data/lib/daytona_api_client/models/rate_limit_config.rb +0 -188
- data/lib/daytona_api_client/models/rate_limit_entry.rb +0 -158
- data/lib/daytona_api_client/models/region_quota.rb +0 -453
- data/lib/daytona_api_client/models/region_type.rb +0 -42
- data/lib/daytona_api_client/models/region_usage_overview.rb +0 -518
- data/lib/daytona_api_client/models/resize_sandbox.rb +0 -225
- data/lib/daytona_api_client/models/resolve_sandbox_secrets200_response_inner.rb +0 -176
- data/lib/daytona_api_client/models/runner_class.rb +0 -40
- data/lib/daytona_api_client/models/runner_full.rb +0 -757
- data/lib/daytona_api_client/models/runner_health_metrics.rb +0 -482
- data/lib/daytona_api_client/models/sandbox_created_webhook.rb +0 -349
- data/lib/daytona_api_client/models/sandbox_list_sort_direction.rb +0 -41
- data/lib/daytona_api_client/models/sandbox_list_sort_field.rb +0 -45
- data/lib/daytona_api_client/models/sandbox_state_updated_webhook.rb +0 -349
- data/lib/daytona_api_client/models/snapshot_state_updated_webhook.rb +0 -376
- data/lib/daytona_api_client/models/sso_oidc_config.rb +0 -192
- data/lib/daytona_api_client/models/string_filter.rb +0 -182
- data/lib/daytona_api_client/models/test_identity_provider_connection.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_identity_provider.rb +0 -212
- data/lib/daytona_api_client/models/update_oidc_id_p_config.rb +0 -178
- data/lib/daytona_api_client/models/update_organization_default_region.rb +0 -165
- data/lib/daytona_api_client/models/update_region.rb +0 -182
- data/lib/daytona_api_client/models/update_sandbox_network_settings.rb +0 -168
- data/lib/daytona_api_client/models/update_sandbox_secrets.rb +0 -167
- data/lib/daytona_api_client/models/update_secret.rb +0 -170
- data/lib/daytona_api_client/models/update_warm_pool.rb +0 -174
- data/lib/daytona_api_client/models/url.rb +0 -165
- data/lib/daytona_api_client/models/volume_state_updated_webhook.rb +0 -376
- data/lib/daytona_api_client/models/warm_pool.rb +0 -490
- data/lib/daytona_api_client/models/webhook_event.rb +0 -46
- data/lib/daytona_api_client/models/workos_admin_portal_intent.rb +0 -41
- data/lib/daytona_api_client/models/workos_admin_portal_link.rb +0 -165
- data/lib/daytona_api_client/models/workos_sso_connection.rb +0 -329
data/lib/daytona_api_client/models/{list_sandboxes_response.rb → session_execute_request.rb}
RENAMED
|
@@ -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,18 +14,22 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module DaytonaApiClient
|
|
17
|
-
class
|
|
18
|
-
#
|
|
19
|
-
attr_accessor :
|
|
17
|
+
class SessionExecuteRequest
|
|
18
|
+
# The command to execute
|
|
19
|
+
attr_accessor :command
|
|
20
20
|
|
|
21
|
-
#
|
|
22
|
-
attr_accessor :
|
|
21
|
+
# Whether to execute the command asynchronously
|
|
22
|
+
attr_accessor :run_async
|
|
23
|
+
|
|
24
|
+
# Deprecated: Use runAsync instead. Whether to execute the command asynchronously
|
|
25
|
+
attr_accessor :async
|
|
23
26
|
|
|
24
27
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
28
|
def self.attribute_map
|
|
26
29
|
{
|
|
27
|
-
:'
|
|
28
|
-
:'
|
|
30
|
+
:'command' => :'command',
|
|
31
|
+
:'run_async' => :'runAsync',
|
|
32
|
+
:'async' => :'async'
|
|
29
33
|
}
|
|
30
34
|
end
|
|
31
35
|
|
|
@@ -42,15 +46,15 @@ module DaytonaApiClient
|
|
|
42
46
|
# Attribute type mapping.
|
|
43
47
|
def self.openapi_types
|
|
44
48
|
{
|
|
45
|
-
:'
|
|
46
|
-
:'
|
|
49
|
+
:'command' => :'String',
|
|
50
|
+
:'run_async' => :'Boolean',
|
|
51
|
+
:'async' => :'Boolean'
|
|
47
52
|
}
|
|
48
53
|
end
|
|
49
54
|
|
|
50
55
|
# List of attributes with nullable: true
|
|
51
56
|
def self.openapi_nullable
|
|
52
57
|
Set.new([
|
|
53
|
-
:'next_cursor'
|
|
54
58
|
])
|
|
55
59
|
end
|
|
56
60
|
|
|
@@ -58,30 +62,30 @@ module DaytonaApiClient
|
|
|
58
62
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
59
63
|
def initialize(attributes = {})
|
|
60
64
|
if (!attributes.is_a?(Hash))
|
|
61
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::
|
|
65
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::SessionExecuteRequest` initialize method"
|
|
62
66
|
end
|
|
63
67
|
|
|
64
68
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
65
69
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
66
70
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
67
71
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
68
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::
|
|
72
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::SessionExecuteRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
69
73
|
end
|
|
70
74
|
h[k.to_sym] = v
|
|
71
75
|
}
|
|
72
76
|
|
|
73
|
-
if attributes.key?(:'
|
|
74
|
-
|
|
75
|
-
self.items = value
|
|
76
|
-
end
|
|
77
|
+
if attributes.key?(:'command')
|
|
78
|
+
self.command = attributes[:'command']
|
|
77
79
|
else
|
|
78
|
-
self.
|
|
80
|
+
self.command = nil
|
|
79
81
|
end
|
|
80
82
|
|
|
81
|
-
if attributes.key?(:'
|
|
82
|
-
self.
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
if attributes.key?(:'run_async')
|
|
84
|
+
self.run_async = attributes[:'run_async']
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
if attributes.key?(:'async')
|
|
88
|
+
self.async = attributes[:'async']
|
|
85
89
|
end
|
|
86
90
|
end
|
|
87
91
|
|
|
@@ -90,8 +94,8 @@ module DaytonaApiClient
|
|
|
90
94
|
def list_invalid_properties
|
|
91
95
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
92
96
|
invalid_properties = Array.new
|
|
93
|
-
if @
|
|
94
|
-
invalid_properties.push('invalid value for "
|
|
97
|
+
if @command.nil?
|
|
98
|
+
invalid_properties.push('invalid value for "command", command cannot be nil.')
|
|
95
99
|
end
|
|
96
100
|
|
|
97
101
|
invalid_properties
|
|
@@ -101,18 +105,18 @@ module DaytonaApiClient
|
|
|
101
105
|
# @return true if the model is valid
|
|
102
106
|
def valid?
|
|
103
107
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
104
|
-
return false if @
|
|
108
|
+
return false if @command.nil?
|
|
105
109
|
true
|
|
106
110
|
end
|
|
107
111
|
|
|
108
112
|
# Custom attribute writer method with validation
|
|
109
|
-
# @param [Object]
|
|
110
|
-
def
|
|
111
|
-
if
|
|
112
|
-
fail ArgumentError, '
|
|
113
|
+
# @param [Object] command Value to be assigned
|
|
114
|
+
def command=(command)
|
|
115
|
+
if command.nil?
|
|
116
|
+
fail ArgumentError, 'command cannot be nil'
|
|
113
117
|
end
|
|
114
118
|
|
|
115
|
-
@
|
|
119
|
+
@command = command
|
|
116
120
|
end
|
|
117
121
|
|
|
118
122
|
# Checks equality by comparing each attribute.
|
|
@@ -120,8 +124,9 @@ module DaytonaApiClient
|
|
|
120
124
|
def ==(o)
|
|
121
125
|
return true if self.equal?(o)
|
|
122
126
|
self.class == o.class &&
|
|
123
|
-
|
|
124
|
-
|
|
127
|
+
command == o.command &&
|
|
128
|
+
run_async == o.run_async &&
|
|
129
|
+
async == o.async
|
|
125
130
|
end
|
|
126
131
|
|
|
127
132
|
# @see the `==` method
|
|
@@ -133,7 +138,7 @@ module DaytonaApiClient
|
|
|
133
138
|
# Calculates hash code according to all attributes.
|
|
134
139
|
# @return [Integer] Hash code
|
|
135
140
|
def hash
|
|
136
|
-
[
|
|
141
|
+
[command, run_async, async].hash
|
|
137
142
|
end
|
|
138
143
|
|
|
139
144
|
# Builds the object from hash
|
|
@@ -159,6 +164,61 @@ module DaytonaApiClient
|
|
|
159
164
|
new(transformed_hash)
|
|
160
165
|
end
|
|
161
166
|
|
|
167
|
+
# Deserializes the data based on type
|
|
168
|
+
# @param string type Data type
|
|
169
|
+
# @param string value Value to be deserialized
|
|
170
|
+
# @return [Object] Deserialized data
|
|
171
|
+
def self._deserialize(type, value)
|
|
172
|
+
case type.to_sym
|
|
173
|
+
when :Time
|
|
174
|
+
Time.parse(value)
|
|
175
|
+
when :Date
|
|
176
|
+
Date.parse(value)
|
|
177
|
+
when :String
|
|
178
|
+
value.to_s
|
|
179
|
+
when :Integer
|
|
180
|
+
value.to_i
|
|
181
|
+
when :Float
|
|
182
|
+
value.to_f
|
|
183
|
+
when :Boolean
|
|
184
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
185
|
+
true
|
|
186
|
+
else
|
|
187
|
+
false
|
|
188
|
+
end
|
|
189
|
+
when :Object
|
|
190
|
+
# generic object (usually a Hash), return directly
|
|
191
|
+
value
|
|
192
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
193
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
194
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
195
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
196
|
+
k_type = Regexp.last_match[:k_type]
|
|
197
|
+
v_type = Regexp.last_match[:v_type]
|
|
198
|
+
{}.tap do |hash|
|
|
199
|
+
value.each do |k, v|
|
|
200
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
else # model
|
|
204
|
+
# models (e.g. Pet) or oneOf
|
|
205
|
+
klass = DaytonaApiClient.const_get(type)
|
|
206
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Returns the string representation of the object
|
|
211
|
+
# @return [String] String presentation of the object
|
|
212
|
+
def to_s
|
|
213
|
+
to_hash.to_s
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
217
|
+
# @return [Hash] Returns the object in the form of hash
|
|
218
|
+
def to_body
|
|
219
|
+
to_hash
|
|
220
|
+
end
|
|
221
|
+
|
|
162
222
|
# Returns the object in the form of hash
|
|
163
223
|
# @return [Hash] Returns the object in the form of hash
|
|
164
224
|
def to_hash
|
|
@@ -175,6 +235,22 @@ module DaytonaApiClient
|
|
|
175
235
|
hash
|
|
176
236
|
end
|
|
177
237
|
|
|
238
|
+
# Outputs non-array value in the form of hash
|
|
239
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
240
|
+
# @param [Object] value Any valid value
|
|
241
|
+
# @return [Hash] Returns the value in the form of hash
|
|
242
|
+
def _to_hash(value)
|
|
243
|
+
if value.is_a?(Array)
|
|
244
|
+
value.compact.map { |v| _to_hash(v) }
|
|
245
|
+
elsif value.is_a?(Hash)
|
|
246
|
+
{}.tap do |hash|
|
|
247
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
248
|
+
end
|
|
249
|
+
elsif value.respond_to? :to_hash
|
|
250
|
+
value.to_hash
|
|
251
|
+
else
|
|
252
|
+
value
|
|
253
|
+
end
|
|
254
|
+
end
|
|
178
255
|
end
|
|
179
|
-
|
|
180
256
|
end
|
|
@@ -0,0 +1,239 @@
|
|
|
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.12.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module DaytonaApiClient
|
|
17
|
+
class SessionExecuteResponse
|
|
18
|
+
# The ID of the executed command
|
|
19
|
+
attr_accessor :cmd_id
|
|
20
|
+
|
|
21
|
+
# The output of the executed command marked with stdout and stderr prefixes
|
|
22
|
+
attr_accessor :output
|
|
23
|
+
|
|
24
|
+
# The exit code of the executed command
|
|
25
|
+
attr_accessor :exit_code
|
|
26
|
+
|
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
|
+
def self.attribute_map
|
|
29
|
+
{
|
|
30
|
+
:'cmd_id' => :'cmdId',
|
|
31
|
+
:'output' => :'output',
|
|
32
|
+
:'exit_code' => :'exitCode'
|
|
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
|
+
:'cmd_id' => :'String',
|
|
50
|
+
:'output' => :'String',
|
|
51
|
+
:'exit_code' => :'Float'
|
|
52
|
+
}
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# List of attributes with nullable: true
|
|
56
|
+
def self.openapi_nullable
|
|
57
|
+
Set.new([
|
|
58
|
+
])
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Initializes the object
|
|
62
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
63
|
+
def initialize(attributes = {})
|
|
64
|
+
if (!attributes.is_a?(Hash))
|
|
65
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::SessionExecuteResponse` initialize method"
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
69
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
70
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
71
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
72
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::SessionExecuteResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
73
|
+
end
|
|
74
|
+
h[k.to_sym] = v
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if attributes.key?(:'cmd_id')
|
|
78
|
+
self.cmd_id = attributes[:'cmd_id']
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
if attributes.key?(:'output')
|
|
82
|
+
self.output = attributes[:'output']
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
if attributes.key?(:'exit_code')
|
|
86
|
+
self.exit_code = attributes[:'exit_code']
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
91
|
+
# @return Array for valid properties with the reasons
|
|
92
|
+
def list_invalid_properties
|
|
93
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
94
|
+
invalid_properties = Array.new
|
|
95
|
+
invalid_properties
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Check to see if the all the properties in the model are valid
|
|
99
|
+
# @return true if the model is valid
|
|
100
|
+
def valid?
|
|
101
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
102
|
+
true
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Checks equality by comparing each attribute.
|
|
106
|
+
# @param [Object] Object to be compared
|
|
107
|
+
def ==(o)
|
|
108
|
+
return true if self.equal?(o)
|
|
109
|
+
self.class == o.class &&
|
|
110
|
+
cmd_id == o.cmd_id &&
|
|
111
|
+
output == o.output &&
|
|
112
|
+
exit_code == o.exit_code
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# @see the `==` method
|
|
116
|
+
# @param [Object] Object to be compared
|
|
117
|
+
def eql?(o)
|
|
118
|
+
self == o
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Calculates hash code according to all attributes.
|
|
122
|
+
# @return [Integer] Hash code
|
|
123
|
+
def hash
|
|
124
|
+
[cmd_id, output, exit_code].hash
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Builds the object from hash
|
|
128
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
129
|
+
# @return [Object] Returns the model itself
|
|
130
|
+
def self.build_from_hash(attributes)
|
|
131
|
+
return nil unless attributes.is_a?(Hash)
|
|
132
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
133
|
+
transformed_hash = {}
|
|
134
|
+
openapi_types.each_pair do |key, type|
|
|
135
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
136
|
+
transformed_hash["#{key}"] = nil
|
|
137
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
138
|
+
# check to ensure the input is an array given that the attribute
|
|
139
|
+
# is documented as an array but the input is not
|
|
140
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
141
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
142
|
+
end
|
|
143
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
144
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
new(transformed_hash)
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# Deserializes the data based on type
|
|
151
|
+
# @param string type Data type
|
|
152
|
+
# @param string value Value to be deserialized
|
|
153
|
+
# @return [Object] Deserialized data
|
|
154
|
+
def self._deserialize(type, value)
|
|
155
|
+
case type.to_sym
|
|
156
|
+
when :Time
|
|
157
|
+
Time.parse(value)
|
|
158
|
+
when :Date
|
|
159
|
+
Date.parse(value)
|
|
160
|
+
when :String
|
|
161
|
+
value.to_s
|
|
162
|
+
when :Integer
|
|
163
|
+
value.to_i
|
|
164
|
+
when :Float
|
|
165
|
+
value.to_f
|
|
166
|
+
when :Boolean
|
|
167
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
168
|
+
true
|
|
169
|
+
else
|
|
170
|
+
false
|
|
171
|
+
end
|
|
172
|
+
when :Object
|
|
173
|
+
# generic object (usually a Hash), return directly
|
|
174
|
+
value
|
|
175
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
176
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
177
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
178
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
179
|
+
k_type = Regexp.last_match[:k_type]
|
|
180
|
+
v_type = Regexp.last_match[:v_type]
|
|
181
|
+
{}.tap do |hash|
|
|
182
|
+
value.each do |k, v|
|
|
183
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
else # model
|
|
187
|
+
# models (e.g. Pet) or oneOf
|
|
188
|
+
klass = DaytonaApiClient.const_get(type)
|
|
189
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
190
|
+
end
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# Returns the string representation of the object
|
|
194
|
+
# @return [String] String presentation of the object
|
|
195
|
+
def to_s
|
|
196
|
+
to_hash.to_s
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
200
|
+
# @return [Hash] Returns the object in the form of hash
|
|
201
|
+
def to_body
|
|
202
|
+
to_hash
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Returns the object in the form of hash
|
|
206
|
+
# @return [Hash] Returns the object in the form of hash
|
|
207
|
+
def to_hash
|
|
208
|
+
hash = {}
|
|
209
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
210
|
+
value = self.send(attr)
|
|
211
|
+
if value.nil?
|
|
212
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
213
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
hash[param] = _to_hash(value)
|
|
217
|
+
end
|
|
218
|
+
hash
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Outputs non-array value in the form of hash
|
|
222
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
223
|
+
# @param [Object] value Any valid value
|
|
224
|
+
# @return [Hash] Returns the value in the form of hash
|
|
225
|
+
def _to_hash(value)
|
|
226
|
+
if value.is_a?(Array)
|
|
227
|
+
value.compact.map { |v| _to_hash(v) }
|
|
228
|
+
elsif value.is_a?(Hash)
|
|
229
|
+
{}.tap do |hash|
|
|
230
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
231
|
+
end
|
|
232
|
+
elsif value.respond_to? :to_hash
|
|
233
|
+
value.to_hash
|
|
234
|
+
else
|
|
235
|
+
value
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
end
|
|
239
|
+
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,36 +14,14 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module DaytonaApiClient
|
|
17
|
-
class
|
|
18
|
-
#
|
|
19
|
-
attr_accessor :
|
|
20
|
-
|
|
21
|
-
class EnumAttributeValidator
|
|
22
|
-
attr_reader :datatype
|
|
23
|
-
attr_reader :allowable_values
|
|
24
|
-
|
|
25
|
-
def initialize(datatype, allowable_values)
|
|
26
|
-
@allowable_values = allowable_values.map do |value|
|
|
27
|
-
case datatype.to_s
|
|
28
|
-
when /Integer/i
|
|
29
|
-
value.to_i
|
|
30
|
-
when /Float/i
|
|
31
|
-
value.to_f
|
|
32
|
-
else
|
|
33
|
-
value
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def valid?(value)
|
|
39
|
-
!value || allowable_values.include?(value)
|
|
40
|
-
end
|
|
41
|
-
end
|
|
17
|
+
class SetSnapshotGeneralStatusDto
|
|
18
|
+
# Whether the snapshot is general
|
|
19
|
+
attr_accessor :general
|
|
42
20
|
|
|
43
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
44
22
|
def self.attribute_map
|
|
45
23
|
{
|
|
46
|
-
:'
|
|
24
|
+
:'general' => :'general'
|
|
47
25
|
}
|
|
48
26
|
end
|
|
49
27
|
|
|
@@ -60,7 +38,7 @@ module DaytonaApiClient
|
|
|
60
38
|
# Attribute type mapping.
|
|
61
39
|
def self.openapi_types
|
|
62
40
|
{
|
|
63
|
-
:'
|
|
41
|
+
:'general' => :'Boolean'
|
|
64
42
|
}
|
|
65
43
|
end
|
|
66
44
|
|
|
@@ -74,22 +52,22 @@ module DaytonaApiClient
|
|
|
74
52
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
75
53
|
def initialize(attributes = {})
|
|
76
54
|
if (!attributes.is_a?(Hash))
|
|
77
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::
|
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::SetSnapshotGeneralStatusDto` initialize method"
|
|
78
56
|
end
|
|
79
57
|
|
|
80
58
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
81
59
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
82
60
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
83
61
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
84
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::
|
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::SetSnapshotGeneralStatusDto`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
85
63
|
end
|
|
86
64
|
h[k.to_sym] = v
|
|
87
65
|
}
|
|
88
66
|
|
|
89
|
-
if attributes.key?(:'
|
|
90
|
-
self.
|
|
67
|
+
if attributes.key?(:'general')
|
|
68
|
+
self.general = attributes[:'general']
|
|
91
69
|
else
|
|
92
|
-
self.
|
|
70
|
+
self.general = nil
|
|
93
71
|
end
|
|
94
72
|
end
|
|
95
73
|
|
|
@@ -98,8 +76,8 @@ module DaytonaApiClient
|
|
|
98
76
|
def list_invalid_properties
|
|
99
77
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
100
78
|
invalid_properties = Array.new
|
|
101
|
-
if @
|
|
102
|
-
invalid_properties.push('invalid value for "
|
|
79
|
+
if @general.nil?
|
|
80
|
+
invalid_properties.push('invalid value for "general", general cannot be nil.')
|
|
103
81
|
end
|
|
104
82
|
|
|
105
83
|
invalid_properties
|
|
@@ -109,18 +87,18 @@ module DaytonaApiClient
|
|
|
109
87
|
# @return true if the model is valid
|
|
110
88
|
def valid?
|
|
111
89
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
112
|
-
return false if @
|
|
90
|
+
return false if @general.nil?
|
|
113
91
|
true
|
|
114
92
|
end
|
|
115
93
|
|
|
116
94
|
# Custom attribute writer method with validation
|
|
117
|
-
# @param [Object]
|
|
118
|
-
def
|
|
119
|
-
if
|
|
120
|
-
fail ArgumentError, '
|
|
95
|
+
# @param [Object] general Value to be assigned
|
|
96
|
+
def general=(general)
|
|
97
|
+
if general.nil?
|
|
98
|
+
fail ArgumentError, 'general cannot be nil'
|
|
121
99
|
end
|
|
122
100
|
|
|
123
|
-
@
|
|
101
|
+
@general = general
|
|
124
102
|
end
|
|
125
103
|
|
|
126
104
|
# Checks equality by comparing each attribute.
|
|
@@ -128,7 +106,7 @@ module DaytonaApiClient
|
|
|
128
106
|
def ==(o)
|
|
129
107
|
return true if self.equal?(o)
|
|
130
108
|
self.class == o.class &&
|
|
131
|
-
|
|
109
|
+
general == o.general
|
|
132
110
|
end
|
|
133
111
|
|
|
134
112
|
# @see the `==` method
|
|
@@ -140,7 +118,7 @@ module DaytonaApiClient
|
|
|
140
118
|
# Calculates hash code according to all attributes.
|
|
141
119
|
# @return [Integer] Hash code
|
|
142
120
|
def hash
|
|
143
|
-
[
|
|
121
|
+
[general].hash
|
|
144
122
|
end
|
|
145
123
|
|
|
146
124
|
# Builds the object from hash
|
|
@@ -166,6 +144,61 @@ module DaytonaApiClient
|
|
|
166
144
|
new(transformed_hash)
|
|
167
145
|
end
|
|
168
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
|
+
|
|
169
202
|
# Returns the object in the form of hash
|
|
170
203
|
# @return [Hash] Returns the object in the form of hash
|
|
171
204
|
def to_hash
|
|
@@ -182,6 +215,22 @@ module DaytonaApiClient
|
|
|
182
215
|
hash
|
|
183
216
|
end
|
|
184
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
|
|
185
235
|
end
|
|
186
|
-
|
|
187
236
|
end
|