daytona_api_client 0.218.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 +102 -59
- 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 +279 -1591
- data/lib/daytona_api_client/api/preview_api.rb +8 -202
- data/lib/daytona_api_client/api/runners_api.rb +22 -470
- data/lib/daytona_api_client/api/sandbox_api.rb +429 -2200
- data/lib/daytona_api_client/api/snapshots_api.rb +117 -46
- data/lib/daytona_api_client/api/toolbox_api.rb +5108 -0
- data/lib/daytona_api_client/api/users_api.rb +172 -100
- 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 +93 -51
- data/lib/daytona_api_client/models/announcement.rb +74 -3
- data/lib/daytona_api_client/models/api_key_list.rb +78 -17
- 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/{audit_target_scenario.rb → computer_use_status_response.rb} +96 -44
- 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 +290 -0
- data/lib/daytona_api_client/models/create_organization_role.rb +74 -3
- data/lib/daytona_api_client/models/create_runner.rb +361 -51
- data/lib/daytona_api_client/models/create_sandbox.rb +117 -120
- 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/{volume_created_webhook.rb → create_user.rb} +113 -131
- 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 -140
- data/lib/daytona_api_client/models/{runner_service_health.rb → display_info_response.rb} +95 -59
- data/lib/daytona_api_client/models/docker_registry.rb +76 -5
- data/lib/daytona_api_client/models/{oidc_id_p_config.rb → download_files.rb} +95 -86
- data/lib/daytona_api_client/models/{create_warm_pool.rb → execute_request.rb} +106 -62
- data/lib/daytona_api_client/models/{metric_data_point.rb → execute_response.rb} +109 -38
- data/lib/daytona_api_client/models/file_info.rb +417 -0
- data/lib/daytona_api_client/models/{snapshot_removed_webhook.rb → file_status.rb} +133 -142
- data/lib/daytona_api_client/models/git_add_request.rb +264 -0
- data/lib/daytona_api_client/models/{create_secret.rb → git_branch_request.rb} +106 -59
- 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/{snapshot_created_webhook.rb → git_commit_info.rb} +151 -161
- 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_region.rb → git_delete_branch_request.rb} +106 -54
- data/lib/daytona_api_client/models/{snapshot_manager_credentials.rb → git_repo_request.rb} +96 -35
- data/lib/daytona_api_client/models/git_status.rb +290 -0
- data/lib/daytona_api_client/models/health_controller_check200_response.rb +74 -3
- data/lib/daytona_api_client/models/health_controller_check200_response_info_value.rb +74 -3
- data/lib/daytona_api_client/models/health_controller_check503_response.rb +74 -3
- data/lib/daytona_api_client/models/{oidc_id_p_config_response.rb → keyboard_hotkey_request.rb} +93 -59
- data/lib/daytona_api_client/models/{create_region_response.rb → keyboard_press_request.rb} +102 -63
- data/lib/daytona_api_client/models/keyboard_type_request.rb +246 -0
- data/lib/daytona_api_client/models/list_branch_response.rb +237 -0
- data/lib/daytona_api_client/models/lsp_completion_params.rb +325 -0
- data/lib/daytona_api_client/models/lsp_document_request.rb +290 -0
- data/lib/daytona_api_client/models/lsp_location.rb +261 -0
- data/lib/daytona_api_client/models/{gpu_capacity.rb → lsp_server_request.rb} +109 -104
- data/lib/daytona_api_client/models/{secret.rb → lsp_symbol.rb} +121 -146
- 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/{available_sandbox_class.rb → mouse_position.rb} +109 -95
- data/lib/daytona_api_client/models/mouse_scroll_request.rb +300 -0
- data/lib/daytona_api_client/models/{test_identity_provider_connection_response.rb → mouse_scroll_response.rb} +81 -30
- data/lib/daytona_api_client/models/oidc_config.rb +78 -68
- data/lib/daytona_api_client/models/organization.rb +159 -307
- 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 +236 -0
- data/lib/daytona_api_client/models/organization_suspension.rb +290 -0
- 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 +80 -19
- data/lib/daytona_api_client/models/{paginated_jobs.rb → paginated_sandboxes.rb} +80 -9
- data/lib/daytona_api_client/models/paginated_snapshots.rb +77 -6
- data/lib/daytona_api_client/models/{paginated_logs.rb → paginated_snapshots_dto.rb} +80 -13
- data/lib/daytona_api_client/models/port_preview_url.rb +88 -34
- data/lib/daytona_api_client/models/position.rb +261 -0
- data/lib/daytona_api_client/models/posthog_config.rb +74 -3
- data/lib/daytona_api_client/models/process_errors_response.rb +263 -0
- data/lib/daytona_api_client/models/process_logs_response.rb +263 -0
- data/lib/daytona_api_client/models/process_restart_response.rb +263 -0
- data/lib/daytona_api_client/models/process_status_response.rb +263 -0
- data/lib/daytona_api_client/models/{update_last_activity.rb → project_dir_response.rb} +83 -13
- data/lib/daytona_api_client/models/{pending_sso_link.rb → pty_create_request.rb} +114 -109
- data/lib/daytona_api_client/models/pty_create_response.rb +236 -0
- data/lib/daytona_api_client/models/{sandbox_identity.rb → pty_list_response.rb} +95 -49
- data/lib/daytona_api_client/models/pty_resize_request.rb +263 -0
- data/lib/daytona_api_client/models/pty_session_info.rb +425 -0
- data/lib/daytona_api_client/models/range.rb +261 -0
- data/lib/daytona_api_client/models/region.rb +78 -192
- data/lib/daytona_api_client/models/{regenerate_api_key_response.rb → region_screenshot_response.rb} +113 -22
- data/lib/daytona_api_client/models/registry_push_access_dto.rb +74 -3
- data/lib/daytona_api_client/models/replace_request.rb +289 -0
- data/lib/daytona_api_client/models/replace_result.rb +236 -0
- 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 +105 -220
- 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_sandbox_snapshot.rb → sandbox_info.rb} +113 -17
- 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/{gpu_capacity_response.rb → search_files_response.rb} +93 -49
- data/lib/daytona_api_client/models/send_webhook_dto.rb +273 -0
- 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/{generate_workos_admin_portal_link.rb → set_snapshot_general_status_dto.rb} +93 -44
- data/lib/daytona_api_client/models/snapshot_dto.rb +78 -84
- data/lib/daytona_api_client/models/snapshot_state.rb +6 -5
- data/lib/daytona_api_client/models/ssh_access_dto.rb +78 -34
- data/lib/daytona_api_client/models/ssh_access_validation_dto.rb +98 -7
- data/lib/daytona_api_client/models/storage_access_dto.rb +78 -34
- data/lib/daytona_api_client/models/update_docker_registry.rb +74 -3
- data/lib/daytona_api_client/models/update_organization_invitation.rb +76 -5
- data/lib/daytona_api_client/models/update_organization_member_access.rb +76 -5
- data/lib/daytona_api_client/models/update_organization_quota.rb +317 -0
- data/lib/daytona_api_client/models/update_organization_role.rb +74 -3
- data/lib/daytona_api_client/models/update_sandbox_state_dto.rb +80 -29
- data/lib/daytona_api_client/models/user.rb +75 -51
- 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} +303 -226
- data/lib/daytona_api_client/version.rb +2 -2
- data/lib/daytona_api_client.rb +83 -93
- data/project.json +13 -38
- metadata +88 -102
- data/.gitignore +0 -39
- data/.openapi-generator/FILES +0 -175
- 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/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/audit_scenarios.rb +0 -167
- data/lib/daytona_api_client/models/create_identity_provider.rb +0 -269
- data/lib/daytona_api_client/models/create_runner_sandbox_class.rb +0 -42
- 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 -46
- data/lib/daytona_api_client/models/identity_provider.rb +0 -439
- data/lib/daytona_api_client/models/int_filter.rb +0 -222
- data/lib/daytona_api_client/models/job.rb +0 -366
- data/lib/daytona_api_client/models/job_status.rb +0 -43
- data/lib/daytona_api_client/models/job_type.rb +0 -55
- data/lib/daytona_api_client/models/log_entry.rb +0 -334
- data/lib/daytona_api_client/models/metric_series.rb +0 -194
- data/lib/daytona_api_client/models/metrics_response.rb +0 -167
- data/lib/daytona_api_client/models/otel_config.rb +0 -188
- data/lib/daytona_api_client/models/poll_jobs_response.rb +0 -167
- data/lib/daytona_api_client/models/rate_limit_config.rb +0 -188
- data/lib/daytona_api_client/models/rate_limit_entry.rb +0 -158
- data/lib/daytona_api_client/models/region_quota.rb +0 -453
- data/lib/daytona_api_client/models/region_type.rb +0 -42
- data/lib/daytona_api_client/models/region_usage_overview.rb +0 -518
- data/lib/daytona_api_client/models/resize_sandbox.rb +0 -225
- data/lib/daytona_api_client/models/resolve_sandbox_secrets200_response_inner.rb +0 -176
- data/lib/daytona_api_client/models/runner_class.rb +0 -40
- data/lib/daytona_api_client/models/runner_full.rb +0 -757
- data/lib/daytona_api_client/models/runner_health_metrics.rb +0 -482
- data/lib/daytona_api_client/models/sandbox_created_webhook.rb +0 -349
- 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/sandbox_state_updated_webhook.rb +0 -349
- data/lib/daytona_api_client/models/snapshot_state_updated_webhook.rb +0 -376
- data/lib/daytona_api_client/models/sso_oidc_config.rb +0 -192
- data/lib/daytona_api_client/models/string_filter.rb +0 -182
- data/lib/daytona_api_client/models/test_identity_provider_connection.rb +0 -165
- data/lib/daytona_api_client/models/trace_span.rb +0 -332
- data/lib/daytona_api_client/models/trace_summary.rb +0 -310
- data/lib/daytona_api_client/models/update_identity_provider.rb +0 -212
- data/lib/daytona_api_client/models/update_oidc_id_p_config.rb +0 -178
- data/lib/daytona_api_client/models/update_organization_default_region.rb +0 -165
- data/lib/daytona_api_client/models/update_region.rb +0 -182
- data/lib/daytona_api_client/models/update_sandbox_network_settings.rb +0 -168
- data/lib/daytona_api_client/models/update_sandbox_secrets.rb +0 -167
- data/lib/daytona_api_client/models/update_secret.rb +0 -170
- data/lib/daytona_api_client/models/update_warm_pool.rb +0 -174
- data/lib/daytona_api_client/models/url.rb +0 -165
- data/lib/daytona_api_client/models/volume_state_updated_webhook.rb +0 -376
- data/lib/daytona_api_client/models/warm_pool.rb +0 -490
- data/lib/daytona_api_client/models/webhook_event.rb +0 -46
- data/lib/daytona_api_client/models/workos_admin_portal_intent.rb +0 -41
- data/lib/daytona_api_client/models/workos_admin_portal_link.rb +0 -165
- data/lib/daytona_api_client/models/workos_sso_connection.rb +0 -329
|
@@ -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,14 +14,28 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module DaytonaApiClient
|
|
17
|
-
class
|
|
18
|
-
# The toolbox proxy URL for the sandbox
|
|
17
|
+
class GitCloneRequest
|
|
19
18
|
attr_accessor :url
|
|
20
19
|
|
|
20
|
+
attr_accessor :path
|
|
21
|
+
|
|
22
|
+
attr_accessor :username
|
|
23
|
+
|
|
24
|
+
attr_accessor :password
|
|
25
|
+
|
|
26
|
+
attr_accessor :branch
|
|
27
|
+
|
|
28
|
+
attr_accessor :commit_id
|
|
29
|
+
|
|
21
30
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
31
|
def self.attribute_map
|
|
23
32
|
{
|
|
24
|
-
:'url' => :'url'
|
|
33
|
+
:'url' => :'url',
|
|
34
|
+
:'path' => :'path',
|
|
35
|
+
:'username' => :'username',
|
|
36
|
+
:'password' => :'password',
|
|
37
|
+
:'branch' => :'branch',
|
|
38
|
+
:'commit_id' => :'commit_id'
|
|
25
39
|
}
|
|
26
40
|
end
|
|
27
41
|
|
|
@@ -38,7 +52,12 @@ module DaytonaApiClient
|
|
|
38
52
|
# Attribute type mapping.
|
|
39
53
|
def self.openapi_types
|
|
40
54
|
{
|
|
41
|
-
:'url' => :'String'
|
|
55
|
+
:'url' => :'String',
|
|
56
|
+
:'path' => :'String',
|
|
57
|
+
:'username' => :'String',
|
|
58
|
+
:'password' => :'String',
|
|
59
|
+
:'branch' => :'String',
|
|
60
|
+
:'commit_id' => :'String'
|
|
42
61
|
}
|
|
43
62
|
end
|
|
44
63
|
|
|
@@ -52,14 +71,14 @@ module DaytonaApiClient
|
|
|
52
71
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
53
72
|
def initialize(attributes = {})
|
|
54
73
|
if (!attributes.is_a?(Hash))
|
|
55
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::
|
|
74
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::GitCloneRequest` initialize method"
|
|
56
75
|
end
|
|
57
76
|
|
|
58
77
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
59
78
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
60
79
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
61
80
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
62
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::
|
|
81
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::GitCloneRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
63
82
|
end
|
|
64
83
|
h[k.to_sym] = v
|
|
65
84
|
}
|
|
@@ -69,6 +88,28 @@ module DaytonaApiClient
|
|
|
69
88
|
else
|
|
70
89
|
self.url = nil
|
|
71
90
|
end
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'path')
|
|
93
|
+
self.path = attributes[:'path']
|
|
94
|
+
else
|
|
95
|
+
self.path = nil
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
if attributes.key?(:'username')
|
|
99
|
+
self.username = attributes[:'username']
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if attributes.key?(:'password')
|
|
103
|
+
self.password = attributes[:'password']
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if attributes.key?(:'branch')
|
|
107
|
+
self.branch = attributes[:'branch']
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if attributes.key?(:'commit_id')
|
|
111
|
+
self.commit_id = attributes[:'commit_id']
|
|
112
|
+
end
|
|
72
113
|
end
|
|
73
114
|
|
|
74
115
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -80,6 +121,10 @@ module DaytonaApiClient
|
|
|
80
121
|
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
|
81
122
|
end
|
|
82
123
|
|
|
124
|
+
if @path.nil?
|
|
125
|
+
invalid_properties.push('invalid value for "path", path cannot be nil.')
|
|
126
|
+
end
|
|
127
|
+
|
|
83
128
|
invalid_properties
|
|
84
129
|
end
|
|
85
130
|
|
|
@@ -88,6 +133,7 @@ module DaytonaApiClient
|
|
|
88
133
|
def valid?
|
|
89
134
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
90
135
|
return false if @url.nil?
|
|
136
|
+
return false if @path.nil?
|
|
91
137
|
true
|
|
92
138
|
end
|
|
93
139
|
|
|
@@ -101,12 +147,27 @@ module DaytonaApiClient
|
|
|
101
147
|
@url = url
|
|
102
148
|
end
|
|
103
149
|
|
|
150
|
+
# Custom attribute writer method with validation
|
|
151
|
+
# @param [Object] path Value to be assigned
|
|
152
|
+
def path=(path)
|
|
153
|
+
if path.nil?
|
|
154
|
+
fail ArgumentError, 'path cannot be nil'
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
@path = path
|
|
158
|
+
end
|
|
159
|
+
|
|
104
160
|
# Checks equality by comparing each attribute.
|
|
105
161
|
# @param [Object] Object to be compared
|
|
106
162
|
def ==(o)
|
|
107
163
|
return true if self.equal?(o)
|
|
108
164
|
self.class == o.class &&
|
|
109
|
-
url == o.url
|
|
165
|
+
url == o.url &&
|
|
166
|
+
path == o.path &&
|
|
167
|
+
username == o.username &&
|
|
168
|
+
password == o.password &&
|
|
169
|
+
branch == o.branch &&
|
|
170
|
+
commit_id == o.commit_id
|
|
110
171
|
end
|
|
111
172
|
|
|
112
173
|
# @see the `==` method
|
|
@@ -118,7 +179,7 @@ module DaytonaApiClient
|
|
|
118
179
|
# Calculates hash code according to all attributes.
|
|
119
180
|
# @return [Integer] Hash code
|
|
120
181
|
def hash
|
|
121
|
-
[url].hash
|
|
182
|
+
[url, path, username, password, branch, commit_id].hash
|
|
122
183
|
end
|
|
123
184
|
|
|
124
185
|
# Builds the object from hash
|
|
@@ -144,6 +205,61 @@ module DaytonaApiClient
|
|
|
144
205
|
new(transformed_hash)
|
|
145
206
|
end
|
|
146
207
|
|
|
208
|
+
# Deserializes the data based on type
|
|
209
|
+
# @param string type Data type
|
|
210
|
+
# @param string value Value to be deserialized
|
|
211
|
+
# @return [Object] Deserialized data
|
|
212
|
+
def self._deserialize(type, value)
|
|
213
|
+
case type.to_sym
|
|
214
|
+
when :Time
|
|
215
|
+
Time.parse(value)
|
|
216
|
+
when :Date
|
|
217
|
+
Date.parse(value)
|
|
218
|
+
when :String
|
|
219
|
+
value.to_s
|
|
220
|
+
when :Integer
|
|
221
|
+
value.to_i
|
|
222
|
+
when :Float
|
|
223
|
+
value.to_f
|
|
224
|
+
when :Boolean
|
|
225
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
226
|
+
true
|
|
227
|
+
else
|
|
228
|
+
false
|
|
229
|
+
end
|
|
230
|
+
when :Object
|
|
231
|
+
# generic object (usually a Hash), return directly
|
|
232
|
+
value
|
|
233
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
234
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
235
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
236
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
237
|
+
k_type = Regexp.last_match[:k_type]
|
|
238
|
+
v_type = Regexp.last_match[:v_type]
|
|
239
|
+
{}.tap do |hash|
|
|
240
|
+
value.each do |k, v|
|
|
241
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
242
|
+
end
|
|
243
|
+
end
|
|
244
|
+
else # model
|
|
245
|
+
# models (e.g. Pet) or oneOf
|
|
246
|
+
klass = DaytonaApiClient.const_get(type)
|
|
247
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
248
|
+
end
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
# Returns the string representation of the object
|
|
252
|
+
# @return [String] String presentation of the object
|
|
253
|
+
def to_s
|
|
254
|
+
to_hash.to_s
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
258
|
+
# @return [Hash] Returns the object in the form of hash
|
|
259
|
+
def to_body
|
|
260
|
+
to_hash
|
|
261
|
+
end
|
|
262
|
+
|
|
147
263
|
# Returns the object in the form of hash
|
|
148
264
|
# @return [Hash] Returns the object in the form of hash
|
|
149
265
|
def to_hash
|
|
@@ -160,6 +276,22 @@ module DaytonaApiClient
|
|
|
160
276
|
hash
|
|
161
277
|
end
|
|
162
278
|
|
|
279
|
+
# Outputs non-array value in the form of hash
|
|
280
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
281
|
+
# @param [Object] value Any valid value
|
|
282
|
+
# @return [Hash] Returns the value in the form of hash
|
|
283
|
+
def _to_hash(value)
|
|
284
|
+
if value.is_a?(Array)
|
|
285
|
+
value.compact.map { |v| _to_hash(v) }
|
|
286
|
+
elsif value.is_a?(Hash)
|
|
287
|
+
{}.tap do |hash|
|
|
288
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
289
|
+
end
|
|
290
|
+
elsif value.respond_to? :to_hash
|
|
291
|
+
value.to_hash
|
|
292
|
+
else
|
|
293
|
+
value
|
|
294
|
+
end
|
|
295
|
+
end
|
|
163
296
|
end
|
|
164
|
-
|
|
165
297
|
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,60 +14,25 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module DaytonaApiClient
|
|
17
|
-
class
|
|
18
|
-
|
|
19
|
-
attr_accessor :event
|
|
17
|
+
class GitCommitInfo
|
|
18
|
+
attr_accessor :hash
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
attr_accessor :timestamp
|
|
23
|
-
|
|
24
|
-
# Snapshot ID
|
|
25
|
-
attr_accessor :id
|
|
26
|
-
|
|
27
|
-
# Snapshot name
|
|
28
|
-
attr_accessor :name
|
|
29
|
-
|
|
30
|
-
# Organization ID
|
|
31
|
-
attr_accessor :organization_id
|
|
32
|
-
|
|
33
|
-
# Snapshot state
|
|
34
|
-
attr_accessor :state
|
|
20
|
+
attr_accessor :message
|
|
35
21
|
|
|
36
|
-
|
|
37
|
-
attr_accessor :created_at
|
|
22
|
+
attr_accessor :author
|
|
38
23
|
|
|
39
|
-
|
|
40
|
-
attr_reader :datatype
|
|
41
|
-
attr_reader :allowable_values
|
|
42
|
-
|
|
43
|
-
def initialize(datatype, allowable_values)
|
|
44
|
-
@allowable_values = allowable_values.map do |value|
|
|
45
|
-
case datatype.to_s
|
|
46
|
-
when /Integer/i
|
|
47
|
-
value.to_i
|
|
48
|
-
when /Float/i
|
|
49
|
-
value.to_f
|
|
50
|
-
else
|
|
51
|
-
value
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
end
|
|
24
|
+
attr_accessor :email
|
|
55
25
|
|
|
56
|
-
|
|
57
|
-
!value || allowable_values.include?(value)
|
|
58
|
-
end
|
|
59
|
-
end
|
|
26
|
+
attr_accessor :timestamp
|
|
60
27
|
|
|
61
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
62
29
|
def self.attribute_map
|
|
63
30
|
{
|
|
64
|
-
:'
|
|
65
|
-
:'
|
|
66
|
-
:'
|
|
67
|
-
:'
|
|
68
|
-
:'
|
|
69
|
-
:'state' => :'state',
|
|
70
|
-
:'created_at' => :'createdAt'
|
|
31
|
+
:'hash' => :'hash',
|
|
32
|
+
:'message' => :'message',
|
|
33
|
+
:'author' => :'author',
|
|
34
|
+
:'email' => :'email',
|
|
35
|
+
:'timestamp' => :'timestamp'
|
|
71
36
|
}
|
|
72
37
|
end
|
|
73
38
|
|
|
@@ -84,13 +49,11 @@ module DaytonaApiClient
|
|
|
84
49
|
# Attribute type mapping.
|
|
85
50
|
def self.openapi_types
|
|
86
51
|
{
|
|
87
|
-
:'
|
|
88
|
-
:'
|
|
89
|
-
:'
|
|
90
|
-
:'
|
|
91
|
-
:'
|
|
92
|
-
:'state' => :'SnapshotState',
|
|
93
|
-
:'created_at' => :'Time'
|
|
52
|
+
:'hash' => :'String',
|
|
53
|
+
:'message' => :'String',
|
|
54
|
+
:'author' => :'String',
|
|
55
|
+
:'email' => :'String',
|
|
56
|
+
:'timestamp' => :'String'
|
|
94
57
|
}
|
|
95
58
|
end
|
|
96
59
|
|
|
@@ -104,58 +67,46 @@ module DaytonaApiClient
|
|
|
104
67
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
105
68
|
def initialize(attributes = {})
|
|
106
69
|
if (!attributes.is_a?(Hash))
|
|
107
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::
|
|
70
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::GitCommitInfo` initialize method"
|
|
108
71
|
end
|
|
109
72
|
|
|
110
73
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
111
74
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
112
75
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
113
76
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
114
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::
|
|
77
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::GitCommitInfo`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
115
78
|
end
|
|
116
79
|
h[k.to_sym] = v
|
|
117
80
|
}
|
|
118
81
|
|
|
119
|
-
if attributes.key?(:'
|
|
120
|
-
self.
|
|
121
|
-
else
|
|
122
|
-
self.event = nil
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
if attributes.key?(:'timestamp')
|
|
126
|
-
self.timestamp = attributes[:'timestamp']
|
|
127
|
-
else
|
|
128
|
-
self.timestamp = nil
|
|
129
|
-
end
|
|
130
|
-
|
|
131
|
-
if attributes.key?(:'id')
|
|
132
|
-
self.id = attributes[:'id']
|
|
82
|
+
if attributes.key?(:'hash')
|
|
83
|
+
self.hash = attributes[:'hash']
|
|
133
84
|
else
|
|
134
|
-
self.
|
|
85
|
+
self.hash = nil
|
|
135
86
|
end
|
|
136
87
|
|
|
137
|
-
if attributes.key?(:'
|
|
138
|
-
self.
|
|
88
|
+
if attributes.key?(:'message')
|
|
89
|
+
self.message = attributes[:'message']
|
|
139
90
|
else
|
|
140
|
-
self.
|
|
91
|
+
self.message = nil
|
|
141
92
|
end
|
|
142
93
|
|
|
143
|
-
if attributes.key?(:'
|
|
144
|
-
self.
|
|
94
|
+
if attributes.key?(:'author')
|
|
95
|
+
self.author = attributes[:'author']
|
|
145
96
|
else
|
|
146
|
-
self.
|
|
97
|
+
self.author = nil
|
|
147
98
|
end
|
|
148
99
|
|
|
149
|
-
if attributes.key?(:'
|
|
150
|
-
self.
|
|
100
|
+
if attributes.key?(:'email')
|
|
101
|
+
self.email = attributes[:'email']
|
|
151
102
|
else
|
|
152
|
-
self.
|
|
103
|
+
self.email = nil
|
|
153
104
|
end
|
|
154
105
|
|
|
155
|
-
if attributes.key?(:'
|
|
156
|
-
self.
|
|
106
|
+
if attributes.key?(:'timestamp')
|
|
107
|
+
self.timestamp = attributes[:'timestamp']
|
|
157
108
|
else
|
|
158
|
-
self.
|
|
109
|
+
self.timestamp = nil
|
|
159
110
|
end
|
|
160
111
|
end
|
|
161
112
|
|
|
@@ -164,32 +115,24 @@ module DaytonaApiClient
|
|
|
164
115
|
def list_invalid_properties
|
|
165
116
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
166
117
|
invalid_properties = Array.new
|
|
167
|
-
if @
|
|
168
|
-
invalid_properties.push('invalid value for "
|
|
118
|
+
if @hash.nil?
|
|
119
|
+
invalid_properties.push('invalid value for "hash", hash cannot be nil.')
|
|
169
120
|
end
|
|
170
121
|
|
|
171
|
-
if @
|
|
172
|
-
invalid_properties.push('invalid value for "
|
|
122
|
+
if @message.nil?
|
|
123
|
+
invalid_properties.push('invalid value for "message", message cannot be nil.')
|
|
173
124
|
end
|
|
174
125
|
|
|
175
|
-
if @
|
|
176
|
-
invalid_properties.push('invalid value for "
|
|
126
|
+
if @author.nil?
|
|
127
|
+
invalid_properties.push('invalid value for "author", author cannot be nil.')
|
|
177
128
|
end
|
|
178
129
|
|
|
179
|
-
if @
|
|
180
|
-
invalid_properties.push('invalid value for "
|
|
130
|
+
if @email.nil?
|
|
131
|
+
invalid_properties.push('invalid value for "email", email cannot be nil.')
|
|
181
132
|
end
|
|
182
133
|
|
|
183
|
-
if @
|
|
184
|
-
invalid_properties.push('invalid value for "
|
|
185
|
-
end
|
|
186
|
-
|
|
187
|
-
if @state.nil?
|
|
188
|
-
invalid_properties.push('invalid value for "state", state cannot be nil.')
|
|
189
|
-
end
|
|
190
|
-
|
|
191
|
-
if @created_at.nil?
|
|
192
|
-
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
134
|
+
if @timestamp.nil?
|
|
135
|
+
invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.')
|
|
193
136
|
end
|
|
194
137
|
|
|
195
138
|
invalid_properties
|
|
@@ -199,84 +142,62 @@ module DaytonaApiClient
|
|
|
199
142
|
# @return true if the model is valid
|
|
200
143
|
def valid?
|
|
201
144
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
202
|
-
return false if @
|
|
145
|
+
return false if @hash.nil?
|
|
146
|
+
return false if @message.nil?
|
|
147
|
+
return false if @author.nil?
|
|
148
|
+
return false if @email.nil?
|
|
203
149
|
return false if @timestamp.nil?
|
|
204
|
-
return false if @id.nil?
|
|
205
|
-
return false if @name.nil?
|
|
206
|
-
return false if @organization_id.nil?
|
|
207
|
-
return false if @state.nil?
|
|
208
|
-
return false if @created_at.nil?
|
|
209
150
|
true
|
|
210
151
|
end
|
|
211
152
|
|
|
212
153
|
# Custom attribute writer method with validation
|
|
213
|
-
# @param [Object]
|
|
214
|
-
def
|
|
215
|
-
if
|
|
216
|
-
fail ArgumentError, '
|
|
217
|
-
end
|
|
218
|
-
|
|
219
|
-
@event = event
|
|
220
|
-
end
|
|
221
|
-
|
|
222
|
-
# Custom attribute writer method with validation
|
|
223
|
-
# @param [Object] timestamp Value to be assigned
|
|
224
|
-
def timestamp=(timestamp)
|
|
225
|
-
if timestamp.nil?
|
|
226
|
-
fail ArgumentError, 'timestamp cannot be nil'
|
|
154
|
+
# @param [Object] hash Value to be assigned
|
|
155
|
+
def hash=(hash)
|
|
156
|
+
if hash.nil?
|
|
157
|
+
fail ArgumentError, 'hash cannot be nil'
|
|
227
158
|
end
|
|
228
159
|
|
|
229
|
-
@
|
|
160
|
+
@hash = hash
|
|
230
161
|
end
|
|
231
162
|
|
|
232
163
|
# Custom attribute writer method with validation
|
|
233
|
-
# @param [Object]
|
|
234
|
-
def
|
|
235
|
-
if
|
|
236
|
-
fail ArgumentError, '
|
|
164
|
+
# @param [Object] message Value to be assigned
|
|
165
|
+
def message=(message)
|
|
166
|
+
if message.nil?
|
|
167
|
+
fail ArgumentError, 'message cannot be nil'
|
|
237
168
|
end
|
|
238
169
|
|
|
239
|
-
@
|
|
170
|
+
@message = message
|
|
240
171
|
end
|
|
241
172
|
|
|
242
173
|
# Custom attribute writer method with validation
|
|
243
|
-
# @param [Object]
|
|
244
|
-
def
|
|
245
|
-
if
|
|
246
|
-
fail ArgumentError, '
|
|
174
|
+
# @param [Object] author Value to be assigned
|
|
175
|
+
def author=(author)
|
|
176
|
+
if author.nil?
|
|
177
|
+
fail ArgumentError, 'author cannot be nil'
|
|
247
178
|
end
|
|
248
179
|
|
|
249
|
-
@
|
|
180
|
+
@author = author
|
|
250
181
|
end
|
|
251
182
|
|
|
252
183
|
# Custom attribute writer method with validation
|
|
253
|
-
# @param [Object]
|
|
254
|
-
def
|
|
255
|
-
if
|
|
256
|
-
fail ArgumentError, '
|
|
184
|
+
# @param [Object] email Value to be assigned
|
|
185
|
+
def email=(email)
|
|
186
|
+
if email.nil?
|
|
187
|
+
fail ArgumentError, 'email cannot be nil'
|
|
257
188
|
end
|
|
258
189
|
|
|
259
|
-
@
|
|
190
|
+
@email = email
|
|
260
191
|
end
|
|
261
192
|
|
|
262
193
|
# Custom attribute writer method with validation
|
|
263
|
-
# @param [Object]
|
|
264
|
-
def
|
|
265
|
-
if
|
|
266
|
-
fail ArgumentError, '
|
|
267
|
-
end
|
|
268
|
-
|
|
269
|
-
@state = state
|
|
270
|
-
end
|
|
271
|
-
|
|
272
|
-
# Custom attribute writer method with validation
|
|
273
|
-
# @param [Object] created_at Value to be assigned
|
|
274
|
-
def created_at=(created_at)
|
|
275
|
-
if created_at.nil?
|
|
276
|
-
fail ArgumentError, 'created_at cannot be nil'
|
|
194
|
+
# @param [Object] timestamp Value to be assigned
|
|
195
|
+
def timestamp=(timestamp)
|
|
196
|
+
if timestamp.nil?
|
|
197
|
+
fail ArgumentError, 'timestamp cannot be nil'
|
|
277
198
|
end
|
|
278
199
|
|
|
279
|
-
@
|
|
200
|
+
@timestamp = timestamp
|
|
280
201
|
end
|
|
281
202
|
|
|
282
203
|
# Checks equality by comparing each attribute.
|
|
@@ -284,13 +205,11 @@ module DaytonaApiClient
|
|
|
284
205
|
def ==(o)
|
|
285
206
|
return true if self.equal?(o)
|
|
286
207
|
self.class == o.class &&
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
state == o.state &&
|
|
293
|
-
created_at == o.created_at
|
|
208
|
+
hash == o.hash &&
|
|
209
|
+
message == o.message &&
|
|
210
|
+
author == o.author &&
|
|
211
|
+
email == o.email &&
|
|
212
|
+
timestamp == o.timestamp
|
|
294
213
|
end
|
|
295
214
|
|
|
296
215
|
# @see the `==` method
|
|
@@ -302,7 +221,7 @@ module DaytonaApiClient
|
|
|
302
221
|
# Calculates hash code according to all attributes.
|
|
303
222
|
# @return [Integer] Hash code
|
|
304
223
|
def hash
|
|
305
|
-
[
|
|
224
|
+
[hash, message, author, email, timestamp].hash
|
|
306
225
|
end
|
|
307
226
|
|
|
308
227
|
# Builds the object from hash
|
|
@@ -328,6 +247,61 @@ module DaytonaApiClient
|
|
|
328
247
|
new(transformed_hash)
|
|
329
248
|
end
|
|
330
249
|
|
|
250
|
+
# Deserializes the data based on type
|
|
251
|
+
# @param string type Data type
|
|
252
|
+
# @param string value Value to be deserialized
|
|
253
|
+
# @return [Object] Deserialized data
|
|
254
|
+
def self._deserialize(type, value)
|
|
255
|
+
case type.to_sym
|
|
256
|
+
when :Time
|
|
257
|
+
Time.parse(value)
|
|
258
|
+
when :Date
|
|
259
|
+
Date.parse(value)
|
|
260
|
+
when :String
|
|
261
|
+
value.to_s
|
|
262
|
+
when :Integer
|
|
263
|
+
value.to_i
|
|
264
|
+
when :Float
|
|
265
|
+
value.to_f
|
|
266
|
+
when :Boolean
|
|
267
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
268
|
+
true
|
|
269
|
+
else
|
|
270
|
+
false
|
|
271
|
+
end
|
|
272
|
+
when :Object
|
|
273
|
+
# generic object (usually a Hash), return directly
|
|
274
|
+
value
|
|
275
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
276
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
277
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
278
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
279
|
+
k_type = Regexp.last_match[:k_type]
|
|
280
|
+
v_type = Regexp.last_match[:v_type]
|
|
281
|
+
{}.tap do |hash|
|
|
282
|
+
value.each do |k, v|
|
|
283
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
284
|
+
end
|
|
285
|
+
end
|
|
286
|
+
else # model
|
|
287
|
+
# models (e.g. Pet) or oneOf
|
|
288
|
+
klass = DaytonaApiClient.const_get(type)
|
|
289
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
290
|
+
end
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
# Returns the string representation of the object
|
|
294
|
+
# @return [String] String presentation of the object
|
|
295
|
+
def to_s
|
|
296
|
+
to_hash.to_s
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
300
|
+
# @return [Hash] Returns the object in the form of hash
|
|
301
|
+
def to_body
|
|
302
|
+
to_hash
|
|
303
|
+
end
|
|
304
|
+
|
|
331
305
|
# Returns the object in the form of hash
|
|
332
306
|
# @return [Hash] Returns the object in the form of hash
|
|
333
307
|
def to_hash
|
|
@@ -344,6 +318,22 @@ module DaytonaApiClient
|
|
|
344
318
|
hash
|
|
345
319
|
end
|
|
346
320
|
|
|
321
|
+
# Outputs non-array value in the form of hash
|
|
322
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
323
|
+
# @param [Object] value Any valid value
|
|
324
|
+
# @return [Hash] Returns the value in the form of hash
|
|
325
|
+
def _to_hash(value)
|
|
326
|
+
if value.is_a?(Array)
|
|
327
|
+
value.compact.map { |v| _to_hash(v) }
|
|
328
|
+
elsif value.is_a?(Hash)
|
|
329
|
+
{}.tap do |hash|
|
|
330
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
331
|
+
end
|
|
332
|
+
elsif value.respond_to? :to_hash
|
|
333
|
+
value.to_hash
|
|
334
|
+
else
|
|
335
|
+
value
|
|
336
|
+
end
|
|
337
|
+
end
|
|
347
338
|
end
|
|
348
|
-
|
|
349
339
|
end
|