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.
Files changed (183) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +39 -0
  3. data/.openapi-generator/FILES +171 -0
  4. data/.openapi-generator/VERSION +1 -0
  5. data/.openapi-generator-ignore +33 -0
  6. data/.rspec +2 -0
  7. data/.rubocop.yml +148 -0
  8. data/Gemfile +9 -0
  9. data/Gemfile.lock +101 -0
  10. data/Rakefile +10 -0
  11. data/daytona_api_client.gemspec +39 -0
  12. data/fix-gemspec.sh +11 -0
  13. data/lib/daytona_api_client/api/api_keys_api.rb +401 -0
  14. data/lib/daytona_api_client/api/audit_api.rb +192 -0
  15. data/lib/daytona_api_client/api/config_api.rb +77 -0
  16. data/lib/daytona_api_client/api/docker_registry_api.rb +472 -0
  17. data/lib/daytona_api_client/api/health_api.rb +75 -0
  18. data/lib/daytona_api_client/api/object_storage_api.rb +80 -0
  19. data/lib/daytona_api_client/api/organizations_api.rb +1902 -0
  20. data/lib/daytona_api_client/api/preview_api.rb +211 -0
  21. data/lib/daytona_api_client/api/regions_api.rb +83 -0
  22. data/lib/daytona_api_client/api/runners_api.rb +376 -0
  23. data/lib/daytona_api_client/api/sandbox_api.rb +1660 -0
  24. data/lib/daytona_api_client/api/snapshots_api.rb +641 -0
  25. data/lib/daytona_api_client/api/toolbox_api.rb +5108 -0
  26. data/lib/daytona_api_client/api/users_api.rb +553 -0
  27. data/lib/daytona_api_client/api/volumes_api.rb +342 -0
  28. data/lib/daytona_api_client/api/webhooks_api.rb +413 -0
  29. data/lib/daytona_api_client/api/workspace_api.rb +955 -0
  30. data/lib/daytona_api_client/api_client.rb +393 -0
  31. data/lib/daytona_api_client/api_error.rb +58 -0
  32. data/lib/daytona_api_client/configuration.rb +306 -0
  33. data/lib/daytona_api_client/models/account_provider.rb +261 -0
  34. data/lib/daytona_api_client/models/announcement.rb +246 -0
  35. data/lib/daytona_api_client/models/api_key_list.rb +384 -0
  36. data/lib/daytona_api_client/models/api_key_response.rb +344 -0
  37. data/lib/daytona_api_client/models/audit_log.rb +422 -0
  38. data/lib/daytona_api_client/models/build_info.rb +285 -0
  39. data/lib/daytona_api_client/models/command.rb +273 -0
  40. data/lib/daytona_api_client/models/completion_context.rb +244 -0
  41. data/lib/daytona_api_client/models/completion_item.rb +289 -0
  42. data/lib/daytona_api_client/models/completion_list.rb +263 -0
  43. data/lib/daytona_api_client/models/compressed_screenshot_response.rb +256 -0
  44. data/lib/daytona_api_client/models/computer_use_start_response.rb +263 -0
  45. data/lib/daytona_api_client/models/computer_use_status_response.rb +260 -0
  46. data/lib/daytona_api_client/models/computer_use_stop_response.rb +263 -0
  47. data/lib/daytona_api_client/models/create_api_key.rb +288 -0
  48. data/lib/daytona_api_client/models/create_audit_log.rb +350 -0
  49. data/lib/daytona_api_client/models/create_build_info.rb +248 -0
  50. data/lib/daytona_api_client/models/create_docker_registry.rb +388 -0
  51. data/lib/daytona_api_client/models/create_linked_account.rb +263 -0
  52. data/lib/daytona_api_client/models/create_organization.rb +263 -0
  53. data/lib/daytona_api_client/models/create_organization_invitation.rb +326 -0
  54. data/lib/daytona_api_client/models/create_organization_quota.rb +290 -0
  55. data/lib/daytona_api_client/models/create_organization_role.rb +304 -0
  56. data/lib/daytona_api_client/models/create_runner.rb +545 -0
  57. data/lib/daytona_api_client/models/create_sandbox.rb +439 -0
  58. data/lib/daytona_api_client/models/create_session_request.rb +236 -0
  59. data/lib/daytona_api_client/models/create_snapshot.rb +318 -0
  60. data/lib/daytona_api_client/models/create_user.rb +340 -0
  61. data/lib/daytona_api_client/models/create_volume.rb +235 -0
  62. data/lib/daytona_api_client/models/create_workspace.rb +411 -0
  63. data/lib/daytona_api_client/models/daytona_configuration.rb +568 -0
  64. data/lib/daytona_api_client/models/display_info_response.rb +238 -0
  65. data/lib/daytona_api_client/models/docker_registry.rb +449 -0
  66. data/lib/daytona_api_client/models/download_files.rb +238 -0
  67. data/lib/daytona_api_client/models/execute_request.rb +255 -0
  68. data/lib/daytona_api_client/models/execute_response.rb +263 -0
  69. data/lib/daytona_api_client/models/file_info.rb +417 -0
  70. data/lib/daytona_api_client/models/file_status.rb +313 -0
  71. data/lib/daytona_api_client/models/git_add_request.rb +264 -0
  72. data/lib/daytona_api_client/models/git_branch_request.rb +261 -0
  73. data/lib/daytona_api_client/models/git_checkout_request.rb +261 -0
  74. data/lib/daytona_api_client/models/git_clone_request.rb +297 -0
  75. data/lib/daytona_api_client/models/git_commit_info.rb +339 -0
  76. data/lib/daytona_api_client/models/git_commit_request.rb +325 -0
  77. data/lib/daytona_api_client/models/git_commit_response.rb +235 -0
  78. data/lib/daytona_api_client/models/git_delete_branch_request.rb +261 -0
  79. data/lib/daytona_api_client/models/git_repo_request.rb +253 -0
  80. data/lib/daytona_api_client/models/git_status.rb +290 -0
  81. data/lib/daytona_api_client/models/health_controller_check200_response.rb +253 -0
  82. data/lib/daytona_api_client/models/health_controller_check200_response_info_value.rb +235 -0
  83. data/lib/daytona_api_client/models/health_controller_check503_response.rb +253 -0
  84. data/lib/daytona_api_client/models/keyboard_hotkey_request.rb +236 -0
  85. data/lib/daytona_api_client/models/keyboard_press_request.rb +248 -0
  86. data/lib/daytona_api_client/models/keyboard_type_request.rb +246 -0
  87. data/lib/daytona_api_client/models/list_branch_response.rb +237 -0
  88. data/lib/daytona_api_client/models/lsp_completion_params.rb +325 -0
  89. data/lib/daytona_api_client/models/lsp_document_request.rb +290 -0
  90. data/lib/daytona_api_client/models/lsp_location.rb +261 -0
  91. data/lib/daytona_api_client/models/lsp_server_request.rb +263 -0
  92. data/lib/daytona_api_client/models/lsp_symbol.rb +287 -0
  93. data/lib/daytona_api_client/models/match.rb +287 -0
  94. data/lib/daytona_api_client/models/mouse_click_request.rb +283 -0
  95. data/lib/daytona_api_client/models/mouse_click_response.rb +263 -0
  96. data/lib/daytona_api_client/models/mouse_drag_request.rb +327 -0
  97. data/lib/daytona_api_client/models/mouse_drag_response.rb +263 -0
  98. data/lib/daytona_api_client/models/mouse_move_request.rb +263 -0
  99. data/lib/daytona_api_client/models/mouse_move_response.rb +263 -0
  100. data/lib/daytona_api_client/models/mouse_position.rb +263 -0
  101. data/lib/daytona_api_client/models/mouse_scroll_request.rb +300 -0
  102. data/lib/daytona_api_client/models/mouse_scroll_response.rb +236 -0
  103. data/lib/daytona_api_client/models/oidc_config.rb +290 -0
  104. data/lib/daytona_api_client/models/organization.rb +663 -0
  105. data/lib/daytona_api_client/models/organization_invitation.rb +534 -0
  106. data/lib/daytona_api_client/models/organization_role.rb +412 -0
  107. data/lib/daytona_api_client/models/organization_sandbox_default_limited_network_egress.rb +236 -0
  108. data/lib/daytona_api_client/models/organization_suspension.rb +290 -0
  109. data/lib/daytona_api_client/models/organization_usage_overview.rb +341 -0
  110. data/lib/daytona_api_client/models/organization_user.rb +451 -0
  111. data/lib/daytona_api_client/models/paginated_audit_logs.rb +325 -0
  112. data/lib/daytona_api_client/models/paginated_sandboxes.rb +315 -0
  113. data/lib/daytona_api_client/models/paginated_snapshots.rb +315 -0
  114. data/lib/daytona_api_client/models/paginated_snapshots_dto.rb +315 -0
  115. data/lib/daytona_api_client/models/port_preview_url.rb +290 -0
  116. data/lib/daytona_api_client/models/position.rb +261 -0
  117. data/lib/daytona_api_client/models/posthog_config.rb +263 -0
  118. data/lib/daytona_api_client/models/process_errors_response.rb +263 -0
  119. data/lib/daytona_api_client/models/process_logs_response.rb +263 -0
  120. data/lib/daytona_api_client/models/process_restart_response.rb +263 -0
  121. data/lib/daytona_api_client/models/process_status_response.rb +263 -0
  122. data/lib/daytona_api_client/models/project_dir_response.rb +218 -0
  123. data/lib/daytona_api_client/models/pty_create_request.rb +288 -0
  124. data/lib/daytona_api_client/models/pty_create_response.rb +236 -0
  125. data/lib/daytona_api_client/models/pty_list_response.rb +238 -0
  126. data/lib/daytona_api_client/models/pty_resize_request.rb +263 -0
  127. data/lib/daytona_api_client/models/pty_session_info.rb +425 -0
  128. data/lib/daytona_api_client/models/range.rb +261 -0
  129. data/lib/daytona_api_client/models/rate_limit_config.rb +249 -0
  130. data/lib/daytona_api_client/models/rate_limit_entry.rb +229 -0
  131. data/lib/daytona_api_client/models/region.rb +328 -0
  132. data/lib/daytona_api_client/models/region_quota.rb +339 -0
  133. data/lib/daytona_api_client/models/region_screenshot_response.rb +256 -0
  134. data/lib/daytona_api_client/models/region_usage_overview.rb +391 -0
  135. data/lib/daytona_api_client/models/registry_push_access_dto.rb +371 -0
  136. data/lib/daytona_api_client/models/replace_request.rb +289 -0
  137. data/lib/daytona_api_client/models/replace_result.rb +236 -0
  138. data/lib/daytona_api_client/models/runner.rb +780 -0
  139. data/lib/daytona_api_client/models/runner_snapshot_dto.rb +290 -0
  140. data/lib/daytona_api_client/models/runner_state.rb +43 -0
  141. data/lib/daytona_api_client/models/sandbox.rb +782 -0
  142. data/lib/daytona_api_client/models/sandbox_class.rb +41 -0
  143. data/lib/daytona_api_client/models/sandbox_desired_state.rb +43 -0
  144. data/lib/daytona_api_client/models/sandbox_info.rb +273 -0
  145. data/lib/daytona_api_client/models/sandbox_labels.rb +238 -0
  146. data/lib/daytona_api_client/models/sandbox_state.rb +54 -0
  147. data/lib/daytona_api_client/models/sandbox_volume.rb +273 -0
  148. data/lib/daytona_api_client/models/screenshot_response.rb +256 -0
  149. data/lib/daytona_api_client/models/search_files_response.rb +237 -0
  150. data/lib/daytona_api_client/models/send_webhook_dto.rb +273 -0
  151. data/lib/daytona_api_client/models/session.rb +251 -0
  152. data/lib/daytona_api_client/models/session_execute_request.rb +256 -0
  153. data/lib/daytona_api_client/models/session_execute_response.rb +239 -0
  154. data/lib/daytona_api_client/models/set_snapshot_general_status_dto.rb +236 -0
  155. data/lib/daytona_api_client/models/snapshot_dto.rb +569 -0
  156. data/lib/daytona_api_client/models/snapshot_state.rb +46 -0
  157. data/lib/daytona_api_client/models/ssh_access_dto.rb +371 -0
  158. data/lib/daytona_api_client/models/ssh_access_validation_dto.rb +263 -0
  159. data/lib/daytona_api_client/models/storage_access_dto.rb +371 -0
  160. data/lib/daytona_api_client/models/update_docker_registry.rb +310 -0
  161. data/lib/daytona_api_client/models/update_organization_default_region.rb +236 -0
  162. data/lib/daytona_api_client/models/update_organization_invitation.rb +299 -0
  163. data/lib/daytona_api_client/models/update_organization_member_access.rb +289 -0
  164. data/lib/daytona_api_client/models/update_organization_quota.rb +317 -0
  165. data/lib/daytona_api_client/models/update_organization_region_quota.rb +245 -0
  166. data/lib/daytona_api_client/models/update_organization_role.rb +304 -0
  167. data/lib/daytona_api_client/models/update_sandbox_state_dto.rb +270 -0
  168. data/lib/daytona_api_client/models/user.rb +346 -0
  169. data/lib/daytona_api_client/models/user_home_dir_response.rb +218 -0
  170. data/lib/daytona_api_client/models/user_public_key.rb +263 -0
  171. data/lib/daytona_api_client/models/volume_dto.rb +417 -0
  172. data/lib/daytona_api_client/models/volume_state.rb +45 -0
  173. data/lib/daytona_api_client/models/webhook_app_portal_access.rb +236 -0
  174. data/lib/daytona_api_client/models/webhook_controller_get_status200_response.rb +218 -0
  175. data/lib/daytona_api_client/models/webhook_initialization_status.rb +343 -0
  176. data/lib/daytona_api_client/models/windows_response.rb +265 -0
  177. data/lib/daytona_api_client/models/work_dir_response.rb +218 -0
  178. data/lib/daytona_api_client/models/workspace.rb +834 -0
  179. data/lib/daytona_api_client/models/workspace_port_preview_url.rb +263 -0
  180. data/lib/daytona_api_client/version.rb +15 -0
  181. data/lib/daytona_api_client.rb +201 -0
  182. data/project.json +59 -0
  183. metadata +261 -0
