daytona_api_client 0.126.0.alpha.6
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 +7 -0
- data/.gitignore +39 -0
- data/.openapi-generator/FILES +171 -0
- data/.openapi-generator/VERSION +1 -0
- data/.openapi-generator-ignore +33 -0
- data/.rspec +2 -0
- data/.rubocop.yml +148 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +101 -0
- data/Rakefile +10 -0
- data/daytona_api_client.gemspec +39 -0
- data/fix-gemspec.sh +11 -0
- data/lib/daytona_api_client/api/api_keys_api.rb +401 -0
- data/lib/daytona_api_client/api/audit_api.rb +192 -0
- data/lib/daytona_api_client/api/config_api.rb +77 -0
- data/lib/daytona_api_client/api/docker_registry_api.rb +472 -0
- data/lib/daytona_api_client/api/health_api.rb +75 -0
- data/lib/daytona_api_client/api/object_storage_api.rb +80 -0
- data/lib/daytona_api_client/api/organizations_api.rb +1902 -0
- data/lib/daytona_api_client/api/preview_api.rb +211 -0
- data/lib/daytona_api_client/api/regions_api.rb +83 -0
- data/lib/daytona_api_client/api/runners_api.rb +376 -0
- data/lib/daytona_api_client/api/sandbox_api.rb +1660 -0
- data/lib/daytona_api_client/api/snapshots_api.rb +641 -0
- data/lib/daytona_api_client/api/toolbox_api.rb +5108 -0
- data/lib/daytona_api_client/api/users_api.rb +553 -0
- data/lib/daytona_api_client/api/volumes_api.rb +342 -0
- data/lib/daytona_api_client/api/webhooks_api.rb +413 -0
- data/lib/daytona_api_client/api/workspace_api.rb +955 -0
- data/lib/daytona_api_client/api_client.rb +393 -0
- data/lib/daytona_api_client/api_error.rb +58 -0
- data/lib/daytona_api_client/configuration.rb +306 -0
- data/lib/daytona_api_client/models/account_provider.rb +261 -0
- data/lib/daytona_api_client/models/announcement.rb +246 -0
- data/lib/daytona_api_client/models/api_key_list.rb +384 -0
- data/lib/daytona_api_client/models/api_key_response.rb +344 -0
- data/lib/daytona_api_client/models/audit_log.rb +422 -0
- data/lib/daytona_api_client/models/build_info.rb +285 -0
- data/lib/daytona_api_client/models/command.rb +273 -0
- 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/completion_list.rb +263 -0
- 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/computer_use_status_response.rb +260 -0
- data/lib/daytona_api_client/models/computer_use_stop_response.rb +263 -0
- data/lib/daytona_api_client/models/create_api_key.rb +288 -0
- data/lib/daytona_api_client/models/create_audit_log.rb +350 -0
- data/lib/daytona_api_client/models/create_build_info.rb +248 -0
- data/lib/daytona_api_client/models/create_docker_registry.rb +388 -0
- data/lib/daytona_api_client/models/create_linked_account.rb +263 -0
- data/lib/daytona_api_client/models/create_organization.rb +263 -0
- data/lib/daytona_api_client/models/create_organization_invitation.rb +326 -0
- data/lib/daytona_api_client/models/create_organization_quota.rb +290 -0
- data/lib/daytona_api_client/models/create_organization_role.rb +304 -0
- data/lib/daytona_api_client/models/create_runner.rb +545 -0
- data/lib/daytona_api_client/models/create_sandbox.rb +439 -0
- data/lib/daytona_api_client/models/create_session_request.rb +236 -0
- data/lib/daytona_api_client/models/create_snapshot.rb +318 -0
- data/lib/daytona_api_client/models/create_user.rb +340 -0
- data/lib/daytona_api_client/models/create_volume.rb +235 -0
- data/lib/daytona_api_client/models/create_workspace.rb +411 -0
- data/lib/daytona_api_client/models/daytona_configuration.rb +568 -0
- data/lib/daytona_api_client/models/display_info_response.rb +238 -0
- data/lib/daytona_api_client/models/docker_registry.rb +449 -0
- data/lib/daytona_api_client/models/download_files.rb +238 -0
- data/lib/daytona_api_client/models/execute_request.rb +255 -0
- 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/file_status.rb +313 -0
- data/lib/daytona_api_client/models/git_add_request.rb +264 -0
- data/lib/daytona_api_client/models/git_branch_request.rb +261 -0
- data/lib/daytona_api_client/models/git_checkout_request.rb +261 -0
- data/lib/daytona_api_client/models/git_clone_request.rb +297 -0
- data/lib/daytona_api_client/models/git_commit_info.rb +339 -0
- data/lib/daytona_api_client/models/git_commit_request.rb +325 -0
- data/lib/daytona_api_client/models/git_commit_response.rb +235 -0
- data/lib/daytona_api_client/models/git_delete_branch_request.rb +261 -0
- data/lib/daytona_api_client/models/git_repo_request.rb +253 -0
- data/lib/daytona_api_client/models/git_status.rb +290 -0
- data/lib/daytona_api_client/models/health_controller_check200_response.rb +253 -0
- data/lib/daytona_api_client/models/health_controller_check200_response_info_value.rb +235 -0
- data/lib/daytona_api_client/models/health_controller_check503_response.rb +253 -0
- data/lib/daytona_api_client/models/keyboard_hotkey_request.rb +236 -0
- data/lib/daytona_api_client/models/keyboard_press_request.rb +248 -0
- 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 +290 -0
- data/lib/daytona_api_client/models/organization.rb +663 -0
- data/lib/daytona_api_client/models/organization_invitation.rb +534 -0
- data/lib/daytona_api_client/models/organization_role.rb +412 -0
- 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 +341 -0
- data/lib/daytona_api_client/models/organization_user.rb +451 -0
- data/lib/daytona_api_client/models/paginated_audit_logs.rb +325 -0
- data/lib/daytona_api_client/models/paginated_sandboxes.rb +315 -0
- data/lib/daytona_api_client/models/paginated_snapshots.rb +315 -0
- data/lib/daytona_api_client/models/paginated_snapshots_dto.rb +315 -0
- data/lib/daytona_api_client/models/port_preview_url.rb +290 -0
- data/lib/daytona_api_client/models/position.rb +261 -0
- data/lib/daytona_api_client/models/posthog_config.rb +263 -0
- 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/project_dir_response.rb +218 -0
- 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/pty_list_response.rb +238 -0
- 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/rate_limit_config.rb +249 -0
- data/lib/daytona_api_client/models/rate_limit_entry.rb +229 -0
- data/lib/daytona_api_client/models/region.rb +328 -0
- data/lib/daytona_api_client/models/region_quota.rb +339 -0
- data/lib/daytona_api_client/models/region_screenshot_response.rb +256 -0
- data/lib/daytona_api_client/models/region_usage_overview.rb +391 -0
- data/lib/daytona_api_client/models/registry_push_access_dto.rb +371 -0
- 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 +780 -0
- data/lib/daytona_api_client/models/runner_snapshot_dto.rb +290 -0
- data/lib/daytona_api_client/models/runner_state.rb +43 -0
- data/lib/daytona_api_client/models/sandbox.rb +782 -0
- data/lib/daytona_api_client/models/sandbox_class.rb +41 -0
- data/lib/daytona_api_client/models/sandbox_desired_state.rb +43 -0
- data/lib/daytona_api_client/models/sandbox_info.rb +273 -0
- data/lib/daytona_api_client/models/sandbox_labels.rb +238 -0
- data/lib/daytona_api_client/models/sandbox_state.rb +54 -0
- data/lib/daytona_api_client/models/sandbox_volume.rb +273 -0
- data/lib/daytona_api_client/models/screenshot_response.rb +256 -0
- data/lib/daytona_api_client/models/search_files_response.rb +237 -0
- 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/session_execute_request.rb +256 -0
- data/lib/daytona_api_client/models/session_execute_response.rb +239 -0
- data/lib/daytona_api_client/models/set_snapshot_general_status_dto.rb +236 -0
- data/lib/daytona_api_client/models/snapshot_dto.rb +569 -0
- data/lib/daytona_api_client/models/snapshot_state.rb +46 -0
- data/lib/daytona_api_client/models/ssh_access_dto.rb +371 -0
- data/lib/daytona_api_client/models/ssh_access_validation_dto.rb +263 -0
- data/lib/daytona_api_client/models/storage_access_dto.rb +371 -0
- data/lib/daytona_api_client/models/update_docker_registry.rb +310 -0
- data/lib/daytona_api_client/models/update_organization_default_region.rb +236 -0
- data/lib/daytona_api_client/models/update_organization_invitation.rb +299 -0
- data/lib/daytona_api_client/models/update_organization_member_access.rb +289 -0
- data/lib/daytona_api_client/models/update_organization_quota.rb +317 -0
- data/lib/daytona_api_client/models/update_organization_region_quota.rb +245 -0
- data/lib/daytona_api_client/models/update_organization_role.rb +304 -0
- data/lib/daytona_api_client/models/update_sandbox_state_dto.rb +270 -0
- data/lib/daytona_api_client/models/user.rb +346 -0
- data/lib/daytona_api_client/models/user_home_dir_response.rb +218 -0
- data/lib/daytona_api_client/models/user_public_key.rb +263 -0
- data/lib/daytona_api_client/models/volume_dto.rb +417 -0
- data/lib/daytona_api_client/models/volume_state.rb +45 -0
- data/lib/daytona_api_client/models/webhook_app_portal_access.rb +236 -0
- data/lib/daytona_api_client/models/webhook_controller_get_status200_response.rb +218 -0
- data/lib/daytona_api_client/models/webhook_initialization_status.rb +343 -0
- data/lib/daytona_api_client/models/windows_response.rb +265 -0
- data/lib/daytona_api_client/models/work_dir_response.rb +218 -0
- data/lib/daytona_api_client/models/workspace.rb +834 -0
- data/lib/daytona_api_client/models/workspace_port_preview_url.rb +263 -0
- data/lib/daytona_api_client/version.rb +15 -0
- data/lib/daytona_api_client.rb +201 -0
- data/project.json +59 -0
- metadata +261 -0
|
@@ -0,0 +1,545 @@
|
|
|
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 CreateRunner
|
|
18
|
+
attr_accessor :domain
|
|
19
|
+
|
|
20
|
+
attr_accessor :api_url
|
|
21
|
+
|
|
22
|
+
attr_accessor :proxy_url
|
|
23
|
+
|
|
24
|
+
attr_accessor :api_key
|
|
25
|
+
|
|
26
|
+
attr_accessor :cpu
|
|
27
|
+
|
|
28
|
+
attr_accessor :memory_gi_b
|
|
29
|
+
|
|
30
|
+
attr_accessor :disk_gi_b
|
|
31
|
+
|
|
32
|
+
attr_accessor :gpu
|
|
33
|
+
|
|
34
|
+
attr_accessor :gpu_type
|
|
35
|
+
|
|
36
|
+
attr_accessor :_class
|
|
37
|
+
|
|
38
|
+
attr_accessor :region
|
|
39
|
+
|
|
40
|
+
attr_accessor :version
|
|
41
|
+
|
|
42
|
+
class EnumAttributeValidator
|
|
43
|
+
attr_reader :datatype
|
|
44
|
+
attr_reader :allowable_values
|
|
45
|
+
|
|
46
|
+
def initialize(datatype, allowable_values)
|
|
47
|
+
@allowable_values = allowable_values.map do |value|
|
|
48
|
+
case datatype.to_s
|
|
49
|
+
when /Integer/i
|
|
50
|
+
value.to_i
|
|
51
|
+
when /Float/i
|
|
52
|
+
value.to_f
|
|
53
|
+
else
|
|
54
|
+
value
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def valid?(value)
|
|
60
|
+
!value || allowable_values.include?(value)
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
65
|
+
def self.attribute_map
|
|
66
|
+
{
|
|
67
|
+
:'domain' => :'domain',
|
|
68
|
+
:'api_url' => :'apiUrl',
|
|
69
|
+
:'proxy_url' => :'proxyUrl',
|
|
70
|
+
:'api_key' => :'apiKey',
|
|
71
|
+
:'cpu' => :'cpu',
|
|
72
|
+
:'memory_gi_b' => :'memoryGiB',
|
|
73
|
+
:'disk_gi_b' => :'diskGiB',
|
|
74
|
+
:'gpu' => :'gpu',
|
|
75
|
+
:'gpu_type' => :'gpuType',
|
|
76
|
+
:'_class' => :'class',
|
|
77
|
+
:'region' => :'region',
|
|
78
|
+
:'version' => :'version'
|
|
79
|
+
}
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Returns attribute mapping this model knows about
|
|
83
|
+
def self.acceptable_attribute_map
|
|
84
|
+
attribute_map
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Returns all the JSON keys this model knows about
|
|
88
|
+
def self.acceptable_attributes
|
|
89
|
+
acceptable_attribute_map.values
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Attribute type mapping.
|
|
93
|
+
def self.openapi_types
|
|
94
|
+
{
|
|
95
|
+
:'domain' => :'String',
|
|
96
|
+
:'api_url' => :'String',
|
|
97
|
+
:'proxy_url' => :'String',
|
|
98
|
+
:'api_key' => :'String',
|
|
99
|
+
:'cpu' => :'Float',
|
|
100
|
+
:'memory_gi_b' => :'Float',
|
|
101
|
+
:'disk_gi_b' => :'Float',
|
|
102
|
+
:'gpu' => :'Float',
|
|
103
|
+
:'gpu_type' => :'String',
|
|
104
|
+
:'_class' => :'String',
|
|
105
|
+
:'region' => :'String',
|
|
106
|
+
:'version' => :'String'
|
|
107
|
+
}
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# List of attributes with nullable: true
|
|
111
|
+
def self.openapi_nullable
|
|
112
|
+
Set.new([
|
|
113
|
+
])
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Initializes the object
|
|
117
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
118
|
+
def initialize(attributes = {})
|
|
119
|
+
if (!attributes.is_a?(Hash))
|
|
120
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::CreateRunner` initialize method"
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
124
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
125
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
126
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
127
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::CreateRunner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
128
|
+
end
|
|
129
|
+
h[k.to_sym] = v
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'domain')
|
|
133
|
+
self.domain = attributes[:'domain']
|
|
134
|
+
else
|
|
135
|
+
self.domain = nil
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if attributes.key?(:'api_url')
|
|
139
|
+
self.api_url = attributes[:'api_url']
|
|
140
|
+
else
|
|
141
|
+
self.api_url = nil
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if attributes.key?(:'proxy_url')
|
|
145
|
+
self.proxy_url = attributes[:'proxy_url']
|
|
146
|
+
else
|
|
147
|
+
self.proxy_url = nil
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
if attributes.key?(:'api_key')
|
|
151
|
+
self.api_key = attributes[:'api_key']
|
|
152
|
+
else
|
|
153
|
+
self.api_key = nil
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if attributes.key?(:'cpu')
|
|
157
|
+
self.cpu = attributes[:'cpu']
|
|
158
|
+
else
|
|
159
|
+
self.cpu = nil
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
if attributes.key?(:'memory_gi_b')
|
|
163
|
+
self.memory_gi_b = attributes[:'memory_gi_b']
|
|
164
|
+
else
|
|
165
|
+
self.memory_gi_b = nil
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
if attributes.key?(:'disk_gi_b')
|
|
169
|
+
self.disk_gi_b = attributes[:'disk_gi_b']
|
|
170
|
+
else
|
|
171
|
+
self.disk_gi_b = nil
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
if attributes.key?(:'gpu')
|
|
175
|
+
self.gpu = attributes[:'gpu']
|
|
176
|
+
else
|
|
177
|
+
self.gpu = nil
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
if attributes.key?(:'gpu_type')
|
|
181
|
+
self.gpu_type = attributes[:'gpu_type']
|
|
182
|
+
else
|
|
183
|
+
self.gpu_type = nil
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
if attributes.key?(:'_class')
|
|
187
|
+
self._class = attributes[:'_class']
|
|
188
|
+
else
|
|
189
|
+
self._class = nil
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
if attributes.key?(:'region')
|
|
193
|
+
self.region = attributes[:'region']
|
|
194
|
+
else
|
|
195
|
+
self.region = nil
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
if attributes.key?(:'version')
|
|
199
|
+
self.version = attributes[:'version']
|
|
200
|
+
else
|
|
201
|
+
self.version = nil
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
206
|
+
# @return Array for valid properties with the reasons
|
|
207
|
+
def list_invalid_properties
|
|
208
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
209
|
+
invalid_properties = Array.new
|
|
210
|
+
if @domain.nil?
|
|
211
|
+
invalid_properties.push('invalid value for "domain", domain cannot be nil.')
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
if @api_url.nil?
|
|
215
|
+
invalid_properties.push('invalid value for "api_url", api_url cannot be nil.')
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
if @proxy_url.nil?
|
|
219
|
+
invalid_properties.push('invalid value for "proxy_url", proxy_url cannot be nil.')
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
if @api_key.nil?
|
|
223
|
+
invalid_properties.push('invalid value for "api_key", api_key cannot be nil.')
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
if @cpu.nil?
|
|
227
|
+
invalid_properties.push('invalid value for "cpu", cpu cannot be nil.')
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
if @memory_gi_b.nil?
|
|
231
|
+
invalid_properties.push('invalid value for "memory_gi_b", memory_gi_b cannot be nil.')
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
if @disk_gi_b.nil?
|
|
235
|
+
invalid_properties.push('invalid value for "disk_gi_b", disk_gi_b cannot be nil.')
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
if @gpu.nil?
|
|
239
|
+
invalid_properties.push('invalid value for "gpu", gpu cannot be nil.')
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
if @gpu_type.nil?
|
|
243
|
+
invalid_properties.push('invalid value for "gpu_type", gpu_type cannot be nil.')
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
if @_class.nil?
|
|
247
|
+
invalid_properties.push('invalid value for "_class", _class cannot be nil.')
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
if @region.nil?
|
|
251
|
+
invalid_properties.push('invalid value for "region", region cannot be nil.')
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
if @version.nil?
|
|
255
|
+
invalid_properties.push('invalid value for "version", version cannot be nil.')
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
invalid_properties
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
# Check to see if the all the properties in the model are valid
|
|
262
|
+
# @return true if the model is valid
|
|
263
|
+
def valid?
|
|
264
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
265
|
+
return false if @domain.nil?
|
|
266
|
+
return false if @api_url.nil?
|
|
267
|
+
return false if @proxy_url.nil?
|
|
268
|
+
return false if @api_key.nil?
|
|
269
|
+
return false if @cpu.nil?
|
|
270
|
+
return false if @memory_gi_b.nil?
|
|
271
|
+
return false if @disk_gi_b.nil?
|
|
272
|
+
return false if @gpu.nil?
|
|
273
|
+
return false if @gpu_type.nil?
|
|
274
|
+
return false if @_class.nil?
|
|
275
|
+
_class_validator = EnumAttributeValidator.new('String', ["small", "medium", "large"])
|
|
276
|
+
return false unless _class_validator.valid?(@_class)
|
|
277
|
+
return false if @region.nil?
|
|
278
|
+
return false if @version.nil?
|
|
279
|
+
true
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
# Custom attribute writer method with validation
|
|
283
|
+
# @param [Object] domain Value to be assigned
|
|
284
|
+
def domain=(domain)
|
|
285
|
+
if domain.nil?
|
|
286
|
+
fail ArgumentError, 'domain cannot be nil'
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
@domain = domain
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
# Custom attribute writer method with validation
|
|
293
|
+
# @param [Object] api_url Value to be assigned
|
|
294
|
+
def api_url=(api_url)
|
|
295
|
+
if api_url.nil?
|
|
296
|
+
fail ArgumentError, 'api_url cannot be nil'
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
@api_url = api_url
|
|
300
|
+
end
|
|
301
|
+
|
|
302
|
+
# Custom attribute writer method with validation
|
|
303
|
+
# @param [Object] proxy_url Value to be assigned
|
|
304
|
+
def proxy_url=(proxy_url)
|
|
305
|
+
if proxy_url.nil?
|
|
306
|
+
fail ArgumentError, 'proxy_url cannot be nil'
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
@proxy_url = proxy_url
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
# Custom attribute writer method with validation
|
|
313
|
+
# @param [Object] api_key Value to be assigned
|
|
314
|
+
def api_key=(api_key)
|
|
315
|
+
if api_key.nil?
|
|
316
|
+
fail ArgumentError, 'api_key cannot be nil'
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
@api_key = api_key
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
# Custom attribute writer method with validation
|
|
323
|
+
# @param [Object] cpu Value to be assigned
|
|
324
|
+
def cpu=(cpu)
|
|
325
|
+
if cpu.nil?
|
|
326
|
+
fail ArgumentError, 'cpu cannot be nil'
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
@cpu = cpu
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
# Custom attribute writer method with validation
|
|
333
|
+
# @param [Object] memory_gi_b Value to be assigned
|
|
334
|
+
def memory_gi_b=(memory_gi_b)
|
|
335
|
+
if memory_gi_b.nil?
|
|
336
|
+
fail ArgumentError, 'memory_gi_b cannot be nil'
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
@memory_gi_b = memory_gi_b
|
|
340
|
+
end
|
|
341
|
+
|
|
342
|
+
# Custom attribute writer method with validation
|
|
343
|
+
# @param [Object] disk_gi_b Value to be assigned
|
|
344
|
+
def disk_gi_b=(disk_gi_b)
|
|
345
|
+
if disk_gi_b.nil?
|
|
346
|
+
fail ArgumentError, 'disk_gi_b cannot be nil'
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
@disk_gi_b = disk_gi_b
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
# Custom attribute writer method with validation
|
|
353
|
+
# @param [Object] gpu Value to be assigned
|
|
354
|
+
def gpu=(gpu)
|
|
355
|
+
if gpu.nil?
|
|
356
|
+
fail ArgumentError, 'gpu cannot be nil'
|
|
357
|
+
end
|
|
358
|
+
|
|
359
|
+
@gpu = gpu
|
|
360
|
+
end
|
|
361
|
+
|
|
362
|
+
# Custom attribute writer method with validation
|
|
363
|
+
# @param [Object] gpu_type Value to be assigned
|
|
364
|
+
def gpu_type=(gpu_type)
|
|
365
|
+
if gpu_type.nil?
|
|
366
|
+
fail ArgumentError, 'gpu_type cannot be nil'
|
|
367
|
+
end
|
|
368
|
+
|
|
369
|
+
@gpu_type = gpu_type
|
|
370
|
+
end
|
|
371
|
+
|
|
372
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
373
|
+
# @param [Object] _class Object to be assigned
|
|
374
|
+
def _class=(_class)
|
|
375
|
+
validator = EnumAttributeValidator.new('String', ["small", "medium", "large"])
|
|
376
|
+
unless validator.valid?(_class)
|
|
377
|
+
fail ArgumentError, "invalid value for \"_class\", must be one of #{validator.allowable_values}."
|
|
378
|
+
end
|
|
379
|
+
@_class = _class
|
|
380
|
+
end
|
|
381
|
+
|
|
382
|
+
# Custom attribute writer method with validation
|
|
383
|
+
# @param [Object] region Value to be assigned
|
|
384
|
+
def region=(region)
|
|
385
|
+
if region.nil?
|
|
386
|
+
fail ArgumentError, 'region cannot be nil'
|
|
387
|
+
end
|
|
388
|
+
|
|
389
|
+
@region = region
|
|
390
|
+
end
|
|
391
|
+
|
|
392
|
+
# Custom attribute writer method with validation
|
|
393
|
+
# @param [Object] version Value to be assigned
|
|
394
|
+
def version=(version)
|
|
395
|
+
if version.nil?
|
|
396
|
+
fail ArgumentError, 'version cannot be nil'
|
|
397
|
+
end
|
|
398
|
+
|
|
399
|
+
@version = version
|
|
400
|
+
end
|
|
401
|
+
|
|
402
|
+
# Checks equality by comparing each attribute.
|
|
403
|
+
# @param [Object] Object to be compared
|
|
404
|
+
def ==(o)
|
|
405
|
+
return true if self.equal?(o)
|
|
406
|
+
self.class == o.class &&
|
|
407
|
+
domain == o.domain &&
|
|
408
|
+
api_url == o.api_url &&
|
|
409
|
+
proxy_url == o.proxy_url &&
|
|
410
|
+
api_key == o.api_key &&
|
|
411
|
+
cpu == o.cpu &&
|
|
412
|
+
memory_gi_b == o.memory_gi_b &&
|
|
413
|
+
disk_gi_b == o.disk_gi_b &&
|
|
414
|
+
gpu == o.gpu &&
|
|
415
|
+
gpu_type == o.gpu_type &&
|
|
416
|
+
_class == o._class &&
|
|
417
|
+
region == o.region &&
|
|
418
|
+
version == o.version
|
|
419
|
+
end
|
|
420
|
+
|
|
421
|
+
# @see the `==` method
|
|
422
|
+
# @param [Object] Object to be compared
|
|
423
|
+
def eql?(o)
|
|
424
|
+
self == o
|
|
425
|
+
end
|
|
426
|
+
|
|
427
|
+
# Calculates hash code according to all attributes.
|
|
428
|
+
# @return [Integer] Hash code
|
|
429
|
+
def hash
|
|
430
|
+
[domain, api_url, proxy_url, api_key, cpu, memory_gi_b, disk_gi_b, gpu, gpu_type, _class, region, version].hash
|
|
431
|
+
end
|
|
432
|
+
|
|
433
|
+
# Builds the object from hash
|
|
434
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
435
|
+
# @return [Object] Returns the model itself
|
|
436
|
+
def self.build_from_hash(attributes)
|
|
437
|
+
return nil unless attributes.is_a?(Hash)
|
|
438
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
439
|
+
transformed_hash = {}
|
|
440
|
+
openapi_types.each_pair do |key, type|
|
|
441
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
442
|
+
transformed_hash["#{key}"] = nil
|
|
443
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
444
|
+
# check to ensure the input is an array given that the attribute
|
|
445
|
+
# is documented as an array but the input is not
|
|
446
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
447
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
448
|
+
end
|
|
449
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
450
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
451
|
+
end
|
|
452
|
+
end
|
|
453
|
+
new(transformed_hash)
|
|
454
|
+
end
|
|
455
|
+
|
|
456
|
+
# Deserializes the data based on type
|
|
457
|
+
# @param string type Data type
|
|
458
|
+
# @param string value Value to be deserialized
|
|
459
|
+
# @return [Object] Deserialized data
|
|
460
|
+
def self._deserialize(type, value)
|
|
461
|
+
case type.to_sym
|
|
462
|
+
when :Time
|
|
463
|
+
Time.parse(value)
|
|
464
|
+
when :Date
|
|
465
|
+
Date.parse(value)
|
|
466
|
+
when :String
|
|
467
|
+
value.to_s
|
|
468
|
+
when :Integer
|
|
469
|
+
value.to_i
|
|
470
|
+
when :Float
|
|
471
|
+
value.to_f
|
|
472
|
+
when :Boolean
|
|
473
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
474
|
+
true
|
|
475
|
+
else
|
|
476
|
+
false
|
|
477
|
+
end
|
|
478
|
+
when :Object
|
|
479
|
+
# generic object (usually a Hash), return directly
|
|
480
|
+
value
|
|
481
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
482
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
483
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
484
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
485
|
+
k_type = Regexp.last_match[:k_type]
|
|
486
|
+
v_type = Regexp.last_match[:v_type]
|
|
487
|
+
{}.tap do |hash|
|
|
488
|
+
value.each do |k, v|
|
|
489
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
490
|
+
end
|
|
491
|
+
end
|
|
492
|
+
else # model
|
|
493
|
+
# models (e.g. Pet) or oneOf
|
|
494
|
+
klass = DaytonaApiClient.const_get(type)
|
|
495
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
496
|
+
end
|
|
497
|
+
end
|
|
498
|
+
|
|
499
|
+
# Returns the string representation of the object
|
|
500
|
+
# @return [String] String presentation of the object
|
|
501
|
+
def to_s
|
|
502
|
+
to_hash.to_s
|
|
503
|
+
end
|
|
504
|
+
|
|
505
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
506
|
+
# @return [Hash] Returns the object in the form of hash
|
|
507
|
+
def to_body
|
|
508
|
+
to_hash
|
|
509
|
+
end
|
|
510
|
+
|
|
511
|
+
# Returns the object in the form of hash
|
|
512
|
+
# @return [Hash] Returns the object in the form of hash
|
|
513
|
+
def to_hash
|
|
514
|
+
hash = {}
|
|
515
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
516
|
+
value = self.send(attr)
|
|
517
|
+
if value.nil?
|
|
518
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
519
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
520
|
+
end
|
|
521
|
+
|
|
522
|
+
hash[param] = _to_hash(value)
|
|
523
|
+
end
|
|
524
|
+
hash
|
|
525
|
+
end
|
|
526
|
+
|
|
527
|
+
# Outputs non-array value in the form of hash
|
|
528
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
529
|
+
# @param [Object] value Any valid value
|
|
530
|
+
# @return [Hash] Returns the value in the form of hash
|
|
531
|
+
def _to_hash(value)
|
|
532
|
+
if value.is_a?(Array)
|
|
533
|
+
value.compact.map { |v| _to_hash(v) }
|
|
534
|
+
elsif value.is_a?(Hash)
|
|
535
|
+
{}.tap do |hash|
|
|
536
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
537
|
+
end
|
|
538
|
+
elsif value.respond_to? :to_hash
|
|
539
|
+
value.to_hash
|
|
540
|
+
else
|
|
541
|
+
value
|
|
542
|
+
end
|
|
543
|
+
end
|
|
544
|
+
end
|
|
545
|
+
end
|