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,469 @@
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 OrganizationUsageOverview
18
+ attr_accessor :total_cpu_quota
19
+
20
+ attr_accessor :total_memory_quota
21
+
22
+ attr_accessor :total_disk_quota
23
+
24
+ attr_accessor :current_cpu_usage
25
+
26
+ attr_accessor :current_memory_usage
27
+
28
+ attr_accessor :current_disk_usage
29
+
30
+ attr_accessor :total_snapshot_quota
31
+
32
+ attr_accessor :current_snapshot_usage
33
+
34
+ attr_accessor :total_volume_quota
35
+
36
+ attr_accessor :current_volume_usage
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'total_cpu_quota' => :'totalCpuQuota',
42
+ :'total_memory_quota' => :'totalMemoryQuota',
43
+ :'total_disk_quota' => :'totalDiskQuota',
44
+ :'current_cpu_usage' => :'currentCpuUsage',
45
+ :'current_memory_usage' => :'currentMemoryUsage',
46
+ :'current_disk_usage' => :'currentDiskUsage',
47
+ :'total_snapshot_quota' => :'totalSnapshotQuota',
48
+ :'current_snapshot_usage' => :'currentSnapshotUsage',
49
+ :'total_volume_quota' => :'totalVolumeQuota',
50
+ :'current_volume_usage' => :'currentVolumeUsage'
51
+ }
52
+ end
53
+
54
+ # Returns attribute mapping this model knows about
55
+ def self.acceptable_attribute_map
56
+ attribute_map
57
+ end
58
+
59
+ # Returns all the JSON keys this model knows about
60
+ def self.acceptable_attributes
61
+ acceptable_attribute_map.values
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ def self.openapi_types
66
+ {
67
+ :'total_cpu_quota' => :'Float',
68
+ :'total_memory_quota' => :'Float',
69
+ :'total_disk_quota' => :'Float',
70
+ :'current_cpu_usage' => :'Float',
71
+ :'current_memory_usage' => :'Float',
72
+ :'current_disk_usage' => :'Float',
73
+ :'total_snapshot_quota' => :'Float',
74
+ :'current_snapshot_usage' => :'Float',
75
+ :'total_volume_quota' => :'Float',
76
+ :'current_volume_usage' => :'Float'
77
+ }
78
+ end
79
+
80
+ # List of attributes with nullable: true
81
+ def self.openapi_nullable
82
+ Set.new([
83
+ ])
84
+ end
85
+
86
+ # Initializes the object
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ def initialize(attributes = {})
89
+ if (!attributes.is_a?(Hash))
90
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::OrganizationUsageOverview` initialize method"
91
+ end
92
+
93
+ # check to see if the attribute exists and convert string to symbol for hash key
94
+ acceptable_attribute_map = self.class.acceptable_attribute_map
95
+ attributes = attributes.each_with_object({}) { |(k, v), h|
96
+ if (!acceptable_attribute_map.key?(k.to_sym))
97
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::OrganizationUsageOverview`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
98
+ end
99
+ h[k.to_sym] = v
100
+ }
101
+
102
+ if attributes.key?(:'total_cpu_quota')
103
+ self.total_cpu_quota = attributes[:'total_cpu_quota']
104
+ else
105
+ self.total_cpu_quota = nil
106
+ end
107
+
108
+ if attributes.key?(:'total_memory_quota')
109
+ self.total_memory_quota = attributes[:'total_memory_quota']
110
+ else
111
+ self.total_memory_quota = nil
112
+ end
113
+
114
+ if attributes.key?(:'total_disk_quota')
115
+ self.total_disk_quota = attributes[:'total_disk_quota']
116
+ else
117
+ self.total_disk_quota = nil
118
+ end
119
+
120
+ if attributes.key?(:'current_cpu_usage')
121
+ self.current_cpu_usage = attributes[:'current_cpu_usage']
122
+ else
123
+ self.current_cpu_usage = nil
124
+ end
125
+
126
+ if attributes.key?(:'current_memory_usage')
127
+ self.current_memory_usage = attributes[:'current_memory_usage']
128
+ else
129
+ self.current_memory_usage = nil
130
+ end
131
+
132
+ if attributes.key?(:'current_disk_usage')
133
+ self.current_disk_usage = attributes[:'current_disk_usage']
134
+ else
135
+ self.current_disk_usage = nil
136
+ end
137
+
138
+ if attributes.key?(:'total_snapshot_quota')
139
+ self.total_snapshot_quota = attributes[:'total_snapshot_quota']
140
+ else
141
+ self.total_snapshot_quota = nil
142
+ end
143
+
144
+ if attributes.key?(:'current_snapshot_usage')
145
+ self.current_snapshot_usage = attributes[:'current_snapshot_usage']
146
+ else
147
+ self.current_snapshot_usage = nil
148
+ end
149
+
150
+ if attributes.key?(:'total_volume_quota')
151
+ self.total_volume_quota = attributes[:'total_volume_quota']
152
+ else
153
+ self.total_volume_quota = nil
154
+ end
155
+
156
+ if attributes.key?(:'current_volume_usage')
157
+ self.current_volume_usage = attributes[:'current_volume_usage']
158
+ else
159
+ self.current_volume_usage = nil
160
+ end
161
+ end
162
+
163
+ # Show invalid properties with the reasons. Usually used together with valid?
164
+ # @return Array for valid properties with the reasons
165
+ def list_invalid_properties
166
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
167
+ invalid_properties = Array.new
168
+ if @total_cpu_quota.nil?
169
+ invalid_properties.push('invalid value for "total_cpu_quota", total_cpu_quota cannot be nil.')
170
+ end
171
+
172
+ if @total_memory_quota.nil?
173
+ invalid_properties.push('invalid value for "total_memory_quota", total_memory_quota cannot be nil.')
174
+ end
175
+
176
+ if @total_disk_quota.nil?
177
+ invalid_properties.push('invalid value for "total_disk_quota", total_disk_quota cannot be nil.')
178
+ end
179
+
180
+ if @current_cpu_usage.nil?
181
+ invalid_properties.push('invalid value for "current_cpu_usage", current_cpu_usage cannot be nil.')
182
+ end
183
+
184
+ if @current_memory_usage.nil?
185
+ invalid_properties.push('invalid value for "current_memory_usage", current_memory_usage cannot be nil.')
186
+ end
187
+
188
+ if @current_disk_usage.nil?
189
+ invalid_properties.push('invalid value for "current_disk_usage", current_disk_usage cannot be nil.')
190
+ end
191
+
192
+ if @total_snapshot_quota.nil?
193
+ invalid_properties.push('invalid value for "total_snapshot_quota", total_snapshot_quota cannot be nil.')
194
+ end
195
+
196
+ if @current_snapshot_usage.nil?
197
+ invalid_properties.push('invalid value for "current_snapshot_usage", current_snapshot_usage cannot be nil.')
198
+ end
199
+
200
+ if @total_volume_quota.nil?
201
+ invalid_properties.push('invalid value for "total_volume_quota", total_volume_quota cannot be nil.')
202
+ end
203
+
204
+ if @current_volume_usage.nil?
205
+ invalid_properties.push('invalid value for "current_volume_usage", current_volume_usage cannot be nil.')
206
+ end
207
+
208
+ invalid_properties
209
+ end
210
+
211
+ # Check to see if the all the properties in the model are valid
212
+ # @return true if the model is valid
213
+ def valid?
214
+ warn '[DEPRECATED] the `valid?` method is obsolete'
215
+ return false if @total_cpu_quota.nil?
216
+ return false if @total_memory_quota.nil?
217
+ return false if @total_disk_quota.nil?
218
+ return false if @current_cpu_usage.nil?
219
+ return false if @current_memory_usage.nil?
220
+ return false if @current_disk_usage.nil?
221
+ return false if @total_snapshot_quota.nil?
222
+ return false if @current_snapshot_usage.nil?
223
+ return false if @total_volume_quota.nil?
224
+ return false if @current_volume_usage.nil?
225
+ true
226
+ end
227
+
228
+ # Custom attribute writer method with validation
229
+ # @param [Object] total_cpu_quota Value to be assigned
230
+ def total_cpu_quota=(total_cpu_quota)
231
+ if total_cpu_quota.nil?
232
+ fail ArgumentError, 'total_cpu_quota cannot be nil'
233
+ end
234
+
235
+ @total_cpu_quota = total_cpu_quota
236
+ end
237
+
238
+ # Custom attribute writer method with validation
239
+ # @param [Object] total_memory_quota Value to be assigned
240
+ def total_memory_quota=(total_memory_quota)
241
+ if total_memory_quota.nil?
242
+ fail ArgumentError, 'total_memory_quota cannot be nil'
243
+ end
244
+
245
+ @total_memory_quota = total_memory_quota
246
+ end
247
+
248
+ # Custom attribute writer method with validation
249
+ # @param [Object] total_disk_quota Value to be assigned
250
+ def total_disk_quota=(total_disk_quota)
251
+ if total_disk_quota.nil?
252
+ fail ArgumentError, 'total_disk_quota cannot be nil'
253
+ end
254
+
255
+ @total_disk_quota = total_disk_quota
256
+ end
257
+
258
+ # Custom attribute writer method with validation
259
+ # @param [Object] current_cpu_usage Value to be assigned
260
+ def current_cpu_usage=(current_cpu_usage)
261
+ if current_cpu_usage.nil?
262
+ fail ArgumentError, 'current_cpu_usage cannot be nil'
263
+ end
264
+
265
+ @current_cpu_usage = current_cpu_usage
266
+ end
267
+
268
+ # Custom attribute writer method with validation
269
+ # @param [Object] current_memory_usage Value to be assigned
270
+ def current_memory_usage=(current_memory_usage)
271
+ if current_memory_usage.nil?
272
+ fail ArgumentError, 'current_memory_usage cannot be nil'
273
+ end
274
+
275
+ @current_memory_usage = current_memory_usage
276
+ end
277
+
278
+ # Custom attribute writer method with validation
279
+ # @param [Object] current_disk_usage Value to be assigned
280
+ def current_disk_usage=(current_disk_usage)
281
+ if current_disk_usage.nil?
282
+ fail ArgumentError, 'current_disk_usage cannot be nil'
283
+ end
284
+
285
+ @current_disk_usage = current_disk_usage
286
+ end
287
+
288
+ # Custom attribute writer method with validation
289
+ # @param [Object] total_snapshot_quota Value to be assigned
290
+ def total_snapshot_quota=(total_snapshot_quota)
291
+ if total_snapshot_quota.nil?
292
+ fail ArgumentError, 'total_snapshot_quota cannot be nil'
293
+ end
294
+
295
+ @total_snapshot_quota = total_snapshot_quota
296
+ end
297
+
298
+ # Custom attribute writer method with validation
299
+ # @param [Object] current_snapshot_usage Value to be assigned
300
+ def current_snapshot_usage=(current_snapshot_usage)
301
+ if current_snapshot_usage.nil?
302
+ fail ArgumentError, 'current_snapshot_usage cannot be nil'
303
+ end
304
+
305
+ @current_snapshot_usage = current_snapshot_usage
306
+ end
307
+
308
+ # Custom attribute writer method with validation
309
+ # @param [Object] total_volume_quota Value to be assigned
310
+ def total_volume_quota=(total_volume_quota)
311
+ if total_volume_quota.nil?
312
+ fail ArgumentError, 'total_volume_quota cannot be nil'
313
+ end
314
+
315
+ @total_volume_quota = total_volume_quota
316
+ end
317
+
318
+ # Custom attribute writer method with validation
319
+ # @param [Object] current_volume_usage Value to be assigned
320
+ def current_volume_usage=(current_volume_usage)
321
+ if current_volume_usage.nil?
322
+ fail ArgumentError, 'current_volume_usage cannot be nil'
323
+ end
324
+
325
+ @current_volume_usage = current_volume_usage
326
+ end
327
+
328
+ # Checks equality by comparing each attribute.
329
+ # @param [Object] Object to be compared
330
+ def ==(o)
331
+ return true if self.equal?(o)
332
+ self.class == o.class &&
333
+ total_cpu_quota == o.total_cpu_quota &&
334
+ total_memory_quota == o.total_memory_quota &&
335
+ total_disk_quota == o.total_disk_quota &&
336
+ current_cpu_usage == o.current_cpu_usage &&
337
+ current_memory_usage == o.current_memory_usage &&
338
+ current_disk_usage == o.current_disk_usage &&
339
+ total_snapshot_quota == o.total_snapshot_quota &&
340
+ current_snapshot_usage == o.current_snapshot_usage &&
341
+ total_volume_quota == o.total_volume_quota &&
342
+ current_volume_usage == o.current_volume_usage
343
+ end
344
+
345
+ # @see the `==` method
346
+ # @param [Object] Object to be compared
347
+ def eql?(o)
348
+ self == o
349
+ end
350
+
351
+ # Calculates hash code according to all attributes.
352
+ # @return [Integer] Hash code
353
+ def hash
354
+ [total_cpu_quota, total_memory_quota, total_disk_quota, current_cpu_usage, current_memory_usage, current_disk_usage, total_snapshot_quota, current_snapshot_usage, total_volume_quota, current_volume_usage].hash
355
+ end
356
+
357
+ # Builds the object from hash
358
+ # @param [Hash] attributes Model attributes in the form of hash
359
+ # @return [Object] Returns the model itself
360
+ def self.build_from_hash(attributes)
361
+ return nil unless attributes.is_a?(Hash)
362
+ attributes = attributes.transform_keys(&:to_sym)
363
+ transformed_hash = {}
364
+ openapi_types.each_pair do |key, type|
365
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
366
+ transformed_hash["#{key}"] = nil
367
+ elsif type =~ /\AArray<(.*)>/i
368
+ # check to ensure the input is an array given that the attribute
369
+ # is documented as an array but the input is not
370
+ if attributes[attribute_map[key]].is_a?(Array)
371
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
372
+ end
373
+ elsif !attributes[attribute_map[key]].nil?
374
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
375
+ end
376
+ end
377
+ new(transformed_hash)
378
+ end
379
+
380
+ # Deserializes the data based on type
381
+ # @param string type Data type
382
+ # @param string value Value to be deserialized
383
+ # @return [Object] Deserialized data
384
+ def self._deserialize(type, value)
385
+ case type.to_sym
386
+ when :Time
387
+ Time.parse(value)
388
+ when :Date
389
+ Date.parse(value)
390
+ when :String
391
+ value.to_s
392
+ when :Integer
393
+ value.to_i
394
+ when :Float
395
+ value.to_f
396
+ when :Boolean
397
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
398
+ true
399
+ else
400
+ false
401
+ end
402
+ when :Object
403
+ # generic object (usually a Hash), return directly
404
+ value
405
+ when /\AArray<(?<inner_type>.+)>\z/
406
+ inner_type = Regexp.last_match[:inner_type]
407
+ value.map { |v| _deserialize(inner_type, v) }
408
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
409
+ k_type = Regexp.last_match[:k_type]
410
+ v_type = Regexp.last_match[:v_type]
411
+ {}.tap do |hash|
412
+ value.each do |k, v|
413
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
414
+ end
415
+ end
416
+ else # model
417
+ # models (e.g. Pet) or oneOf
418
+ klass = DaytonaApiClient.const_get(type)
419
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
420
+ end
421
+ end
422
+
423
+ # Returns the string representation of the object
424
+ # @return [String] String presentation of the object
425
+ def to_s
426
+ to_hash.to_s
427
+ end
428
+
429
+ # to_body is an alias to to_hash (backward compatibility)
430
+ # @return [Hash] Returns the object in the form of hash
431
+ def to_body
432
+ to_hash
433
+ end
434
+
435
+ # Returns the object in the form of hash
436
+ # @return [Hash] Returns the object in the form of hash
437
+ def to_hash
438
+ hash = {}
439
+ self.class.attribute_map.each_pair do |attr, param|
440
+ value = self.send(attr)
441
+ if value.nil?
442
+ is_nullable = self.class.openapi_nullable.include?(attr)
443
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
444
+ end
445
+
446
+ hash[param] = _to_hash(value)
447
+ end
448
+ hash
449
+ end
450
+
451
+ # Outputs non-array value in the form of hash
452
+ # For object, use to_hash. Otherwise, just return the value
453
+ # @param [Object] value Any valid value
454
+ # @return [Hash] Returns the value in the form of hash
455
+ def _to_hash(value)
456
+ if value.is_a?(Array)
457
+ value.compact.map { |v| _to_hash(v) }
458
+ elsif value.is_a?(Hash)
459
+ {}.tap do |hash|
460
+ value.each { |k, v| hash[k] = _to_hash(v) }
461
+ end
462
+ elsif value.respond_to? :to_hash
463
+ value.to_hash
464
+ else
465
+ value
466
+ end
467
+ end
468
+ end
469
+ end