daytona_api_client 0.218.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 +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 -120
- 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 -220
- 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 -46
- 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
|
@@ -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,14 +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
|
|
47
|
-
|
|
48
|
-
# OTel collector endpoint override for this sandbox. When set, sandbox OTel data is sent to this endpoint instead of the default collector (the Daytona-hosted collector or the region-configured endpoint) and will not be available in the Daytona analytics API or dashboard.
|
|
49
|
-
attr_accessor :otel_endpoint_override
|
|
39
|
+
# The sandbox class type
|
|
40
|
+
attr_accessor :_class
|
|
50
41
|
|
|
51
42
|
# The target (region) where the sandbox will be created
|
|
52
43
|
attr_accessor :target
|
|
@@ -57,12 +48,6 @@ module DaytonaApiClient
|
|
|
57
48
|
# GPU units allocated to the sandbox
|
|
58
49
|
attr_accessor :gpu
|
|
59
50
|
|
|
60
|
-
# 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.
|
|
61
|
-
attr_accessor :gpu_type
|
|
62
|
-
|
|
63
|
-
# GPU-only. When true, the sandbox may be instantly terminated without notice to free GPU capacity for an on-demand (non-spot) GPU sandbox. Ignored / rejected when the sandbox requests no GPUs.
|
|
64
|
-
attr_accessor :spot
|
|
65
|
-
|
|
66
51
|
# Memory allocated to the sandbox in GB
|
|
67
52
|
attr_accessor :memory
|
|
68
53
|
|
|
@@ -72,37 +57,43 @@ module DaytonaApiClient
|
|
|
72
57
|
# Auto-stop interval in minutes (0 means disabled)
|
|
73
58
|
attr_accessor :auto_stop_interval
|
|
74
59
|
|
|
75
|
-
# 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.
|
|
76
|
-
attr_accessor :auto_pause_interval
|
|
77
|
-
|
|
78
60
|
# Auto-archive interval in minutes (0 means the maximum interval will be used)
|
|
79
61
|
attr_accessor :auto_archive_interval
|
|
80
62
|
|
|
81
63
|
# Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)
|
|
82
64
|
attr_accessor :auto_delete_interval
|
|
83
65
|
|
|
84
|
-
# 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.
|
|
85
|
-
attr_accessor :ttl_minutes
|
|
86
|
-
|
|
87
66
|
# Array of volumes to attach to the sandbox
|
|
88
67
|
attr_accessor :volumes
|
|
89
68
|
|
|
90
69
|
# Build information for the sandbox
|
|
91
70
|
attr_accessor :build_info
|
|
92
71
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
|
98
88
|
|
|
99
|
-
|
|
100
|
-
|
|
89
|
+
def valid?(value)
|
|
90
|
+
!value || allowable_values.include?(value)
|
|
91
|
+
end
|
|
92
|
+
end
|
|
101
93
|
|
|
102
94
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
103
95
|
def self.attribute_map
|
|
104
96
|
{
|
|
105
|
-
:'name' => :'name',
|
|
106
97
|
:'snapshot' => :'snapshot',
|
|
107
98
|
:'user' => :'user',
|
|
108
99
|
:'env' => :'env',
|
|
@@ -110,26 +101,17 @@ module DaytonaApiClient
|
|
|
110
101
|
:'public' => :'public',
|
|
111
102
|
:'network_block_all' => :'networkBlockAll',
|
|
112
103
|
:'network_allow_list' => :'networkAllowList',
|
|
113
|
-
:'
|
|
114
|
-
:'outbound_proxy_url' => :'outboundProxyUrl',
|
|
115
|
-
:'otel_endpoint_override' => :'otelEndpointOverride',
|
|
104
|
+
:'_class' => :'class',
|
|
116
105
|
:'target' => :'target',
|
|
117
106
|
:'cpu' => :'cpu',
|
|
118
107
|
:'gpu' => :'gpu',
|
|
119
|
-
:'gpu_type' => :'gpuType',
|
|
120
|
-
:'spot' => :'spot',
|
|
121
108
|
:'memory' => :'memory',
|
|
122
109
|
:'disk' => :'disk',
|
|
123
110
|
:'auto_stop_interval' => :'autoStopInterval',
|
|
124
|
-
:'auto_pause_interval' => :'autoPauseInterval',
|
|
125
111
|
:'auto_archive_interval' => :'autoArchiveInterval',
|
|
126
112
|
:'auto_delete_interval' => :'autoDeleteInterval',
|
|
127
|
-
:'ttl_minutes' => :'ttlMinutes',
|
|
128
113
|
:'volumes' => :'volumes',
|
|
129
|
-
:'build_info' => :'buildInfo'
|
|
130
|
-
:'linked_sandbox' => :'linkedSandbox',
|
|
131
|
-
:'secrets' => :'secrets',
|
|
132
|
-
:'kvm' => :'kvm'
|
|
114
|
+
:'build_info' => :'buildInfo'
|
|
133
115
|
}
|
|
134
116
|
end
|
|
135
117
|
|
|
@@ -146,7 +128,6 @@ module DaytonaApiClient
|
|
|
146
128
|
# Attribute type mapping.
|
|
147
129
|
def self.openapi_types
|
|
148
130
|
{
|
|
149
|
-
:'name' => :'String',
|
|
150
131
|
:'snapshot' => :'String',
|
|
151
132
|
:'user' => :'String',
|
|
152
133
|
:'env' => :'Hash<String, String>',
|
|
@@ -154,26 +135,17 @@ module DaytonaApiClient
|
|
|
154
135
|
:'public' => :'Boolean',
|
|
155
136
|
:'network_block_all' => :'Boolean',
|
|
156
137
|
:'network_allow_list' => :'String',
|
|
157
|
-
:'
|
|
158
|
-
:'outbound_proxy_url' => :'String',
|
|
159
|
-
:'otel_endpoint_override' => :'String',
|
|
138
|
+
:'_class' => :'String',
|
|
160
139
|
:'target' => :'String',
|
|
161
140
|
:'cpu' => :'Integer',
|
|
162
141
|
:'gpu' => :'Integer',
|
|
163
|
-
:'gpu_type' => :'Array<GpuType>',
|
|
164
|
-
:'spot' => :'Boolean',
|
|
165
142
|
:'memory' => :'Integer',
|
|
166
143
|
:'disk' => :'Integer',
|
|
167
144
|
:'auto_stop_interval' => :'Integer',
|
|
168
|
-
:'auto_pause_interval' => :'Integer',
|
|
169
145
|
:'auto_archive_interval' => :'Integer',
|
|
170
146
|
:'auto_delete_interval' => :'Integer',
|
|
171
|
-
:'ttl_minutes' => :'Integer',
|
|
172
147
|
:'volumes' => :'Array<SandboxVolume>',
|
|
173
|
-
:'build_info' => :'CreateBuildInfo'
|
|
174
|
-
:'linked_sandbox' => :'String',
|
|
175
|
-
:'secrets' => :'Array<Hash<String, String>>',
|
|
176
|
-
:'kvm' => :'Boolean'
|
|
148
|
+
:'build_info' => :'CreateBuildInfo'
|
|
177
149
|
}
|
|
178
150
|
end
|
|
179
151
|
|
|
@@ -199,10 +171,6 @@ module DaytonaApiClient
|
|
|
199
171
|
h[k.to_sym] = v
|
|
200
172
|
}
|
|
201
173
|
|
|
202
|
-
if attributes.key?(:'name')
|
|
203
|
-
self.name = attributes[:'name']
|
|
204
|
-
end
|
|
205
|
-
|
|
206
174
|
if attributes.key?(:'snapshot')
|
|
207
175
|
self.snapshot = attributes[:'snapshot']
|
|
208
176
|
end
|
|
@@ -235,16 +203,8 @@ module DaytonaApiClient
|
|
|
235
203
|
self.network_allow_list = attributes[:'network_allow_list']
|
|
236
204
|
end
|
|
237
205
|
|
|
238
|
-
if attributes.key?(:'
|
|
239
|
-
self.
|
|
240
|
-
end
|
|
241
|
-
|
|
242
|
-
if attributes.key?(:'outbound_proxy_url')
|
|
243
|
-
self.outbound_proxy_url = attributes[:'outbound_proxy_url']
|
|
244
|
-
end
|
|
245
|
-
|
|
246
|
-
if attributes.key?(:'otel_endpoint_override')
|
|
247
|
-
self.otel_endpoint_override = attributes[:'otel_endpoint_override']
|
|
206
|
+
if attributes.key?(:'_class')
|
|
207
|
+
self._class = attributes[:'_class']
|
|
248
208
|
end
|
|
249
209
|
|
|
250
210
|
if attributes.key?(:'target')
|
|
@@ -259,18 +219,6 @@ module DaytonaApiClient
|
|
|
259
219
|
self.gpu = attributes[:'gpu']
|
|
260
220
|
end
|
|
261
221
|
|
|
262
|
-
if attributes.key?(:'gpu_type')
|
|
263
|
-
if (value = attributes[:'gpu_type']).is_a?(Array)
|
|
264
|
-
self.gpu_type = value
|
|
265
|
-
end
|
|
266
|
-
end
|
|
267
|
-
|
|
268
|
-
if attributes.key?(:'spot')
|
|
269
|
-
self.spot = attributes[:'spot']
|
|
270
|
-
else
|
|
271
|
-
self.spot = false
|
|
272
|
-
end
|
|
273
|
-
|
|
274
222
|
if attributes.key?(:'memory')
|
|
275
223
|
self.memory = attributes[:'memory']
|
|
276
224
|
end
|
|
@@ -283,10 +231,6 @@ module DaytonaApiClient
|
|
|
283
231
|
self.auto_stop_interval = attributes[:'auto_stop_interval']
|
|
284
232
|
end
|
|
285
233
|
|
|
286
|
-
if attributes.key?(:'auto_pause_interval')
|
|
287
|
-
self.auto_pause_interval = attributes[:'auto_pause_interval']
|
|
288
|
-
end
|
|
289
|
-
|
|
290
234
|
if attributes.key?(:'auto_archive_interval')
|
|
291
235
|
self.auto_archive_interval = attributes[:'auto_archive_interval']
|
|
292
236
|
end
|
|
@@ -295,10 +239,6 @@ module DaytonaApiClient
|
|
|
295
239
|
self.auto_delete_interval = attributes[:'auto_delete_interval']
|
|
296
240
|
end
|
|
297
241
|
|
|
298
|
-
if attributes.key?(:'ttl_minutes')
|
|
299
|
-
self.ttl_minutes = attributes[:'ttl_minutes']
|
|
300
|
-
end
|
|
301
|
-
|
|
302
242
|
if attributes.key?(:'volumes')
|
|
303
243
|
if (value = attributes[:'volumes']).is_a?(Array)
|
|
304
244
|
self.volumes = value
|
|
@@ -308,22 +248,6 @@ module DaytonaApiClient
|
|
|
308
248
|
if attributes.key?(:'build_info')
|
|
309
249
|
self.build_info = attributes[:'build_info']
|
|
310
250
|
end
|
|
311
|
-
|
|
312
|
-
if attributes.key?(:'linked_sandbox')
|
|
313
|
-
self.linked_sandbox = attributes[:'linked_sandbox']
|
|
314
|
-
end
|
|
315
|
-
|
|
316
|
-
if attributes.key?(:'secrets')
|
|
317
|
-
if (value = attributes[:'secrets']).is_a?(Array)
|
|
318
|
-
self.secrets = value
|
|
319
|
-
end
|
|
320
|
-
end
|
|
321
|
-
|
|
322
|
-
if attributes.key?(:'kvm')
|
|
323
|
-
self.kvm = attributes[:'kvm']
|
|
324
|
-
else
|
|
325
|
-
self.kvm = false
|
|
326
|
-
end
|
|
327
251
|
end
|
|
328
252
|
|
|
329
253
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -338,15 +262,26 @@ module DaytonaApiClient
|
|
|
338
262
|
# @return true if the model is valid
|
|
339
263
|
def valid?
|
|
340
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)
|
|
341
267
|
true
|
|
342
268
|
end
|
|
343
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
|
+
|
|
344
280
|
# Checks equality by comparing each attribute.
|
|
345
281
|
# @param [Object] Object to be compared
|
|
346
282
|
def ==(o)
|
|
347
283
|
return true if self.equal?(o)
|
|
348
284
|
self.class == o.class &&
|
|
349
|
-
name == o.name &&
|
|
350
285
|
snapshot == o.snapshot &&
|
|
351
286
|
user == o.user &&
|
|
352
287
|
env == o.env &&
|
|
@@ -354,26 +289,17 @@ module DaytonaApiClient
|
|
|
354
289
|
public == o.public &&
|
|
355
290
|
network_block_all == o.network_block_all &&
|
|
356
291
|
network_allow_list == o.network_allow_list &&
|
|
357
|
-
|
|
358
|
-
outbound_proxy_url == o.outbound_proxy_url &&
|
|
359
|
-
otel_endpoint_override == o.otel_endpoint_override &&
|
|
292
|
+
_class == o._class &&
|
|
360
293
|
target == o.target &&
|
|
361
294
|
cpu == o.cpu &&
|
|
362
295
|
gpu == o.gpu &&
|
|
363
|
-
gpu_type == o.gpu_type &&
|
|
364
|
-
spot == o.spot &&
|
|
365
296
|
memory == o.memory &&
|
|
366
297
|
disk == o.disk &&
|
|
367
298
|
auto_stop_interval == o.auto_stop_interval &&
|
|
368
|
-
auto_pause_interval == o.auto_pause_interval &&
|
|
369
299
|
auto_archive_interval == o.auto_archive_interval &&
|
|
370
300
|
auto_delete_interval == o.auto_delete_interval &&
|
|
371
|
-
ttl_minutes == o.ttl_minutes &&
|
|
372
301
|
volumes == o.volumes &&
|
|
373
|
-
build_info == o.build_info
|
|
374
|
-
linked_sandbox == o.linked_sandbox &&
|
|
375
|
-
secrets == o.secrets &&
|
|
376
|
-
kvm == o.kvm
|
|
302
|
+
build_info == o.build_info
|
|
377
303
|
end
|
|
378
304
|
|
|
379
305
|
# @see the `==` method
|
|
@@ -385,7 +311,7 @@ module DaytonaApiClient
|
|
|
385
311
|
# Calculates hash code according to all attributes.
|
|
386
312
|
# @return [Integer] Hash code
|
|
387
313
|
def hash
|
|
388
|
-
[
|
|
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
|
|
389
315
|
end
|
|
390
316
|
|
|
391
317
|
# Builds the object from hash
|
|
@@ -411,6 +337,61 @@ module DaytonaApiClient
|
|
|
411
337
|
new(transformed_hash)
|
|
412
338
|
end
|
|
413
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
|
+
|
|
414
395
|
# Returns the object in the form of hash
|
|
415
396
|
# @return [Hash] Returns the object in the form of hash
|
|
416
397
|
def to_hash
|
|
@@ -427,6 +408,22 @@ module DaytonaApiClient
|
|
|
427
408
|
hash
|
|
428
409
|
end
|
|
429
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
|
|
430
428
|
end
|
|
431
|
-
|
|
432
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
|