daytona_api_client 0.155.0 → 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 (206) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +101 -0
  4. data/daytona_api_client.gemspec +2 -2
  5. data/lib/daytona_api_client/api/api_keys_api.rb +1 -1
  6. data/lib/daytona_api_client/api/audit_api.rb +66 -18
  7. data/lib/daytona_api_client/api/docker_registry_api.rb +2 -5
  8. data/lib/daytona_api_client/api/health_api.rb +1 -52
  9. data/lib/daytona_api_client/api/organizations_api.rb +130 -982
  10. data/lib/daytona_api_client/api/preview_api.rb +5 -74
  11. data/lib/daytona_api_client/api/runners_api.rb +21 -408
  12. data/lib/daytona_api_client/api/sandbox_api.rb +192 -964
  13. data/lib/daytona_api_client/api/snapshots_api.rb +2 -68
  14. data/lib/daytona_api_client/api/toolbox_api.rb +740 -740
  15. data/lib/daytona_api_client/api/users_api.rb +2 -2
  16. data/lib/daytona_api_client/api/volumes_api.rb +1 -1
  17. data/lib/daytona_api_client/api/webhooks_api.rb +3 -3
  18. data/lib/daytona_api_client/api/workspace_api.rb +5 -5
  19. data/lib/daytona_api_client/configuration.rb +1 -4
  20. data/lib/daytona_api_client/models/account_provider.rb +0 -2
  21. data/lib/daytona_api_client/models/announcement.rb +0 -2
  22. data/lib/daytona_api_client/models/api_key_list.rb +0 -2
  23. data/lib/daytona_api_client/models/api_key_response.rb +0 -2
  24. data/lib/daytona_api_client/models/audit_log.rb +0 -2
  25. data/lib/daytona_api_client/models/build_info.rb +4 -33
  26. data/lib/daytona_api_client/models/command.rb +0 -2
  27. data/lib/daytona_api_client/models/completion_context.rb +0 -2
  28. data/lib/daytona_api_client/models/completion_item.rb +0 -2
  29. data/lib/daytona_api_client/models/completion_list.rb +0 -2
  30. data/lib/daytona_api_client/models/compressed_screenshot_response.rb +0 -2
  31. data/lib/daytona_api_client/models/computer_use_start_response.rb +0 -2
  32. data/lib/daytona_api_client/models/computer_use_status_response.rb +0 -2
  33. data/lib/daytona_api_client/models/computer_use_stop_response.rb +0 -2
  34. data/lib/daytona_api_client/models/create_api_key.rb +1 -3
  35. data/lib/daytona_api_client/models/{job.rb → create_audit_log.rb} +79 -168
  36. data/lib/daytona_api_client/models/create_build_info.rb +0 -2
  37. data/lib/daytona_api_client/models/create_docker_registry.rb +0 -2
  38. data/lib/daytona_api_client/models/create_linked_account.rb +0 -2
  39. data/lib/daytona_api_client/models/create_organization.rb +4 -33
  40. data/lib/daytona_api_client/models/create_organization_invitation.rb +0 -2
  41. data/lib/daytona_api_client/models/create_organization_quota.rb +0 -2
  42. data/lib/daytona_api_client/models/create_organization_role.rb +0 -2
  43. data/lib/daytona_api_client/models/create_runner.rb +315 -33
  44. data/lib/daytona_api_client/models/create_sandbox.rb +1 -13
  45. data/lib/daytona_api_client/models/create_session_request.rb +0 -2
  46. data/lib/daytona_api_client/models/create_snapshot.rb +4 -16
  47. data/lib/daytona_api_client/models/create_user.rb +1 -12
  48. data/lib/daytona_api_client/models/create_volume.rb +0 -2
  49. data/lib/daytona_api_client/models/create_workspace.rb +0 -2
  50. data/lib/daytona_api_client/models/daytona_configuration.rb +4 -53
  51. data/lib/daytona_api_client/models/display_info_response.rb +0 -2
  52. data/lib/daytona_api_client/models/docker_registry.rb +0 -2
  53. data/lib/daytona_api_client/models/download_files.rb +0 -2
  54. data/lib/daytona_api_client/models/execute_request.rb +0 -2
  55. data/lib/daytona_api_client/models/execute_response.rb +0 -2
  56. data/lib/daytona_api_client/models/file_info.rb +0 -2
  57. data/lib/daytona_api_client/models/file_status.rb +0 -2
  58. data/lib/daytona_api_client/models/git_add_request.rb +0 -2
  59. data/lib/daytona_api_client/models/git_branch_request.rb +0 -2
  60. data/lib/daytona_api_client/models/git_checkout_request.rb +0 -2
  61. data/lib/daytona_api_client/models/git_clone_request.rb +0 -2
  62. data/lib/daytona_api_client/models/git_commit_info.rb +0 -2
  63. data/lib/daytona_api_client/models/git_commit_request.rb +0 -2
  64. data/lib/daytona_api_client/models/git_commit_response.rb +0 -2
  65. data/lib/daytona_api_client/models/git_delete_branch_request.rb +0 -2
  66. data/lib/daytona_api_client/models/git_repo_request.rb +0 -2
  67. data/lib/daytona_api_client/models/git_status.rb +0 -2
  68. data/lib/daytona_api_client/models/health_controller_check200_response.rb +0 -2
  69. data/lib/daytona_api_client/models/health_controller_check200_response_info_value.rb +0 -2
  70. data/lib/daytona_api_client/models/health_controller_check503_response.rb +0 -2
  71. data/lib/daytona_api_client/models/keyboard_hotkey_request.rb +0 -2
  72. data/lib/daytona_api_client/models/keyboard_press_request.rb +0 -2
  73. data/lib/daytona_api_client/models/keyboard_type_request.rb +0 -2
  74. data/lib/daytona_api_client/models/list_branch_response.rb +0 -2
  75. data/lib/daytona_api_client/models/lsp_completion_params.rb +0 -2
  76. data/lib/daytona_api_client/models/lsp_document_request.rb +0 -2
  77. data/lib/daytona_api_client/models/lsp_location.rb +0 -2
  78. data/lib/daytona_api_client/models/lsp_server_request.rb +0 -2
  79. data/lib/daytona_api_client/models/lsp_symbol.rb +0 -2
  80. data/lib/daytona_api_client/models/match.rb +0 -2
  81. data/lib/daytona_api_client/models/mouse_click_request.rb +0 -2
  82. data/lib/daytona_api_client/models/mouse_click_response.rb +0 -2
  83. data/lib/daytona_api_client/models/mouse_drag_request.rb +0 -2
  84. data/lib/daytona_api_client/models/mouse_drag_response.rb +0 -2
  85. data/lib/daytona_api_client/models/mouse_move_request.rb +0 -2
  86. data/lib/daytona_api_client/models/mouse_move_response.rb +0 -2
  87. data/lib/daytona_api_client/models/mouse_position.rb +0 -2
  88. data/lib/daytona_api_client/models/mouse_scroll_request.rb +0 -2
  89. data/lib/daytona_api_client/models/mouse_scroll_response.rb +0 -2
  90. data/lib/daytona_api_client/models/oidc_config.rb +0 -2
  91. data/lib/daytona_api_client/models/organization.rb +85 -148
  92. data/lib/daytona_api_client/models/organization_invitation.rb +0 -2
  93. data/lib/daytona_api_client/models/organization_role.rb +0 -2
  94. data/lib/daytona_api_client/models/organization_sandbox_default_limited_network_egress.rb +0 -2
  95. data/lib/daytona_api_client/models/organization_suspension.rb +5 -9
  96. data/lib/daytona_api_client/models/organization_usage_overview.rb +146 -20
  97. data/lib/daytona_api_client/models/organization_user.rb +0 -2
  98. data/lib/daytona_api_client/models/paginated_audit_logs.rb +4 -16
  99. data/lib/daytona_api_client/models/paginated_sandboxes.rb +0 -2
  100. data/lib/daytona_api_client/models/paginated_snapshots.rb +0 -2
  101. data/lib/daytona_api_client/models/{paginated_jobs.rb → paginated_snapshots_dto.rb} +4 -6
  102. data/lib/daytona_api_client/models/port_preview_url.rb +14 -33
  103. data/lib/daytona_api_client/models/position.rb +0 -2
  104. data/lib/daytona_api_client/models/posthog_config.rb +0 -2
  105. data/lib/daytona_api_client/models/process_errors_response.rb +0 -2
  106. data/lib/daytona_api_client/models/process_logs_response.rb +0 -2
  107. data/lib/daytona_api_client/models/process_restart_response.rb +0 -2
  108. data/lib/daytona_api_client/models/process_status_response.rb +0 -2
  109. data/lib/daytona_api_client/models/project_dir_response.rb +0 -2
  110. data/lib/daytona_api_client/models/pty_create_request.rb +0 -2
  111. data/lib/daytona_api_client/models/pty_create_response.rb +0 -2
  112. data/lib/daytona_api_client/models/pty_list_response.rb +0 -2
  113. data/lib/daytona_api_client/models/pty_resize_request.rb +0 -2
  114. data/lib/daytona_api_client/models/pty_session_info.rb +0 -2
  115. data/lib/daytona_api_client/models/range.rb +0 -2
  116. data/lib/daytona_api_client/models/region.rb +4 -180
  117. data/lib/daytona_api_client/models/region_screenshot_response.rb +0 -2
  118. data/lib/daytona_api_client/models/registry_push_access_dto.rb +0 -2
  119. data/lib/daytona_api_client/models/replace_request.rb +0 -2
  120. data/lib/daytona_api_client/models/replace_result.rb +0 -2
  121. data/lib/daytona_api_client/models/runner.rb +117 -81
  122. data/lib/daytona_api_client/models/runner_snapshot_dto.rb +17 -2
  123. data/lib/daytona_api_client/models/sandbox.rb +14 -80
  124. data/lib/daytona_api_client/models/sandbox_info.rb +0 -2
  125. data/lib/daytona_api_client/models/sandbox_labels.rb +0 -2
  126. data/lib/daytona_api_client/models/sandbox_state.rb +1 -2
  127. data/lib/daytona_api_client/models/sandbox_volume.rb +4 -16
  128. data/lib/daytona_api_client/models/screenshot_response.rb +0 -2
  129. data/lib/daytona_api_client/models/search_files_response.rb +0 -2
  130. data/lib/daytona_api_client/models/send_webhook_dto.rb +1 -25
  131. data/lib/daytona_api_client/models/session.rb +0 -2
  132. data/lib/daytona_api_client/models/session_execute_request.rb +0 -2
  133. data/lib/daytona_api_client/models/session_execute_response.rb +0 -2
  134. data/lib/daytona_api_client/models/set_snapshot_general_status_dto.rb +0 -2
  135. data/lib/daytona_api_client/models/snapshot_dto.rb +4 -38
  136. data/lib/daytona_api_client/models/snapshot_state.rb +4 -1
  137. data/lib/daytona_api_client/models/ssh_access_dto.rb +4 -33
  138. data/lib/daytona_api_client/models/ssh_access_validation_dto.rb +24 -6
  139. data/lib/daytona_api_client/models/storage_access_dto.rb +0 -2
  140. data/lib/daytona_api_client/models/update_docker_registry.rb +0 -2
  141. data/lib/daytona_api_client/models/update_organization_invitation.rb +0 -2
  142. data/lib/daytona_api_client/models/update_organization_member_access.rb +0 -2
  143. data/lib/daytona_api_client/models/update_organization_quota.rb +41 -92
  144. data/lib/daytona_api_client/models/update_organization_role.rb +0 -2
  145. data/lib/daytona_api_client/models/update_sandbox_state_dto.rb +6 -28
  146. data/lib/daytona_api_client/models/user.rb +0 -2
  147. data/lib/daytona_api_client/models/user_home_dir_response.rb +0 -2
  148. data/lib/daytona_api_client/models/user_public_key.rb +0 -2
  149. data/lib/daytona_api_client/models/volume_dto.rb +0 -2
  150. data/lib/daytona_api_client/models/webhook_app_portal_access.rb +1 -30
  151. data/lib/daytona_api_client/models/webhook_controller_get_status200_response.rb +0 -2
  152. data/lib/daytona_api_client/models/webhook_initialization_status.rb +0 -2
  153. data/lib/daytona_api_client/models/windows_response.rb +0 -2
  154. data/lib/daytona_api_client/models/work_dir_response.rb +0 -2
  155. data/lib/daytona_api_client/models/workspace.rb +27 -66
  156. data/lib/daytona_api_client/version.rb +1 -1
  157. data/lib/daytona_api_client.rb +1 -42
  158. data/project.json +11 -37
  159. metadata +5 -50
  160. data/.gitignore +0 -39
  161. data/.openapi-generator/FILES +0 -206
  162. data/.openapi-generator/VERSION +0 -1
  163. data/.openapi-generator-ignore +0 -31
  164. data/.rspec +0 -2
  165. data/.rubocop.yml +0 -148
  166. data/fix-gemspec.sh +0 -11
  167. data/lib/daytona_api_client/api/admin_api.rb +0 -386
  168. data/lib/daytona_api_client/api/jobs_api.rb +0 -299
  169. data/lib/daytona_api_client/api/regions_api.rb +0 -77
  170. data/lib/daytona_api_client/models/admin_create_runner.rb +0 -387
  171. data/lib/daytona_api_client/models/create_region.rb +0 -271
  172. data/lib/daytona_api_client/models/create_region_response.rb +0 -282
  173. data/lib/daytona_api_client/models/create_runner_response.rb +0 -265
  174. data/lib/daytona_api_client/models/job_status.rb +0 -42
  175. data/lib/daytona_api_client/models/job_type.rb +0 -50
  176. data/lib/daytona_api_client/models/log_entry.rb +0 -407
  177. data/lib/daytona_api_client/models/metric_data_point.rb +0 -265
  178. data/lib/daytona_api_client/models/metric_series.rb +0 -267
  179. data/lib/daytona_api_client/models/metrics_response.rb +0 -240
  180. data/lib/daytona_api_client/models/otel_config.rb +0 -251
  181. data/lib/daytona_api_client/models/paginated_logs.rb +0 -321
  182. data/lib/daytona_api_client/models/paginated_traces.rb +0 -321
  183. data/lib/daytona_api_client/models/poll_jobs_response.rb +0 -240
  184. data/lib/daytona_api_client/models/rate_limit_config.rb +0 -251
  185. data/lib/daytona_api_client/models/rate_limit_entry.rb +0 -231
  186. data/lib/daytona_api_client/models/regenerate_api_key_response.rb +0 -238
  187. data/lib/daytona_api_client/models/region_quota.rb +0 -341
  188. data/lib/daytona_api_client/models/region_type.rb +0 -41
  189. data/lib/daytona_api_client/models/region_usage_overview.rb +0 -393
  190. data/lib/daytona_api_client/models/resize_sandbox.rb +0 -298
  191. data/lib/daytona_api_client/models/runner_full.rb +0 -781
  192. data/lib/daytona_api_client/models/runner_health_metrics.rb +0 -535
  193. data/lib/daytona_api_client/models/runner_healthcheck.rb +0 -290
  194. data/lib/daytona_api_client/models/runner_service_health.rb +0 -275
  195. data/lib/daytona_api_client/models/signed_port_preview_url.rb +0 -319
  196. data/lib/daytona_api_client/models/snapshot_manager_credentials.rb +0 -265
  197. data/lib/daytona_api_client/models/toolbox_proxy_url.rb +0 -238
  198. data/lib/daytona_api_client/models/trace_span.rb +0 -405
  199. data/lib/daytona_api_client/models/trace_summary.rb +0 -383
  200. data/lib/daytona_api_client/models/update_job_status.rb +0 -280
  201. data/lib/daytona_api_client/models/update_organization_default_region.rb +0 -238
  202. data/lib/daytona_api_client/models/update_organization_region_quota.rb +0 -247
  203. data/lib/daytona_api_client/models/update_region.rb +0 -244
  204. data/lib/daytona_api_client/models/url.rb +0 -238
  205. data/lib/daytona_api_client/models/webhook_event.rb +0 -45
  206. data/lib/daytona_api_client/models/workspace_port_preview_url.rb +0 -265
