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
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Daytona
|
|
3
|
+
|
|
4
|
+
#Daytona AI platform API Docs
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0
|
|
7
|
+
Contact: support@daytona.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.12.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module DaytonaApiClient
|
|
17
|
+
class CreateWorkspace
|
|
18
|
+
# The image used for the workspace
|
|
19
|
+
attr_accessor :image
|
|
20
|
+
|
|
21
|
+
# The user associated with the project
|
|
22
|
+
attr_accessor :user
|
|
23
|
+
|
|
24
|
+
# Environment variables for the workspace
|
|
25
|
+
attr_accessor :env
|
|
26
|
+
|
|
27
|
+
# Labels for the workspace
|
|
28
|
+
attr_accessor :labels
|
|
29
|
+
|
|
30
|
+
# Whether the workspace http preview is publicly accessible
|
|
31
|
+
attr_accessor :public
|
|
32
|
+
|
|
33
|
+
# The workspace class type
|
|
34
|
+
attr_accessor :_class
|
|
35
|
+
|
|
36
|
+
# The target (region) where the workspace will be created
|
|
37
|
+
attr_accessor :target
|
|
38
|
+
|
|
39
|
+
# CPU cores allocated to the workspace
|
|
40
|
+
attr_accessor :cpu
|
|
41
|
+
|
|
42
|
+
# GPU units allocated to the workspace
|
|
43
|
+
attr_accessor :gpu
|
|
44
|
+
|
|
45
|
+
# Memory allocated to the workspace in GB
|
|
46
|
+
attr_accessor :memory
|
|
47
|
+
|
|
48
|
+
# Disk space allocated to the workspace in GB
|
|
49
|
+
attr_accessor :disk
|
|
50
|
+
|
|
51
|
+
# Auto-stop interval in minutes (0 means disabled)
|
|
52
|
+
attr_accessor :auto_stop_interval
|
|
53
|
+
|
|
54
|
+
# Auto-archive interval in minutes (0 means the maximum interval will be used)
|
|
55
|
+
attr_accessor :auto_archive_interval
|
|
56
|
+
|
|
57
|
+
# Array of volumes to attach to the workspace
|
|
58
|
+
attr_accessor :volumes
|
|
59
|
+
|
|
60
|
+
# Build information for the workspace
|
|
61
|
+
attr_accessor :build_info
|
|
62
|
+
|
|
63
|
+
class EnumAttributeValidator
|
|
64
|
+
attr_reader :datatype
|
|
65
|
+
attr_reader :allowable_values
|
|
66
|
+
|
|
67
|
+
def initialize(datatype, allowable_values)
|
|
68
|
+
@allowable_values = allowable_values.map do |value|
|
|
69
|
+
case datatype.to_s
|
|
70
|
+
when /Integer/i
|
|
71
|
+
value.to_i
|
|
72
|
+
when /Float/i
|
|
73
|
+
value.to_f
|
|
74
|
+
else
|
|
75
|
+
value
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def valid?(value)
|
|
81
|
+
!value || allowable_values.include?(value)
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
86
|
+
def self.attribute_map
|
|
87
|
+
{
|
|
88
|
+
:'image' => :'image',
|
|
89
|
+
:'user' => :'user',
|
|
90
|
+
:'env' => :'env',
|
|
91
|
+
:'labels' => :'labels',
|
|
92
|
+
:'public' => :'public',
|
|
93
|
+
:'_class' => :'class',
|
|
94
|
+
:'target' => :'target',
|
|
95
|
+
:'cpu' => :'cpu',
|
|
96
|
+
:'gpu' => :'gpu',
|
|
97
|
+
:'memory' => :'memory',
|
|
98
|
+
:'disk' => :'disk',
|
|
99
|
+
:'auto_stop_interval' => :'autoStopInterval',
|
|
100
|
+
:'auto_archive_interval' => :'autoArchiveInterval',
|
|
101
|
+
:'volumes' => :'volumes',
|
|
102
|
+
:'build_info' => :'buildInfo'
|
|
103
|
+
}
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Returns attribute mapping this model knows about
|
|
107
|
+
def self.acceptable_attribute_map
|
|
108
|
+
attribute_map
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Returns all the JSON keys this model knows about
|
|
112
|
+
def self.acceptable_attributes
|
|
113
|
+
acceptable_attribute_map.values
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Attribute type mapping.
|
|
117
|
+
def self.openapi_types
|
|
118
|
+
{
|
|
119
|
+
:'image' => :'String',
|
|
120
|
+
:'user' => :'String',
|
|
121
|
+
:'env' => :'Hash<String, String>',
|
|
122
|
+
:'labels' => :'Hash<String, String>',
|
|
123
|
+
:'public' => :'Boolean',
|
|
124
|
+
:'_class' => :'String',
|
|
125
|
+
:'target' => :'String',
|
|
126
|
+
:'cpu' => :'Integer',
|
|
127
|
+
:'gpu' => :'Integer',
|
|
128
|
+
:'memory' => :'Integer',
|
|
129
|
+
:'disk' => :'Integer',
|
|
130
|
+
:'auto_stop_interval' => :'Integer',
|
|
131
|
+
:'auto_archive_interval' => :'Integer',
|
|
132
|
+
:'volumes' => :'Array<SandboxVolume>',
|
|
133
|
+
:'build_info' => :'CreateBuildInfo'
|
|
134
|
+
}
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# List of attributes with nullable: true
|
|
138
|
+
def self.openapi_nullable
|
|
139
|
+
Set.new([
|
|
140
|
+
])
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Initializes the object
|
|
144
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
145
|
+
def initialize(attributes = {})
|
|
146
|
+
if (!attributes.is_a?(Hash))
|
|
147
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::CreateWorkspace` initialize method"
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
151
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
152
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
153
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
154
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::CreateWorkspace`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
155
|
+
end
|
|
156
|
+
h[k.to_sym] = v
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if attributes.key?(:'image')
|
|
160
|
+
self.image = attributes[:'image']
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
if attributes.key?(:'user')
|
|
164
|
+
self.user = attributes[:'user']
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
if attributes.key?(:'env')
|
|
168
|
+
if (value = attributes[:'env']).is_a?(Hash)
|
|
169
|
+
self.env = value
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
if attributes.key?(:'labels')
|
|
174
|
+
if (value = attributes[:'labels']).is_a?(Hash)
|
|
175
|
+
self.labels = value
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
if attributes.key?(:'public')
|
|
180
|
+
self.public = attributes[:'public']
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
if attributes.key?(:'_class')
|
|
184
|
+
self._class = attributes[:'_class']
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
if attributes.key?(:'target')
|
|
188
|
+
self.target = attributes[:'target']
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
if attributes.key?(:'cpu')
|
|
192
|
+
self.cpu = attributes[:'cpu']
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
if attributes.key?(:'gpu')
|
|
196
|
+
self.gpu = attributes[:'gpu']
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
if attributes.key?(:'memory')
|
|
200
|
+
self.memory = attributes[:'memory']
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
if attributes.key?(:'disk')
|
|
204
|
+
self.disk = attributes[:'disk']
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
if attributes.key?(:'auto_stop_interval')
|
|
208
|
+
self.auto_stop_interval = attributes[:'auto_stop_interval']
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
if attributes.key?(:'auto_archive_interval')
|
|
212
|
+
self.auto_archive_interval = attributes[:'auto_archive_interval']
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
if attributes.key?(:'volumes')
|
|
216
|
+
if (value = attributes[:'volumes']).is_a?(Array)
|
|
217
|
+
self.volumes = value
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
if attributes.key?(:'build_info')
|
|
222
|
+
self.build_info = attributes[:'build_info']
|
|
223
|
+
end
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
227
|
+
# @return Array for valid properties with the reasons
|
|
228
|
+
def list_invalid_properties
|
|
229
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
230
|
+
invalid_properties = Array.new
|
|
231
|
+
invalid_properties
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
# Check to see if the all the properties in the model are valid
|
|
235
|
+
# @return true if the model is valid
|
|
236
|
+
def valid?
|
|
237
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
238
|
+
_class_validator = EnumAttributeValidator.new('String', ["small", "medium", "large"])
|
|
239
|
+
return false unless _class_validator.valid?(@_class)
|
|
240
|
+
target_validator = EnumAttributeValidator.new('String', ["eu", "us", "asia"])
|
|
241
|
+
return false unless target_validator.valid?(@target)
|
|
242
|
+
true
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
246
|
+
# @param [Object] _class Object to be assigned
|
|
247
|
+
def _class=(_class)
|
|
248
|
+
validator = EnumAttributeValidator.new('String', ["small", "medium", "large"])
|
|
249
|
+
unless validator.valid?(_class)
|
|
250
|
+
fail ArgumentError, "invalid value for \"_class\", must be one of #{validator.allowable_values}."
|
|
251
|
+
end
|
|
252
|
+
@_class = _class
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
256
|
+
# @param [Object] target Object to be assigned
|
|
257
|
+
def target=(target)
|
|
258
|
+
validator = EnumAttributeValidator.new('String', ["eu", "us", "asia"])
|
|
259
|
+
unless validator.valid?(target)
|
|
260
|
+
fail ArgumentError, "invalid value for \"target\", must be one of #{validator.allowable_values}."
|
|
261
|
+
end
|
|
262
|
+
@target = target
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# Checks equality by comparing each attribute.
|
|
266
|
+
# @param [Object] Object to be compared
|
|
267
|
+
def ==(o)
|
|
268
|
+
return true if self.equal?(o)
|
|
269
|
+
self.class == o.class &&
|
|
270
|
+
image == o.image &&
|
|
271
|
+
user == o.user &&
|
|
272
|
+
env == o.env &&
|
|
273
|
+
labels == o.labels &&
|
|
274
|
+
public == o.public &&
|
|
275
|
+
_class == o._class &&
|
|
276
|
+
target == o.target &&
|
|
277
|
+
cpu == o.cpu &&
|
|
278
|
+
gpu == o.gpu &&
|
|
279
|
+
memory == o.memory &&
|
|
280
|
+
disk == o.disk &&
|
|
281
|
+
auto_stop_interval == o.auto_stop_interval &&
|
|
282
|
+
auto_archive_interval == o.auto_archive_interval &&
|
|
283
|
+
volumes == o.volumes &&
|
|
284
|
+
build_info == o.build_info
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
# @see the `==` method
|
|
288
|
+
# @param [Object] Object to be compared
|
|
289
|
+
def eql?(o)
|
|
290
|
+
self == o
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
# Calculates hash code according to all attributes.
|
|
294
|
+
# @return [Integer] Hash code
|
|
295
|
+
def hash
|
|
296
|
+
[image, user, env, labels, public, _class, target, cpu, gpu, memory, disk, auto_stop_interval, auto_archive_interval, volumes, build_info].hash
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
# Builds the object from hash
|
|
300
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
301
|
+
# @return [Object] Returns the model itself
|
|
302
|
+
def self.build_from_hash(attributes)
|
|
303
|
+
return nil unless attributes.is_a?(Hash)
|
|
304
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
305
|
+
transformed_hash = {}
|
|
306
|
+
openapi_types.each_pair do |key, type|
|
|
307
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
308
|
+
transformed_hash["#{key}"] = nil
|
|
309
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
310
|
+
# check to ensure the input is an array given that the attribute
|
|
311
|
+
# is documented as an array but the input is not
|
|
312
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
313
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
314
|
+
end
|
|
315
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
316
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
317
|
+
end
|
|
318
|
+
end
|
|
319
|
+
new(transformed_hash)
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
# Deserializes the data based on type
|
|
323
|
+
# @param string type Data type
|
|
324
|
+
# @param string value Value to be deserialized
|
|
325
|
+
# @return [Object] Deserialized data
|
|
326
|
+
def self._deserialize(type, value)
|
|
327
|
+
case type.to_sym
|
|
328
|
+
when :Time
|
|
329
|
+
Time.parse(value)
|
|
330
|
+
when :Date
|
|
331
|
+
Date.parse(value)
|
|
332
|
+
when :String
|
|
333
|
+
value.to_s
|
|
334
|
+
when :Integer
|
|
335
|
+
value.to_i
|
|
336
|
+
when :Float
|
|
337
|
+
value.to_f
|
|
338
|
+
when :Boolean
|
|
339
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
340
|
+
true
|
|
341
|
+
else
|
|
342
|
+
false
|
|
343
|
+
end
|
|
344
|
+
when :Object
|
|
345
|
+
# generic object (usually a Hash), return directly
|
|
346
|
+
value
|
|
347
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
348
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
349
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
350
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
351
|
+
k_type = Regexp.last_match[:k_type]
|
|
352
|
+
v_type = Regexp.last_match[:v_type]
|
|
353
|
+
{}.tap do |hash|
|
|
354
|
+
value.each do |k, v|
|
|
355
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
356
|
+
end
|
|
357
|
+
end
|
|
358
|
+
else # model
|
|
359
|
+
# models (e.g. Pet) or oneOf
|
|
360
|
+
klass = DaytonaApiClient.const_get(type)
|
|
361
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
362
|
+
end
|
|
363
|
+
end
|
|
364
|
+
|
|
365
|
+
# Returns the string representation of the object
|
|
366
|
+
# @return [String] String presentation of the object
|
|
367
|
+
def to_s
|
|
368
|
+
to_hash.to_s
|
|
369
|
+
end
|
|
370
|
+
|
|
371
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
372
|
+
# @return [Hash] Returns the object in the form of hash
|
|
373
|
+
def to_body
|
|
374
|
+
to_hash
|
|
375
|
+
end
|
|
376
|
+
|
|
377
|
+
# Returns the object in the form of hash
|
|
378
|
+
# @return [Hash] Returns the object in the form of hash
|
|
379
|
+
def to_hash
|
|
380
|
+
hash = {}
|
|
381
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
382
|
+
value = self.send(attr)
|
|
383
|
+
if value.nil?
|
|
384
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
385
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
hash[param] = _to_hash(value)
|
|
389
|
+
end
|
|
390
|
+
hash
|
|
391
|
+
end
|
|
392
|
+
|
|
393
|
+
# Outputs non-array value in the form of hash
|
|
394
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
395
|
+
# @param [Object] value Any valid value
|
|
396
|
+
# @return [Hash] Returns the value in the form of hash
|
|
397
|
+
def _to_hash(value)
|
|
398
|
+
if value.is_a?(Array)
|
|
399
|
+
value.compact.map { |v| _to_hash(v) }
|
|
400
|
+
elsif value.is_a?(Hash)
|
|
401
|
+
{}.tap do |hash|
|
|
402
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
403
|
+
end
|
|
404
|
+
elsif value.respond_to? :to_hash
|
|
405
|
+
value.to_hash
|
|
406
|
+
else
|
|
407
|
+
value
|
|
408
|
+
end
|
|
409
|
+
end
|
|
410
|
+
end
|
|
411
|
+
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 DaytonaConfiguration
|
|
17
|
+
class DaytonaConfiguration
|
|
18
18
|
# Daytona version
|
|
19
19
|
attr_accessor :version
|
|
20
20
|
|
|
@@ -36,9 +36,6 @@ module DaytonaApiClient
|
|
|
36
36
|
# Proxy template URL
|
|
37
37
|
attr_accessor :proxy_template_url
|
|
38
38
|
|
|
39
|
-
# Toolbox template URL
|
|
40
|
-
attr_accessor :proxy_toolbox_url
|
|
41
|
-
|
|
42
39
|
# Default snapshot for sandboxes
|
|
43
40
|
attr_accessor :default_snapshot
|
|
44
41
|
|
|
@@ -57,21 +54,12 @@ module DaytonaApiClient
|
|
|
57
54
|
# Billing API URL
|
|
58
55
|
attr_accessor :billing_api_url
|
|
59
56
|
|
|
60
|
-
# Analytics API URL
|
|
61
|
-
attr_accessor :analytics_api_url
|
|
62
|
-
|
|
63
|
-
# Stripe publishable key for client-side Stripe.js
|
|
64
|
-
attr_accessor :stripe_publishable_key
|
|
65
|
-
|
|
66
57
|
# SSH Gateway command
|
|
67
58
|
attr_accessor :ssh_gateway_command
|
|
68
59
|
|
|
69
60
|
# Base64 encoded SSH Gateway public key
|
|
70
61
|
attr_accessor :ssh_gateway_public_key
|
|
71
62
|
|
|
72
|
-
# Rate limit configuration
|
|
73
|
-
attr_accessor :rate_limit
|
|
74
|
-
|
|
75
63
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
76
64
|
def self.attribute_map
|
|
77
65
|
{
|
|
@@ -82,18 +70,14 @@ module DaytonaApiClient
|
|
|
82
70
|
:'announcements' => :'announcements',
|
|
83
71
|
:'pylon_app_id' => :'pylonAppId',
|
|
84
72
|
:'proxy_template_url' => :'proxyTemplateUrl',
|
|
85
|
-
:'proxy_toolbox_url' => :'proxyToolboxUrl',
|
|
86
73
|
:'default_snapshot' => :'defaultSnapshot',
|
|
87
74
|
:'dashboard_url' => :'dashboardUrl',
|
|
88
75
|
:'max_auto_archive_interval' => :'maxAutoArchiveInterval',
|
|
89
76
|
:'maintanance_mode' => :'maintananceMode',
|
|
90
77
|
:'environment' => :'environment',
|
|
91
78
|
:'billing_api_url' => :'billingApiUrl',
|
|
92
|
-
:'analytics_api_url' => :'analyticsApiUrl',
|
|
93
|
-
:'stripe_publishable_key' => :'stripePublishableKey',
|
|
94
79
|
:'ssh_gateway_command' => :'sshGatewayCommand',
|
|
95
|
-
:'ssh_gateway_public_key' => :'sshGatewayPublicKey'
|
|
96
|
-
:'rate_limit' => :'rateLimit'
|
|
80
|
+
:'ssh_gateway_public_key' => :'sshGatewayPublicKey'
|
|
97
81
|
}
|
|
98
82
|
end
|
|
99
83
|
|
|
@@ -117,18 +101,14 @@ module DaytonaApiClient
|
|
|
117
101
|
:'announcements' => :'Hash<String, Announcement>',
|
|
118
102
|
:'pylon_app_id' => :'String',
|
|
119
103
|
:'proxy_template_url' => :'String',
|
|
120
|
-
:'proxy_toolbox_url' => :'String',
|
|
121
104
|
:'default_snapshot' => :'String',
|
|
122
105
|
:'dashboard_url' => :'String',
|
|
123
106
|
:'max_auto_archive_interval' => :'Float',
|
|
124
107
|
:'maintanance_mode' => :'Boolean',
|
|
125
108
|
:'environment' => :'String',
|
|
126
109
|
:'billing_api_url' => :'String',
|
|
127
|
-
:'analytics_api_url' => :'String',
|
|
128
|
-
:'stripe_publishable_key' => :'String',
|
|
129
110
|
:'ssh_gateway_command' => :'String',
|
|
130
|
-
:'ssh_gateway_public_key' => :'String'
|
|
131
|
-
:'rate_limit' => :'RateLimitConfig'
|
|
111
|
+
:'ssh_gateway_public_key' => :'String'
|
|
132
112
|
}
|
|
133
113
|
end
|
|
134
114
|
|
|
@@ -194,12 +174,6 @@ module DaytonaApiClient
|
|
|
194
174
|
self.proxy_template_url = nil
|
|
195
175
|
end
|
|
196
176
|
|
|
197
|
-
if attributes.key?(:'proxy_toolbox_url')
|
|
198
|
-
self.proxy_toolbox_url = attributes[:'proxy_toolbox_url']
|
|
199
|
-
else
|
|
200
|
-
self.proxy_toolbox_url = nil
|
|
201
|
-
end
|
|
202
|
-
|
|
203
177
|
if attributes.key?(:'default_snapshot')
|
|
204
178
|
self.default_snapshot = attributes[:'default_snapshot']
|
|
205
179
|
else
|
|
@@ -234,14 +208,6 @@ module DaytonaApiClient
|
|
|
234
208
|
self.billing_api_url = attributes[:'billing_api_url']
|
|
235
209
|
end
|
|
236
210
|
|
|
237
|
-
if attributes.key?(:'analytics_api_url')
|
|
238
|
-
self.analytics_api_url = attributes[:'analytics_api_url']
|
|
239
|
-
end
|
|
240
|
-
|
|
241
|
-
if attributes.key?(:'stripe_publishable_key')
|
|
242
|
-
self.stripe_publishable_key = attributes[:'stripe_publishable_key']
|
|
243
|
-
end
|
|
244
|
-
|
|
245
211
|
if attributes.key?(:'ssh_gateway_command')
|
|
246
212
|
self.ssh_gateway_command = attributes[:'ssh_gateway_command']
|
|
247
213
|
end
|
|
@@ -249,10 +215,6 @@ module DaytonaApiClient
|
|
|
249
215
|
if attributes.key?(:'ssh_gateway_public_key')
|
|
250
216
|
self.ssh_gateway_public_key = attributes[:'ssh_gateway_public_key']
|
|
251
217
|
end
|
|
252
|
-
|
|
253
|
-
if attributes.key?(:'rate_limit')
|
|
254
|
-
self.rate_limit = attributes[:'rate_limit']
|
|
255
|
-
end
|
|
256
218
|
end
|
|
257
219
|
|
|
258
220
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -280,10 +242,6 @@ module DaytonaApiClient
|
|
|
280
242
|
invalid_properties.push('invalid value for "proxy_template_url", proxy_template_url cannot be nil.')
|
|
281
243
|
end
|
|
282
244
|
|
|
283
|
-
if @proxy_toolbox_url.nil?
|
|
284
|
-
invalid_properties.push('invalid value for "proxy_toolbox_url", proxy_toolbox_url cannot be nil.')
|
|
285
|
-
end
|
|
286
|
-
|
|
287
245
|
if @default_snapshot.nil?
|
|
288
246
|
invalid_properties.push('invalid value for "default_snapshot", default_snapshot cannot be nil.')
|
|
289
247
|
end
|
|
@@ -316,7 +274,6 @@ module DaytonaApiClient
|
|
|
316
274
|
return false if @linked_accounts_enabled.nil?
|
|
317
275
|
return false if @announcements.nil?
|
|
318
276
|
return false if @proxy_template_url.nil?
|
|
319
|
-
return false if @proxy_toolbox_url.nil?
|
|
320
277
|
return false if @default_snapshot.nil?
|
|
321
278
|
return false if @dashboard_url.nil?
|
|
322
279
|
return false if @max_auto_archive_interval.nil?
|
|
@@ -375,16 +332,6 @@ module DaytonaApiClient
|
|
|
375
332
|
@proxy_template_url = proxy_template_url
|
|
376
333
|
end
|
|
377
334
|
|
|
378
|
-
# Custom attribute writer method with validation
|
|
379
|
-
# @param [Object] proxy_toolbox_url Value to be assigned
|
|
380
|
-
def proxy_toolbox_url=(proxy_toolbox_url)
|
|
381
|
-
if proxy_toolbox_url.nil?
|
|
382
|
-
fail ArgumentError, 'proxy_toolbox_url cannot be nil'
|
|
383
|
-
end
|
|
384
|
-
|
|
385
|
-
@proxy_toolbox_url = proxy_toolbox_url
|
|
386
|
-
end
|
|
387
|
-
|
|
388
335
|
# Custom attribute writer method with validation
|
|
389
336
|
# @param [Object] default_snapshot Value to be assigned
|
|
390
337
|
def default_snapshot=(default_snapshot)
|
|
@@ -447,18 +394,14 @@ module DaytonaApiClient
|
|
|
447
394
|
announcements == o.announcements &&
|
|
448
395
|
pylon_app_id == o.pylon_app_id &&
|
|
449
396
|
proxy_template_url == o.proxy_template_url &&
|
|
450
|
-
proxy_toolbox_url == o.proxy_toolbox_url &&
|
|
451
397
|
default_snapshot == o.default_snapshot &&
|
|
452
398
|
dashboard_url == o.dashboard_url &&
|
|
453
399
|
max_auto_archive_interval == o.max_auto_archive_interval &&
|
|
454
400
|
maintanance_mode == o.maintanance_mode &&
|
|
455
401
|
environment == o.environment &&
|
|
456
402
|
billing_api_url == o.billing_api_url &&
|
|
457
|
-
analytics_api_url == o.analytics_api_url &&
|
|
458
|
-
stripe_publishable_key == o.stripe_publishable_key &&
|
|
459
403
|
ssh_gateway_command == o.ssh_gateway_command &&
|
|
460
|
-
ssh_gateway_public_key == o.ssh_gateway_public_key
|
|
461
|
-
rate_limit == o.rate_limit
|
|
404
|
+
ssh_gateway_public_key == o.ssh_gateway_public_key
|
|
462
405
|
end
|
|
463
406
|
|
|
464
407
|
# @see the `==` method
|
|
@@ -470,7 +413,7 @@ module DaytonaApiClient
|
|
|
470
413
|
# Calculates hash code according to all attributes.
|
|
471
414
|
# @return [Integer] Hash code
|
|
472
415
|
def hash
|
|
473
|
-
[version, posthog, oidc, linked_accounts_enabled, announcements, pylon_app_id, proxy_template_url,
|
|
416
|
+
[version, posthog, oidc, linked_accounts_enabled, announcements, pylon_app_id, proxy_template_url, default_snapshot, dashboard_url, max_auto_archive_interval, maintanance_mode, environment, billing_api_url, ssh_gateway_command, ssh_gateway_public_key].hash
|
|
474
417
|
end
|
|
475
418
|
|
|
476
419
|
# Builds the object from hash
|
|
@@ -496,6 +439,61 @@ module DaytonaApiClient
|
|
|
496
439
|
new(transformed_hash)
|
|
497
440
|
end
|
|
498
441
|
|
|
442
|
+
# Deserializes the data based on type
|
|
443
|
+
# @param string type Data type
|
|
444
|
+
# @param string value Value to be deserialized
|
|
445
|
+
# @return [Object] Deserialized data
|
|
446
|
+
def self._deserialize(type, value)
|
|
447
|
+
case type.to_sym
|
|
448
|
+
when :Time
|
|
449
|
+
Time.parse(value)
|
|
450
|
+
when :Date
|
|
451
|
+
Date.parse(value)
|
|
452
|
+
when :String
|
|
453
|
+
value.to_s
|
|
454
|
+
when :Integer
|
|
455
|
+
value.to_i
|
|
456
|
+
when :Float
|
|
457
|
+
value.to_f
|
|
458
|
+
when :Boolean
|
|
459
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
460
|
+
true
|
|
461
|
+
else
|
|
462
|
+
false
|
|
463
|
+
end
|
|
464
|
+
when :Object
|
|
465
|
+
# generic object (usually a Hash), return directly
|
|
466
|
+
value
|
|
467
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
468
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
469
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
470
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
471
|
+
k_type = Regexp.last_match[:k_type]
|
|
472
|
+
v_type = Regexp.last_match[:v_type]
|
|
473
|
+
{}.tap do |hash|
|
|
474
|
+
value.each do |k, v|
|
|
475
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
476
|
+
end
|
|
477
|
+
end
|
|
478
|
+
else # model
|
|
479
|
+
# models (e.g. Pet) or oneOf
|
|
480
|
+
klass = DaytonaApiClient.const_get(type)
|
|
481
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
482
|
+
end
|
|
483
|
+
end
|
|
484
|
+
|
|
485
|
+
# Returns the string representation of the object
|
|
486
|
+
# @return [String] String presentation of the object
|
|
487
|
+
def to_s
|
|
488
|
+
to_hash.to_s
|
|
489
|
+
end
|
|
490
|
+
|
|
491
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
492
|
+
# @return [Hash] Returns the object in the form of hash
|
|
493
|
+
def to_body
|
|
494
|
+
to_hash
|
|
495
|
+
end
|
|
496
|
+
|
|
499
497
|
# Returns the object in the form of hash
|
|
500
498
|
# @return [Hash] Returns the object in the form of hash
|
|
501
499
|
def to_hash
|
|
@@ -512,6 +510,22 @@ module DaytonaApiClient
|
|
|
512
510
|
hash
|
|
513
511
|
end
|
|
514
512
|
|
|
513
|
+
# Outputs non-array value in the form of hash
|
|
514
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
515
|
+
# @param [Object] value Any valid value
|
|
516
|
+
# @return [Hash] Returns the value in the form of hash
|
|
517
|
+
def _to_hash(value)
|
|
518
|
+
if value.is_a?(Array)
|
|
519
|
+
value.compact.map { |v| _to_hash(v) }
|
|
520
|
+
elsif value.is_a?(Hash)
|
|
521
|
+
{}.tap do |hash|
|
|
522
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
523
|
+
end
|
|
524
|
+
elsif value.respond_to? :to_hash
|
|
525
|
+
value.to_hash
|
|
526
|
+
else
|
|
527
|
+
value
|
|
528
|
+
end
|
|
529
|
+
end
|
|
515
530
|
end
|
|
516
|
-
|
|
517
531
|
end
|