daytona_api_client 0.204.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 +4 -4
- data/lib/daytona_api_client/api/api_keys_api.rb +2 -2
- data/lib/daytona_api_client/api/audit_api.rb +98 -55
- 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 +310 -1846
- 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 +434 -2352
- data/lib/daytona_api_client/api/snapshots_api.rb +113 -42
- data/lib/daytona_api_client/api/toolbox_api.rb +5108 -0
- data/lib/daytona_api_client/api/users_api.rb +153 -89
- 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 +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/{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/{available_sandbox_class.rb → computer_use_status_response.rb} +97 -86
- 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 +78 -26
- data/lib/daytona_api_client/models/create_organization_role.rb +74 -3
- data/lib/daytona_api_client/models/create_runner.rb +386 -43
- data/lib/daytona_api_client/models/create_sandbox.rb +117 -86
- 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/create_user.rb +97 -40
- 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 -96
- 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/{paginated_jobs.rb → download_files.rb} +94 -100
- data/lib/daytona_api_client/models/{create_warm_pool.rb → execute_request.rb} +106 -62
- data/lib/daytona_api_client/models/execute_response.rb +263 -0
- data/lib/daytona_api_client/models/file_info.rb +417 -0
- data/lib/daytona_api_client/models/{secret.rb → file_status.rb} +122 -121
- data/lib/daytona_api_client/models/git_add_request.rb +264 -0
- data/lib/daytona_api_client/models/{admin_create_organization.rb → git_branch_request.rb} +95 -53
- 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/{trace_span.rb → git_commit_info.rb} +148 -141
- 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_secret.rb → git_delete_branch_request.rb} +106 -59
- 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/lsp_server_request.rb +263 -0
- data/lib/daytona_api_client/models/{create_sandbox_snapshot.rb → lsp_symbol.rb} +132 -22
- 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/mouse_position.rb +263 -0
- 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 +74 -3
- data/lib/daytona_api_client/models/organization.rb +159 -270
- 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_deprecated.rb → paginated_sandboxes.rb} +76 -5
- 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 +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/{metric_data_point.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 -181
- 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/{oidc_id_p_config.rb → replace_result.rb} +95 -88
- 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 +101 -174
- 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_region.rb → sandbox_info.rb} +113 -38
- 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/{audit_target_scenario.rb → search_files_response.rb} +95 -66
- data/lib/daytona_api_client/models/send_webhook_dto.rb +75 -26
- 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/{organization_sso_enabled.rb → session_execute_response.rb} +104 -30
- data/lib/daytona_api_client/models/set_snapshot_general_status_dto.rb +74 -3
- 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 +115 -131
- 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 -31
- 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} +299 -200
- data/lib/daytona_api_client/version.rb +2 -2
- data/lib/daytona_api_client.rb +76 -87
- data/project.json +13 -38
- metadata +81 -96
- data/.gitignore +0 -39
- data/.openapi-generator/FILES +0 -176
- 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 -1618
- 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/admin_create_runner.rb +0 -326
- data/lib/daytona_api_client/models/admin_get_webhook_status200_response.rb +0 -147
- 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_organization_region_quota.rb +0 -386
- 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 -44
- 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/organization_preview_warning.rb +0 -165
- 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_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/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_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_organization_region_quota.rb +0 -313
- data/lib/daytona_api_client/models/update_region.rb +0 -171
- 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/warm_pool.rb +0 -490
- data/lib/daytona_api_client/models/webhook_event.rb +0 -46
|
@@ -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,10 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module DaytonaApiClient
|
|
17
|
-
class CreateSandbox
|
|
18
|
-
# The name of the sandbox. If not provided, the sandbox ID will be used as the name
|
|
19
|
-
attr_accessor :name
|
|
20
|
-
|
|
17
|
+
class CreateSandbox
|
|
21
18
|
# The ID or name of the snapshot used for the sandbox
|
|
22
19
|
attr_accessor :snapshot
|
|
23
20
|
|
|
@@ -39,11 +36,8 @@ module DaytonaApiClient
|
|
|
39
36
|
# Comma-separated list of allowed CIDR network addresses for the sandbox
|
|
40
37
|
attr_accessor :network_allow_list
|
|
41
38
|
|
|
42
|
-
#
|
|
43
|
-
attr_accessor :
|
|
44
|
-
|
|
45
|
-
# Outbound proxy URL to route the sandbox HTTP(S) traffic through (http or https; credentials may be included in the URL). On its own this is convenience routing, not a security boundary: it is applied by injecting the standard HTTP(S)_PROXY environment variables at creation, so a process that clears those variables egresses directly. Combine with domainAllowList to have web-port (80/443) egress transparently redirected through the proxy chain at the network layer, which cannot be bypassed from inside the sandbox.
|
|
46
|
-
attr_accessor :outbound_proxy_url
|
|
39
|
+
# The sandbox class type
|
|
40
|
+
attr_accessor :_class
|
|
47
41
|
|
|
48
42
|
# The target (region) where the sandbox will be created
|
|
49
43
|
attr_accessor :target
|
|
@@ -54,9 +48,6 @@ module DaytonaApiClient
|
|
|
54
48
|
# GPU units allocated to the sandbox
|
|
55
49
|
attr_accessor :gpu
|
|
56
50
|
|
|
57
|
-
# Preferred GPU type for the sandbox. Accepts a single value or an ordered preference list — the scheduler tries each in order and pins the sandbox to the first that has capacity.
|
|
58
|
-
attr_accessor :gpu_type
|
|
59
|
-
|
|
60
51
|
# Memory allocated to the sandbox in GB
|
|
61
52
|
attr_accessor :memory
|
|
62
53
|
|
|
@@ -66,34 +57,43 @@ module DaytonaApiClient
|
|
|
66
57
|
# Auto-stop interval in minutes (0 means disabled)
|
|
67
58
|
attr_accessor :auto_stop_interval
|
|
68
59
|
|
|
69
|
-
# Auto-pause interval in minutes (0 means disabled). Only supported for sandbox classes that support pausing. Not allowed for ephemeral sandboxes. At most one of autoStopInterval and autoPauseInterval may be non-zero. For non-ephemeral sandbox classes that support pausing, defaults to 60 minutes (with auto-stop disabled) when neither interval is provided.
|
|
70
|
-
attr_accessor :auto_pause_interval
|
|
71
|
-
|
|
72
60
|
# Auto-archive interval in minutes (0 means the maximum interval will be used)
|
|
73
61
|
attr_accessor :auto_archive_interval
|
|
74
62
|
|
|
75
63
|
# Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)
|
|
76
64
|
attr_accessor :auto_delete_interval
|
|
77
65
|
|
|
78
|
-
# Maximum time to live in minutes, counted as wall-clock time since creation regardless of sandbox state (0 means disabled). When it elapses the sandbox is destroyed, even if it is stopped, paused, or archived. Subject to the maximum sandbox lifespan configured for the organization region and sandbox class, in which case it also defaults to that maximum and cannot be disabled.
|
|
79
|
-
attr_accessor :ttl_minutes
|
|
80
|
-
|
|
81
66
|
# Array of volumes to attach to the sandbox
|
|
82
67
|
attr_accessor :volumes
|
|
83
68
|
|
|
84
69
|
# Build information for the sandbox
|
|
85
70
|
attr_accessor :build_info
|
|
86
71
|
|
|
87
|
-
|
|
88
|
-
|
|
72
|
+
class EnumAttributeValidator
|
|
73
|
+
attr_reader :datatype
|
|
74
|
+
attr_reader :allowable_values
|
|
75
|
+
|
|
76
|
+
def initialize(datatype, allowable_values)
|
|
77
|
+
@allowable_values = allowable_values.map do |value|
|
|
78
|
+
case datatype.to_s
|
|
79
|
+
when /Integer/i
|
|
80
|
+
value.to_i
|
|
81
|
+
when /Float/i
|
|
82
|
+
value.to_f
|
|
83
|
+
else
|
|
84
|
+
value
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
89
88
|
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
def valid?(value)
|
|
90
|
+
!value || allowable_values.include?(value)
|
|
91
|
+
end
|
|
92
|
+
end
|
|
92
93
|
|
|
93
94
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
94
95
|
def self.attribute_map
|
|
95
96
|
{
|
|
96
|
-
:'name' => :'name',
|
|
97
97
|
:'snapshot' => :'snapshot',
|
|
98
98
|
:'user' => :'user',
|
|
99
99
|
:'env' => :'env',
|
|
@@ -101,23 +101,17 @@ module DaytonaApiClient
|
|
|
101
101
|
:'public' => :'public',
|
|
102
102
|
:'network_block_all' => :'networkBlockAll',
|
|
103
103
|
:'network_allow_list' => :'networkAllowList',
|
|
104
|
-
:'
|
|
105
|
-
:'outbound_proxy_url' => :'outboundProxyUrl',
|
|
104
|
+
:'_class' => :'class',
|
|
106
105
|
:'target' => :'target',
|
|
107
106
|
:'cpu' => :'cpu',
|
|
108
107
|
:'gpu' => :'gpu',
|
|
109
|
-
:'gpu_type' => :'gpuType',
|
|
110
108
|
:'memory' => :'memory',
|
|
111
109
|
:'disk' => :'disk',
|
|
112
110
|
:'auto_stop_interval' => :'autoStopInterval',
|
|
113
|
-
:'auto_pause_interval' => :'autoPauseInterval',
|
|
114
111
|
:'auto_archive_interval' => :'autoArchiveInterval',
|
|
115
112
|
:'auto_delete_interval' => :'autoDeleteInterval',
|
|
116
|
-
:'ttl_minutes' => :'ttlMinutes',
|
|
117
113
|
:'volumes' => :'volumes',
|
|
118
|
-
:'build_info' => :'buildInfo'
|
|
119
|
-
:'linked_sandbox' => :'linkedSandbox',
|
|
120
|
-
:'secrets' => :'secrets'
|
|
114
|
+
:'build_info' => :'buildInfo'
|
|
121
115
|
}
|
|
122
116
|
end
|
|
123
117
|
|
|
@@ -134,7 +128,6 @@ module DaytonaApiClient
|
|
|
134
128
|
# Attribute type mapping.
|
|
135
129
|
def self.openapi_types
|
|
136
130
|
{
|
|
137
|
-
:'name' => :'String',
|
|
138
131
|
:'snapshot' => :'String',
|
|
139
132
|
:'user' => :'String',
|
|
140
133
|
:'env' => :'Hash<String, String>',
|
|
@@ -142,23 +135,17 @@ module DaytonaApiClient
|
|
|
142
135
|
:'public' => :'Boolean',
|
|
143
136
|
:'network_block_all' => :'Boolean',
|
|
144
137
|
:'network_allow_list' => :'String',
|
|
145
|
-
:'
|
|
146
|
-
:'outbound_proxy_url' => :'String',
|
|
138
|
+
:'_class' => :'String',
|
|
147
139
|
:'target' => :'String',
|
|
148
140
|
:'cpu' => :'Integer',
|
|
149
141
|
:'gpu' => :'Integer',
|
|
150
|
-
:'gpu_type' => :'Array<GpuType>',
|
|
151
142
|
:'memory' => :'Integer',
|
|
152
143
|
:'disk' => :'Integer',
|
|
153
144
|
:'auto_stop_interval' => :'Integer',
|
|
154
|
-
:'auto_pause_interval' => :'Integer',
|
|
155
145
|
:'auto_archive_interval' => :'Integer',
|
|
156
146
|
:'auto_delete_interval' => :'Integer',
|
|
157
|
-
:'ttl_minutes' => :'Integer',
|
|
158
147
|
:'volumes' => :'Array<SandboxVolume>',
|
|
159
|
-
:'build_info' => :'CreateBuildInfo'
|
|
160
|
-
:'linked_sandbox' => :'String',
|
|
161
|
-
:'secrets' => :'Array<Hash<String, String>>'
|
|
148
|
+
:'build_info' => :'CreateBuildInfo'
|
|
162
149
|
}
|
|
163
150
|
end
|
|
164
151
|
|
|
@@ -184,10 +171,6 @@ module DaytonaApiClient
|
|
|
184
171
|
h[k.to_sym] = v
|
|
185
172
|
}
|
|
186
173
|
|
|
187
|
-
if attributes.key?(:'name')
|
|
188
|
-
self.name = attributes[:'name']
|
|
189
|
-
end
|
|
190
|
-
|
|
191
174
|
if attributes.key?(:'snapshot')
|
|
192
175
|
self.snapshot = attributes[:'snapshot']
|
|
193
176
|
end
|
|
@@ -220,12 +203,8 @@ module DaytonaApiClient
|
|
|
220
203
|
self.network_allow_list = attributes[:'network_allow_list']
|
|
221
204
|
end
|
|
222
205
|
|
|
223
|
-
if attributes.key?(:'
|
|
224
|
-
self.
|
|
225
|
-
end
|
|
226
|
-
|
|
227
|
-
if attributes.key?(:'outbound_proxy_url')
|
|
228
|
-
self.outbound_proxy_url = attributes[:'outbound_proxy_url']
|
|
206
|
+
if attributes.key?(:'_class')
|
|
207
|
+
self._class = attributes[:'_class']
|
|
229
208
|
end
|
|
230
209
|
|
|
231
210
|
if attributes.key?(:'target')
|
|
@@ -240,12 +219,6 @@ module DaytonaApiClient
|
|
|
240
219
|
self.gpu = attributes[:'gpu']
|
|
241
220
|
end
|
|
242
221
|
|
|
243
|
-
if attributes.key?(:'gpu_type')
|
|
244
|
-
if (value = attributes[:'gpu_type']).is_a?(Array)
|
|
245
|
-
self.gpu_type = value
|
|
246
|
-
end
|
|
247
|
-
end
|
|
248
|
-
|
|
249
222
|
if attributes.key?(:'memory')
|
|
250
223
|
self.memory = attributes[:'memory']
|
|
251
224
|
end
|
|
@@ -258,10 +231,6 @@ module DaytonaApiClient
|
|
|
258
231
|
self.auto_stop_interval = attributes[:'auto_stop_interval']
|
|
259
232
|
end
|
|
260
233
|
|
|
261
|
-
if attributes.key?(:'auto_pause_interval')
|
|
262
|
-
self.auto_pause_interval = attributes[:'auto_pause_interval']
|
|
263
|
-
end
|
|
264
|
-
|
|
265
234
|
if attributes.key?(:'auto_archive_interval')
|
|
266
235
|
self.auto_archive_interval = attributes[:'auto_archive_interval']
|
|
267
236
|
end
|
|
@@ -270,10 +239,6 @@ module DaytonaApiClient
|
|
|
270
239
|
self.auto_delete_interval = attributes[:'auto_delete_interval']
|
|
271
240
|
end
|
|
272
241
|
|
|
273
|
-
if attributes.key?(:'ttl_minutes')
|
|
274
|
-
self.ttl_minutes = attributes[:'ttl_minutes']
|
|
275
|
-
end
|
|
276
|
-
|
|
277
242
|
if attributes.key?(:'volumes')
|
|
278
243
|
if (value = attributes[:'volumes']).is_a?(Array)
|
|
279
244
|
self.volumes = value
|
|
@@ -283,16 +248,6 @@ module DaytonaApiClient
|
|
|
283
248
|
if attributes.key?(:'build_info')
|
|
284
249
|
self.build_info = attributes[:'build_info']
|
|
285
250
|
end
|
|
286
|
-
|
|
287
|
-
if attributes.key?(:'linked_sandbox')
|
|
288
|
-
self.linked_sandbox = attributes[:'linked_sandbox']
|
|
289
|
-
end
|
|
290
|
-
|
|
291
|
-
if attributes.key?(:'secrets')
|
|
292
|
-
if (value = attributes[:'secrets']).is_a?(Array)
|
|
293
|
-
self.secrets = value
|
|
294
|
-
end
|
|
295
|
-
end
|
|
296
251
|
end
|
|
297
252
|
|
|
298
253
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -307,15 +262,26 @@ module DaytonaApiClient
|
|
|
307
262
|
# @return true if the model is valid
|
|
308
263
|
def valid?
|
|
309
264
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
265
|
+
_class_validator = EnumAttributeValidator.new('String', ["small", "medium", "large"])
|
|
266
|
+
return false unless _class_validator.valid?(@_class)
|
|
310
267
|
true
|
|
311
268
|
end
|
|
312
269
|
|
|
270
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
271
|
+
# @param [Object] _class Object to be assigned
|
|
272
|
+
def _class=(_class)
|
|
273
|
+
validator = EnumAttributeValidator.new('String', ["small", "medium", "large"])
|
|
274
|
+
unless validator.valid?(_class)
|
|
275
|
+
fail ArgumentError, "invalid value for \"_class\", must be one of #{validator.allowable_values}."
|
|
276
|
+
end
|
|
277
|
+
@_class = _class
|
|
278
|
+
end
|
|
279
|
+
|
|
313
280
|
# Checks equality by comparing each attribute.
|
|
314
281
|
# @param [Object] Object to be compared
|
|
315
282
|
def ==(o)
|
|
316
283
|
return true if self.equal?(o)
|
|
317
284
|
self.class == o.class &&
|
|
318
|
-
name == o.name &&
|
|
319
285
|
snapshot == o.snapshot &&
|
|
320
286
|
user == o.user &&
|
|
321
287
|
env == o.env &&
|
|
@@ -323,23 +289,17 @@ module DaytonaApiClient
|
|
|
323
289
|
public == o.public &&
|
|
324
290
|
network_block_all == o.network_block_all &&
|
|
325
291
|
network_allow_list == o.network_allow_list &&
|
|
326
|
-
|
|
327
|
-
outbound_proxy_url == o.outbound_proxy_url &&
|
|
292
|
+
_class == o._class &&
|
|
328
293
|
target == o.target &&
|
|
329
294
|
cpu == o.cpu &&
|
|
330
295
|
gpu == o.gpu &&
|
|
331
|
-
gpu_type == o.gpu_type &&
|
|
332
296
|
memory == o.memory &&
|
|
333
297
|
disk == o.disk &&
|
|
334
298
|
auto_stop_interval == o.auto_stop_interval &&
|
|
335
|
-
auto_pause_interval == o.auto_pause_interval &&
|
|
336
299
|
auto_archive_interval == o.auto_archive_interval &&
|
|
337
300
|
auto_delete_interval == o.auto_delete_interval &&
|
|
338
|
-
ttl_minutes == o.ttl_minutes &&
|
|
339
301
|
volumes == o.volumes &&
|
|
340
|
-
build_info == o.build_info
|
|
341
|
-
linked_sandbox == o.linked_sandbox &&
|
|
342
|
-
secrets == o.secrets
|
|
302
|
+
build_info == o.build_info
|
|
343
303
|
end
|
|
344
304
|
|
|
345
305
|
# @see the `==` method
|
|
@@ -351,7 +311,7 @@ module DaytonaApiClient
|
|
|
351
311
|
# Calculates hash code according to all attributes.
|
|
352
312
|
# @return [Integer] Hash code
|
|
353
313
|
def hash
|
|
354
|
-
[
|
|
314
|
+
[snapshot, user, env, labels, public, network_block_all, network_allow_list, _class, target, cpu, gpu, memory, disk, auto_stop_interval, auto_archive_interval, auto_delete_interval, volumes, build_info].hash
|
|
355
315
|
end
|
|
356
316
|
|
|
357
317
|
# Builds the object from hash
|
|
@@ -377,6 +337,61 @@ module DaytonaApiClient
|
|
|
377
337
|
new(transformed_hash)
|
|
378
338
|
end
|
|
379
339
|
|
|
340
|
+
# Deserializes the data based on type
|
|
341
|
+
# @param string type Data type
|
|
342
|
+
# @param string value Value to be deserialized
|
|
343
|
+
# @return [Object] Deserialized data
|
|
344
|
+
def self._deserialize(type, value)
|
|
345
|
+
case type.to_sym
|
|
346
|
+
when :Time
|
|
347
|
+
Time.parse(value)
|
|
348
|
+
when :Date
|
|
349
|
+
Date.parse(value)
|
|
350
|
+
when :String
|
|
351
|
+
value.to_s
|
|
352
|
+
when :Integer
|
|
353
|
+
value.to_i
|
|
354
|
+
when :Float
|
|
355
|
+
value.to_f
|
|
356
|
+
when :Boolean
|
|
357
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
358
|
+
true
|
|
359
|
+
else
|
|
360
|
+
false
|
|
361
|
+
end
|
|
362
|
+
when :Object
|
|
363
|
+
# generic object (usually a Hash), return directly
|
|
364
|
+
value
|
|
365
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
366
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
367
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
368
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
369
|
+
k_type = Regexp.last_match[:k_type]
|
|
370
|
+
v_type = Regexp.last_match[:v_type]
|
|
371
|
+
{}.tap do |hash|
|
|
372
|
+
value.each do |k, v|
|
|
373
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
374
|
+
end
|
|
375
|
+
end
|
|
376
|
+
else # model
|
|
377
|
+
# models (e.g. Pet) or oneOf
|
|
378
|
+
klass = DaytonaApiClient.const_get(type)
|
|
379
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
380
|
+
end
|
|
381
|
+
end
|
|
382
|
+
|
|
383
|
+
# Returns the string representation of the object
|
|
384
|
+
# @return [String] String presentation of the object
|
|
385
|
+
def to_s
|
|
386
|
+
to_hash.to_s
|
|
387
|
+
end
|
|
388
|
+
|
|
389
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
390
|
+
# @return [Hash] Returns the object in the form of hash
|
|
391
|
+
def to_body
|
|
392
|
+
to_hash
|
|
393
|
+
end
|
|
394
|
+
|
|
380
395
|
# Returns the object in the form of hash
|
|
381
396
|
# @return [Hash] Returns the object in the form of hash
|
|
382
397
|
def to_hash
|
|
@@ -393,6 +408,22 @@ module DaytonaApiClient
|
|
|
393
408
|
hash
|
|
394
409
|
end
|
|
395
410
|
|
|
411
|
+
# Outputs non-array value in the form of hash
|
|
412
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
413
|
+
# @param [Object] value Any valid value
|
|
414
|
+
# @return [Hash] Returns the value in the form of hash
|
|
415
|
+
def _to_hash(value)
|
|
416
|
+
if value.is_a?(Array)
|
|
417
|
+
value.compact.map { |v| _to_hash(v) }
|
|
418
|
+
elsif value.is_a?(Hash)
|
|
419
|
+
{}.tap do |hash|
|
|
420
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
421
|
+
end
|
|
422
|
+
elsif value.respond_to? :to_hash
|
|
423
|
+
value.to_hash
|
|
424
|
+
else
|
|
425
|
+
value
|
|
426
|
+
end
|
|
427
|
+
end
|
|
396
428
|
end
|
|
397
|
-
|
|
398
429
|
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,26 +14,14 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module DaytonaApiClient
|
|
17
|
-
class
|
|
18
|
-
# ID of the
|
|
19
|
-
attr_accessor :
|
|
20
|
-
|
|
21
|
-
# Port number of the signed preview URL
|
|
22
|
-
attr_accessor :port
|
|
23
|
-
|
|
24
|
-
# Token of the signed preview URL
|
|
25
|
-
attr_accessor :token
|
|
26
|
-
|
|
27
|
-
# Signed preview url
|
|
28
|
-
attr_accessor :url
|
|
17
|
+
class CreateSessionRequest
|
|
18
|
+
# The ID of the session
|
|
19
|
+
attr_accessor :session_id
|
|
29
20
|
|
|
30
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
31
22
|
def self.attribute_map
|
|
32
23
|
{
|
|
33
|
-
:'
|
|
34
|
-
:'port' => :'port',
|
|
35
|
-
:'token' => :'token',
|
|
36
|
-
:'url' => :'url'
|
|
24
|
+
:'session_id' => :'sessionId'
|
|
37
25
|
}
|
|
38
26
|
end
|
|
39
27
|
|
|
@@ -50,10 +38,7 @@ module DaytonaApiClient
|
|
|
50
38
|
# Attribute type mapping.
|
|
51
39
|
def self.openapi_types
|
|
52
40
|
{
|
|
53
|
-
:'
|
|
54
|
-
:'port' => :'Integer',
|
|
55
|
-
:'token' => :'String',
|
|
56
|
-
:'url' => :'String'
|
|
41
|
+
:'session_id' => :'String'
|
|
57
42
|
}
|
|
58
43
|
end
|
|
59
44
|
|
|
@@ -67,40 +52,22 @@ module DaytonaApiClient
|
|
|
67
52
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
68
53
|
def initialize(attributes = {})
|
|
69
54
|
if (!attributes.is_a?(Hash))
|
|
70
|
-
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::CreateSessionRequest` initialize method"
|
|
71
56
|
end
|
|
72
57
|
|
|
73
58
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
74
59
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
75
60
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
76
61
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
77
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::
|
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::CreateSessionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
78
63
|
end
|
|
79
64
|
h[k.to_sym] = v
|
|
80
65
|
}
|
|
81
66
|
|
|
82
|
-
if attributes.key?(:'
|
|
83
|
-
self.
|
|
67
|
+
if attributes.key?(:'session_id')
|
|
68
|
+
self.session_id = attributes[:'session_id']
|
|
84
69
|
else
|
|
85
|
-
self.
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
if attributes.key?(:'port')
|
|
89
|
-
self.port = attributes[:'port']
|
|
90
|
-
else
|
|
91
|
-
self.port = nil
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
if attributes.key?(:'token')
|
|
95
|
-
self.token = attributes[:'token']
|
|
96
|
-
else
|
|
97
|
-
self.token = nil
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
if attributes.key?(:'url')
|
|
101
|
-
self.url = attributes[:'url']
|
|
102
|
-
else
|
|
103
|
-
self.url = nil
|
|
70
|
+
self.session_id = nil
|
|
104
71
|
end
|
|
105
72
|
end
|
|
106
73
|
|
|
@@ -109,20 +76,8 @@ module DaytonaApiClient
|
|
|
109
76
|
def list_invalid_properties
|
|
110
77
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
111
78
|
invalid_properties = Array.new
|
|
112
|
-
if @
|
|
113
|
-
invalid_properties.push('invalid value for "
|
|
114
|
-
end
|
|
115
|
-
|
|
116
|
-
if @port.nil?
|
|
117
|
-
invalid_properties.push('invalid value for "port", port cannot be nil.')
|
|
118
|
-
end
|
|
119
|
-
|
|
120
|
-
if @token.nil?
|
|
121
|
-
invalid_properties.push('invalid value for "token", token cannot be nil.')
|
|
122
|
-
end
|
|
123
|
-
|
|
124
|
-
if @url.nil?
|
|
125
|
-
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
|
79
|
+
if @session_id.nil?
|
|
80
|
+
invalid_properties.push('invalid value for "session_id", session_id cannot be nil.')
|
|
126
81
|
end
|
|
127
82
|
|
|
128
83
|
invalid_properties
|
|
@@ -132,51 +87,18 @@ module DaytonaApiClient
|
|
|
132
87
|
# @return true if the model is valid
|
|
133
88
|
def valid?
|
|
134
89
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
135
|
-
return false if @
|
|
136
|
-
return false if @port.nil?
|
|
137
|
-
return false if @token.nil?
|
|
138
|
-
return false if @url.nil?
|
|
90
|
+
return false if @session_id.nil?
|
|
139
91
|
true
|
|
140
92
|
end
|
|
141
93
|
|
|
142
94
|
# Custom attribute writer method with validation
|
|
143
|
-
# @param [Object]
|
|
144
|
-
def
|
|
145
|
-
if
|
|
146
|
-
fail ArgumentError, '
|
|
147
|
-
end
|
|
148
|
-
|
|
149
|
-
@sandbox_id = sandbox_id
|
|
150
|
-
end
|
|
151
|
-
|
|
152
|
-
# Custom attribute writer method with validation
|
|
153
|
-
# @param [Object] port Value to be assigned
|
|
154
|
-
def port=(port)
|
|
155
|
-
if port.nil?
|
|
156
|
-
fail ArgumentError, 'port cannot be nil'
|
|
95
|
+
# @param [Object] session_id Value to be assigned
|
|
96
|
+
def session_id=(session_id)
|
|
97
|
+
if session_id.nil?
|
|
98
|
+
fail ArgumentError, 'session_id cannot be nil'
|
|
157
99
|
end
|
|
158
100
|
|
|
159
|
-
@
|
|
160
|
-
end
|
|
161
|
-
|
|
162
|
-
# Custom attribute writer method with validation
|
|
163
|
-
# @param [Object] token Value to be assigned
|
|
164
|
-
def token=(token)
|
|
165
|
-
if token.nil?
|
|
166
|
-
fail ArgumentError, 'token cannot be nil'
|
|
167
|
-
end
|
|
168
|
-
|
|
169
|
-
@token = token
|
|
170
|
-
end
|
|
171
|
-
|
|
172
|
-
# Custom attribute writer method with validation
|
|
173
|
-
# @param [Object] url Value to be assigned
|
|
174
|
-
def url=(url)
|
|
175
|
-
if url.nil?
|
|
176
|
-
fail ArgumentError, 'url cannot be nil'
|
|
177
|
-
end
|
|
178
|
-
|
|
179
|
-
@url = url
|
|
101
|
+
@session_id = session_id
|
|
180
102
|
end
|
|
181
103
|
|
|
182
104
|
# Checks equality by comparing each attribute.
|
|
@@ -184,10 +106,7 @@ module DaytonaApiClient
|
|
|
184
106
|
def ==(o)
|
|
185
107
|
return true if self.equal?(o)
|
|
186
108
|
self.class == o.class &&
|
|
187
|
-
|
|
188
|
-
port == o.port &&
|
|
189
|
-
token == o.token &&
|
|
190
|
-
url == o.url
|
|
109
|
+
session_id == o.session_id
|
|
191
110
|
end
|
|
192
111
|
|
|
193
112
|
# @see the `==` method
|
|
@@ -199,7 +118,7 @@ module DaytonaApiClient
|
|
|
199
118
|
# Calculates hash code according to all attributes.
|
|
200
119
|
# @return [Integer] Hash code
|
|
201
120
|
def hash
|
|
202
|
-
[
|
|
121
|
+
[session_id].hash
|
|
203
122
|
end
|
|
204
123
|
|
|
205
124
|
# Builds the object from hash
|
|
@@ -225,6 +144,61 @@ module DaytonaApiClient
|
|
|
225
144
|
new(transformed_hash)
|
|
226
145
|
end
|
|
227
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
|
+
|
|
228
202
|
# Returns the object in the form of hash
|
|
229
203
|
# @return [Hash] Returns the object in the form of hash
|
|
230
204
|
def to_hash
|
|
@@ -241,6 +215,22 @@ module DaytonaApiClient
|
|
|
241
215
|
hash
|
|
242
216
|
end
|
|
243
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
|
|
244
235
|
end
|
|
245
|
-
|
|
246
236
|
end
|