@@ -0,0 +1,780 @@
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 Runner
18
+ # The ID of the runner
19
+ attr_accessor :id
20
+
21
+ # The domain of the runner
22
+ attr_accessor :domain
23
+
24
+ # The API URL of the runner
25
+ attr_accessor :api_url
26
+
27
+ # The proxy URL of the runner
28
+ attr_accessor :proxy_url
29
+
30
+ # The API key for the runner
31
+ attr_accessor :api_key
32
+
33
+ # The CPU capacity of the runner
34
+ attr_accessor :cpu
35
+
36
+ # The memory capacity of the runner in GiB
37
+ attr_accessor :memory
38
+
39
+ # The disk capacity of the runner in GiB
40
+ attr_accessor :disk
41
+
42
+ # The GPU capacity of the runner
43
+ attr_accessor :gpu
44
+
45
+ # The type of GPU
46
+ attr_accessor :gpu_type
47
+
48
+ # The class of the runner
49
+ attr_accessor :_class
50
+
51
+ # Current CPU usage percentage
52
+ attr_accessor :current_cpu_usage_percentage
53
+
54
+ # Current RAM usage percentage
55
+ attr_accessor :current_memory_usage_percentage
56
+
57
+ # Current disk usage percentage
58
+ attr_accessor :current_disk_usage_percentage
59
+
60
+ # Current allocated CPU
61
+ attr_accessor :current_allocated_cpu
62
+
63
+ # Current allocated memory in GiB
64
+ attr_accessor :current_allocated_memory_gi_b
65
+
66
+ # Current allocated disk in GiB
67
+ attr_accessor :current_allocated_disk_gi_b
68
+
69
+ # Current snapshot count
70
+ attr_accessor :current_snapshot_count
71
+
72
+ # Runner availability score
73
+ attr_accessor :availability_score
74
+
75
+ # The region of the runner
76
+ attr_accessor :region
77
+
78
+ # The state of the runner
79
+ attr_accessor :state
80
+
81
+ # The last time the runner was checked
82
+ attr_accessor :last_checked
83
+
84
+ # Whether the runner is unschedulable
85
+ attr_accessor :unschedulable
86
+
87
+ # The creation timestamp of the runner
88
+ attr_accessor :created_at
89
+
90
+ # The last update timestamp of the runner
91
+ attr_accessor :updated_at
92
+
93
+ # The version of the runner
94
+ attr_accessor :version
95
+
96
+ class EnumAttributeValidator
97
+ attr_reader :datatype
98
+ attr_reader :allowable_values
99
+
100
+ def initialize(datatype, allowable_values)
101
+ @allowable_values = allowable_values.map do |value|
102
+ case datatype.to_s
103
+ when /Integer/i
104
+ value.to_i
105
+ when /Float/i
106
+ value.to_f
107
+ else
108
+ value
109
+ end
110
+ end
111
+ end
112
+
113
+ def valid?(value)
114
+ !value || allowable_values.include?(value)
115
+ end
116
+ end
117
+
118
+ # Attribute mapping from ruby-style variable name to JSON key.
119
+ def self.attribute_map
120
+ {
121
+ :'id' => :'id',
122
+ :'domain' => :'domain',
123
+ :'api_url' => :'apiUrl',
124
+ :'proxy_url' => :'proxyUrl',
125
+ :'api_key' => :'apiKey',
126
+ :'cpu' => :'cpu',
127
+ :'memory' => :'memory',
128
+ :'disk' => :'disk',
129
+ :'gpu' => :'gpu',
130
+ :'gpu_type' => :'gpuType',
131
+ :'_class' => :'class',
132
+ :'current_cpu_usage_percentage' => :'currentCpuUsagePercentage',
133
+ :'current_memory_usage_percentage' => :'currentMemoryUsagePercentage',
134
+ :'current_disk_usage_percentage' => :'currentDiskUsagePercentage',
135
+ :'current_allocated_cpu' => :'currentAllocatedCpu',
136
+ :'current_allocated_memory_gi_b' => :'currentAllocatedMemoryGiB',
137
+ :'current_allocated_disk_gi_b' => :'currentAllocatedDiskGiB',
138
+ :'current_snapshot_count' => :'currentSnapshotCount',
139
+ :'availability_score' => :'availabilityScore',
140
+ :'region' => :'region',
141
+ :'state' => :'state',
142
+ :'last_checked' => :'lastChecked',
143
+ :'unschedulable' => :'unschedulable',
144
+ :'created_at' => :'createdAt',
145
+ :'updated_at' => :'updatedAt',
146
+ :'version' => :'version'
147
+ }
148
+ end
149
+
150
+ # Returns attribute mapping this model knows about
151
+ def self.acceptable_attribute_map
152
+ attribute_map
153
+ end
154
+
155
+ # Returns all the JSON keys this model knows about
156
+ def self.acceptable_attributes
157
+ acceptable_attribute_map.values
158
+ end
159
+
160
+ # Attribute type mapping.
161
+ def self.openapi_types
162
+ {
163
+ :'id' => :'String',
164
+ :'domain' => :'String',
165
+ :'api_url' => :'String',
166
+ :'proxy_url' => :'String',
167
+ :'api_key' => :'String',
168
+ :'cpu' => :'Float',
169
+ :'memory' => :'Float',
170
+ :'disk' => :'Float',
171
+ :'gpu' => :'Float',
172
+ :'gpu_type' => :'String',
173
+ :'_class' => :'SandboxClass',
174
+ :'current_cpu_usage_percentage' => :'Float',
175
+ :'current_memory_usage_percentage' => :'Float',
176
+ :'current_disk_usage_percentage' => :'Float',
177
+ :'current_allocated_cpu' => :'Float',
178
+ :'current_allocated_memory_gi_b' => :'Float',
179
+ :'current_allocated_disk_gi_b' => :'Float',
180
+ :'current_snapshot_count' => :'Float',
181
+ :'availability_score' => :'Float',
182
+ :'region' => :'String',
183
+ :'state' => :'RunnerState',
184
+ :'last_checked' => :'String',
185
+ :'unschedulable' => :'Boolean',
186
+ :'created_at' => :'String',
187
+ :'updated_at' => :'String',
188
+ :'version' => :'String'
189
+ }
190
+ end
191
+
192
+ # List of attributes with nullable: true
193
+ def self.openapi_nullable
194
+ Set.new([
195
+ ])
196
+ end
197
+
198
+ # Initializes the object
199
+ # @param [Hash] attributes Model attributes in the form of hash
200
+ def initialize(attributes = {})
201
+ if (!attributes.is_a?(Hash))
202
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::Runner` initialize method"
203
+ end
204
+
205
+ # check to see if the attribute exists and convert string to symbol for hash key
206
+ acceptable_attribute_map = self.class.acceptable_attribute_map
207
+ attributes = attributes.each_with_object({}) { |(k, v), h|
208
+ if (!acceptable_attribute_map.key?(k.to_sym))
209
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::Runner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
210
+ end
211
+ h[k.to_sym] = v
212
+ }
213
+
214
+ if attributes.key?(:'id')
215
+ self.id = attributes[:'id']
216
+ else
217
+ self.id = nil
218
+ end
219
+
220
+ if attributes.key?(:'domain')
221
+ self.domain = attributes[:'domain']
222
+ else
223
+ self.domain = nil
224
+ end
225
+
226
+ if attributes.key?(:'api_url')
227
+ self.api_url = attributes[:'api_url']
228
+ else
229
+ self.api_url = nil
230
+ end
231
+
232
+ if attributes.key?(:'proxy_url')
233
+ self.proxy_url = attributes[:'proxy_url']
234
+ else
235
+ self.proxy_url = nil
236
+ end
237
+
238
+ if attributes.key?(:'api_key')
239
+ self.api_key = attributes[:'api_key']
240
+ else
241
+ self.api_key = nil
242
+ end
243
+
244
+ if attributes.key?(:'cpu')
245
+ self.cpu = attributes[:'cpu']
246
+ else
247
+ self.cpu = nil
248
+ end
249
+
250
+ if attributes.key?(:'memory')
251
+ self.memory = attributes[:'memory']
252
+ else
253
+ self.memory = nil
254
+ end
255
+
256
+ if attributes.key?(:'disk')
257
+ self.disk = attributes[:'disk']
258
+ else
259
+ self.disk = nil
260
+ end
261
+
262
+ if attributes.key?(:'gpu')
263
+ self.gpu = attributes[:'gpu']
264
+ else
265
+ self.gpu = nil
266
+ end
267
+
268
+ if attributes.key?(:'gpu_type')
269
+ self.gpu_type = attributes[:'gpu_type']
270
+ else
271
+ self.gpu_type = nil
272
+ end
273
+
274
+ if attributes.key?(:'_class')
275
+ self._class = attributes[:'_class']
276
+ else
277
+ self._class = nil
278
+ end
279
+
280
+ if attributes.key?(:'current_cpu_usage_percentage')
281
+ self.current_cpu_usage_percentage = attributes[:'current_cpu_usage_percentage']
282
+ end
283
+
284
+ if attributes.key?(:'current_memory_usage_percentage')
285
+ self.current_memory_usage_percentage = attributes[:'current_memory_usage_percentage']
286
+ end
287
+
288
+ if attributes.key?(:'current_disk_usage_percentage')
289
+ self.current_disk_usage_percentage = attributes[:'current_disk_usage_percentage']
290
+ end
291
+
292
+ if attributes.key?(:'current_allocated_cpu')
293
+ self.current_allocated_cpu = attributes[:'current_allocated_cpu']
294
+ end
295
+
296
+ if attributes.key?(:'current_allocated_memory_gi_b')
297
+ self.current_allocated_memory_gi_b = attributes[:'current_allocated_memory_gi_b']
298
+ end
299
+
300
+ if attributes.key?(:'current_allocated_disk_gi_b')
301
+ self.current_allocated_disk_gi_b = attributes[:'current_allocated_disk_gi_b']
302
+ end
303
+
304
+ if attributes.key?(:'current_snapshot_count')
305
+ self.current_snapshot_count = attributes[:'current_snapshot_count']
306
+ end
307
+
308
+ if attributes.key?(:'availability_score')
309
+ self.availability_score = attributes[:'availability_score']
310
+ end
311
+
312
+ if attributes.key?(:'region')
313
+ self.region = attributes[:'region']
314
+ else
315
+ self.region = nil
316
+ end
317
+
318
+ if attributes.key?(:'state')
319
+ self.state = attributes[:'state']
320
+ else
321
+ self.state = nil
322
+ end
323
+
324
+ if attributes.key?(:'last_checked')
325
+ self.last_checked = attributes[:'last_checked']
326
+ end
327
+
328
+ if attributes.key?(:'unschedulable')
329
+ self.unschedulable = attributes[:'unschedulable']
330
+ else
331
+ self.unschedulable = nil
332
+ end
333
+
334
+ if attributes.key?(:'created_at')
335
+ self.created_at = attributes[:'created_at']
336
+ else
337
+ self.created_at = nil
338
+ end
339
+
340
+ if attributes.key?(:'updated_at')
341
+ self.updated_at = attributes[:'updated_at']
342
+ else
343
+ self.updated_at = nil
344
+ end
345
+
346
+ if attributes.key?(:'version')
347
+ self.version = attributes[:'version']
348
+ else
349
+ self.version = nil
350
+ end
351
+ end
352
+
353
+ # Show invalid properties with the reasons. Usually used together with valid?
354
+ # @return Array for valid properties with the reasons
355
+ def list_invalid_properties
356
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
357
+ invalid_properties = Array.new
358
+ if @id.nil?
359
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
360
+ end
361
+
362
+ if @domain.nil?
363
+ invalid_properties.push('invalid value for "domain", domain cannot be nil.')
364
+ end
365
+
366
+ if @api_url.nil?
367
+ invalid_properties.push('invalid value for "api_url", api_url cannot be nil.')
368
+ end
369
+
370
+ if @proxy_url.nil?
371
+ invalid_properties.push('invalid value for "proxy_url", proxy_url cannot be nil.')
372
+ end
373
+
374
+ if @api_key.nil?
375
+ invalid_properties.push('invalid value for "api_key", api_key cannot be nil.')
376
+ end
377
+
378
+ if @cpu.nil?
379
+ invalid_properties.push('invalid value for "cpu", cpu cannot be nil.')
380
+ end
381
+
382
+ if @memory.nil?
383
+ invalid_properties.push('invalid value for "memory", memory cannot be nil.')
384
+ end
385
+
386
+ if @disk.nil?
387
+ invalid_properties.push('invalid value for "disk", disk cannot be nil.')
388
+ end
389
+
390
+ if @gpu.nil?
391
+ invalid_properties.push('invalid value for "gpu", gpu cannot be nil.')
392
+ end
393
+
394
+ if @gpu_type.nil?
395
+ invalid_properties.push('invalid value for "gpu_type", gpu_type cannot be nil.')
396
+ end
397
+
398
+ if @_class.nil?
399
+ invalid_properties.push('invalid value for "_class", _class cannot be nil.')
400
+ end
401
+
402
+ if @region.nil?
403
+ invalid_properties.push('invalid value for "region", region cannot be nil.')
404
+ end
405
+
406
+ if @state.nil?
407
+ invalid_properties.push('invalid value for "state", state cannot be nil.')
408
+ end
409
+
410
+ if @unschedulable.nil?
411
+ invalid_properties.push('invalid value for "unschedulable", unschedulable cannot be nil.')
412
+ end
413
+
414
+ if @created_at.nil?
415
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
416
+ end
417
+
418
+ if @updated_at.nil?
419
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
420
+ end
421
+
422
+ if @version.nil?
423
+ invalid_properties.push('invalid value for "version", version cannot be nil.')
424
+ end
425
+
426
+ invalid_properties
427
+ end
428
+
429
+ # Check to see if the all the properties in the model are valid
430
+ # @return true if the model is valid
431
+ def valid?
432
+ warn '[DEPRECATED] the `valid?` method is obsolete'
433
+ return false if @id.nil?
434
+ return false if @domain.nil?
435
+ return false if @api_url.nil?
436
+ return false if @proxy_url.nil?
437
+ return false if @api_key.nil?
438
+ return false if @cpu.nil?
439
+ return false if @memory.nil?
440
+ return false if @disk.nil?
441
+ return false if @gpu.nil?
442
+ return false if @gpu_type.nil?
443
+ return false if @_class.nil?
444
+ return false if @region.nil?
445
+ return false if @state.nil?
446
+ return false if @unschedulable.nil?
447
+ return false if @created_at.nil?
448
+ return false if @updated_at.nil?
449
+ return false if @version.nil?
450
+ true
451
+ end
452
+
453
+ # Custom attribute writer method with validation
454
+ # @param [Object] id Value to be assigned
455
+ def id=(id)
456
+ if id.nil?
457
+ fail ArgumentError, 'id cannot be nil'
458
+ end
459
+
460
+ @id = id
461
+ end
462
+
463
+ # Custom attribute writer method with validation
464
+ # @param [Object] domain Value to be assigned
465
+ def domain=(domain)
466
+ if domain.nil?
467
+ fail ArgumentError, 'domain cannot be nil'
468
+ end
469
+
470
+ @domain = domain
471
+ end
472
+
473
+ # Custom attribute writer method with validation
474
+ # @param [Object] api_url Value to be assigned
475
+ def api_url=(api_url)
476
+ if api_url.nil?
477
+ fail ArgumentError, 'api_url cannot be nil'
478
+ end
479
+
480
+ @api_url = api_url
481
+ end
482
+
483
+ # Custom attribute writer method with validation
484
+ # @param [Object] proxy_url Value to be assigned
485
+ def proxy_url=(proxy_url)
486
+ if proxy_url.nil?
487
+ fail ArgumentError, 'proxy_url cannot be nil'
488
+ end
489
+
490
+ @proxy_url = proxy_url
491
+ end
492
+
493
+ # Custom attribute writer method with validation
494
+ # @param [Object] api_key Value to be assigned
495
+ def api_key=(api_key)
496
+ if api_key.nil?
497
+ fail ArgumentError, 'api_key cannot be nil'
498
+ end
499
+
500
+ @api_key = api_key
501
+ end
502
+
503
+ # Custom attribute writer method with validation
504
+ # @param [Object] cpu Value to be assigned
505
+ def cpu=(cpu)
506
+ if cpu.nil?
507
+ fail ArgumentError, 'cpu cannot be nil'
508
+ end
509
+
510
+ @cpu = cpu
511
+ end
512
+
513
+ # Custom attribute writer method with validation
514
+ # @param [Object] memory Value to be assigned
515
+ def memory=(memory)
516
+ if memory.nil?
517
+ fail ArgumentError, 'memory cannot be nil'
518
+ end
519
+
520
+ @memory = memory
521
+ end
522
+
523
+ # Custom attribute writer method with validation
524
+ # @param [Object] disk Value to be assigned
525
+ def disk=(disk)
526
+ if disk.nil?
527
+ fail ArgumentError, 'disk cannot be nil'
528
+ end
529
+
530
+ @disk = disk
531
+ end
532
+
533
+ # Custom attribute writer method with validation
534
+ # @param [Object] gpu Value to be assigned
535
+ def gpu=(gpu)
536
+ if gpu.nil?
537
+ fail ArgumentError, 'gpu cannot be nil'
538
+ end
539
+
540
+ @gpu = gpu
541
+ end
542
+
543
+ # Custom attribute writer method with validation
544
+ # @param [Object] gpu_type Value to be assigned
545
+ def gpu_type=(gpu_type)
546
+ if gpu_type.nil?
547
+ fail ArgumentError, 'gpu_type cannot be nil'
548
+ end
549
+
550
+ @gpu_type = gpu_type
551
+ end
552
+
553
+ # Custom attribute writer method with validation
554
+ # @param [Object] _class Value to be assigned
555
+ def _class=(_class)
556
+ if _class.nil?
557
+ fail ArgumentError, '_class cannot be nil'
558
+ end
559
+
560
+ @_class = _class
561
+ end
562
+
563
+ # Custom attribute writer method with validation
564
+ # @param [Object] region Value to be assigned
565
+ def region=(region)
566
+ if region.nil?
567
+ fail ArgumentError, 'region cannot be nil'
568
+ end
569
+
570
+ @region = region
571
+ end
572
+
573
+ # Custom attribute writer method with validation
574
+ # @param [Object] state Value to be assigned
575
+ def state=(state)
576
+ if state.nil?
577
+ fail ArgumentError, 'state cannot be nil'
578
+ end
579
+
580
+ @state = state
581
+ end
582
+
583
+ # Custom attribute writer method with validation
584
+ # @param [Object] unschedulable Value to be assigned
585
+ def unschedulable=(unschedulable)
586
+ if unschedulable.nil?
587
+ fail ArgumentError, 'unschedulable cannot be nil'
588
+ end
589
+
590
+ @unschedulable = unschedulable
591
+ end
592
+
593
+ # Custom attribute writer method with validation
594
+ # @param [Object] created_at Value to be assigned
595
+ def created_at=(created_at)
596
+ if created_at.nil?
597
+ fail ArgumentError, 'created_at cannot be nil'
598
+ end
599
+
600
+ @created_at = created_at
601
+ end
602
+
603
+ # Custom attribute writer method with validation
604
+ # @param [Object] updated_at Value to be assigned
605
+ def updated_at=(updated_at)
606
+ if updated_at.nil?
607
+ fail ArgumentError, 'updated_at cannot be nil'
608
+ end
609
+
610
+ @updated_at = updated_at
611
+ end
612
+
613
+ # Custom attribute writer method with validation
614
+ # @param [Object] version Value to be assigned
615
+ def version=(version)
616
+ if version.nil?
617
+ fail ArgumentError, 'version cannot be nil'
618
+ end
619
+
620
+ @version = version
621
+ end
622
+
623
+ # Checks equality by comparing each attribute.
624
+ # @param [Object] Object to be compared
625
+ def ==(o)
626
+ return true if self.equal?(o)
627
+ self.class == o.class &&
628
+ id == o.id &&
629
+ domain == o.domain &&
630
+ api_url == o.api_url &&
631
+ proxy_url == o.proxy_url &&
632
+ api_key == o.api_key &&
633
+ cpu == o.cpu &&
634
+ memory == o.memory &&
635
+ disk == o.disk &&
636
+ gpu == o.gpu &&
637
+ gpu_type == o.gpu_type &&
638
+ _class == o._class &&
639
+ current_cpu_usage_percentage == o.current_cpu_usage_percentage &&
640
+ current_memory_usage_percentage == o.current_memory_usage_percentage &&
641
+ current_disk_usage_percentage == o.current_disk_usage_percentage &&
642
+ current_allocated_cpu == o.current_allocated_cpu &&
643
+ current_allocated_memory_gi_b == o.current_allocated_memory_gi_b &&
644
+ current_allocated_disk_gi_b == o.current_allocated_disk_gi_b &&
645
+ current_snapshot_count == o.current_snapshot_count &&
646
+ availability_score == o.availability_score &&
647
+ region == o.region &&
648
+ state == o.state &&
649
+ last_checked == o.last_checked &&
650
+ unschedulable == o.unschedulable &&
651
+ created_at == o.created_at &&
652
+ updated_at == o.updated_at &&
653
+ version == o.version
654
+ end
655
+
656
+ # @see the `==` method
657
+ # @param [Object] Object to be compared
658
+ def eql?(o)
659
+ self == o
660
+ end
661
+
662
+ # Calculates hash code according to all attributes.
663
+ # @return [Integer] Hash code
664
+ def hash
665
+ [id, domain, api_url, proxy_url, api_key, cpu, memory, disk, gpu, gpu_type, _class, current_cpu_usage_percentage, current_memory_usage_percentage, current_disk_usage_percentage, current_allocated_cpu, current_allocated_memory_gi_b, current_allocated_disk_gi_b, current_snapshot_count, availability_score, region, state, last_checked, unschedulable, created_at, updated_at, version].hash
666
+ end
667
+
668
+ # Builds the object from hash
669
+ # @param [Hash] attributes Model attributes in the form of hash
670
+ # @return [Object] Returns the model itself
671
+ def self.build_from_hash(attributes)
672
+ return nil unless attributes.is_a?(Hash)
673
+ attributes = attributes.transform_keys(&:to_sym)
674
+ transformed_hash = {}
675
+ openapi_types.each_pair do |key, type|
676
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
677
+ transformed_hash["#{key}"] = nil
678
+ elsif type =~ /\AArray<(.*)>/i
679
+ # check to ensure the input is an array given that the attribute
680
+ # is documented as an array but the input is not
681
+ if attributes[attribute_map[key]].is_a?(Array)
682
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
683
+ end
684
+ elsif !attributes[attribute_map[key]].nil?
685
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
686
+ end
687
+ end
688
+ new(transformed_hash)
689
+ end
690
+
691
+ # Deserializes the data based on type
692
+ # @param string type Data type
693
+ # @param string value Value to be deserialized
694
+ # @return [Object] Deserialized data
695
+ def self._deserialize(type, value)
696
+ case type.to_sym
697
+ when :Time
698
+ Time.parse(value)
699
+ when :Date
700
+ Date.parse(value)
701
+ when :String
702
+ value.to_s
703
+ when :Integer
704
+ value.to_i
705
+ when :Float
706
+ value.to_f
707
+ when :Boolean
708
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
709
+ true
710
+ else
711
+ false
712
+ end
713
+ when :Object
714
+ # generic object (usually a Hash), return directly
715
+ value
716
+ when /\AArray<(?<inner_type>.+)>\z/
717
+ inner_type = Regexp.last_match[:inner_type]
718
+ value.map { |v| _deserialize(inner_type, v) }
719
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
720
+ k_type = Regexp.last_match[:k_type]
721
+ v_type = Regexp.last_match[:v_type]
722
+ {}.tap do |hash|
723
+ value.each do |k, v|
724
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
725
+ end
726
+ end
727
+ else # model
728
+ # models (e.g. Pet) or oneOf
729
+ klass = DaytonaApiClient.const_get(type)
730
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
731
+ end
732
+ end
733
+
734
+ # Returns the string representation of the object
735
+ # @return [String] String presentation of the object
736
+ def to_s
737
+ to_hash.to_s
738
+ end
739
+
740
+ # to_body is an alias to to_hash (backward compatibility)
741
+ # @return [Hash] Returns the object in the form of hash
742
+ def to_body
743
+ to_hash
744
+ end
745
+
746
+ # Returns the object in the form of hash
747
+ # @return [Hash] Returns the object in the form of hash
748
+ def to_hash
749
+ hash = {}
750
+ self.class.attribute_map.each_pair do |attr, param|
751
+ value = self.send(attr)
752
+ if value.nil?
753
+ is_nullable = self.class.openapi_nullable.include?(attr)
754
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
755
+ end
756
+
757
+ hash[param] = _to_hash(value)
758
+ end
759
+ hash
760
+ end
761
+
762
+ # Outputs non-array value in the form of hash
763
+ # For object, use to_hash. Otherwise, just return the value
764
+ # @param [Object] value Any valid value
765
+ # @return [Hash] Returns the value in the form of hash
766
+ def _to_hash(value)
767
+ if value.is_a?(Array)
768
+ value.compact.map { |v| _to_hash(v) }
769
+ elsif value.is_a?(Hash)
770
+ {}.tap do |hash|
771
+ value.each { |k, v| hash[k] = _to_hash(v) }
772
+ end
773
+ elsif value.respond_to? :to_hash
774
+ value.to_hash
775
+ else
776
+ value
777
+ end
778
+ end
779
+ end
780
+ end