@@ -1,393 +0,0 @@
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 RegionUsageOverview
18
- attr_accessor :region_id
19
-
20
- attr_accessor :total_cpu_quota
21
-
22
- attr_accessor :current_cpu_usage
23
-
24
- attr_accessor :total_memory_quota
25
-
26
- attr_accessor :current_memory_usage
27
-
28
- attr_accessor :total_disk_quota
29
-
30
- attr_accessor :current_disk_usage
31
-
32
- # Attribute mapping from ruby-style variable name to JSON key.
33
- def self.attribute_map
34
- {
35
- :'region_id' => :'regionId',
36
- :'total_cpu_quota' => :'totalCpuQuota',
37
- :'current_cpu_usage' => :'currentCpuUsage',
38
- :'total_memory_quota' => :'totalMemoryQuota',
39
- :'current_memory_usage' => :'currentMemoryUsage',
40
- :'total_disk_quota' => :'totalDiskQuota',
41
- :'current_disk_usage' => :'currentDiskUsage'
42
- }
43
- end
44
-
45
- # Returns attribute mapping this model knows about
46
- def self.acceptable_attribute_map
47
- attribute_map
48
- end
49
-
50
- # Returns all the JSON keys this model knows about
51
- def self.acceptable_attributes
52
- acceptable_attribute_map.values
53
- end
54
-
55
- # Attribute type mapping.
56
- def self.openapi_types
57
- {
58
- :'region_id' => :'String',
59
- :'total_cpu_quota' => :'Float',
60
- :'current_cpu_usage' => :'Float',
61
- :'total_memory_quota' => :'Float',
62
- :'current_memory_usage' => :'Float',
63
- :'total_disk_quota' => :'Float',
64
- :'current_disk_usage' => :'Float'
65
- }
66
- end
67
-
68
- # List of attributes with nullable: true
69
- def self.openapi_nullable
70
- Set.new([
71
- ])
72
- end
73
-
74
- # Initializes the object
75
- # @param [Hash] attributes Model attributes in the form of hash
76
- def initialize(attributes = {})
77
- if (!attributes.is_a?(Hash))
78
- fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::RegionUsageOverview` initialize method"
79
- end
80
-
81
- # check to see if the attribute exists and convert string to symbol for hash key
82
- acceptable_attribute_map = self.class.acceptable_attribute_map
83
- attributes = attributes.each_with_object({}) { |(k, v), h|
84
- if (!acceptable_attribute_map.key?(k.to_sym))
85
- fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::RegionUsageOverview`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
86
- end
87
- h[k.to_sym] = v
88
- }
89
-
90
- if attributes.key?(:'region_id')
91
- self.region_id = attributes[:'region_id']
92
- else
93
- self.region_id = nil
94
- end
95
-
96
- if attributes.key?(:'total_cpu_quota')
97
- self.total_cpu_quota = attributes[:'total_cpu_quota']
98
- else
99
- self.total_cpu_quota = nil
100
- end
101
-
102
- if attributes.key?(:'current_cpu_usage')
103
- self.current_cpu_usage = attributes[:'current_cpu_usage']
104
- else
105
- self.current_cpu_usage = 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?(:'current_memory_usage')
115
- self.current_memory_usage = attributes[:'current_memory_usage']
116
- else
117
- self.current_memory_usage = nil
118
- end
119
-
120
- if attributes.key?(:'total_disk_quota')
121
- self.total_disk_quota = attributes[:'total_disk_quota']
122
- else
123
- self.total_disk_quota = nil
124
- end
125
-
126
- if attributes.key?(:'current_disk_usage')
127
- self.current_disk_usage = attributes[:'current_disk_usage']
128
- else
129
- self.current_disk_usage = nil
130
- end
131
- end
132
-
133
- # Show invalid properties with the reasons. Usually used together with valid?
134
- # @return Array for valid properties with the reasons
135
- def list_invalid_properties
136
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
137
- invalid_properties = Array.new
138
- if @region_id.nil?
139
- invalid_properties.push('invalid value for "region_id", region_id cannot be nil.')
140
- end
141
-
142
- if @total_cpu_quota.nil?
143
- invalid_properties.push('invalid value for "total_cpu_quota", total_cpu_quota cannot be nil.')
144
- end
145
-
146
- if @current_cpu_usage.nil?
147
- invalid_properties.push('invalid value for "current_cpu_usage", current_cpu_usage cannot be nil.')
148
- end
149
-
150
- if @total_memory_quota.nil?
151
- invalid_properties.push('invalid value for "total_memory_quota", total_memory_quota cannot be nil.')
152
- end
153
-
154
- if @current_memory_usage.nil?
155
- invalid_properties.push('invalid value for "current_memory_usage", current_memory_usage cannot be nil.')
156
- end
157
-
158
- if @total_disk_quota.nil?
159
- invalid_properties.push('invalid value for "total_disk_quota", total_disk_quota cannot be nil.')
160
- end
161
-
162
- if @current_disk_usage.nil?
163
- invalid_properties.push('invalid value for "current_disk_usage", current_disk_usage cannot be nil.')
164
- end
165
-
166
- invalid_properties
167
- end
168
-
169
- # Check to see if the all the properties in the model are valid
170
- # @return true if the model is valid
171
- def valid?
172
- warn '[DEPRECATED] the `valid?` method is obsolete'
173
- return false if @region_id.nil?
174
- return false if @total_cpu_quota.nil?
175
- return false if @current_cpu_usage.nil?
176
- return false if @total_memory_quota.nil?
177
- return false if @current_memory_usage.nil?
178
- return false if @total_disk_quota.nil?
179
- return false if @current_disk_usage.nil?
180
- true
181
- end
182
-
183
- # Custom attribute writer method with validation
184
- # @param [Object] region_id Value to be assigned
185
- def region_id=(region_id)
186
- if region_id.nil?
187
- fail ArgumentError, 'region_id cannot be nil'
188
- end
189
-
190
- @region_id = region_id
191
- end
192
-
193
- # Custom attribute writer method with validation
194
- # @param [Object] total_cpu_quota Value to be assigned
195
- def total_cpu_quota=(total_cpu_quota)
196
- if total_cpu_quota.nil?
197
- fail ArgumentError, 'total_cpu_quota cannot be nil'
198
- end
199
-
200
- @total_cpu_quota = total_cpu_quota
201
- end
202
-
203
- # Custom attribute writer method with validation
204
- # @param [Object] current_cpu_usage Value to be assigned
205
- def current_cpu_usage=(current_cpu_usage)
206
- if current_cpu_usage.nil?
207
- fail ArgumentError, 'current_cpu_usage cannot be nil'
208
- end
209
-
210
- @current_cpu_usage = current_cpu_usage
211
- end
212
-
213
- # Custom attribute writer method with validation
214
- # @param [Object] total_memory_quota Value to be assigned
215
- def total_memory_quota=(total_memory_quota)
216
- if total_memory_quota.nil?
217
- fail ArgumentError, 'total_memory_quota cannot be nil'
218
- end
219
-
220
- @total_memory_quota = total_memory_quota
221
- end
222
-
223
- # Custom attribute writer method with validation
224
- # @param [Object] current_memory_usage Value to be assigned
225
- def current_memory_usage=(current_memory_usage)
226
- if current_memory_usage.nil?
227
- fail ArgumentError, 'current_memory_usage cannot be nil'
228
- end
229
-
230
- @current_memory_usage = current_memory_usage
231
- end
232
-
233
- # Custom attribute writer method with validation
234
- # @param [Object] total_disk_quota Value to be assigned
235
- def total_disk_quota=(total_disk_quota)
236
- if total_disk_quota.nil?
237
- fail ArgumentError, 'total_disk_quota cannot be nil'
238
- end
239
-
240
- @total_disk_quota = total_disk_quota
241
- end
242
-
243
- # Custom attribute writer method with validation
244
- # @param [Object] current_disk_usage Value to be assigned
245
- def current_disk_usage=(current_disk_usage)
246
- if current_disk_usage.nil?
247
- fail ArgumentError, 'current_disk_usage cannot be nil'
248
- end
249
-
250
- @current_disk_usage = current_disk_usage
251
- end
252
-
253
- # Checks equality by comparing each attribute.
254
- # @param [Object] Object to be compared
255
- def ==(o)
256
- return true if self.equal?(o)
257
- self.class == o.class &&
258
- region_id == o.region_id &&
259
- total_cpu_quota == o.total_cpu_quota &&
260
- current_cpu_usage == o.current_cpu_usage &&
261
- total_memory_quota == o.total_memory_quota &&
262
- current_memory_usage == o.current_memory_usage &&
263
- total_disk_quota == o.total_disk_quota &&
264
- current_disk_usage == o.current_disk_usage
265
- end
266
-
267
- # @see the `==` method
268
- # @param [Object] Object to be compared
269
- def eql?(o)
270
- self == o
271
- end
272
-
273
- # Calculates hash code according to all attributes.
274
- # @return [Integer] Hash code
275
- def hash
276
- [region_id, total_cpu_quota, current_cpu_usage, total_memory_quota, current_memory_usage, total_disk_quota, current_disk_usage].hash
277
- end
278
-
279
- # Builds the object from hash
280
- # @param [Hash] attributes Model attributes in the form of hash
281
- # @return [Object] Returns the model itself
282
- def self.build_from_hash(attributes)
283
- return nil unless attributes.is_a?(Hash)
284
- attributes = attributes.transform_keys(&:to_sym)
285
- transformed_hash = {}
286
- openapi_types.each_pair do |key, type|
287
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
288
- transformed_hash["#{key}"] = nil
289
- elsif type =~ /\AArray<(.*)>/i
290
- # check to ensure the input is an array given that the attribute
291
- # is documented as an array but the input is not
292
- if attributes[attribute_map[key]].is_a?(Array)
293
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
294
- end
295
- elsif !attributes[attribute_map[key]].nil?
296
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
297
- end
298
- end
299
- new(transformed_hash)
300
- end
301
-
302
- # Deserializes the data based on type
303
- # @param string type Data type
304
- # @param string value Value to be deserialized
305
- # @return [Object] Deserialized data
306
- def self._deserialize(type, value)
307
- case type.to_sym
308
- when :Time
309
- Time.parse(value)
310
- when :Date
311
- Date.parse(value)
312
- when :String
313
- value.to_s
314
- when :Integer
315
- value.to_i
316
- when :Float
317
- value.to_f
318
- when :Boolean
319
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
320
- true
321
- else
322
- false
323
- end
324
- when :Object
325
- # generic object (usually a Hash), return directly
326
- value
327
- when /\AArray<(?<inner_type>.+)>\z/
328
- inner_type = Regexp.last_match[:inner_type]
329
- value.map { |v| _deserialize(inner_type, v) }
330
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
331
- k_type = Regexp.last_match[:k_type]
332
- v_type = Regexp.last_match[:v_type]
333
- {}.tap do |hash|
334
- value.each do |k, v|
335
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
336
- end
337
- end
338
- else # model
339
- # models (e.g. Pet) or oneOf
340
- klass = DaytonaApiClient.const_get(type)
341
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
342
- end
343
- end
344
-
345
- # Returns the string representation of the object
346
- # @return [String] String presentation of the object
347
- def to_s
348
- to_hash.to_s
349
- end
350
-
351
- # to_body is an alias to to_hash (backward compatibility)
352
- # @return [Hash] Returns the object in the form of hash
353
- def to_body
354
- to_hash
355
- end
356
-
357
- # Returns the object in the form of hash
358
- # @return [Hash] Returns the object in the form of hash
359
- def to_hash
360
- hash = {}
361
- self.class.attribute_map.each_pair do |attr, param|
362
- value = self.send(attr)
363
- if value.nil?
364
- is_nullable = self.class.openapi_nullable.include?(attr)
365
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
366
- end
367
-
368
- hash[param] = _to_hash(value)
369
- end
370
- hash
371
- end
372
-
373
- # Outputs non-array value in the form of hash
374
- # For object, use to_hash. Otherwise, just return the value
375
- # @param [Object] value Any valid value
376
- # @return [Hash] Returns the value in the form of hash
377
- def _to_hash(value)
378
- if value.is_a?(Array)
379
- value.compact.map { |v| _to_hash(v) }
380
- elsif value.is_a?(Hash)
381
- {}.tap do |hash|
382
- value.each { |k, v| hash[k] = _to_hash(v) }
383
- end
384
- elsif value.respond_to? :to_hash
385
- value.to_hash
386
- else
387
- value
388
- end
389
- end
390
-
391
- end
392
-
393
- end
@@ -1,298 +0,0 @@
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 ResizeSandbox
18
- # CPU cores to allocate to the sandbox (minimum: 1)
19
- attr_accessor :cpu
20
-
21
- # Memory in GB to allocate to the sandbox (minimum: 1)
22
- attr_accessor :memory
23
-
24
- # Disk space in GB to allocate to the sandbox (can only be increased)
25
- attr_accessor :disk
26
-
27
- # Attribute mapping from ruby-style variable name to JSON key.
28
- def self.attribute_map
29
- {
30
- :'cpu' => :'cpu',
31
- :'memory' => :'memory',
32
- :'disk' => :'disk'
33
- }
34
- end
35
-
36
- # Returns attribute mapping this model knows about
37
- def self.acceptable_attribute_map
38
- attribute_map
39
- end
40
-
41
- # Returns all the JSON keys this model knows about
42
- def self.acceptable_attributes
43
- acceptable_attribute_map.values
44
- end
45
-
46
- # Attribute type mapping.
47
- def self.openapi_types
48
- {
49
- :'cpu' => :'Integer',
50
- :'memory' => :'Integer',
51
- :'disk' => :'Integer'
52
- }
53
- end
54
-
55
- # List of attributes with nullable: true
56
- def self.openapi_nullable
57
- Set.new([
58
- ])
59
- end
60
-
61
- # Initializes the object
62
- # @param [Hash] attributes Model attributes in the form of hash
63
- def initialize(attributes = {})
64
- if (!attributes.is_a?(Hash))
65
- fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::ResizeSandbox` initialize method"
66
- end
67
-
68
- # check to see if the attribute exists and convert string to symbol for hash key
69
- acceptable_attribute_map = self.class.acceptable_attribute_map
70
- attributes = attributes.each_with_object({}) { |(k, v), h|
71
- if (!acceptable_attribute_map.key?(k.to_sym))
72
- fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::ResizeSandbox`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
- end
74
- h[k.to_sym] = v
75
- }
76
-
77
- if attributes.key?(:'cpu')
78
- self.cpu = attributes[:'cpu']
79
- end
80
-
81
- if attributes.key?(:'memory')
82
- self.memory = attributes[:'memory']
83
- end
84
-
85
- if attributes.key?(:'disk')
86
- self.disk = attributes[:'disk']
87
- end
88
- end
89
-
90
- # Show invalid properties with the reasons. Usually used together with valid?
91
- # @return Array for valid properties with the reasons
92
- def list_invalid_properties
93
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
94
- invalid_properties = Array.new
95
- if !@cpu.nil? && @cpu < 1
96
- invalid_properties.push('invalid value for "cpu", must be greater than or equal to 1.')
97
- end
98
-
99
- if !@memory.nil? && @memory < 1
100
- invalid_properties.push('invalid value for "memory", must be greater than or equal to 1.')
101
- end
102
-
103
- if !@disk.nil? && @disk < 1
104
- invalid_properties.push('invalid value for "disk", must be greater than or equal to 1.')
105
- end
106
-
107
- invalid_properties
108
- end
109
-
110
- # Check to see if the all the properties in the model are valid
111
- # @return true if the model is valid
112
- def valid?
113
- warn '[DEPRECATED] the `valid?` method is obsolete'
114
- return false if !@cpu.nil? && @cpu < 1
115
- return false if !@memory.nil? && @memory < 1
116
- return false if !@disk.nil? && @disk < 1
117
- true
118
- end
119
-
120
- # Custom attribute writer method with validation
121
- # @param [Object] cpu Value to be assigned
122
- def cpu=(cpu)
123
- if cpu.nil?
124
- fail ArgumentError, 'cpu cannot be nil'
125
- end
126
-
127
- if cpu < 1
128
- fail ArgumentError, 'invalid value for "cpu", must be greater than or equal to 1.'
129
- end
130
-
131
- @cpu = cpu
132
- end
133
-
134
- # Custom attribute writer method with validation
135
- # @param [Object] memory Value to be assigned
136
- def memory=(memory)
137
- if memory.nil?
138
- fail ArgumentError, 'memory cannot be nil'
139
- end
140
-
141
- if memory < 1
142
- fail ArgumentError, 'invalid value for "memory", must be greater than or equal to 1.'
143
- end
144
-
145
- @memory = memory
146
- end
147
-
148
- # Custom attribute writer method with validation
149
- # @param [Object] disk Value to be assigned
150
- def disk=(disk)
151
- if disk.nil?
152
- fail ArgumentError, 'disk cannot be nil'
153
- end
154
-
155
- if disk < 1
156
- fail ArgumentError, 'invalid value for "disk", must be greater than or equal to 1.'
157
- end
158
-
159
- @disk = disk
160
- end
161
-
162
- # Checks equality by comparing each attribute.
163
- # @param [Object] Object to be compared
164
- def ==(o)
165
- return true if self.equal?(o)
166
- self.class == o.class &&
167
- cpu == o.cpu &&
168
- memory == o.memory &&
169
- disk == o.disk
170
- end
171
-
172
- # @see the `==` method
173
- # @param [Object] Object to be compared
174
- def eql?(o)
175
- self == o
176
- end
177
-
178
- # Calculates hash code according to all attributes.
179
- # @return [Integer] Hash code
180
- def hash
181
- [cpu, memory, disk].hash
182
- end
183
-
184
- # Builds the object from hash
185
- # @param [Hash] attributes Model attributes in the form of hash
186
- # @return [Object] Returns the model itself
187
- def self.build_from_hash(attributes)
188
- return nil unless attributes.is_a?(Hash)
189
- attributes = attributes.transform_keys(&:to_sym)
190
- transformed_hash = {}
191
- openapi_types.each_pair do |key, type|
192
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
193
- transformed_hash["#{key}"] = nil
194
- elsif type =~ /\AArray<(.*)>/i
195
- # check to ensure the input is an array given that the attribute
196
- # is documented as an array but the input is not
197
- if attributes[attribute_map[key]].is_a?(Array)
198
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
199
- end
200
- elsif !attributes[attribute_map[key]].nil?
201
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
202
- end
203
- end
204
- new(transformed_hash)
205
- end
206
-
207
- # Deserializes the data based on type
208
- # @param string type Data type
209
- # @param string value Value to be deserialized
210
- # @return [Object] Deserialized data
211
- def self._deserialize(type, value)
212
- case type.to_sym
213
- when :Time
214
- Time.parse(value)
215
- when :Date
216
- Date.parse(value)
217
- when :String
218
- value.to_s
219
- when :Integer
220
- value.to_i
221
- when :Float
222
- value.to_f
223
- when :Boolean
224
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
225
- true
226
- else
227
- false
228
- end
229
- when :Object
230
- # generic object (usually a Hash), return directly
231
- value
232
- when /\AArray<(?<inner_type>.+)>\z/
233
- inner_type = Regexp.last_match[:inner_type]
234
- value.map { |v| _deserialize(inner_type, v) }
235
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
236
- k_type = Regexp.last_match[:k_type]
237
- v_type = Regexp.last_match[:v_type]
238
- {}.tap do |hash|
239
- value.each do |k, v|
240
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
241
- end
242
- end
243
- else # model
244
- # models (e.g. Pet) or oneOf
245
- klass = DaytonaApiClient.const_get(type)
246
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
247
- end
248
- end
249
-
250
- # Returns the string representation of the object
251
- # @return [String] String presentation of the object
252
- def to_s
253
- to_hash.to_s
254
- end
255
-
256
- # to_body is an alias to to_hash (backward compatibility)
257
- # @return [Hash] Returns the object in the form of hash
258
- def to_body
259
- to_hash
260
- end
261
-
262
- # Returns the object in the form of hash
263
- # @return [Hash] Returns the object in the form of hash
264
- def to_hash
265
- hash = {}
266
- self.class.attribute_map.each_pair do |attr, param|
267
- value = self.send(attr)
268
- if value.nil?
269
- is_nullable = self.class.openapi_nullable.include?(attr)
270
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
271
- end
272
-
273
- hash[param] = _to_hash(value)
274
- end
275
- hash
276
- end
277
-
278
- # Outputs non-array value in the form of hash
279
- # For object, use to_hash. Otherwise, just return the value
280
- # @param [Object] value Any valid value
281
- # @return [Hash] Returns the value in the form of hash
282
- def _to_hash(value)
283
- if value.is_a?(Array)
284
- value.compact.map { |v| _to_hash(v) }
285
- elsif value.is_a?(Hash)
286
- {}.tap do |hash|
287
- value.each { |k, v| hash[k] = _to_hash(v) }
288
- end
289
- elsif value.respond_to? :to_hash
290
- value.to_hash
291
- else
292
- value
293
- end
294
- end
295
-
296
- end
297
-
298
- end