daytona_api_client 0.202.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 +140 -40
- 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 +265 -1316
- data/lib/daytona_api_client/api/preview_api.rb +8 -202
- data/lib/daytona_api_client/api/runners_api.rb +22 -412
- data/lib/daytona_api_client/api/sandbox_api.rb +434 -2352
- data/lib/daytona_api_client/api/snapshots_api.rb +113 -39
- data/lib/daytona_api_client/api/toolbox_api.rb +5108 -0
- data/lib/daytona_api_client/api/users_api.rb +239 -2
- data/lib/daytona_api_client/api/volumes_api.rb +2 -2
- data/lib/daytona_api_client/api/webhooks_api.rb +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 -76
- 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 +77 -15
- 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 -64
- data/lib/daytona_api_client/models/display_info_response.rb +238 -0
- 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/{create_sandbox_snapshot.rb → keyboard_hotkey_request.rb} +93 -34
- 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/lsp_symbol.rb +287 -0
- 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/mouse_scroll_response.rb +236 -0
- data/lib/daytona_api_client/models/oidc_config.rb +74 -3
- data/lib/daytona_api_client/models/organization.rb +159 -243
- 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/pty_create_request.rb +288 -0
- 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/{resize_sandbox.rb → replace_result.rb} +95 -84
- 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 -164
- 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/{runner_service_health.rb → search_files_response.rb} +94 -59
- 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/session_execute_response.rb +239 -0
- data/lib/daytona_api_client/models/set_snapshot_general_status_dto.rb +74 -3
- data/lib/daytona_api_client/models/snapshot_dto.rb +78 -71
- 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 +74 -3
- 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} +339 -193
- data/lib/daytona_api_client/version.rb +2 -2
- data/lib/daytona_api_client.rb +76 -74
- data/project.json +13 -38
- metadata +81 -83
- data/.gitignore +0 -39
- data/.openapi-generator/FILES +0 -163
- 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 -1615
- 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/create_organization_region_quota.rb +0 -375
- 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/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 -440
- 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/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/string_filter.rb +0 -182
- data/lib/daytona_api_client/models/trace_summary.rb +0 -310
- 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 -302
- 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,8 +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 :
|
|
39
|
+
# The sandbox class type
|
|
40
|
+
attr_accessor :_class
|
|
44
41
|
|
|
45
42
|
# The target (region) where the sandbox will be created
|
|
46
43
|
attr_accessor :target
|
|
@@ -51,9 +48,6 @@ module DaytonaApiClient
|
|
|
51
48
|
# GPU units allocated to the sandbox
|
|
52
49
|
attr_accessor :gpu
|
|
53
50
|
|
|
54
|
-
# 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.
|
|
55
|
-
attr_accessor :gpu_type
|
|
56
|
-
|
|
57
51
|
# Memory allocated to the sandbox in GB
|
|
58
52
|
attr_accessor :memory
|
|
59
53
|
|
|
@@ -63,34 +57,43 @@ module DaytonaApiClient
|
|
|
63
57
|
# Auto-stop interval in minutes (0 means disabled)
|
|
64
58
|
attr_accessor :auto_stop_interval
|
|
65
59
|
|
|
66
|
-
# 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.
|
|
67
|
-
attr_accessor :auto_pause_interval
|
|
68
|
-
|
|
69
60
|
# Auto-archive interval in minutes (0 means the maximum interval will be used)
|
|
70
61
|
attr_accessor :auto_archive_interval
|
|
71
62
|
|
|
72
63
|
# Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)
|
|
73
64
|
attr_accessor :auto_delete_interval
|
|
74
65
|
|
|
75
|
-
# 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.
|
|
76
|
-
attr_accessor :ttl_minutes
|
|
77
|
-
|
|
78
66
|
# Array of volumes to attach to the sandbox
|
|
79
67
|
attr_accessor :volumes
|
|
80
68
|
|
|
81
69
|
# Build information for the sandbox
|
|
82
70
|
attr_accessor :build_info
|
|
83
71
|
|
|
84
|
-
|
|
85
|
-
|
|
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
|
|
86
88
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
+
def valid?(value)
|
|
90
|
+
!value || allowable_values.include?(value)
|
|
91
|
+
end
|
|
92
|
+
end
|
|
89
93
|
|
|
90
94
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
91
95
|
def self.attribute_map
|
|
92
96
|
{
|
|
93
|
-
:'name' => :'name',
|
|
94
97
|
:'snapshot' => :'snapshot',
|
|
95
98
|
:'user' => :'user',
|
|
96
99
|
:'env' => :'env',
|
|
@@ -98,22 +101,17 @@ module DaytonaApiClient
|
|
|
98
101
|
:'public' => :'public',
|
|
99
102
|
:'network_block_all' => :'networkBlockAll',
|
|
100
103
|
:'network_allow_list' => :'networkAllowList',
|
|
101
|
-
:'
|
|
104
|
+
:'_class' => :'class',
|
|
102
105
|
:'target' => :'target',
|
|
103
106
|
:'cpu' => :'cpu',
|
|
104
107
|
:'gpu' => :'gpu',
|
|
105
|
-
:'gpu_type' => :'gpuType',
|
|
106
108
|
:'memory' => :'memory',
|
|
107
109
|
:'disk' => :'disk',
|
|
108
110
|
:'auto_stop_interval' => :'autoStopInterval',
|
|
109
|
-
:'auto_pause_interval' => :'autoPauseInterval',
|
|
110
111
|
:'auto_archive_interval' => :'autoArchiveInterval',
|
|
111
112
|
:'auto_delete_interval' => :'autoDeleteInterval',
|
|
112
|
-
:'ttl_minutes' => :'ttlMinutes',
|
|
113
113
|
:'volumes' => :'volumes',
|
|
114
|
-
:'build_info' => :'buildInfo'
|
|
115
|
-
:'linked_sandbox' => :'linkedSandbox',
|
|
116
|
-
:'secrets' => :'secrets'
|
|
114
|
+
:'build_info' => :'buildInfo'
|
|
117
115
|
}
|
|
118
116
|
end
|
|
119
117
|
|
|
@@ -130,7 +128,6 @@ module DaytonaApiClient
|
|
|
130
128
|
# Attribute type mapping.
|
|
131
129
|
def self.openapi_types
|
|
132
130
|
{
|
|
133
|
-
:'name' => :'String',
|
|
134
131
|
:'snapshot' => :'String',
|
|
135
132
|
:'user' => :'String',
|
|
136
133
|
:'env' => :'Hash<String, String>',
|
|
@@ -138,22 +135,17 @@ module DaytonaApiClient
|
|
|
138
135
|
:'public' => :'Boolean',
|
|
139
136
|
:'network_block_all' => :'Boolean',
|
|
140
137
|
:'network_allow_list' => :'String',
|
|
141
|
-
:'
|
|
138
|
+
:'_class' => :'String',
|
|
142
139
|
:'target' => :'String',
|
|
143
140
|
:'cpu' => :'Integer',
|
|
144
141
|
:'gpu' => :'Integer',
|
|
145
|
-
:'gpu_type' => :'Array<GpuType>',
|
|
146
142
|
:'memory' => :'Integer',
|
|
147
143
|
:'disk' => :'Integer',
|
|
148
144
|
:'auto_stop_interval' => :'Integer',
|
|
149
|
-
:'auto_pause_interval' => :'Integer',
|
|
150
145
|
:'auto_archive_interval' => :'Integer',
|
|
151
146
|
:'auto_delete_interval' => :'Integer',
|
|
152
|
-
:'ttl_minutes' => :'Integer',
|
|
153
147
|
:'volumes' => :'Array<SandboxVolume>',
|
|
154
|
-
:'build_info' => :'CreateBuildInfo'
|
|
155
|
-
:'linked_sandbox' => :'String',
|
|
156
|
-
:'secrets' => :'Array<Hash<String, String>>'
|
|
148
|
+
:'build_info' => :'CreateBuildInfo'
|
|
157
149
|
}
|
|
158
150
|
end
|
|
159
151
|
|
|
@@ -179,10 +171,6 @@ module DaytonaApiClient
|
|
|
179
171
|
h[k.to_sym] = v
|
|
180
172
|
}
|
|
181
173
|
|
|
182
|
-
if attributes.key?(:'name')
|
|
183
|
-
self.name = attributes[:'name']
|
|
184
|
-
end
|
|
185
|
-
|
|
186
174
|
if attributes.key?(:'snapshot')
|
|
187
175
|
self.snapshot = attributes[:'snapshot']
|
|
188
176
|
end
|
|
@@ -215,8 +203,8 @@ module DaytonaApiClient
|
|
|
215
203
|
self.network_allow_list = attributes[:'network_allow_list']
|
|
216
204
|
end
|
|
217
205
|
|
|
218
|
-
if attributes.key?(:'
|
|
219
|
-
self.
|
|
206
|
+
if attributes.key?(:'_class')
|
|
207
|
+
self._class = attributes[:'_class']
|
|
220
208
|
end
|
|
221
209
|
|
|
222
210
|
if attributes.key?(:'target')
|
|
@@ -231,12 +219,6 @@ module DaytonaApiClient
|
|
|
231
219
|
self.gpu = attributes[:'gpu']
|
|
232
220
|
end
|
|
233
221
|
|
|
234
|
-
if attributes.key?(:'gpu_type')
|
|
235
|
-
if (value = attributes[:'gpu_type']).is_a?(Array)
|
|
236
|
-
self.gpu_type = value
|
|
237
|
-
end
|
|
238
|
-
end
|
|
239
|
-
|
|
240
222
|
if attributes.key?(:'memory')
|
|
241
223
|
self.memory = attributes[:'memory']
|
|
242
224
|
end
|
|
@@ -249,10 +231,6 @@ module DaytonaApiClient
|
|
|
249
231
|
self.auto_stop_interval = attributes[:'auto_stop_interval']
|
|
250
232
|
end
|
|
251
233
|
|
|
252
|
-
if attributes.key?(:'auto_pause_interval')
|
|
253
|
-
self.auto_pause_interval = attributes[:'auto_pause_interval']
|
|
254
|
-
end
|
|
255
|
-
|
|
256
234
|
if attributes.key?(:'auto_archive_interval')
|
|
257
235
|
self.auto_archive_interval = attributes[:'auto_archive_interval']
|
|
258
236
|
end
|
|
@@ -261,10 +239,6 @@ module DaytonaApiClient
|
|
|
261
239
|
self.auto_delete_interval = attributes[:'auto_delete_interval']
|
|
262
240
|
end
|
|
263
241
|
|
|
264
|
-
if attributes.key?(:'ttl_minutes')
|
|
265
|
-
self.ttl_minutes = attributes[:'ttl_minutes']
|
|
266
|
-
end
|
|
267
|
-
|
|
268
242
|
if attributes.key?(:'volumes')
|
|
269
243
|
if (value = attributes[:'volumes']).is_a?(Array)
|
|
270
244
|
self.volumes = value
|
|
@@ -274,16 +248,6 @@ module DaytonaApiClient
|
|
|
274
248
|
if attributes.key?(:'build_info')
|
|
275
249
|
self.build_info = attributes[:'build_info']
|
|
276
250
|
end
|
|
277
|
-
|
|
278
|
-
if attributes.key?(:'linked_sandbox')
|
|
279
|
-
self.linked_sandbox = attributes[:'linked_sandbox']
|
|
280
|
-
end
|
|
281
|
-
|
|
282
|
-
if attributes.key?(:'secrets')
|
|
283
|
-
if (value = attributes[:'secrets']).is_a?(Array)
|
|
284
|
-
self.secrets = value
|
|
285
|
-
end
|
|
286
|
-
end
|
|
287
251
|
end
|
|
288
252
|
|
|
289
253
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -298,15 +262,26 @@ module DaytonaApiClient
|
|
|
298
262
|
# @return true if the model is valid
|
|
299
263
|
def valid?
|
|
300
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)
|
|
301
267
|
true
|
|
302
268
|
end
|
|
303
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
|
+
|
|
304
280
|
# Checks equality by comparing each attribute.
|
|
305
281
|
# @param [Object] Object to be compared
|
|
306
282
|
def ==(o)
|
|
307
283
|
return true if self.equal?(o)
|
|
308
284
|
self.class == o.class &&
|
|
309
|
-
name == o.name &&
|
|
310
285
|
snapshot == o.snapshot &&
|
|
311
286
|
user == o.user &&
|
|
312
287
|
env == o.env &&
|
|
@@ -314,22 +289,17 @@ module DaytonaApiClient
|
|
|
314
289
|
public == o.public &&
|
|
315
290
|
network_block_all == o.network_block_all &&
|
|
316
291
|
network_allow_list == o.network_allow_list &&
|
|
317
|
-
|
|
292
|
+
_class == o._class &&
|
|
318
293
|
target == o.target &&
|
|
319
294
|
cpu == o.cpu &&
|
|
320
295
|
gpu == o.gpu &&
|
|
321
|
-
gpu_type == o.gpu_type &&
|
|
322
296
|
memory == o.memory &&
|
|
323
297
|
disk == o.disk &&
|
|
324
298
|
auto_stop_interval == o.auto_stop_interval &&
|
|
325
|
-
auto_pause_interval == o.auto_pause_interval &&
|
|
326
299
|
auto_archive_interval == o.auto_archive_interval &&
|
|
327
300
|
auto_delete_interval == o.auto_delete_interval &&
|
|
328
|
-
ttl_minutes == o.ttl_minutes &&
|
|
329
301
|
volumes == o.volumes &&
|
|
330
|
-
build_info == o.build_info
|
|
331
|
-
linked_sandbox == o.linked_sandbox &&
|
|
332
|
-
secrets == o.secrets
|
|
302
|
+
build_info == o.build_info
|
|
333
303
|
end
|
|
334
304
|
|
|
335
305
|
# @see the `==` method
|
|
@@ -341,7 +311,7 @@ module DaytonaApiClient
|
|
|
341
311
|
# Calculates hash code according to all attributes.
|
|
342
312
|
# @return [Integer] Hash code
|
|
343
313
|
def hash
|
|
344
|
-
[
|
|
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
|
|
345
315
|
end
|
|
346
316
|
|
|
347
317
|
# Builds the object from hash
|
|
@@ -367,6 +337,61 @@ module DaytonaApiClient
|
|
|
367
337
|
new(transformed_hash)
|
|
368
338
|
end
|
|
369
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
|
+
|
|
370
395
|
# Returns the object in the form of hash
|
|
371
396
|
# @return [Hash] Returns the object in the form of hash
|
|
372
397
|
def to_hash
|
|
@@ -383,6 +408,22 @@ module DaytonaApiClient
|
|
|
383
408
|
hash
|
|
384
409
|
end
|
|
385
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
|
|
386
428
|
end
|
|
387
|
-
|
|
388
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
|