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,834 @@
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 Workspace
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
+ # The name of the workspace
106
+ attr_accessor :name
107
+
108
+ # The image used for the workspace
109
+ attr_accessor :image
110
+
111
+ # The state of the snapshot
112
+ attr_accessor :snapshot_state
113
+
114
+ # The creation timestamp of the last snapshot
115
+ attr_accessor :snapshot_created_at
116
+
117
+ # Additional information about the sandbox
118
+ attr_accessor :info
119
+
120
+ class EnumAttributeValidator
121
+ attr_reader :datatype
122
+ attr_reader :allowable_values
123
+
124
+ def initialize(datatype, allowable_values)
125
+ @allowable_values = allowable_values.map do |value|
126
+ case datatype.to_s
127
+ when /Integer/i
128
+ value.to_i
129
+ when /Float/i
130
+ value.to_f
131
+ else
132
+ value
133
+ end
134
+ end
135
+ end
136
+
137
+ def valid?(value)
138
+ !value || allowable_values.include?(value)
139
+ end
140
+ end
141
+
142
+ # Attribute mapping from ruby-style variable name to JSON key.
143
+ def self.attribute_map
144
+ {
145
+ :'id' => :'id',
146
+ :'organization_id' => :'organizationId',
147
+ :'snapshot' => :'snapshot',
148
+ :'user' => :'user',
149
+ :'env' => :'env',
150
+ :'labels' => :'labels',
151
+ :'public' => :'public',
152
+ :'network_block_all' => :'networkBlockAll',
153
+ :'network_allow_list' => :'networkAllowList',
154
+ :'target' => :'target',
155
+ :'cpu' => :'cpu',
156
+ :'gpu' => :'gpu',
157
+ :'memory' => :'memory',
158
+ :'disk' => :'disk',
159
+ :'state' => :'state',
160
+ :'desired_state' => :'desiredState',
161
+ :'error_reason' => :'errorReason',
162
+ :'backup_state' => :'backupState',
163
+ :'backup_created_at' => :'backupCreatedAt',
164
+ :'auto_stop_interval' => :'autoStopInterval',
165
+ :'auto_archive_interval' => :'autoArchiveInterval',
166
+ :'auto_delete_interval' => :'autoDeleteInterval',
167
+ :'runner_domain' => :'runnerDomain',
168
+ :'volumes' => :'volumes',
169
+ :'build_info' => :'buildInfo',
170
+ :'created_at' => :'createdAt',
171
+ :'updated_at' => :'updatedAt',
172
+ :'_class' => :'class',
173
+ :'daemon_version' => :'daemonVersion',
174
+ :'name' => :'name',
175
+ :'image' => :'image',
176
+ :'snapshot_state' => :'snapshotState',
177
+ :'snapshot_created_at' => :'snapshotCreatedAt',
178
+ :'info' => :'info'
179
+ }
180
+ end
181
+
182
+ # Returns attribute mapping this model knows about
183
+ def self.acceptable_attribute_map
184
+ attribute_map
185
+ end
186
+
187
+ # Returns all the JSON keys this model knows about
188
+ def self.acceptable_attributes
189
+ acceptable_attribute_map.values
190
+ end
191
+
192
+ # Attribute type mapping.
193
+ def self.openapi_types
194
+ {
195
+ :'id' => :'String',
196
+ :'organization_id' => :'String',
197
+ :'snapshot' => :'String',
198
+ :'user' => :'String',
199
+ :'env' => :'Hash<String, String>',
200
+ :'labels' => :'Hash<String, String>',
201
+ :'public' => :'Boolean',
202
+ :'network_block_all' => :'Boolean',
203
+ :'network_allow_list' => :'String',
204
+ :'target' => :'String',
205
+ :'cpu' => :'Float',
206
+ :'gpu' => :'Float',
207
+ :'memory' => :'Float',
208
+ :'disk' => :'Float',
209
+ :'state' => :'SandboxState',
210
+ :'desired_state' => :'SandboxDesiredState',
211
+ :'error_reason' => :'String',
212
+ :'backup_state' => :'String',
213
+ :'backup_created_at' => :'String',
214
+ :'auto_stop_interval' => :'Float',
215
+ :'auto_archive_interval' => :'Float',
216
+ :'auto_delete_interval' => :'Float',
217
+ :'runner_domain' => :'String',
218
+ :'volumes' => :'Array<SandboxVolume>',
219
+ :'build_info' => :'BuildInfo',
220
+ :'created_at' => :'String',
221
+ :'updated_at' => :'String',
222
+ :'_class' => :'String',
223
+ :'daemon_version' => :'String',
224
+ :'name' => :'String',
225
+ :'image' => :'String',
226
+ :'snapshot_state' => :'String',
227
+ :'snapshot_created_at' => :'String',
228
+ :'info' => :'SandboxInfo'
229
+ }
230
+ end
231
+
232
+ # List of attributes with nullable: true
233
+ def self.openapi_nullable
234
+ Set.new([
235
+ ])
236
+ end
237
+
238
+ # Initializes the object
239
+ # @param [Hash] attributes Model attributes in the form of hash
240
+ def initialize(attributes = {})
241
+ if (!attributes.is_a?(Hash))
242
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::Workspace` initialize method"
243
+ end
244
+
245
+ # check to see if the attribute exists and convert string to symbol for hash key
246
+ acceptable_attribute_map = self.class.acceptable_attribute_map
247
+ attributes = attributes.each_with_object({}) { |(k, v), h|
248
+ if (!acceptable_attribute_map.key?(k.to_sym))
249
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::Workspace`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
250
+ end
251
+ h[k.to_sym] = v
252
+ }
253
+
254
+ if attributes.key?(:'id')
255
+ self.id = attributes[:'id']
256
+ else
257
+ self.id = nil
258
+ end
259
+
260
+ if attributes.key?(:'organization_id')
261
+ self.organization_id = attributes[:'organization_id']
262
+ else
263
+ self.organization_id = nil
264
+ end
265
+
266
+ if attributes.key?(:'snapshot')
267
+ self.snapshot = attributes[:'snapshot']
268
+ end
269
+
270
+ if attributes.key?(:'user')
271
+ self.user = attributes[:'user']
272
+ else
273
+ self.user = nil
274
+ end
275
+
276
+ if attributes.key?(:'env')
277
+ if (value = attributes[:'env']).is_a?(Hash)
278
+ self.env = value
279
+ end
280
+ else
281
+ self.env = nil
282
+ end
283
+
284
+ if attributes.key?(:'labels')
285
+ if (value = attributes[:'labels']).is_a?(Hash)
286
+ self.labels = value
287
+ end
288
+ else
289
+ self.labels = nil
290
+ end
291
+
292
+ if attributes.key?(:'public')
293
+ self.public = attributes[:'public']
294
+ else
295
+ self.public = nil
296
+ end
297
+
298
+ if attributes.key?(:'network_block_all')
299
+ self.network_block_all = attributes[:'network_block_all']
300
+ else
301
+ self.network_block_all = nil
302
+ end
303
+
304
+ if attributes.key?(:'network_allow_list')
305
+ self.network_allow_list = attributes[:'network_allow_list']
306
+ end
307
+
308
+ if attributes.key?(:'target')
309
+ self.target = attributes[:'target']
310
+ else
311
+ self.target = nil
312
+ end
313
+
314
+ if attributes.key?(:'cpu')
315
+ self.cpu = attributes[:'cpu']
316
+ else
317
+ self.cpu = nil
318
+ end
319
+
320
+ if attributes.key?(:'gpu')
321
+ self.gpu = attributes[:'gpu']
322
+ else
323
+ self.gpu = nil
324
+ end
325
+
326
+ if attributes.key?(:'memory')
327
+ self.memory = attributes[:'memory']
328
+ else
329
+ self.memory = nil
330
+ end
331
+
332
+ if attributes.key?(:'disk')
333
+ self.disk = attributes[:'disk']
334
+ else
335
+ self.disk = nil
336
+ end
337
+
338
+ if attributes.key?(:'state')
339
+ self.state = attributes[:'state']
340
+ end
341
+
342
+ if attributes.key?(:'desired_state')
343
+ self.desired_state = attributes[:'desired_state']
344
+ end
345
+
346
+ if attributes.key?(:'error_reason')
347
+ self.error_reason = attributes[:'error_reason']
348
+ end
349
+
350
+ if attributes.key?(:'backup_state')
351
+ self.backup_state = attributes[:'backup_state']
352
+ end
353
+
354
+ if attributes.key?(:'backup_created_at')
355
+ self.backup_created_at = attributes[:'backup_created_at']
356
+ end
357
+
358
+ if attributes.key?(:'auto_stop_interval')
359
+ self.auto_stop_interval = attributes[:'auto_stop_interval']
360
+ end
361
+
362
+ if attributes.key?(:'auto_archive_interval')
363
+ self.auto_archive_interval = attributes[:'auto_archive_interval']
364
+ end
365
+
366
+ if attributes.key?(:'auto_delete_interval')
367
+ self.auto_delete_interval = attributes[:'auto_delete_interval']
368
+ end
369
+
370
+ if attributes.key?(:'runner_domain')
371
+ self.runner_domain = attributes[:'runner_domain']
372
+ end
373
+
374
+ if attributes.key?(:'volumes')
375
+ if (value = attributes[:'volumes']).is_a?(Array)
376
+ self.volumes = value
377
+ end
378
+ end
379
+
380
+ if attributes.key?(:'build_info')
381
+ self.build_info = attributes[:'build_info']
382
+ end
383
+
384
+ if attributes.key?(:'created_at')
385
+ self.created_at = attributes[:'created_at']
386
+ end
387
+
388
+ if attributes.key?(:'updated_at')
389
+ self.updated_at = attributes[:'updated_at']
390
+ end
391
+
392
+ if attributes.key?(:'_class')
393
+ self._class = attributes[:'_class']
394
+ end
395
+
396
+ if attributes.key?(:'daemon_version')
397
+ self.daemon_version = attributes[:'daemon_version']
398
+ end
399
+
400
+ if attributes.key?(:'name')
401
+ self.name = attributes[:'name']
402
+ else
403
+ self.name = ''
404
+ end
405
+
406
+ if attributes.key?(:'image')
407
+ self.image = attributes[:'image']
408
+ end
409
+
410
+ if attributes.key?(:'snapshot_state')
411
+ self.snapshot_state = attributes[:'snapshot_state']
412
+ end
413
+
414
+ if attributes.key?(:'snapshot_created_at')
415
+ self.snapshot_created_at = attributes[:'snapshot_created_at']
416
+ end
417
+
418
+ if attributes.key?(:'info')
419
+ self.info = attributes[:'info']
420
+ end
421
+ end
422
+
423
+ # Show invalid properties with the reasons. Usually used together with valid?
424
+ # @return Array for valid properties with the reasons
425
+ def list_invalid_properties
426
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
427
+ invalid_properties = Array.new
428
+ if @id.nil?
429
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
430
+ end
431
+
432
+ if @organization_id.nil?
433
+ invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.')
434
+ end
435
+
436
+ if @user.nil?
437
+ invalid_properties.push('invalid value for "user", user cannot be nil.')
438
+ end
439
+
440
+ if @env.nil?
441
+ invalid_properties.push('invalid value for "env", env cannot be nil.')
442
+ end
443
+
444
+ if @labels.nil?
445
+ invalid_properties.push('invalid value for "labels", labels cannot be nil.')
446
+ end
447
+
448
+ if @public.nil?
449
+ invalid_properties.push('invalid value for "public", public cannot be nil.')
450
+ end
451
+
452
+ if @network_block_all.nil?
453
+ invalid_properties.push('invalid value for "network_block_all", network_block_all cannot be nil.')
454
+ end
455
+
456
+ if @target.nil?
457
+ invalid_properties.push('invalid value for "target", target cannot be nil.')
458
+ end
459
+
460
+ if @cpu.nil?
461
+ invalid_properties.push('invalid value for "cpu", cpu cannot be nil.')
462
+ end
463
+
464
+ if @gpu.nil?
465
+ invalid_properties.push('invalid value for "gpu", gpu cannot be nil.')
466
+ end
467
+
468
+ if @memory.nil?
469
+ invalid_properties.push('invalid value for "memory", memory cannot be nil.')
470
+ end
471
+
472
+ if @disk.nil?
473
+ invalid_properties.push('invalid value for "disk", disk cannot be nil.')
474
+ end
475
+
476
+ if @name.nil?
477
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
478
+ end
479
+
480
+ invalid_properties
481
+ end
482
+
483
+ # Check to see if the all the properties in the model are valid
484
+ # @return true if the model is valid
485
+ def valid?
486
+ warn '[DEPRECATED] the `valid?` method is obsolete'
487
+ return false if @id.nil?
488
+ return false if @organization_id.nil?
489
+ return false if @user.nil?
490
+ return false if @env.nil?
491
+ return false if @labels.nil?
492
+ return false if @public.nil?
493
+ return false if @network_block_all.nil?
494
+ return false if @target.nil?
495
+ return false if @cpu.nil?
496
+ return false if @gpu.nil?
497
+ return false if @memory.nil?
498
+ return false if @disk.nil?
499
+ backup_state_validator = EnumAttributeValidator.new('String', ["None", "Pending", "InProgress", "Completed", "Error"])
500
+ return false unless backup_state_validator.valid?(@backup_state)
501
+ _class_validator = EnumAttributeValidator.new('String', ["small", "medium", "large"])
502
+ return false unless _class_validator.valid?(@_class)
503
+ return false if @name.nil?
504
+ snapshot_state_validator = EnumAttributeValidator.new('String', ["None", "Pending", "InProgress", "Completed", "Error"])
505
+ return false unless snapshot_state_validator.valid?(@snapshot_state)
506
+ true
507
+ end
508
+
509
+ # Custom attribute writer method with validation
510
+ # @param [Object] id Value to be assigned
511
+ def id=(id)
512
+ if id.nil?
513
+ fail ArgumentError, 'id cannot be nil'
514
+ end
515
+
516
+ @id = id
517
+ end
518
+
519
+ # Custom attribute writer method with validation
520
+ # @param [Object] organization_id Value to be assigned
521
+ def organization_id=(organization_id)
522
+ if organization_id.nil?
523
+ fail ArgumentError, 'organization_id cannot be nil'
524
+ end
525
+
526
+ @organization_id = organization_id
527
+ end
528
+
529
+ # Custom attribute writer method with validation
530
+ # @param [Object] user Value to be assigned
531
+ def user=(user)
532
+ if user.nil?
533
+ fail ArgumentError, 'user cannot be nil'
534
+ end
535
+
536
+ @user = user
537
+ end
538
+
539
+ # Custom attribute writer method with validation
540
+ # @param [Object] env Value to be assigned
541
+ def env=(env)
542
+ if env.nil?
543
+ fail ArgumentError, 'env cannot be nil'
544
+ end
545
+
546
+ @env = env
547
+ end
548
+
549
+ # Custom attribute writer method with validation
550
+ # @param [Object] labels Value to be assigned
551
+ def labels=(labels)
552
+ if labels.nil?
553
+ fail ArgumentError, 'labels cannot be nil'
554
+ end
555
+
556
+ @labels = labels
557
+ end
558
+
559
+ # Custom attribute writer method with validation
560
+ # @param [Object] public Value to be assigned
561
+ def public=(public)
562
+ if public.nil?
563
+ fail ArgumentError, 'public cannot be nil'
564
+ end
565
+
566
+ @public = public
567
+ end
568
+
569
+ # Custom attribute writer method with validation
570
+ # @param [Object] network_block_all Value to be assigned
571
+ def network_block_all=(network_block_all)
572
+ if network_block_all.nil?
573
+ fail ArgumentError, 'network_block_all cannot be nil'
574
+ end
575
+
576
+ @network_block_all = network_block_all
577
+ end
578
+
579
+ # Custom attribute writer method with validation
580
+ # @param [Object] target Value to be assigned
581
+ def target=(target)
582
+ if target.nil?
583
+ fail ArgumentError, 'target cannot be nil'
584
+ end
585
+
586
+ @target = target
587
+ end
588
+
589
+ # Custom attribute writer method with validation
590
+ # @param [Object] cpu Value to be assigned
591
+ def cpu=(cpu)
592
+ if cpu.nil?
593
+ fail ArgumentError, 'cpu cannot be nil'
594
+ end
595
+
596
+ @cpu = cpu
597
+ end
598
+
599
+ # Custom attribute writer method with validation
600
+ # @param [Object] gpu Value to be assigned
601
+ def gpu=(gpu)
602
+ if gpu.nil?
603
+ fail ArgumentError, 'gpu cannot be nil'
604
+ end
605
+
606
+ @gpu = gpu
607
+ end
608
+
609
+ # Custom attribute writer method with validation
610
+ # @param [Object] memory Value to be assigned
611
+ def memory=(memory)
612
+ if memory.nil?
613
+ fail ArgumentError, 'memory cannot be nil'
614
+ end
615
+
616
+ @memory = memory
617
+ end
618
+
619
+ # Custom attribute writer method with validation
620
+ # @param [Object] disk Value to be assigned
621
+ def disk=(disk)
622
+ if disk.nil?
623
+ fail ArgumentError, 'disk cannot be nil'
624
+ end
625
+
626
+ @disk = disk
627
+ end
628
+
629
+ # Custom attribute writer method checking allowed values (enum).
630
+ # @param [Object] backup_state Object to be assigned
631
+ def backup_state=(backup_state)
632
+ validator = EnumAttributeValidator.new('String', ["None", "Pending", "InProgress", "Completed", "Error"])
633
+ unless validator.valid?(backup_state)
634
+ fail ArgumentError, "invalid value for \"backup_state\", must be one of #{validator.allowable_values}."
635
+ end
636
+ @backup_state = backup_state
637
+ end
638
+
639
+ # Custom attribute writer method checking allowed values (enum).
640
+ # @param [Object] _class Object to be assigned
641
+ def _class=(_class)
642
+ validator = EnumAttributeValidator.new('String', ["small", "medium", "large"])
643
+ unless validator.valid?(_class)
644
+ fail ArgumentError, "invalid value for \"_class\", must be one of #{validator.allowable_values}."
645
+ end
646
+ @_class = _class
647
+ end
648
+
649
+ # Custom attribute writer method with validation
650
+ # @param [Object] name Value to be assigned
651
+ def name=(name)
652
+ if name.nil?
653
+ fail ArgumentError, 'name cannot be nil'
654
+ end
655
+
656
+ @name = name
657
+ end
658
+
659
+ # Custom attribute writer method checking allowed values (enum).
660
+ # @param [Object] snapshot_state Object to be assigned
661
+ def snapshot_state=(snapshot_state)
662
+ validator = EnumAttributeValidator.new('String', ["None", "Pending", "InProgress", "Completed", "Error"])
663
+ unless validator.valid?(snapshot_state)
664
+ fail ArgumentError, "invalid value for \"snapshot_state\", must be one of #{validator.allowable_values}."
665
+ end
666
+ @snapshot_state = snapshot_state
667
+ end
668
+
669
+ # Checks equality by comparing each attribute.
670
+ # @param [Object] Object to be compared
671
+ def ==(o)
672
+ return true if self.equal?(o)
673
+ self.class == o.class &&
674
+ id == o.id &&
675
+ organization_id == o.organization_id &&
676
+ snapshot == o.snapshot &&
677
+ user == o.user &&
678
+ env == o.env &&
679
+ labels == o.labels &&
680
+ public == o.public &&
681
+ network_block_all == o.network_block_all &&
682
+ network_allow_list == o.network_allow_list &&
683
+ target == o.target &&
684
+ cpu == o.cpu &&
685
+ gpu == o.gpu &&
686
+ memory == o.memory &&
687
+ disk == o.disk &&
688
+ state == o.state &&
689
+ desired_state == o.desired_state &&
690
+ error_reason == o.error_reason &&
691
+ backup_state == o.backup_state &&
692
+ backup_created_at == o.backup_created_at &&
693
+ auto_stop_interval == o.auto_stop_interval &&
694
+ auto_archive_interval == o.auto_archive_interval &&
695
+ auto_delete_interval == o.auto_delete_interval &&
696
+ runner_domain == o.runner_domain &&
697
+ volumes == o.volumes &&
698
+ build_info == o.build_info &&
699
+ created_at == o.created_at &&
700
+ updated_at == o.updated_at &&
701
+ _class == o._class &&
702
+ daemon_version == o.daemon_version &&
703
+ name == o.name &&
704
+ image == o.image &&
705
+ snapshot_state == o.snapshot_state &&
706
+ snapshot_created_at == o.snapshot_created_at &&
707
+ info == o.info
708
+ end
709
+
710
+ # @see the `==` method
711
+ # @param [Object] Object to be compared
712
+ def eql?(o)
713
+ self == o
714
+ end
715
+
716
+ # Calculates hash code according to all attributes.
717
+ # @return [Integer] Hash code
718
+ def hash
719
+ [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, name, image, snapshot_state, snapshot_created_at, info].hash
720
+ end
721
+
722
+ # Builds the object from hash
723
+ # @param [Hash] attributes Model attributes in the form of hash
724
+ # @return [Object] Returns the model itself
725
+ def self.build_from_hash(attributes)
726
+ return nil unless attributes.is_a?(Hash)
727
+ attributes = attributes.transform_keys(&:to_sym)
728
+ transformed_hash = {}
729
+ openapi_types.each_pair do |key, type|
730
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
731
+ transformed_hash["#{key}"] = nil
732
+ elsif type =~ /\AArray<(.*)>/i
733
+ # check to ensure the input is an array given that the attribute
734
+ # is documented as an array but the input is not
735
+ if attributes[attribute_map[key]].is_a?(Array)
736
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
737
+ end
738
+ elsif !attributes[attribute_map[key]].nil?
739
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
740
+ end
741
+ end
742
+ new(transformed_hash)
743
+ end
744
+
745
+ # Deserializes the data based on type
746
+ # @param string type Data type
747
+ # @param string value Value to be deserialized
748
+ # @return [Object] Deserialized data
749
+ def self._deserialize(type, value)
750
+ case type.to_sym
751
+ when :Time
752
+ Time.parse(value)
753
+ when :Date
754
+ Date.parse(value)
755
+ when :String
756
+ value.to_s
757
+ when :Integer
758
+ value.to_i
759
+ when :Float
760
+ value.to_f
761
+ when :Boolean
762
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
763
+ true
764
+ else
765
+ false
766
+ end
767
+ when :Object
768
+ # generic object (usually a Hash), return directly
769
+ value
770
+ when /\AArray<(?<inner_type>.+)>\z/
771
+ inner_type = Regexp.last_match[:inner_type]
772
+ value.map { |v| _deserialize(inner_type, v) }
773
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
774
+ k_type = Regexp.last_match[:k_type]
775
+ v_type = Regexp.last_match[:v_type]
776
+ {}.tap do |hash|
777
+ value.each do |k, v|
778
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
779
+ end
780
+ end
781
+ else # model
782
+ # models (e.g. Pet) or oneOf
783
+ klass = DaytonaApiClient.const_get(type)
784
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
785
+ end
786
+ end
787
+
788
+ # Returns the string representation of the object
789
+ # @return [String] String presentation of the object
790
+ def to_s
791
+ to_hash.to_s
792
+ end
793
+
794
+ # to_body is an alias to to_hash (backward compatibility)
795
+ # @return [Hash] Returns the object in the form of hash
796
+ def to_body
797
+ to_hash
798
+ end
799
+
800
+ # Returns the object in the form of hash
801
+ # @return [Hash] Returns the object in the form of hash
802
+ def to_hash
803
+ hash = {}
804
+ self.class.attribute_map.each_pair do |attr, param|
805
+ value = self.send(attr)
806
+ if value.nil?
807
+ is_nullable = self.class.openapi_nullable.include?(attr)
808
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
809
+ end
810
+
811
+ hash[param] = _to_hash(value)
812
+ end
813
+ hash
814
+ end
815
+
816
+ # Outputs non-array value in the form of hash
817
+ # For object, use to_hash. Otherwise, just return the value
818
+ # @param [Object] value Any valid value
819
+ # @return [Hash] Returns the value in the form of hash
820
+ def _to_hash(value)
821
+ if value.is_a?(Array)
822
+ value.compact.map { |v| _to_hash(v) }
823
+ elsif value.is_a?(Hash)
824
+ {}.tap do |hash|
825
+ value.each { |k, v| hash[k] = _to_hash(v) }
826
+ end
827
+ elsif value.respond_to? :to_hash
828
+ value.to_hash
829
+ else
830
+ value
831
+ end
832
+ end
833
+ end
834
+ end