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