daytona_api_client 0.182.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 +2 -2
- data/lib/daytona_api_client/api/api_keys_api.rb +2 -2
- data/lib/daytona_api_client/api/audit_api.rb +140 -10
- 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 +307 -1729
- 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 +74 -3
- 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 +77 -16
- data/lib/daytona_api_client/models/create_session_request.rb +74 -3
- data/lib/daytona_api_client/models/create_snapshot.rb +88 -17
- 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 -54
- 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 +191 -138
- 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 +92 -95
- data/lib/daytona_api_client/models/sandbox_class.rb +3 -4
- data/lib/daytona_api_client/models/sandbox_desired_state.rb +3 -4
- 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 -7
- data/lib/daytona_api_client/models/sandbox_volume.rb +78 -17
- 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 -39
- 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 -93
- 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 -170
- data/lib/daytona_api_client/version.rb +2 -2
- data/lib/daytona_api_client.rb +8 -53
- data/project.json +11 -42
- metadata +11 -60
- data/.gitignore +0 -39
- data/.openapi-generator/FILES +0 -210
- 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 -1151
- 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_model_base.rb +0 -88
- data/lib/daytona_api_client/models/admin_create_runner.rb +0 -326
- 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 -165
- data/lib/daytona_api_client/models/fork_sandbox.rb +0 -148
- 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 -53
- 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 -178
- 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 -378
- data/lib/daytona_api_client/models/region_type.rb +0 -42
- data/lib/daytona_api_client/models/region_usage_overview.rb +0 -456
- data/lib/daytona_api_client/models/resize_sandbox.rb +0 -225
- data/lib/daytona_api_client/models/runner_class.rb +0 -41
- data/lib/daytona_api_client/models/runner_full.rb +0 -764
- 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/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/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 -256
- data/lib/daytona_api_client/models/update_region.rb +0 -171
- data/lib/daytona_api_client/models/update_sandbox_network_settings.rb +0 -158
- data/lib/daytona_api_client/models/url.rb +0 -165
- 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,18 +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
57
|
# SSH Gateway command
|
|
64
58
|
attr_accessor :ssh_gateway_command
|
|
65
59
|
|
|
66
60
|
# Base64 encoded SSH Gateway public key
|
|
67
61
|
attr_accessor :ssh_gateway_public_key
|
|
68
62
|
|
|
69
|
-
# Rate limit configuration
|
|
70
|
-
attr_accessor :rate_limit
|
|
71
|
-
|
|
72
63
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
73
64
|
def self.attribute_map
|
|
74
65
|
{
|
|
@@ -79,17 +70,14 @@ module DaytonaApiClient
|
|
|
79
70
|
:'announcements' => :'announcements',
|
|
80
71
|
:'pylon_app_id' => :'pylonAppId',
|
|
81
72
|
:'proxy_template_url' => :'proxyTemplateUrl',
|
|
82
|
-
:'proxy_toolbox_url' => :'proxyToolboxUrl',
|
|
83
73
|
:'default_snapshot' => :'defaultSnapshot',
|
|
84
74
|
:'dashboard_url' => :'dashboardUrl',
|
|
85
75
|
:'max_auto_archive_interval' => :'maxAutoArchiveInterval',
|
|
86
76
|
:'maintanance_mode' => :'maintananceMode',
|
|
87
77
|
:'environment' => :'environment',
|
|
88
78
|
:'billing_api_url' => :'billingApiUrl',
|
|
89
|
-
:'analytics_api_url' => :'analyticsApiUrl',
|
|
90
79
|
:'ssh_gateway_command' => :'sshGatewayCommand',
|
|
91
|
-
:'ssh_gateway_public_key' => :'sshGatewayPublicKey'
|
|
92
|
-
:'rate_limit' => :'rateLimit'
|
|
80
|
+
:'ssh_gateway_public_key' => :'sshGatewayPublicKey'
|
|
93
81
|
}
|
|
94
82
|
end
|
|
95
83
|
|
|
@@ -113,17 +101,14 @@ module DaytonaApiClient
|
|
|
113
101
|
:'announcements' => :'Hash<String, Announcement>',
|
|
114
102
|
:'pylon_app_id' => :'String',
|
|
115
103
|
:'proxy_template_url' => :'String',
|
|
116
|
-
:'proxy_toolbox_url' => :'String',
|
|
117
104
|
:'default_snapshot' => :'String',
|
|
118
105
|
:'dashboard_url' => :'String',
|
|
119
106
|
:'max_auto_archive_interval' => :'Float',
|
|
120
107
|
:'maintanance_mode' => :'Boolean',
|
|
121
108
|
:'environment' => :'String',
|
|
122
109
|
:'billing_api_url' => :'String',
|
|
123
|
-
:'analytics_api_url' => :'String',
|
|
124
110
|
:'ssh_gateway_command' => :'String',
|
|
125
|
-
:'ssh_gateway_public_key' => :'String'
|
|
126
|
-
:'rate_limit' => :'RateLimitConfig'
|
|
111
|
+
:'ssh_gateway_public_key' => :'String'
|
|
127
112
|
}
|
|
128
113
|
end
|
|
129
114
|
|
|
@@ -189,12 +174,6 @@ module DaytonaApiClient
|
|
|
189
174
|
self.proxy_template_url = nil
|
|
190
175
|
end
|
|
191
176
|
|
|
192
|
-
if attributes.key?(:'proxy_toolbox_url')
|
|
193
|
-
self.proxy_toolbox_url = attributes[:'proxy_toolbox_url']
|
|
194
|
-
else
|
|
195
|
-
self.proxy_toolbox_url = nil
|
|
196
|
-
end
|
|
197
|
-
|
|
198
177
|
if attributes.key?(:'default_snapshot')
|
|
199
178
|
self.default_snapshot = attributes[:'default_snapshot']
|
|
200
179
|
else
|
|
@@ -229,10 +208,6 @@ module DaytonaApiClient
|
|
|
229
208
|
self.billing_api_url = attributes[:'billing_api_url']
|
|
230
209
|
end
|
|
231
210
|
|
|
232
|
-
if attributes.key?(:'analytics_api_url')
|
|
233
|
-
self.analytics_api_url = attributes[:'analytics_api_url']
|
|
234
|
-
end
|
|
235
|
-
|
|
236
211
|
if attributes.key?(:'ssh_gateway_command')
|
|
237
212
|
self.ssh_gateway_command = attributes[:'ssh_gateway_command']
|
|
238
213
|
end
|
|
@@ -240,10 +215,6 @@ module DaytonaApiClient
|
|
|
240
215
|
if attributes.key?(:'ssh_gateway_public_key')
|
|
241
216
|
self.ssh_gateway_public_key = attributes[:'ssh_gateway_public_key']
|
|
242
217
|
end
|
|
243
|
-
|
|
244
|
-
if attributes.key?(:'rate_limit')
|
|
245
|
-
self.rate_limit = attributes[:'rate_limit']
|
|
246
|
-
end
|
|
247
218
|
end
|
|
248
219
|
|
|
249
220
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -271,10 +242,6 @@ module DaytonaApiClient
|
|
|
271
242
|
invalid_properties.push('invalid value for "proxy_template_url", proxy_template_url cannot be nil.')
|
|
272
243
|
end
|
|
273
244
|
|
|
274
|
-
if @proxy_toolbox_url.nil?
|
|
275
|
-
invalid_properties.push('invalid value for "proxy_toolbox_url", proxy_toolbox_url cannot be nil.')
|
|
276
|
-
end
|
|
277
|
-
|
|
278
245
|
if @default_snapshot.nil?
|
|
279
246
|
invalid_properties.push('invalid value for "default_snapshot", default_snapshot cannot be nil.')
|
|
280
247
|
end
|
|
@@ -307,7 +274,6 @@ module DaytonaApiClient
|
|
|
307
274
|
return false if @linked_accounts_enabled.nil?
|
|
308
275
|
return false if @announcements.nil?
|
|
309
276
|
return false if @proxy_template_url.nil?
|
|
310
|
-
return false if @proxy_toolbox_url.nil?
|
|
311
277
|
return false if @default_snapshot.nil?
|
|
312
278
|
return false if @dashboard_url.nil?
|
|
313
279
|
return false if @max_auto_archive_interval.nil?
|
|
@@ -366,16 +332,6 @@ module DaytonaApiClient
|
|
|
366
332
|
@proxy_template_url = proxy_template_url
|
|
367
333
|
end
|
|
368
334
|
|
|
369
|
-
# Custom attribute writer method with validation
|
|
370
|
-
# @param [Object] proxy_toolbox_url Value to be assigned
|
|
371
|
-
def proxy_toolbox_url=(proxy_toolbox_url)
|
|
372
|
-
if proxy_toolbox_url.nil?
|
|
373
|
-
fail ArgumentError, 'proxy_toolbox_url cannot be nil'
|
|
374
|
-
end
|
|
375
|
-
|
|
376
|
-
@proxy_toolbox_url = proxy_toolbox_url
|
|
377
|
-
end
|
|
378
|
-
|
|
379
335
|
# Custom attribute writer method with validation
|
|
380
336
|
# @param [Object] default_snapshot Value to be assigned
|
|
381
337
|
def default_snapshot=(default_snapshot)
|
|
@@ -438,17 +394,14 @@ module DaytonaApiClient
|
|
|
438
394
|
announcements == o.announcements &&
|
|
439
395
|
pylon_app_id == o.pylon_app_id &&
|
|
440
396
|
proxy_template_url == o.proxy_template_url &&
|
|
441
|
-
proxy_toolbox_url == o.proxy_toolbox_url &&
|
|
442
397
|
default_snapshot == o.default_snapshot &&
|
|
443
398
|
dashboard_url == o.dashboard_url &&
|
|
444
399
|
max_auto_archive_interval == o.max_auto_archive_interval &&
|
|
445
400
|
maintanance_mode == o.maintanance_mode &&
|
|
446
401
|
environment == o.environment &&
|
|
447
402
|
billing_api_url == o.billing_api_url &&
|
|
448
|
-
analytics_api_url == o.analytics_api_url &&
|
|
449
403
|
ssh_gateway_command == o.ssh_gateway_command &&
|
|
450
|
-
ssh_gateway_public_key == o.ssh_gateway_public_key
|
|
451
|
-
rate_limit == o.rate_limit
|
|
404
|
+
ssh_gateway_public_key == o.ssh_gateway_public_key
|
|
452
405
|
end
|
|
453
406
|
|
|
454
407
|
# @see the `==` method
|
|
@@ -460,7 +413,7 @@ module DaytonaApiClient
|
|
|
460
413
|
# Calculates hash code according to all attributes.
|
|
461
414
|
# @return [Integer] Hash code
|
|
462
415
|
def hash
|
|
463
|
-
[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
|
|
464
417
|
end
|
|
465
418
|
|
|
466
419
|
# Builds the object from hash
|
|
@@ -486,6 +439,61 @@ module DaytonaApiClient
|
|
|
486
439
|
new(transformed_hash)
|
|
487
440
|
end
|
|
488
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
|
+
|
|
489
497
|
# Returns the object in the form of hash
|
|
490
498
|
# @return [Hash] Returns the object in the form of hash
|
|
491
499
|
def to_hash
|
|
@@ -502,6 +510,22 @@ module DaytonaApiClient
|
|
|
502
510
|
hash
|
|
503
511
|
end
|
|
504
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
|
|
505
530
|
end
|
|
506
|
-
|
|
507
531
|
end
|