daytona_api_client 0.211.2 → 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 -2354
- 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 -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/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 -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/{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 -206
- 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 -49
- 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 -41
- 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 -222
- 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 -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/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 -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/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,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,34 +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
|
-
|
|
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
|
|
95
88
|
|
|
96
|
-
|
|
97
|
-
|
|
89
|
+
def valid?(value)
|
|
90
|
+
!value || allowable_values.include?(value)
|
|
91
|
+
end
|
|
92
|
+
end
|
|
98
93
|
|
|
99
94
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
100
95
|
def self.attribute_map
|
|
101
96
|
{
|
|
102
|
-
:'name' => :'name',
|
|
103
97
|
:'snapshot' => :'snapshot',
|
|
104
98
|
:'user' => :'user',
|
|
105
99
|
:'env' => :'env',
|
|
@@ -107,25 +101,17 @@ module DaytonaApiClient
|
|
|
107
101
|
:'public' => :'public',
|
|
108
102
|
:'network_block_all' => :'networkBlockAll',
|
|
109
103
|
:'network_allow_list' => :'networkAllowList',
|
|
110
|
-
:'
|
|
111
|
-
:'outbound_proxy_url' => :'outboundProxyUrl',
|
|
112
|
-
:'otel_endpoint_override' => :'otelEndpointOverride',
|
|
104
|
+
:'_class' => :'class',
|
|
113
105
|
:'target' => :'target',
|
|
114
106
|
:'cpu' => :'cpu',
|
|
115
107
|
:'gpu' => :'gpu',
|
|
116
|
-
:'gpu_type' => :'gpuType',
|
|
117
|
-
:'spot' => :'spot',
|
|
118
108
|
:'memory' => :'memory',
|
|
119
109
|
:'disk' => :'disk',
|
|
120
110
|
:'auto_stop_interval' => :'autoStopInterval',
|
|
121
|
-
:'auto_pause_interval' => :'autoPauseInterval',
|
|
122
111
|
:'auto_archive_interval' => :'autoArchiveInterval',
|
|
123
112
|
:'auto_delete_interval' => :'autoDeleteInterval',
|
|
124
|
-
:'ttl_minutes' => :'ttlMinutes',
|
|
125
113
|
:'volumes' => :'volumes',
|
|
126
|
-
:'build_info' => :'buildInfo'
|
|
127
|
-
:'linked_sandbox' => :'linkedSandbox',
|
|
128
|
-
:'secrets' => :'secrets'
|
|
114
|
+
:'build_info' => :'buildInfo'
|
|
129
115
|
}
|
|
130
116
|
end
|
|
131
117
|
|
|
@@ -142,7 +128,6 @@ module DaytonaApiClient
|
|
|
142
128
|
# Attribute type mapping.
|
|
143
129
|
def self.openapi_types
|
|
144
130
|
{
|
|
145
|
-
:'name' => :'String',
|
|
146
131
|
:'snapshot' => :'String',
|
|
147
132
|
:'user' => :'String',
|
|
148
133
|
:'env' => :'Hash<String, String>',
|
|
@@ -150,25 +135,17 @@ module DaytonaApiClient
|
|
|
150
135
|
:'public' => :'Boolean',
|
|
151
136
|
:'network_block_all' => :'Boolean',
|
|
152
137
|
:'network_allow_list' => :'String',
|
|
153
|
-
:'
|
|
154
|
-
:'outbound_proxy_url' => :'String',
|
|
155
|
-
:'otel_endpoint_override' => :'String',
|
|
138
|
+
:'_class' => :'String',
|
|
156
139
|
:'target' => :'String',
|
|
157
140
|
:'cpu' => :'Integer',
|
|
158
141
|
:'gpu' => :'Integer',
|
|
159
|
-
:'gpu_type' => :'Array<GpuType>',
|
|
160
|
-
:'spot' => :'Boolean',
|
|
161
142
|
:'memory' => :'Integer',
|
|
162
143
|
:'disk' => :'Integer',
|
|
163
144
|
:'auto_stop_interval' => :'Integer',
|
|
164
|
-
:'auto_pause_interval' => :'Integer',
|
|
165
145
|
:'auto_archive_interval' => :'Integer',
|
|
166
146
|
:'auto_delete_interval' => :'Integer',
|
|
167
|
-
:'ttl_minutes' => :'Integer',
|
|
168
147
|
:'volumes' => :'Array<SandboxVolume>',
|
|
169
|
-
:'build_info' => :'CreateBuildInfo'
|
|
170
|
-
:'linked_sandbox' => :'String',
|
|
171
|
-
:'secrets' => :'Array<Hash<String, String>>'
|
|
148
|
+
:'build_info' => :'CreateBuildInfo'
|
|
172
149
|
}
|
|
173
150
|
end
|
|
174
151
|
|
|
@@ -194,10 +171,6 @@ module DaytonaApiClient
|
|
|
194
171
|
h[k.to_sym] = v
|
|
195
172
|
}
|
|
196
173
|
|
|
197
|
-
if attributes.key?(:'name')
|
|
198
|
-
self.name = attributes[:'name']
|
|
199
|
-
end
|
|
200
|
-
|
|
201
174
|
if attributes.key?(:'snapshot')
|
|
202
175
|
self.snapshot = attributes[:'snapshot']
|
|
203
176
|
end
|
|
@@ -230,16 +203,8 @@ module DaytonaApiClient
|
|
|
230
203
|
self.network_allow_list = attributes[:'network_allow_list']
|
|
231
204
|
end
|
|
232
205
|
|
|
233
|
-
if attributes.key?(:'
|
|
234
|
-
self.
|
|
235
|
-
end
|
|
236
|
-
|
|
237
|
-
if attributes.key?(:'outbound_proxy_url')
|
|
238
|
-
self.outbound_proxy_url = attributes[:'outbound_proxy_url']
|
|
239
|
-
end
|
|
240
|
-
|
|
241
|
-
if attributes.key?(:'otel_endpoint_override')
|
|
242
|
-
self.otel_endpoint_override = attributes[:'otel_endpoint_override']
|
|
206
|
+
if attributes.key?(:'_class')
|
|
207
|
+
self._class = attributes[:'_class']
|
|
243
208
|
end
|
|
244
209
|
|
|
245
210
|
if attributes.key?(:'target')
|
|
@@ -254,18 +219,6 @@ module DaytonaApiClient
|
|
|
254
219
|
self.gpu = attributes[:'gpu']
|
|
255
220
|
end
|
|
256
221
|
|
|
257
|
-
if attributes.key?(:'gpu_type')
|
|
258
|
-
if (value = attributes[:'gpu_type']).is_a?(Array)
|
|
259
|
-
self.gpu_type = value
|
|
260
|
-
end
|
|
261
|
-
end
|
|
262
|
-
|
|
263
|
-
if attributes.key?(:'spot')
|
|
264
|
-
self.spot = attributes[:'spot']
|
|
265
|
-
else
|
|
266
|
-
self.spot = false
|
|
267
|
-
end
|
|
268
|
-
|
|
269
222
|
if attributes.key?(:'memory')
|
|
270
223
|
self.memory = attributes[:'memory']
|
|
271
224
|
end
|
|
@@ -278,10 +231,6 @@ module DaytonaApiClient
|
|
|
278
231
|
self.auto_stop_interval = attributes[:'auto_stop_interval']
|
|
279
232
|
end
|
|
280
233
|
|
|
281
|
-
if attributes.key?(:'auto_pause_interval')
|
|
282
|
-
self.auto_pause_interval = attributes[:'auto_pause_interval']
|
|
283
|
-
end
|
|
284
|
-
|
|
285
234
|
if attributes.key?(:'auto_archive_interval')
|
|
286
235
|
self.auto_archive_interval = attributes[:'auto_archive_interval']
|
|
287
236
|
end
|
|
@@ -290,10 +239,6 @@ module DaytonaApiClient
|
|
|
290
239
|
self.auto_delete_interval = attributes[:'auto_delete_interval']
|
|
291
240
|
end
|
|
292
241
|
|
|
293
|
-
if attributes.key?(:'ttl_minutes')
|
|
294
|
-
self.ttl_minutes = attributes[:'ttl_minutes']
|
|
295
|
-
end
|
|
296
|
-
|
|
297
242
|
if attributes.key?(:'volumes')
|
|
298
243
|
if (value = attributes[:'volumes']).is_a?(Array)
|
|
299
244
|
self.volumes = value
|
|
@@ -303,16 +248,6 @@ module DaytonaApiClient
|
|
|
303
248
|
if attributes.key?(:'build_info')
|
|
304
249
|
self.build_info = attributes[:'build_info']
|
|
305
250
|
end
|
|
306
|
-
|
|
307
|
-
if attributes.key?(:'linked_sandbox')
|
|
308
|
-
self.linked_sandbox = attributes[:'linked_sandbox']
|
|
309
|
-
end
|
|
310
|
-
|
|
311
|
-
if attributes.key?(:'secrets')
|
|
312
|
-
if (value = attributes[:'secrets']).is_a?(Array)
|
|
313
|
-
self.secrets = value
|
|
314
|
-
end
|
|
315
|
-
end
|
|
316
251
|
end
|
|
317
252
|
|
|
318
253
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -327,15 +262,26 @@ module DaytonaApiClient
|
|
|
327
262
|
# @return true if the model is valid
|
|
328
263
|
def valid?
|
|
329
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)
|
|
330
267
|
true
|
|
331
268
|
end
|
|
332
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
|
+
|
|
333
280
|
# Checks equality by comparing each attribute.
|
|
334
281
|
# @param [Object] Object to be compared
|
|
335
282
|
def ==(o)
|
|
336
283
|
return true if self.equal?(o)
|
|
337
284
|
self.class == o.class &&
|
|
338
|
-
name == o.name &&
|
|
339
285
|
snapshot == o.snapshot &&
|
|
340
286
|
user == o.user &&
|
|
341
287
|
env == o.env &&
|
|
@@ -343,25 +289,17 @@ module DaytonaApiClient
|
|
|
343
289
|
public == o.public &&
|
|
344
290
|
network_block_all == o.network_block_all &&
|
|
345
291
|
network_allow_list == o.network_allow_list &&
|
|
346
|
-
|
|
347
|
-
outbound_proxy_url == o.outbound_proxy_url &&
|
|
348
|
-
otel_endpoint_override == o.otel_endpoint_override &&
|
|
292
|
+
_class == o._class &&
|
|
349
293
|
target == o.target &&
|
|
350
294
|
cpu == o.cpu &&
|
|
351
295
|
gpu == o.gpu &&
|
|
352
|
-
gpu_type == o.gpu_type &&
|
|
353
|
-
spot == o.spot &&
|
|
354
296
|
memory == o.memory &&
|
|
355
297
|
disk == o.disk &&
|
|
356
298
|
auto_stop_interval == o.auto_stop_interval &&
|
|
357
|
-
auto_pause_interval == o.auto_pause_interval &&
|
|
358
299
|
auto_archive_interval == o.auto_archive_interval &&
|
|
359
300
|
auto_delete_interval == o.auto_delete_interval &&
|
|
360
|
-
ttl_minutes == o.ttl_minutes &&
|
|
361
301
|
volumes == o.volumes &&
|
|
362
|
-
build_info == o.build_info
|
|
363
|
-
linked_sandbox == o.linked_sandbox &&
|
|
364
|
-
secrets == o.secrets
|
|
302
|
+
build_info == o.build_info
|
|
365
303
|
end
|
|
366
304
|
|
|
367
305
|
# @see the `==` method
|
|
@@ -373,7 +311,7 @@ module DaytonaApiClient
|
|
|
373
311
|
# Calculates hash code according to all attributes.
|
|
374
312
|
# @return [Integer] Hash code
|
|
375
313
|
def hash
|
|
376
|
-
[
|
|
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
|
|
377
315
|
end
|
|
378
316
|
|
|
379
317
|
# Builds the object from hash
|
|
@@ -399,6 +337,61 @@ module DaytonaApiClient
|
|
|
399
337
|
new(transformed_hash)
|
|
400
338
|
end
|
|
401
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
|
+
|
|
402
395
|
# Returns the object in the form of hash
|
|
403
396
|
# @return [Hash] Returns the object in the form of hash
|
|
404
397
|
def to_hash
|
|
@@ -415,6 +408,22 @@ module DaytonaApiClient
|
|
|
415
408
|
hash
|
|
416
409
|
end
|
|
417
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
|
|
418
428
|
end
|
|
419
|
-
|
|
420
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
|