daytona_api_client 0.192.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 +155 -1075
- data/lib/daytona_api_client/api/preview_api.rb +8 -77
- data/lib/daytona_api_client/api/runners_api.rb +22 -412
- data/lib/daytona_api_client/api/sandbox_api.rb +346 -1901
- data/lib/daytona_api_client/api/snapshots_api.rb +113 -39
- data/lib/daytona_api_client/api/toolbox_api.rb +741 -741
- 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/command.rb +74 -3
- data/lib/daytona_api_client/models/completion_context.rb +74 -3
- data/lib/daytona_api_client/models/completion_item.rb +74 -3
- data/lib/daytona_api_client/models/completion_list.rb +74 -3
- data/lib/daytona_api_client/models/compressed_screenshot_response.rb +74 -3
- data/lib/daytona_api_client/models/computer_use_start_response.rb +74 -3
- data/lib/daytona_api_client/models/computer_use_status_response.rb +76 -5
- data/lib/daytona_api_client/models/computer_use_stop_response.rb +74 -3
- 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 -17
- 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 -56
- data/lib/daytona_api_client/models/create_session_request.rb +74 -3
- 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 +74 -3
- data/lib/daytona_api_client/models/docker_registry.rb +76 -5
- data/lib/daytona_api_client/models/download_files.rb +74 -3
- data/lib/daytona_api_client/models/execute_request.rb +74 -3
- data/lib/daytona_api_client/models/execute_response.rb +74 -3
- data/lib/daytona_api_client/models/file_info.rb +74 -3
- data/lib/daytona_api_client/models/file_status.rb +74 -3
- data/lib/daytona_api_client/models/git_add_request.rb +74 -3
- data/lib/daytona_api_client/models/git_branch_request.rb +74 -3
- data/lib/daytona_api_client/models/git_checkout_request.rb +74 -3
- data/lib/daytona_api_client/models/git_clone_request.rb +74 -3
- data/lib/daytona_api_client/models/git_commit_info.rb +74 -3
- data/lib/daytona_api_client/models/git_commit_request.rb +74 -3
- data/lib/daytona_api_client/models/git_commit_response.rb +74 -3
- data/lib/daytona_api_client/models/git_delete_branch_request.rb +74 -3
- data/lib/daytona_api_client/models/git_repo_request.rb +74 -3
- data/lib/daytona_api_client/models/git_status.rb +74 -3
- 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/keyboard_hotkey_request.rb +74 -3
- data/lib/daytona_api_client/models/keyboard_press_request.rb +74 -3
- data/lib/daytona_api_client/models/keyboard_type_request.rb +74 -3
- data/lib/daytona_api_client/models/list_branch_response.rb +74 -3
- data/lib/daytona_api_client/models/lsp_completion_params.rb +74 -3
- data/lib/daytona_api_client/models/lsp_document_request.rb +74 -3
- data/lib/daytona_api_client/models/lsp_location.rb +74 -3
- data/lib/daytona_api_client/models/lsp_server_request.rb +74 -3
- data/lib/daytona_api_client/models/lsp_symbol.rb +74 -3
- data/lib/daytona_api_client/models/match.rb +74 -3
- data/lib/daytona_api_client/models/mouse_click_request.rb +74 -3
- data/lib/daytona_api_client/models/mouse_click_response.rb +74 -3
- data/lib/daytona_api_client/models/mouse_drag_request.rb +74 -3
- data/lib/daytona_api_client/models/mouse_drag_response.rb +74 -3
- data/lib/daytona_api_client/models/mouse_move_request.rb +74 -3
- data/lib/daytona_api_client/models/mouse_move_response.rb +74 -3
- data/lib/daytona_api_client/models/mouse_position.rb +74 -3
- data/lib/daytona_api_client/models/mouse_scroll_request.rb +74 -3
- data/lib/daytona_api_client/models/mouse_scroll_response.rb +74 -3
- data/lib/daytona_api_client/models/oidc_config.rb +74 -3
- data/lib/daytona_api_client/models/organization.rb +159 -162
- 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_jobs.rb → paginated_snapshots_dto.rb} +77 -6
- data/lib/daytona_api_client/models/port_preview_url.rb +88 -34
- data/lib/daytona_api_client/models/position.rb +74 -3
- data/lib/daytona_api_client/models/posthog_config.rb +74 -3
- data/lib/daytona_api_client/models/process_errors_response.rb +74 -3
- data/lib/daytona_api_client/models/process_logs_response.rb +74 -3
- data/lib/daytona_api_client/models/process_restart_response.rb +74 -3
- data/lib/daytona_api_client/models/process_status_response.rb +74 -3
- data/lib/daytona_api_client/models/project_dir_response.rb +74 -3
- data/lib/daytona_api_client/models/pty_create_request.rb +74 -3
- data/lib/daytona_api_client/models/pty_create_response.rb +74 -3
- data/lib/daytona_api_client/models/pty_list_response.rb +74 -3
- data/lib/daytona_api_client/models/pty_resize_request.rb +74 -3
- data/lib/daytona_api_client/models/pty_session_info.rb +74 -3
- data/lib/daytona_api_client/models/range.rb +74 -3
- data/lib/daytona_api_client/models/region.rb +78 -181
- data/lib/daytona_api_client/models/region_screenshot_response.rb +74 -3
- data/lib/daytona_api_client/models/registry_push_access_dto.rb +74 -3
- data/lib/daytona_api_client/models/replace_request.rb +74 -3
- data/lib/daytona_api_client/models/replace_result.rb +74 -3
- 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 +104 -137
- 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_secret.rb → sandbox_info.rb} +112 -53
- 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 +74 -3
- data/lib/daytona_api_client/models/search_files_response.rb +74 -3
- data/lib/daytona_api_client/models/send_webhook_dto.rb +75 -26
- data/lib/daytona_api_client/models/session.rb +74 -3
- data/lib/daytona_api_client/models/session_execute_request.rb +74 -3
- data/lib/daytona_api_client/models/session_execute_response.rb +74 -3
- 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 -4
- 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 +74 -3
- 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 -106
- 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/user_home_dir_response.rb +74 -3
- 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/{admin_get_webhook_status200_response.rb → webhook_controller_get_status200_response.rb} +76 -5
- data/lib/daytona_api_client/models/webhook_initialization_status.rb +74 -3
- data/lib/daytona_api_client/models/windows_response.rb +74 -3
- data/lib/daytona_api_client/models/work_dir_response.rb +74 -3
- data/lib/daytona_api_client/models/{sandbox_list_item.rb → workspace.rb} +344 -168
- data/lib/daytona_api_client/version.rb +2 -2
- data/lib/daytona_api_client.rb +8 -63
- data/project.json +13 -38
- metadata +13 -72
- data/.gitignore +0 -39
- data/.openapi-generator/FILES +0 -220
- 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 -1479
- 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 -350
- 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/create_organization_region_quota.rb +0 -372
- data/lib/daytona_api_client/models/create_region.rb +0 -198
- data/lib/daytona_api_client/models/create_region_response.rb +0 -209
- data/lib/daytona_api_client/models/create_runner_response.rb +0 -192
- data/lib/daytona_api_client/models/create_sandbox_snapshot.rb +0 -177
- 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 -41
- 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 -54
- data/lib/daytona_api_client/models/list_sandboxes_response.rb +0 -180
- data/lib/daytona_api_client/models/log_entry.rb +0 -334
- data/lib/daytona_api_client/models/metric_data_point.rb +0 -192
- 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 -178
- data/lib/daytona_api_client/models/paginated_logs.rb +0 -248
- data/lib/daytona_api_client/models/paginated_traces.rb +0 -248
- 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/regenerate_api_key_response.rb +0 -165
- data/lib/daytona_api_client/models/region_quota.rb +0 -437
- data/lib/daytona_api_client/models/region_type.rb +0 -42
- data/lib/daytona_api_client/models/region_usage_overview.rb +0 -515
- 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/runner_healthcheck.rb +0 -217
- data/lib/daytona_api_client/models/runner_service_health.rb +0 -202
- 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/secret.rb +0 -312
- data/lib/daytona_api_client/models/signed_port_preview_url.rb +0 -246
- data/lib/daytona_api_client/models/snapshot_manager_credentials.rb +0 -192
- data/lib/daytona_api_client/models/string_filter.rb +0 -182
- data/lib/daytona_api_client/models/toolbox_proxy_url.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_job_status.rb +0 -207
- 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 -299
- 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_secret.rb +0 -170
- data/lib/daytona_api_client/models/url.rb +0 -165
- 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
|
|
|
@@ -75,16 +69,31 @@ module DaytonaApiClient
|
|
|
75
69
|
# Build information for the sandbox
|
|
76
70
|
attr_accessor :build_info
|
|
77
71
|
|
|
78
|
-
|
|
79
|
-
|
|
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
|
|
80
88
|
|
|
81
|
-
|
|
82
|
-
|
|
89
|
+
def valid?(value)
|
|
90
|
+
!value || allowable_values.include?(value)
|
|
91
|
+
end
|
|
92
|
+
end
|
|
83
93
|
|
|
84
94
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
85
95
|
def self.attribute_map
|
|
86
96
|
{
|
|
87
|
-
:'name' => :'name',
|
|
88
97
|
:'snapshot' => :'snapshot',
|
|
89
98
|
:'user' => :'user',
|
|
90
99
|
:'env' => :'env',
|
|
@@ -92,20 +101,17 @@ module DaytonaApiClient
|
|
|
92
101
|
:'public' => :'public',
|
|
93
102
|
:'network_block_all' => :'networkBlockAll',
|
|
94
103
|
:'network_allow_list' => :'networkAllowList',
|
|
95
|
-
:'
|
|
104
|
+
:'_class' => :'class',
|
|
96
105
|
:'target' => :'target',
|
|
97
106
|
:'cpu' => :'cpu',
|
|
98
107
|
:'gpu' => :'gpu',
|
|
99
|
-
:'gpu_type' => :'gpuType',
|
|
100
108
|
:'memory' => :'memory',
|
|
101
109
|
:'disk' => :'disk',
|
|
102
110
|
:'auto_stop_interval' => :'autoStopInterval',
|
|
103
111
|
:'auto_archive_interval' => :'autoArchiveInterval',
|
|
104
112
|
:'auto_delete_interval' => :'autoDeleteInterval',
|
|
105
113
|
:'volumes' => :'volumes',
|
|
106
|
-
:'build_info' => :'buildInfo'
|
|
107
|
-
:'linked_sandbox' => :'linkedSandbox',
|
|
108
|
-
:'secrets' => :'secrets'
|
|
114
|
+
:'build_info' => :'buildInfo'
|
|
109
115
|
}
|
|
110
116
|
end
|
|
111
117
|
|
|
@@ -122,7 +128,6 @@ module DaytonaApiClient
|
|
|
122
128
|
# Attribute type mapping.
|
|
123
129
|
def self.openapi_types
|
|
124
130
|
{
|
|
125
|
-
:'name' => :'String',
|
|
126
131
|
:'snapshot' => :'String',
|
|
127
132
|
:'user' => :'String',
|
|
128
133
|
:'env' => :'Hash<String, String>',
|
|
@@ -130,20 +135,17 @@ module DaytonaApiClient
|
|
|
130
135
|
:'public' => :'Boolean',
|
|
131
136
|
:'network_block_all' => :'Boolean',
|
|
132
137
|
:'network_allow_list' => :'String',
|
|
133
|
-
:'
|
|
138
|
+
:'_class' => :'String',
|
|
134
139
|
:'target' => :'String',
|
|
135
140
|
:'cpu' => :'Integer',
|
|
136
141
|
:'gpu' => :'Integer',
|
|
137
|
-
:'gpu_type' => :'Array<GpuType>',
|
|
138
142
|
:'memory' => :'Integer',
|
|
139
143
|
:'disk' => :'Integer',
|
|
140
144
|
:'auto_stop_interval' => :'Integer',
|
|
141
145
|
:'auto_archive_interval' => :'Integer',
|
|
142
146
|
:'auto_delete_interval' => :'Integer',
|
|
143
147
|
:'volumes' => :'Array<SandboxVolume>',
|
|
144
|
-
:'build_info' => :'CreateBuildInfo'
|
|
145
|
-
:'linked_sandbox' => :'String',
|
|
146
|
-
:'secrets' => :'Array<Hash<String, String>>'
|
|
148
|
+
:'build_info' => :'CreateBuildInfo'
|
|
147
149
|
}
|
|
148
150
|
end
|
|
149
151
|
|
|
@@ -169,10 +171,6 @@ module DaytonaApiClient
|
|
|
169
171
|
h[k.to_sym] = v
|
|
170
172
|
}
|
|
171
173
|
|
|
172
|
-
if attributes.key?(:'name')
|
|
173
|
-
self.name = attributes[:'name']
|
|
174
|
-
end
|
|
175
|
-
|
|
176
174
|
if attributes.key?(:'snapshot')
|
|
177
175
|
self.snapshot = attributes[:'snapshot']
|
|
178
176
|
end
|
|
@@ -205,8 +203,8 @@ module DaytonaApiClient
|
|
|
205
203
|
self.network_allow_list = attributes[:'network_allow_list']
|
|
206
204
|
end
|
|
207
205
|
|
|
208
|
-
if attributes.key?(:'
|
|
209
|
-
self.
|
|
206
|
+
if attributes.key?(:'_class')
|
|
207
|
+
self._class = attributes[:'_class']
|
|
210
208
|
end
|
|
211
209
|
|
|
212
210
|
if attributes.key?(:'target')
|
|
@@ -221,12 +219,6 @@ module DaytonaApiClient
|
|
|
221
219
|
self.gpu = attributes[:'gpu']
|
|
222
220
|
end
|
|
223
221
|
|
|
224
|
-
if attributes.key?(:'gpu_type')
|
|
225
|
-
if (value = attributes[:'gpu_type']).is_a?(Array)
|
|
226
|
-
self.gpu_type = value
|
|
227
|
-
end
|
|
228
|
-
end
|
|
229
|
-
|
|
230
222
|
if attributes.key?(:'memory')
|
|
231
223
|
self.memory = attributes[:'memory']
|
|
232
224
|
end
|
|
@@ -256,16 +248,6 @@ module DaytonaApiClient
|
|
|
256
248
|
if attributes.key?(:'build_info')
|
|
257
249
|
self.build_info = attributes[:'build_info']
|
|
258
250
|
end
|
|
259
|
-
|
|
260
|
-
if attributes.key?(:'linked_sandbox')
|
|
261
|
-
self.linked_sandbox = attributes[:'linked_sandbox']
|
|
262
|
-
end
|
|
263
|
-
|
|
264
|
-
if attributes.key?(:'secrets')
|
|
265
|
-
if (value = attributes[:'secrets']).is_a?(Array)
|
|
266
|
-
self.secrets = value
|
|
267
|
-
end
|
|
268
|
-
end
|
|
269
251
|
end
|
|
270
252
|
|
|
271
253
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -280,15 +262,26 @@ module DaytonaApiClient
|
|
|
280
262
|
# @return true if the model is valid
|
|
281
263
|
def valid?
|
|
282
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)
|
|
283
267
|
true
|
|
284
268
|
end
|
|
285
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
|
+
|
|
286
280
|
# Checks equality by comparing each attribute.
|
|
287
281
|
# @param [Object] Object to be compared
|
|
288
282
|
def ==(o)
|
|
289
283
|
return true if self.equal?(o)
|
|
290
284
|
self.class == o.class &&
|
|
291
|
-
name == o.name &&
|
|
292
285
|
snapshot == o.snapshot &&
|
|
293
286
|
user == o.user &&
|
|
294
287
|
env == o.env &&
|
|
@@ -296,20 +289,17 @@ module DaytonaApiClient
|
|
|
296
289
|
public == o.public &&
|
|
297
290
|
network_block_all == o.network_block_all &&
|
|
298
291
|
network_allow_list == o.network_allow_list &&
|
|
299
|
-
|
|
292
|
+
_class == o._class &&
|
|
300
293
|
target == o.target &&
|
|
301
294
|
cpu == o.cpu &&
|
|
302
295
|
gpu == o.gpu &&
|
|
303
|
-
gpu_type == o.gpu_type &&
|
|
304
296
|
memory == o.memory &&
|
|
305
297
|
disk == o.disk &&
|
|
306
298
|
auto_stop_interval == o.auto_stop_interval &&
|
|
307
299
|
auto_archive_interval == o.auto_archive_interval &&
|
|
308
300
|
auto_delete_interval == o.auto_delete_interval &&
|
|
309
301
|
volumes == o.volumes &&
|
|
310
|
-
build_info == o.build_info
|
|
311
|
-
linked_sandbox == o.linked_sandbox &&
|
|
312
|
-
secrets == o.secrets
|
|
302
|
+
build_info == o.build_info
|
|
313
303
|
end
|
|
314
304
|
|
|
315
305
|
# @see the `==` method
|
|
@@ -321,7 +311,7 @@ module DaytonaApiClient
|
|
|
321
311
|
# Calculates hash code according to all attributes.
|
|
322
312
|
# @return [Integer] Hash code
|
|
323
313
|
def hash
|
|
324
|
-
[
|
|
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
|
|
325
315
|
end
|
|
326
316
|
|
|
327
317
|
# Builds the object from hash
|
|
@@ -347,6 +337,61 @@ module DaytonaApiClient
|
|
|
347
337
|
new(transformed_hash)
|
|
348
338
|
end
|
|
349
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
|
+
|
|
350
395
|
# Returns the object in the form of hash
|
|
351
396
|
# @return [Hash] Returns the object in the form of hash
|
|
352
397
|
def to_hash
|
|
@@ -363,6 +408,22 @@ module DaytonaApiClient
|
|
|
363
408
|
hash
|
|
364
409
|
end
|
|
365
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
|
|
366
428
|
end
|
|
367
|
-
|
|
368
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,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module DaytonaApiClient
|
|
17
|
-
class CreateSessionRequest
|
|
17
|
+
class CreateSessionRequest
|
|
18
18
|
# The ID of the session
|
|
19
19
|
attr_accessor :session_id
|
|
20
20
|
|
|
@@ -144,6 +144,61 @@ module DaytonaApiClient
|
|
|
144
144
|
new(transformed_hash)
|
|
145
145
|
end
|
|
146
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
|
+
|
|
147
202
|
# Returns the object in the form of hash
|
|
148
203
|
# @return [Hash] Returns the object in the form of hash
|
|
149
204
|
def to_hash
|
|
@@ -160,6 +215,22 @@ module DaytonaApiClient
|
|
|
160
215
|
hash
|
|
161
216
|
end
|
|
162
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
|
|
163
235
|
end
|
|
164
|
-
|
|
165
236
|
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,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module DaytonaApiClient
|
|
17
|
-
class CreateSnapshot
|
|
17
|
+
class CreateSnapshot
|
|
18
18
|
# The name of the snapshot
|
|
19
19
|
attr_accessor :name
|
|
20
20
|
|
|
@@ -24,15 +24,15 @@ module DaytonaApiClient
|
|
|
24
24
|
# The entrypoint command for the snapshot
|
|
25
25
|
attr_accessor :entrypoint
|
|
26
26
|
|
|
27
|
+
# Whether the snapshot is general
|
|
28
|
+
attr_accessor :general
|
|
29
|
+
|
|
27
30
|
# CPU cores allocated to the resulting sandbox
|
|
28
31
|
attr_accessor :cpu
|
|
29
32
|
|
|
30
33
|
# GPU units allocated to the resulting sandbox
|
|
31
34
|
attr_accessor :gpu
|
|
32
35
|
|
|
33
|
-
# Preferred GPU type for the resulting sandbox.
|
|
34
|
-
attr_accessor :gpu_type
|
|
35
|
-
|
|
36
36
|
# Memory allocated to the resulting sandbox in GB
|
|
37
37
|
attr_accessor :memory
|
|
38
38
|
|
|
@@ -42,48 +42,18 @@ module DaytonaApiClient
|
|
|
42
42
|
# Build information for the snapshot
|
|
43
43
|
attr_accessor :build_info
|
|
44
44
|
|
|
45
|
-
# ID of the region where the snapshot will be available. Defaults to organization default region if not specified.
|
|
46
|
-
attr_accessor :region_id
|
|
47
|
-
|
|
48
|
-
# Target sandbox class. Determines which runners can host sandboxes created from this snapshot.
|
|
49
|
-
attr_accessor :sandbox_class
|
|
50
|
-
|
|
51
|
-
class EnumAttributeValidator
|
|
52
|
-
attr_reader :datatype
|
|
53
|
-
attr_reader :allowable_values
|
|
54
|
-
|
|
55
|
-
def initialize(datatype, allowable_values)
|
|
56
|
-
@allowable_values = allowable_values.map do |value|
|
|
57
|
-
case datatype.to_s
|
|
58
|
-
when /Integer/i
|
|
59
|
-
value.to_i
|
|
60
|
-
when /Float/i
|
|
61
|
-
value.to_f
|
|
62
|
-
else
|
|
63
|
-
value
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
def valid?(value)
|
|
69
|
-
!value || allowable_values.include?(value)
|
|
70
|
-
end
|
|
71
|
-
end
|
|
72
|
-
|
|
73
45
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
74
46
|
def self.attribute_map
|
|
75
47
|
{
|
|
76
48
|
:'name' => :'name',
|
|
77
49
|
:'image_name' => :'imageName',
|
|
78
50
|
:'entrypoint' => :'entrypoint',
|
|
51
|
+
:'general' => :'general',
|
|
79
52
|
:'cpu' => :'cpu',
|
|
80
53
|
:'gpu' => :'gpu',
|
|
81
|
-
:'gpu_type' => :'gpuType',
|
|
82
54
|
:'memory' => :'memory',
|
|
83
55
|
:'disk' => :'disk',
|
|
84
|
-
:'build_info' => :'buildInfo'
|
|
85
|
-
:'region_id' => :'regionId',
|
|
86
|
-
:'sandbox_class' => :'sandboxClass'
|
|
56
|
+
:'build_info' => :'buildInfo'
|
|
87
57
|
}
|
|
88
58
|
end
|
|
89
59
|
|
|
@@ -103,14 +73,12 @@ module DaytonaApiClient
|
|
|
103
73
|
:'name' => :'String',
|
|
104
74
|
:'image_name' => :'String',
|
|
105
75
|
:'entrypoint' => :'Array<String>',
|
|
76
|
+
:'general' => :'Boolean',
|
|
106
77
|
:'cpu' => :'Integer',
|
|
107
78
|
:'gpu' => :'Integer',
|
|
108
|
-
:'gpu_type' => :'Array<GpuType>',
|
|
109
79
|
:'memory' => :'Integer',
|
|
110
80
|
:'disk' => :'Integer',
|
|
111
|
-
:'build_info' => :'CreateBuildInfo'
|
|
112
|
-
:'region_id' => :'String',
|
|
113
|
-
:'sandbox_class' => :'SandboxClass'
|
|
81
|
+
:'build_info' => :'CreateBuildInfo'
|
|
114
82
|
}
|
|
115
83
|
end
|
|
116
84
|
|
|
@@ -152,6 +120,10 @@ module DaytonaApiClient
|
|
|
152
120
|
end
|
|
153
121
|
end
|
|
154
122
|
|
|
123
|
+
if attributes.key?(:'general')
|
|
124
|
+
self.general = attributes[:'general']
|
|
125
|
+
end
|
|
126
|
+
|
|
155
127
|
if attributes.key?(:'cpu')
|
|
156
128
|
self.cpu = attributes[:'cpu']
|
|
157
129
|
end
|
|
@@ -160,12 +132,6 @@ module DaytonaApiClient
|
|
|
160
132
|
self.gpu = attributes[:'gpu']
|
|
161
133
|
end
|
|
162
134
|
|
|
163
|
-
if attributes.key?(:'gpu_type')
|
|
164
|
-
if (value = attributes[:'gpu_type']).is_a?(Array)
|
|
165
|
-
self.gpu_type = value
|
|
166
|
-
end
|
|
167
|
-
end
|
|
168
|
-
|
|
169
135
|
if attributes.key?(:'memory')
|
|
170
136
|
self.memory = attributes[:'memory']
|
|
171
137
|
end
|
|
@@ -177,14 +143,6 @@ module DaytonaApiClient
|
|
|
177
143
|
if attributes.key?(:'build_info')
|
|
178
144
|
self.build_info = attributes[:'build_info']
|
|
179
145
|
end
|
|
180
|
-
|
|
181
|
-
if attributes.key?(:'region_id')
|
|
182
|
-
self.region_id = attributes[:'region_id']
|
|
183
|
-
end
|
|
184
|
-
|
|
185
|
-
if attributes.key?(:'sandbox_class')
|
|
186
|
-
self.sandbox_class = attributes[:'sandbox_class']
|
|
187
|
-
end
|
|
188
146
|
end
|
|
189
147
|
|
|
190
148
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -225,14 +183,12 @@ module DaytonaApiClient
|
|
|
225
183
|
name == o.name &&
|
|
226
184
|
image_name == o.image_name &&
|
|
227
185
|
entrypoint == o.entrypoint &&
|
|
186
|
+
general == o.general &&
|
|
228
187
|
cpu == o.cpu &&
|
|
229
188
|
gpu == o.gpu &&
|
|
230
|
-
gpu_type == o.gpu_type &&
|
|
231
189
|
memory == o.memory &&
|
|
232
190
|
disk == o.disk &&
|
|
233
|
-
build_info == o.build_info
|
|
234
|
-
region_id == o.region_id &&
|
|
235
|
-
sandbox_class == o.sandbox_class
|
|
191
|
+
build_info == o.build_info
|
|
236
192
|
end
|
|
237
193
|
|
|
238
194
|
# @see the `==` method
|
|
@@ -244,7 +200,7 @@ module DaytonaApiClient
|
|
|
244
200
|
# Calculates hash code according to all attributes.
|
|
245
201
|
# @return [Integer] Hash code
|
|
246
202
|
def hash
|
|
247
|
-
[name, image_name, entrypoint, cpu, gpu,
|
|
203
|
+
[name, image_name, entrypoint, general, cpu, gpu, memory, disk, build_info].hash
|
|
248
204
|
end
|
|
249
205
|
|
|
250
206
|
# Builds the object from hash
|
|
@@ -270,6 +226,61 @@ module DaytonaApiClient
|
|
|
270
226
|
new(transformed_hash)
|
|
271
227
|
end
|
|
272
228
|
|
|
229
|
+
# Deserializes the data based on type
|
|
230
|
+
# @param string type Data type
|
|
231
|
+
# @param string value Value to be deserialized
|
|
232
|
+
# @return [Object] Deserialized data
|
|
233
|
+
def self._deserialize(type, value)
|
|
234
|
+
case type.to_sym
|
|
235
|
+
when :Time
|
|
236
|
+
Time.parse(value)
|
|
237
|
+
when :Date
|
|
238
|
+
Date.parse(value)
|
|
239
|
+
when :String
|
|
240
|
+
value.to_s
|
|
241
|
+
when :Integer
|
|
242
|
+
value.to_i
|
|
243
|
+
when :Float
|
|
244
|
+
value.to_f
|
|
245
|
+
when :Boolean
|
|
246
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
247
|
+
true
|
|
248
|
+
else
|
|
249
|
+
false
|
|
250
|
+
end
|
|
251
|
+
when :Object
|
|
252
|
+
# generic object (usually a Hash), return directly
|
|
253
|
+
value
|
|
254
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
255
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
256
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
257
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
258
|
+
k_type = Regexp.last_match[:k_type]
|
|
259
|
+
v_type = Regexp.last_match[:v_type]
|
|
260
|
+
{}.tap do |hash|
|
|
261
|
+
value.each do |k, v|
|
|
262
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
263
|
+
end
|
|
264
|
+
end
|
|
265
|
+
else # model
|
|
266
|
+
# models (e.g. Pet) or oneOf
|
|
267
|
+
klass = DaytonaApiClient.const_get(type)
|
|
268
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
269
|
+
end
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
# Returns the string representation of the object
|
|
273
|
+
# @return [String] String presentation of the object
|
|
274
|
+
def to_s
|
|
275
|
+
to_hash.to_s
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
279
|
+
# @return [Hash] Returns the object in the form of hash
|
|
280
|
+
def to_body
|
|
281
|
+
to_hash
|
|
282
|
+
end
|
|
283
|
+
|
|
273
284
|
# Returns the object in the form of hash
|
|
274
285
|
# @return [Hash] Returns the object in the form of hash
|
|
275
286
|
def to_hash
|
|
@@ -286,6 +297,22 @@ module DaytonaApiClient
|
|
|
286
297
|
hash
|
|
287
298
|
end
|
|
288
299
|
|
|
300
|
+
# Outputs non-array value in the form of hash
|
|
301
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
302
|
+
# @param [Object] value Any valid value
|
|
303
|
+
# @return [Hash] Returns the value in the form of hash
|
|
304
|
+
def _to_hash(value)
|
|
305
|
+
if value.is_a?(Array)
|
|
306
|
+
value.compact.map { |v| _to_hash(v) }
|
|
307
|
+
elsif value.is_a?(Hash)
|
|
308
|
+
{}.tap do |hash|
|
|
309
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
310
|
+
end
|
|
311
|
+
elsif value.respond_to? :to_hash
|
|
312
|
+
value.to_hash
|
|
313
|
+
else
|
|
314
|
+
value
|
|
315
|
+
end
|
|
316
|
+
end
|
|
289
317
|
end
|
|
290
|
-
|
|
291
318
|
end
|