daytona_api_client 0.126.0.pre.alpha.2

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