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,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 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
+ # 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
+ :'name' => :'name',
148
+ :'snapshot' => :'snapshot',
149
+ :'user' => :'user',
150
+ :'env' => :'env',
151
+ :'labels' => :'labels',
152
+ :'public' => :'public',
153
+ :'network_block_all' => :'networkBlockAll',
154
+ :'network_allow_list' => :'networkAllowList',
155
+ :'target' => :'target',
156
+ :'cpu' => :'cpu',
157
+ :'gpu' => :'gpu',
158
+ :'memory' => :'memory',
159
+ :'disk' => :'disk',
160
+ :'state' => :'state',
161
+ :'desired_state' => :'desiredState',
162
+ :'error_reason' => :'errorReason',
163
+ :'recoverable' => :'recoverable',
164
+ :'backup_state' => :'backupState',
165
+ :'backup_created_at' => :'backupCreatedAt',
166
+ :'auto_stop_interval' => :'autoStopInterval',
167
+ :'auto_archive_interval' => :'autoArchiveInterval',
168
+ :'auto_delete_interval' => :'autoDeleteInterval',
169
+ :'volumes' => :'volumes',
170
+ :'build_info' => :'buildInfo',
171
+ :'created_at' => :'createdAt',
172
+ :'updated_at' => :'updatedAt',
173
+ :'_class' => :'class',
174
+ :'daemon_version' => :'daemonVersion',
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
+ :'name' => :'String',
198
+ :'snapshot' => :'String',
199
+ :'user' => :'String',
200
+ :'env' => :'Hash<String, String>',
201
+ :'labels' => :'Hash<String, String>',
202
+ :'public' => :'Boolean',
203
+ :'network_block_all' => :'Boolean',
204
+ :'network_allow_list' => :'String',
205
+ :'target' => :'String',
206
+ :'cpu' => :'Float',
207
+ :'gpu' => :'Float',
208
+ :'memory' => :'Float',
209
+ :'disk' => :'Float',
210
+ :'state' => :'SandboxState',
211
+ :'desired_state' => :'SandboxDesiredState',
212
+ :'error_reason' => :'String',
213
+ :'recoverable' => :'Boolean',
214
+ :'backup_state' => :'String',
215
+ :'backup_created_at' => :'String',
216
+ :'auto_stop_interval' => :'Float',
217
+ :'auto_archive_interval' => :'Float',
218
+ :'auto_delete_interval' => :'Float',
219
+ :'volumes' => :'Array<SandboxVolume>',
220
+ :'build_info' => :'BuildInfo',
221
+ :'created_at' => :'String',
222
+ :'updated_at' => :'String',
223
+ :'_class' => :'String',
224
+ :'daemon_version' => :'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?(:'name')
267
+ self.name = attributes[:'name']
268
+ else
269
+ self.name = nil
270
+ end
271
+
272
+ if attributes.key?(:'snapshot')
273
+ self.snapshot = attributes[:'snapshot']
274
+ end
275
+
276
+ if attributes.key?(:'user')
277
+ self.user = attributes[:'user']
278
+ else
279
+ self.user = nil
280
+ end
281
+
282
+ if attributes.key?(:'env')
283
+ if (value = attributes[:'env']).is_a?(Hash)
284
+ self.env = value
285
+ end
286
+ else
287
+ self.env = nil
288
+ end
289
+
290
+ if attributes.key?(:'labels')
291
+ if (value = attributes[:'labels']).is_a?(Hash)
292
+ self.labels = value
293
+ end
294
+ else
295
+ self.labels = nil
296
+ end
297
+
298
+ if attributes.key?(:'public')
299
+ self.public = attributes[:'public']
300
+ else
301
+ self.public = nil
302
+ end
303
+
304
+ if attributes.key?(:'network_block_all')
305
+ self.network_block_all = attributes[:'network_block_all']
306
+ else
307
+ self.network_block_all = nil
308
+ end
309
+
310
+ if attributes.key?(:'network_allow_list')
311
+ self.network_allow_list = attributes[:'network_allow_list']
312
+ end
313
+
314
+ if attributes.key?(:'target')
315
+ self.target = attributes[:'target']
316
+ else
317
+ self.target = nil
318
+ end
319
+
320
+ if attributes.key?(:'cpu')
321
+ self.cpu = attributes[:'cpu']
322
+ else
323
+ self.cpu = nil
324
+ end
325
+
326
+ if attributes.key?(:'gpu')
327
+ self.gpu = attributes[:'gpu']
328
+ else
329
+ self.gpu = nil
330
+ end
331
+
332
+ if attributes.key?(:'memory')
333
+ self.memory = attributes[:'memory']
334
+ else
335
+ self.memory = nil
336
+ end
337
+
338
+ if attributes.key?(:'disk')
339
+ self.disk = attributes[:'disk']
340
+ else
341
+ self.disk = nil
342
+ end
343
+
344
+ if attributes.key?(:'state')
345
+ self.state = attributes[:'state']
346
+ end
347
+
348
+ if attributes.key?(:'desired_state')
349
+ self.desired_state = attributes[:'desired_state']
350
+ end
351
+
352
+ if attributes.key?(:'error_reason')
353
+ self.error_reason = attributes[:'error_reason']
354
+ end
355
+
356
+ if attributes.key?(:'recoverable')
357
+ self.recoverable = attributes[:'recoverable']
358
+ end
359
+
360
+ if attributes.key?(:'backup_state')
361
+ self.backup_state = attributes[:'backup_state']
362
+ end
363
+
364
+ if attributes.key?(:'backup_created_at')
365
+ self.backup_created_at = attributes[:'backup_created_at']
366
+ end
367
+
368
+ if attributes.key?(:'auto_stop_interval')
369
+ self.auto_stop_interval = attributes[:'auto_stop_interval']
370
+ end
371
+
372
+ if attributes.key?(:'auto_archive_interval')
373
+ self.auto_archive_interval = attributes[:'auto_archive_interval']
374
+ end
375
+
376
+ if attributes.key?(:'auto_delete_interval')
377
+ self.auto_delete_interval = attributes[:'auto_delete_interval']
378
+ end
379
+
380
+ if attributes.key?(:'volumes')
381
+ if (value = attributes[:'volumes']).is_a?(Array)
382
+ self.volumes = value
383
+ end
384
+ end
385
+
386
+ if attributes.key?(:'build_info')
387
+ self.build_info = attributes[:'build_info']
388
+ end
389
+
390
+ if attributes.key?(:'created_at')
391
+ self.created_at = attributes[:'created_at']
392
+ end
393
+
394
+ if attributes.key?(:'updated_at')
395
+ self.updated_at = attributes[:'updated_at']
396
+ end
397
+
398
+ if attributes.key?(:'_class')
399
+ self._class = attributes[:'_class']
400
+ end
401
+
402
+ if attributes.key?(:'daemon_version')
403
+ self.daemon_version = attributes[:'daemon_version']
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 @name.nil?
437
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
438
+ end
439
+
440
+ if @user.nil?
441
+ invalid_properties.push('invalid value for "user", user cannot be nil.')
442
+ end
443
+
444
+ if @env.nil?
445
+ invalid_properties.push('invalid value for "env", env cannot be nil.')
446
+ end
447
+
448
+ if @labels.nil?
449
+ invalid_properties.push('invalid value for "labels", labels cannot be nil.')
450
+ end
451
+
452
+ if @public.nil?
453
+ invalid_properties.push('invalid value for "public", public cannot be nil.')
454
+ end
455
+
456
+ if @network_block_all.nil?
457
+ invalid_properties.push('invalid value for "network_block_all", network_block_all cannot be nil.')
458
+ end
459
+
460
+ if @target.nil?
461
+ invalid_properties.push('invalid value for "target", target cannot be nil.')
462
+ end
463
+
464
+ if @cpu.nil?
465
+ invalid_properties.push('invalid value for "cpu", cpu cannot be nil.')
466
+ end
467
+
468
+ if @gpu.nil?
469
+ invalid_properties.push('invalid value for "gpu", gpu cannot be nil.')
470
+ end
471
+
472
+ if @memory.nil?
473
+ invalid_properties.push('invalid value for "memory", memory cannot be nil.')
474
+ end
475
+
476
+ if @disk.nil?
477
+ invalid_properties.push('invalid value for "disk", disk 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 @name.nil?
490
+ return false if @user.nil?
491
+ return false if @env.nil?
492
+ return false if @labels.nil?
493
+ return false if @public.nil?
494
+ return false if @network_block_all.nil?
495
+ return false if @target.nil?
496
+ return false if @cpu.nil?
497
+ return false if @gpu.nil?
498
+ return false if @memory.nil?
499
+ return false if @disk.nil?
500
+ backup_state_validator = EnumAttributeValidator.new('String', ["None", "Pending", "InProgress", "Completed", "Error"])
501
+ return false unless backup_state_validator.valid?(@backup_state)
502
+ _class_validator = EnumAttributeValidator.new('String', ["small", "medium", "large"])
503
+ return false unless _class_validator.valid?(@_class)
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] name Value to be assigned
531
+ def name=(name)
532
+ if name.nil?
533
+ fail ArgumentError, 'name cannot be nil'
534
+ end
535
+
536
+ @name = name
537
+ end
538
+
539
+ # Custom attribute writer method with validation
540
+ # @param [Object] user Value to be assigned
541
+ def user=(user)
542
+ if user.nil?
543
+ fail ArgumentError, 'user cannot be nil'
544
+ end
545
+
546
+ @user = user
547
+ end
548
+
549
+ # Custom attribute writer method with validation
550
+ # @param [Object] env Value to be assigned
551
+ def env=(env)
552
+ if env.nil?
553
+ fail ArgumentError, 'env cannot be nil'
554
+ end
555
+
556
+ @env = env
557
+ end
558
+
559
+ # Custom attribute writer method with validation
560
+ # @param [Object] labels Value to be assigned
561
+ def labels=(labels)
562
+ if labels.nil?
563
+ fail ArgumentError, 'labels cannot be nil'
564
+ end
565
+
566
+ @labels = labels
567
+ end
568
+
569
+ # Custom attribute writer method with validation
570
+ # @param [Object] public Value to be assigned
571
+ def public=(public)
572
+ if public.nil?
573
+ fail ArgumentError, 'public cannot be nil'
574
+ end
575
+
576
+ @public = public
577
+ end
578
+
579
+ # Custom attribute writer method with validation
580
+ # @param [Object] network_block_all Value to be assigned
581
+ def network_block_all=(network_block_all)
582
+ if network_block_all.nil?
583
+ fail ArgumentError, 'network_block_all cannot be nil'
584
+ end
585
+
586
+ @network_block_all = network_block_all
587
+ end
588
+
589
+ # Custom attribute writer method with validation
590
+ # @param [Object] target Value to be assigned
591
+ def target=(target)
592
+ if target.nil?
593
+ fail ArgumentError, 'target cannot be nil'
594
+ end
595
+
596
+ @target = target
597
+ end
598
+
599
+ # Custom attribute writer method with validation
600
+ # @param [Object] cpu Value to be assigned
601
+ def cpu=(cpu)
602
+ if cpu.nil?
603
+ fail ArgumentError, 'cpu cannot be nil'
604
+ end
605
+
606
+ @cpu = cpu
607
+ end
608
+
609
+ # Custom attribute writer method with validation
610
+ # @param [Object] gpu Value to be assigned
611
+ def gpu=(gpu)
612
+ if gpu.nil?
613
+ fail ArgumentError, 'gpu cannot be nil'
614
+ end
615
+
616
+ @gpu = gpu
617
+ end
618
+
619
+ # Custom attribute writer method with validation
620
+ # @param [Object] memory Value to be assigned
621
+ def memory=(memory)
622
+ if memory.nil?
623
+ fail ArgumentError, 'memory cannot be nil'
624
+ end
625
+
626
+ @memory = memory
627
+ end
628
+
629
+ # Custom attribute writer method with validation
630
+ # @param [Object] disk Value to be assigned
631
+ def disk=(disk)
632
+ if disk.nil?
633
+ fail ArgumentError, 'disk cannot be nil'
634
+ end
635
+
636
+ @disk = disk
637
+ end
638
+
639
+ # Custom attribute writer method checking allowed values (enum).
640
+ # @param [Object] backup_state Object to be assigned
641
+ def backup_state=(backup_state)
642
+ validator = EnumAttributeValidator.new('String', ["None", "Pending", "InProgress", "Completed", "Error"])
643
+ unless validator.valid?(backup_state)
644
+ fail ArgumentError, "invalid value for \"backup_state\", must be one of #{validator.allowable_values}."
645
+ end
646
+ @backup_state = backup_state
647
+ end
648
+
649
+ # Custom attribute writer method checking allowed values (enum).
650
+ # @param [Object] _class Object to be assigned
651
+ def _class=(_class)
652
+ validator = EnumAttributeValidator.new('String', ["small", "medium", "large"])
653
+ unless validator.valid?(_class)
654
+ fail ArgumentError, "invalid value for \"_class\", must be one of #{validator.allowable_values}."
655
+ end
656
+ @_class = _class
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
+ name == o.name &&
677
+ snapshot == o.snapshot &&
678
+ user == o.user &&
679
+ env == o.env &&
680
+ labels == o.labels &&
681
+ public == o.public &&
682
+ network_block_all == o.network_block_all &&
683
+ network_allow_list == o.network_allow_list &&
684
+ target == o.target &&
685
+ cpu == o.cpu &&
686
+ gpu == o.gpu &&
687
+ memory == o.memory &&
688
+ disk == o.disk &&
689
+ state == o.state &&
690
+ desired_state == o.desired_state &&
691
+ error_reason == o.error_reason &&
692
+ recoverable == o.recoverable &&
693
+ backup_state == o.backup_state &&
694
+ backup_created_at == o.backup_created_at &&
695
+ auto_stop_interval == o.auto_stop_interval &&
696
+ auto_archive_interval == o.auto_archive_interval &&
697
+ auto_delete_interval == o.auto_delete_interval &&
698
+ volumes == o.volumes &&
699
+ build_info == o.build_info &&
700
+ created_at == o.created_at &&
701
+ updated_at == o.updated_at &&
702
+ _class == o._class &&
703
+ daemon_version == o.daemon_version &&
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, 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, 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