daytona_api_client 0.167.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 (210) 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 +139 -9
  7. data/lib/daytona_api_client/api/docker_registry_api.rb +66 -5
  8. data/lib/daytona_api_client/api/health_api.rb +2 -53
  9. data/lib/daytona_api_client/api/organizations_api.rb +162 -953
  10. data/lib/daytona_api_client/api/preview_api.rb +7 -76
  11. data/lib/daytona_api_client/api/runners_api.rb +21 -408
  12. data/lib/daytona_api_client/api/sandbox_api.rb +214 -1462
  13. data/lib/daytona_api_client/api/snapshots_api.rb +110 -36
  14. data/lib/daytona_api_client/api/toolbox_api.rb +740 -740
  15. data/lib/daytona_api_client/api/users_api.rb +238 -1
  16. data/lib/daytona_api_client/api/volumes_api.rb +1 -1
  17. data/lib/daytona_api_client/api/webhooks_api.rb +267 -4
  18. data/lib/daytona_api_client/api/workspace_api.rb +5 -5
  19. data/lib/daytona_api_client/api_client.rb +1 -1
  20. data/lib/daytona_api_client/configuration.rb +1 -4
  21. data/lib/daytona_api_client/models/account_provider.rb +0 -2
  22. data/lib/daytona_api_client/models/announcement.rb +0 -2
  23. data/lib/daytona_api_client/models/api_key_list.rb +0 -2
  24. data/lib/daytona_api_client/models/api_key_response.rb +0 -2
  25. data/lib/daytona_api_client/models/audit_log.rb +1 -21
  26. data/lib/daytona_api_client/models/build_info.rb +4 -33
  27. data/lib/daytona_api_client/models/command.rb +0 -2
  28. data/lib/daytona_api_client/models/completion_context.rb +0 -2
  29. data/lib/daytona_api_client/models/completion_item.rb +0 -2
  30. data/lib/daytona_api_client/models/completion_list.rb +0 -2
  31. data/lib/daytona_api_client/models/compressed_screenshot_response.rb +0 -2
  32. data/lib/daytona_api_client/models/computer_use_start_response.rb +0 -2
  33. data/lib/daytona_api_client/models/computer_use_status_response.rb +0 -2
  34. data/lib/daytona_api_client/models/computer_use_stop_response.rb +0 -2
  35. data/lib/daytona_api_client/models/create_api_key.rb +1 -3
  36. data/lib/daytona_api_client/models/{job.rb → create_audit_log.rb} +79 -168
  37. data/lib/daytona_api_client/models/create_build_info.rb +0 -2
  38. data/lib/daytona_api_client/models/create_docker_registry.rb +65 -6
  39. data/lib/daytona_api_client/models/create_linked_account.rb +0 -2
  40. data/lib/daytona_api_client/models/create_organization.rb +4 -33
  41. data/lib/daytona_api_client/models/create_organization_invitation.rb +0 -2
  42. data/lib/daytona_api_client/models/create_organization_quota.rb +0 -2
  43. data/lib/daytona_api_client/models/create_organization_role.rb +0 -2
  44. data/lib/daytona_api_client/models/create_runner.rb +315 -33
  45. data/lib/daytona_api_client/models/create_sandbox.rb +1 -13
  46. data/lib/daytona_api_client/models/create_session_request.rb +0 -2
  47. data/lib/daytona_api_client/models/create_snapshot.rb +14 -16
  48. data/lib/daytona_api_client/models/create_user.rb +1 -12
  49. data/lib/daytona_api_client/models/create_volume.rb +0 -2
  50. data/lib/daytona_api_client/models/create_workspace.rb +0 -2
  51. data/lib/daytona_api_client/models/daytona_configuration.rb +4 -53
  52. data/lib/daytona_api_client/models/display_info_response.rb +0 -2
  53. data/lib/daytona_api_client/models/docker_registry.rb +0 -2
  54. data/lib/daytona_api_client/models/download_files.rb +0 -2
  55. data/lib/daytona_api_client/models/execute_request.rb +0 -2
  56. data/lib/daytona_api_client/models/execute_response.rb +0 -2
  57. data/lib/daytona_api_client/models/file_info.rb +0 -2
  58. data/lib/daytona_api_client/models/file_status.rb +0 -2
  59. data/lib/daytona_api_client/models/git_add_request.rb +0 -2
  60. data/lib/daytona_api_client/models/git_branch_request.rb +0 -2
  61. data/lib/daytona_api_client/models/git_checkout_request.rb +0 -2
  62. data/lib/daytona_api_client/models/git_clone_request.rb +0 -2
  63. data/lib/daytona_api_client/models/git_commit_info.rb +0 -2
  64. data/lib/daytona_api_client/models/git_commit_request.rb +0 -2
  65. data/lib/daytona_api_client/models/git_commit_response.rb +0 -2
  66. data/lib/daytona_api_client/models/git_delete_branch_request.rb +0 -2
  67. data/lib/daytona_api_client/models/git_repo_request.rb +0 -2
  68. data/lib/daytona_api_client/models/git_status.rb +0 -2
  69. data/lib/daytona_api_client/models/health_controller_check200_response.rb +0 -2
  70. data/lib/daytona_api_client/models/health_controller_check200_response_info_value.rb +0 -2
  71. data/lib/daytona_api_client/models/health_controller_check503_response.rb +0 -2
  72. data/lib/daytona_api_client/models/keyboard_hotkey_request.rb +0 -2
  73. data/lib/daytona_api_client/models/keyboard_press_request.rb +0 -2
  74. data/lib/daytona_api_client/models/keyboard_type_request.rb +0 -2
  75. data/lib/daytona_api_client/models/list_branch_response.rb +0 -2
  76. data/lib/daytona_api_client/models/lsp_completion_params.rb +0 -2
  77. data/lib/daytona_api_client/models/lsp_document_request.rb +0 -2
  78. data/lib/daytona_api_client/models/lsp_location.rb +0 -2
  79. data/lib/daytona_api_client/models/lsp_server_request.rb +0 -2
  80. data/lib/daytona_api_client/models/lsp_symbol.rb +0 -2
  81. data/lib/daytona_api_client/models/match.rb +0 -2
  82. data/lib/daytona_api_client/models/mouse_click_request.rb +0 -2
  83. data/lib/daytona_api_client/models/mouse_click_response.rb +0 -2
  84. data/lib/daytona_api_client/models/mouse_drag_request.rb +0 -2
  85. data/lib/daytona_api_client/models/mouse_drag_response.rb +0 -2
  86. data/lib/daytona_api_client/models/mouse_move_request.rb +0 -2
  87. data/lib/daytona_api_client/models/mouse_move_response.rb +0 -2
  88. data/lib/daytona_api_client/models/mouse_position.rb +0 -2
  89. data/lib/daytona_api_client/models/mouse_scroll_request.rb +0 -2
  90. data/lib/daytona_api_client/models/mouse_scroll_response.rb +0 -2
  91. data/lib/daytona_api_client/models/oidc_config.rb +0 -2
  92. data/lib/daytona_api_client/models/organization.rb +85 -148
  93. data/lib/daytona_api_client/models/organization_invitation.rb +0 -2
  94. data/lib/daytona_api_client/models/organization_role.rb +0 -2
  95. data/lib/daytona_api_client/models/organization_sandbox_default_limited_network_egress.rb +0 -2
  96. data/lib/daytona_api_client/models/organization_suspension.rb +5 -9
  97. data/lib/daytona_api_client/models/organization_usage_overview.rb +146 -20
  98. data/lib/daytona_api_client/models/organization_user.rb +0 -2
  99. data/lib/daytona_api_client/models/paginated_audit_logs.rb +4 -16
  100. data/lib/daytona_api_client/models/paginated_sandboxes.rb +0 -2
  101. data/lib/daytona_api_client/models/paginated_snapshots.rb +0 -2
  102. data/lib/daytona_api_client/models/{paginated_jobs.rb → paginated_snapshots_dto.rb} +4 -6
  103. data/lib/daytona_api_client/models/port_preview_url.rb +14 -33
  104. data/lib/daytona_api_client/models/position.rb +0 -2
  105. data/lib/daytona_api_client/models/posthog_config.rb +0 -2
  106. data/lib/daytona_api_client/models/process_errors_response.rb +0 -2
  107. data/lib/daytona_api_client/models/process_logs_response.rb +0 -2
  108. data/lib/daytona_api_client/models/process_restart_response.rb +0 -2
  109. data/lib/daytona_api_client/models/process_status_response.rb +0 -2
  110. data/lib/daytona_api_client/models/project_dir_response.rb +0 -2
  111. data/lib/daytona_api_client/models/pty_create_request.rb +0 -2
  112. data/lib/daytona_api_client/models/pty_create_response.rb +0 -2
  113. data/lib/daytona_api_client/models/pty_list_response.rb +0 -2
  114. data/lib/daytona_api_client/models/pty_resize_request.rb +0 -2
  115. data/lib/daytona_api_client/models/pty_session_info.rb +0 -2
  116. data/lib/daytona_api_client/models/range.rb +0 -2
  117. data/lib/daytona_api_client/models/region.rb +4 -180
  118. data/lib/daytona_api_client/models/region_screenshot_response.rb +0 -2
  119. data/lib/daytona_api_client/models/registry_push_access_dto.rb +0 -2
  120. data/lib/daytona_api_client/models/replace_request.rb +0 -2
  121. data/lib/daytona_api_client/models/replace_result.rb +0 -2
  122. data/lib/daytona_api_client/models/runner.rb +117 -108
  123. data/lib/daytona_api_client/models/runner_snapshot_dto.rb +17 -2
  124. data/lib/daytona_api_client/models/sandbox.rb +14 -80
  125. data/lib/daytona_api_client/models/sandbox_info.rb +0 -2
  126. data/lib/daytona_api_client/models/sandbox_labels.rb +0 -2
  127. data/lib/daytona_api_client/models/sandbox_state.rb +1 -4
  128. data/lib/daytona_api_client/models/sandbox_volume.rb +4 -16
  129. data/lib/daytona_api_client/models/screenshot_response.rb +0 -2
  130. data/lib/daytona_api_client/models/search_files_response.rb +0 -2
  131. data/lib/daytona_api_client/models/send_webhook_dto.rb +1 -25
  132. data/lib/daytona_api_client/models/session.rb +0 -2
  133. data/lib/daytona_api_client/models/session_execute_request.rb +0 -2
  134. data/lib/daytona_api_client/models/session_execute_response.rb +0 -2
  135. data/lib/daytona_api_client/models/set_snapshot_general_status_dto.rb +0 -2
  136. data/lib/daytona_api_client/models/snapshot_dto.rb +4 -38
  137. data/lib/daytona_api_client/models/snapshot_state.rb +4 -1
  138. data/lib/daytona_api_client/models/ssh_access_dto.rb +4 -33
  139. data/lib/daytona_api_client/models/ssh_access_validation_dto.rb +24 -6
  140. data/lib/daytona_api_client/models/storage_access_dto.rb +0 -2
  141. data/lib/daytona_api_client/models/update_docker_registry.rb +0 -2
  142. data/lib/daytona_api_client/models/update_organization_invitation.rb +0 -2
  143. data/lib/daytona_api_client/models/update_organization_member_access.rb +0 -2
  144. data/lib/daytona_api_client/models/update_organization_quota.rb +41 -92
  145. data/lib/daytona_api_client/models/update_organization_role.rb +0 -2
  146. data/lib/daytona_api_client/models/update_sandbox_state_dto.rb +6 -28
  147. data/lib/daytona_api_client/models/user.rb +0 -2
  148. data/lib/daytona_api_client/models/user_home_dir_response.rb +0 -2
  149. data/lib/daytona_api_client/models/user_public_key.rb +0 -2
  150. data/lib/daytona_api_client/models/volume_dto.rb +0 -2
  151. data/lib/daytona_api_client/models/webhook_app_portal_access.rb +1 -30
  152. data/lib/daytona_api_client/models/{admin_get_webhook_status200_response.rb → webhook_controller_get_status200_response.rb} +3 -5
  153. data/lib/daytona_api_client/models/webhook_initialization_status.rb +0 -2
  154. data/lib/daytona_api_client/models/windows_response.rb +0 -2
  155. data/lib/daytona_api_client/models/work_dir_response.rb +0 -2
  156. data/lib/daytona_api_client/models/workspace.rb +27 -66
  157. data/lib/daytona_api_client/version.rb +1 -1
  158. data/lib/daytona_api_client.rb +2 -46
  159. data/project.json +11 -38
  160. metadata +6 -54
  161. data/.gitignore +0 -39
  162. data/.openapi-generator/FILES +0 -209
  163. data/.openapi-generator/VERSION +0 -1
  164. data/.openapi-generator-ignore +0 -31
  165. data/.rspec +0 -2
  166. data/.rubocop.yml +0 -148
  167. data/fix-gemspec.sh +0 -11
  168. data/lib/daytona_api_client/api/admin_api.rb +0 -1151
  169. data/lib/daytona_api_client/api/jobs_api.rb +0 -299
  170. data/lib/daytona_api_client/api/regions_api.rb +0 -77
  171. data/lib/daytona_api_client/models/admin_create_runner.rb +0 -387
  172. data/lib/daytona_api_client/models/create_region.rb +0 -271
  173. data/lib/daytona_api_client/models/create_region_response.rb +0 -282
  174. data/lib/daytona_api_client/models/create_runner_response.rb +0 -265
  175. data/lib/daytona_api_client/models/create_sandbox_snapshot.rb +0 -238
  176. data/lib/daytona_api_client/models/fork_sandbox.rb +0 -221
  177. data/lib/daytona_api_client/models/job_status.rb +0 -42
  178. data/lib/daytona_api_client/models/job_type.rb +0 -52
  179. data/lib/daytona_api_client/models/log_entry.rb +0 -407
  180. data/lib/daytona_api_client/models/metric_data_point.rb +0 -265
  181. data/lib/daytona_api_client/models/metric_series.rb +0 -267
  182. data/lib/daytona_api_client/models/metrics_response.rb +0 -240
  183. data/lib/daytona_api_client/models/otel_config.rb +0 -251
  184. data/lib/daytona_api_client/models/paginated_logs.rb +0 -321
  185. data/lib/daytona_api_client/models/paginated_traces.rb +0 -321
  186. data/lib/daytona_api_client/models/poll_jobs_response.rb +0 -240
  187. data/lib/daytona_api_client/models/rate_limit_config.rb +0 -251
  188. data/lib/daytona_api_client/models/rate_limit_entry.rb +0 -231
  189. data/lib/daytona_api_client/models/regenerate_api_key_response.rb +0 -238
  190. data/lib/daytona_api_client/models/region_quota.rb +0 -389
  191. data/lib/daytona_api_client/models/region_type.rb +0 -41
  192. data/lib/daytona_api_client/models/region_usage_overview.rb +0 -393
  193. data/lib/daytona_api_client/models/resize_sandbox.rb +0 -298
  194. data/lib/daytona_api_client/models/runner_class.rb +0 -40
  195. data/lib/daytona_api_client/models/runner_full.rb +0 -808
  196. data/lib/daytona_api_client/models/runner_health_metrics.rb +0 -535
  197. data/lib/daytona_api_client/models/runner_healthcheck.rb +0 -290
  198. data/lib/daytona_api_client/models/runner_service_health.rb +0 -275
  199. data/lib/daytona_api_client/models/signed_port_preview_url.rb +0 -319
  200. data/lib/daytona_api_client/models/snapshot_manager_credentials.rb +0 -265
  201. data/lib/daytona_api_client/models/toolbox_proxy_url.rb +0 -238
  202. data/lib/daytona_api_client/models/trace_span.rb +0 -405
  203. data/lib/daytona_api_client/models/trace_summary.rb +0 -383
  204. data/lib/daytona_api_client/models/update_job_status.rb +0 -280
  205. data/lib/daytona_api_client/models/update_organization_default_region.rb +0 -238
  206. data/lib/daytona_api_client/models/update_organization_region_quota.rb +0 -287
  207. data/lib/daytona_api_client/models/update_region.rb +0 -244
  208. data/lib/daytona_api_client/models/url.rb +0 -238
  209. data/lib/daytona_api_client/models/webhook_event.rb +0 -45
  210. data/lib/daytona_api_client/models/workspace_port_preview_url.rb +0 -265
@@ -1,808 +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 RunnerFull
18
- # The ID of the runner
19
- attr_accessor :id
20
-
21
- # The domain of the runner
22
- attr_accessor :domain
23
-
24
- # The API URL of the runner
25
- attr_accessor :api_url
26
-
27
- # The proxy URL of the runner
28
- attr_accessor :proxy_url
29
-
30
- # The CPU capacity of the runner
31
- attr_accessor :cpu
32
-
33
- # The memory capacity of the runner in GiB
34
- attr_accessor :memory
35
-
36
- # The disk capacity of the runner in GiB
37
- attr_accessor :disk
38
-
39
- # The GPU capacity of the runner
40
- attr_accessor :gpu
41
-
42
- # The type of GPU
43
- attr_accessor :gpu_type
44
-
45
- # The class of the runner
46
- attr_accessor :_class
47
-
48
- # Current CPU usage percentage
49
- attr_accessor :current_cpu_usage_percentage
50
-
51
- # Current RAM usage percentage
52
- attr_accessor :current_memory_usage_percentage
53
-
54
- # Current disk usage percentage
55
- attr_accessor :current_disk_usage_percentage
56
-
57
- # Current allocated CPU
58
- attr_accessor :current_allocated_cpu
59
-
60
- # Current allocated memory in GiB
61
- attr_accessor :current_allocated_memory_gi_b
62
-
63
- # Current allocated disk in GiB
64
- attr_accessor :current_allocated_disk_gi_b
65
-
66
- # Current snapshot count
67
- attr_accessor :current_snapshot_count
68
-
69
- # Current number of started sandboxes
70
- attr_accessor :current_started_sandboxes
71
-
72
- # Runner availability score
73
- attr_accessor :availability_score
74
-
75
- # The region of the runner
76
- attr_accessor :region
77
-
78
- # The name of the runner
79
- attr_accessor :name
80
-
81
- # The state of the runner
82
- attr_accessor :state
83
-
84
- # The last time the runner was checked
85
- attr_accessor :last_checked
86
-
87
- # Whether the runner is unschedulable
88
- attr_accessor :unschedulable
89
-
90
- # The creation timestamp of the runner
91
- attr_accessor :created_at
92
-
93
- # The last update timestamp of the runner
94
- attr_accessor :updated_at
95
-
96
- # The version of the runner (deprecated in favor of apiVersion)
97
- attr_accessor :version
98
-
99
- # The api version of the runner
100
- attr_accessor :api_version
101
-
102
- # The class of the runner
103
- attr_accessor :runner_class
104
-
105
- # The app version of the runner
106
- attr_accessor :app_version
107
-
108
- # The API key for the runner
109
- attr_accessor :api_key
110
-
111
- # The region type of the runner
112
- attr_accessor :region_type
113
-
114
- class EnumAttributeValidator
115
- attr_reader :datatype
116
- attr_reader :allowable_values
117
-
118
- def initialize(datatype, allowable_values)
119
- @allowable_values = allowable_values.map do |value|
120
- case datatype.to_s
121
- when /Integer/i
122
- value.to_i
123
- when /Float/i
124
- value.to_f
125
- else
126
- value
127
- end
128
- end
129
- end
130
-
131
- def valid?(value)
132
- !value || allowable_values.include?(value)
133
- end
134
- end
135
-
136
- # Attribute mapping from ruby-style variable name to JSON key.
137
- def self.attribute_map
138
- {
139
- :'id' => :'id',
140
- :'domain' => :'domain',
141
- :'api_url' => :'apiUrl',
142
- :'proxy_url' => :'proxyUrl',
143
- :'cpu' => :'cpu',
144
- :'memory' => :'memory',
145
- :'disk' => :'disk',
146
- :'gpu' => :'gpu',
147
- :'gpu_type' => :'gpuType',
148
- :'_class' => :'class',
149
- :'current_cpu_usage_percentage' => :'currentCpuUsagePercentage',
150
- :'current_memory_usage_percentage' => :'currentMemoryUsagePercentage',
151
- :'current_disk_usage_percentage' => :'currentDiskUsagePercentage',
152
- :'current_allocated_cpu' => :'currentAllocatedCpu',
153
- :'current_allocated_memory_gi_b' => :'currentAllocatedMemoryGiB',
154
- :'current_allocated_disk_gi_b' => :'currentAllocatedDiskGiB',
155
- :'current_snapshot_count' => :'currentSnapshotCount',
156
- :'current_started_sandboxes' => :'currentStartedSandboxes',
157
- :'availability_score' => :'availabilityScore',
158
- :'region' => :'region',
159
- :'name' => :'name',
160
- :'state' => :'state',
161
- :'last_checked' => :'lastChecked',
162
- :'unschedulable' => :'unschedulable',
163
- :'created_at' => :'createdAt',
164
- :'updated_at' => :'updatedAt',
165
- :'version' => :'version',
166
- :'api_version' => :'apiVersion',
167
- :'runner_class' => :'runnerClass',
168
- :'app_version' => :'appVersion',
169
- :'api_key' => :'apiKey',
170
- :'region_type' => :'regionType'
171
- }
172
- end
173
-
174
- # Returns attribute mapping this model knows about
175
- def self.acceptable_attribute_map
176
- attribute_map
177
- end
178
-
179
- # Returns all the JSON keys this model knows about
180
- def self.acceptable_attributes
181
- acceptable_attribute_map.values
182
- end
183
-
184
- # Attribute type mapping.
185
- def self.openapi_types
186
- {
187
- :'id' => :'String',
188
- :'domain' => :'String',
189
- :'api_url' => :'String',
190
- :'proxy_url' => :'String',
191
- :'cpu' => :'Float',
192
- :'memory' => :'Float',
193
- :'disk' => :'Float',
194
- :'gpu' => :'Float',
195
- :'gpu_type' => :'String',
196
- :'_class' => :'SandboxClass',
197
- :'current_cpu_usage_percentage' => :'Float',
198
- :'current_memory_usage_percentage' => :'Float',
199
- :'current_disk_usage_percentage' => :'Float',
200
- :'current_allocated_cpu' => :'Float',
201
- :'current_allocated_memory_gi_b' => :'Float',
202
- :'current_allocated_disk_gi_b' => :'Float',
203
- :'current_snapshot_count' => :'Float',
204
- :'current_started_sandboxes' => :'Float',
205
- :'availability_score' => :'Float',
206
- :'region' => :'String',
207
- :'name' => :'String',
208
- :'state' => :'RunnerState',
209
- :'last_checked' => :'String',
210
- :'unschedulable' => :'Boolean',
211
- :'created_at' => :'String',
212
- :'updated_at' => :'String',
213
- :'version' => :'String',
214
- :'api_version' => :'String',
215
- :'runner_class' => :'RunnerClass',
216
- :'app_version' => :'String',
217
- :'api_key' => :'String',
218
- :'region_type' => :'RegionType'
219
- }
220
- end
221
-
222
- # List of attributes with nullable: true
223
- def self.openapi_nullable
224
- Set.new([
225
- ])
226
- end
227
-
228
- # Initializes the object
229
- # @param [Hash] attributes Model attributes in the form of hash
230
- def initialize(attributes = {})
231
- if (!attributes.is_a?(Hash))
232
- fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::RunnerFull` initialize method"
233
- end
234
-
235
- # check to see if the attribute exists and convert string to symbol for hash key
236
- acceptable_attribute_map = self.class.acceptable_attribute_map
237
- attributes = attributes.each_with_object({}) { |(k, v), h|
238
- if (!acceptable_attribute_map.key?(k.to_sym))
239
- fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::RunnerFull`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
240
- end
241
- h[k.to_sym] = v
242
- }
243
-
244
- if attributes.key?(:'id')
245
- self.id = attributes[:'id']
246
- else
247
- self.id = nil
248
- end
249
-
250
- if attributes.key?(:'domain')
251
- self.domain = attributes[:'domain']
252
- end
253
-
254
- if attributes.key?(:'api_url')
255
- self.api_url = attributes[:'api_url']
256
- end
257
-
258
- if attributes.key?(:'proxy_url')
259
- self.proxy_url = attributes[:'proxy_url']
260
- end
261
-
262
- if attributes.key?(:'cpu')
263
- self.cpu = attributes[:'cpu']
264
- else
265
- self.cpu = nil
266
- end
267
-
268
- if attributes.key?(:'memory')
269
- self.memory = attributes[:'memory']
270
- else
271
- self.memory = nil
272
- end
273
-
274
- if attributes.key?(:'disk')
275
- self.disk = attributes[:'disk']
276
- else
277
- self.disk = nil
278
- end
279
-
280
- if attributes.key?(:'gpu')
281
- self.gpu = attributes[:'gpu']
282
- end
283
-
284
- if attributes.key?(:'gpu_type')
285
- self.gpu_type = attributes[:'gpu_type']
286
- end
287
-
288
- if attributes.key?(:'_class')
289
- self._class = attributes[:'_class']
290
- else
291
- self._class = nil
292
- end
293
-
294
- if attributes.key?(:'current_cpu_usage_percentage')
295
- self.current_cpu_usage_percentage = attributes[:'current_cpu_usage_percentage']
296
- end
297
-
298
- if attributes.key?(:'current_memory_usage_percentage')
299
- self.current_memory_usage_percentage = attributes[:'current_memory_usage_percentage']
300
- end
301
-
302
- if attributes.key?(:'current_disk_usage_percentage')
303
- self.current_disk_usage_percentage = attributes[:'current_disk_usage_percentage']
304
- end
305
-
306
- if attributes.key?(:'current_allocated_cpu')
307
- self.current_allocated_cpu = attributes[:'current_allocated_cpu']
308
- end
309
-
310
- if attributes.key?(:'current_allocated_memory_gi_b')
311
- self.current_allocated_memory_gi_b = attributes[:'current_allocated_memory_gi_b']
312
- end
313
-
314
- if attributes.key?(:'current_allocated_disk_gi_b')
315
- self.current_allocated_disk_gi_b = attributes[:'current_allocated_disk_gi_b']
316
- end
317
-
318
- if attributes.key?(:'current_snapshot_count')
319
- self.current_snapshot_count = attributes[:'current_snapshot_count']
320
- end
321
-
322
- if attributes.key?(:'current_started_sandboxes')
323
- self.current_started_sandboxes = attributes[:'current_started_sandboxes']
324
- end
325
-
326
- if attributes.key?(:'availability_score')
327
- self.availability_score = attributes[:'availability_score']
328
- end
329
-
330
- if attributes.key?(:'region')
331
- self.region = attributes[:'region']
332
- else
333
- self.region = nil
334
- end
335
-
336
- if attributes.key?(:'name')
337
- self.name = attributes[:'name']
338
- else
339
- self.name = nil
340
- end
341
-
342
- if attributes.key?(:'state')
343
- self.state = attributes[:'state']
344
- else
345
- self.state = nil
346
- end
347
-
348
- if attributes.key?(:'last_checked')
349
- self.last_checked = attributes[:'last_checked']
350
- end
351
-
352
- if attributes.key?(:'unschedulable')
353
- self.unschedulable = attributes[:'unschedulable']
354
- else
355
- self.unschedulable = nil
356
- end
357
-
358
- if attributes.key?(:'created_at')
359
- self.created_at = attributes[:'created_at']
360
- else
361
- self.created_at = nil
362
- end
363
-
364
- if attributes.key?(:'updated_at')
365
- self.updated_at = attributes[:'updated_at']
366
- else
367
- self.updated_at = nil
368
- end
369
-
370
- if attributes.key?(:'version')
371
- self.version = attributes[:'version']
372
- else
373
- self.version = nil
374
- end
375
-
376
- if attributes.key?(:'api_version')
377
- self.api_version = attributes[:'api_version']
378
- else
379
- self.api_version = nil
380
- end
381
-
382
- if attributes.key?(:'runner_class')
383
- self.runner_class = attributes[:'runner_class']
384
- else
385
- self.runner_class = nil
386
- end
387
-
388
- if attributes.key?(:'app_version')
389
- self.app_version = attributes[:'app_version']
390
- end
391
-
392
- if attributes.key?(:'api_key')
393
- self.api_key = attributes[:'api_key']
394
- else
395
- self.api_key = nil
396
- end
397
-
398
- if attributes.key?(:'region_type')
399
- self.region_type = attributes[:'region_type']
400
- end
401
- end
402
-
403
- # Show invalid properties with the reasons. Usually used together with valid?
404
- # @return Array for valid properties with the reasons
405
- def list_invalid_properties
406
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
407
- invalid_properties = Array.new
408
- if @id.nil?
409
- invalid_properties.push('invalid value for "id", id cannot be nil.')
410
- end
411
-
412
- if @cpu.nil?
413
- invalid_properties.push('invalid value for "cpu", cpu cannot be nil.')
414
- end
415
-
416
- if @memory.nil?
417
- invalid_properties.push('invalid value for "memory", memory cannot be nil.')
418
- end
419
-
420
- if @disk.nil?
421
- invalid_properties.push('invalid value for "disk", disk cannot be nil.')
422
- end
423
-
424
- if @_class.nil?
425
- invalid_properties.push('invalid value for "_class", _class cannot be nil.')
426
- end
427
-
428
- if @region.nil?
429
- invalid_properties.push('invalid value for "region", region cannot be nil.')
430
- end
431
-
432
- if @name.nil?
433
- invalid_properties.push('invalid value for "name", name cannot be nil.')
434
- end
435
-
436
- if @state.nil?
437
- invalid_properties.push('invalid value for "state", state cannot be nil.')
438
- end
439
-
440
- if @unschedulable.nil?
441
- invalid_properties.push('invalid value for "unschedulable", unschedulable cannot be nil.')
442
- end
443
-
444
- if @created_at.nil?
445
- invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
446
- end
447
-
448
- if @updated_at.nil?
449
- invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
450
- end
451
-
452
- if @version.nil?
453
- invalid_properties.push('invalid value for "version", version cannot be nil.')
454
- end
455
-
456
- if @api_version.nil?
457
- invalid_properties.push('invalid value for "api_version", api_version cannot be nil.')
458
- end
459
-
460
- if @runner_class.nil?
461
- invalid_properties.push('invalid value for "runner_class", runner_class cannot be nil.')
462
- end
463
-
464
- if @api_key.nil?
465
- invalid_properties.push('invalid value for "api_key", api_key cannot be nil.')
466
- end
467
-
468
- invalid_properties
469
- end
470
-
471
- # Check to see if the all the properties in the model are valid
472
- # @return true if the model is valid
473
- def valid?
474
- warn '[DEPRECATED] the `valid?` method is obsolete'
475
- return false if @id.nil?
476
- return false if @cpu.nil?
477
- return false if @memory.nil?
478
- return false if @disk.nil?
479
- return false if @_class.nil?
480
- return false if @region.nil?
481
- return false if @name.nil?
482
- return false if @state.nil?
483
- return false if @unschedulable.nil?
484
- return false if @created_at.nil?
485
- return false if @updated_at.nil?
486
- return false if @version.nil?
487
- return false if @api_version.nil?
488
- return false if @runner_class.nil?
489
- return false if @api_key.nil?
490
- true
491
- end
492
-
493
- # Custom attribute writer method with validation
494
- # @param [Object] id Value to be assigned
495
- def id=(id)
496
- if id.nil?
497
- fail ArgumentError, 'id cannot be nil'
498
- end
499
-
500
- @id = id
501
- end
502
-
503
- # Custom attribute writer method with validation
504
- # @param [Object] cpu Value to be assigned
505
- def cpu=(cpu)
506
- if cpu.nil?
507
- fail ArgumentError, 'cpu cannot be nil'
508
- end
509
-
510
- @cpu = cpu
511
- end
512
-
513
- # Custom attribute writer method with validation
514
- # @param [Object] memory Value to be assigned
515
- def memory=(memory)
516
- if memory.nil?
517
- fail ArgumentError, 'memory cannot be nil'
518
- end
519
-
520
- @memory = memory
521
- end
522
-
523
- # Custom attribute writer method with validation
524
- # @param [Object] disk Value to be assigned
525
- def disk=(disk)
526
- if disk.nil?
527
- fail ArgumentError, 'disk cannot be nil'
528
- end
529
-
530
- @disk = disk
531
- end
532
-
533
- # Custom attribute writer method with validation
534
- # @param [Object] _class Value to be assigned
535
- def _class=(_class)
536
- if _class.nil?
537
- fail ArgumentError, '_class cannot be nil'
538
- end
539
-
540
- @_class = _class
541
- end
542
-
543
- # Custom attribute writer method with validation
544
- # @param [Object] region Value to be assigned
545
- def region=(region)
546
- if region.nil?
547
- fail ArgumentError, 'region cannot be nil'
548
- end
549
-
550
- @region = region
551
- end
552
-
553
- # Custom attribute writer method with validation
554
- # @param [Object] name Value to be assigned
555
- def name=(name)
556
- if name.nil?
557
- fail ArgumentError, 'name cannot be nil'
558
- end
559
-
560
- @name = name
561
- end
562
-
563
- # Custom attribute writer method with validation
564
- # @param [Object] state Value to be assigned
565
- def state=(state)
566
- if state.nil?
567
- fail ArgumentError, 'state cannot be nil'
568
- end
569
-
570
- @state = state
571
- end
572
-
573
- # Custom attribute writer method with validation
574
- # @param [Object] unschedulable Value to be assigned
575
- def unschedulable=(unschedulable)
576
- if unschedulable.nil?
577
- fail ArgumentError, 'unschedulable cannot be nil'
578
- end
579
-
580
- @unschedulable = unschedulable
581
- end
582
-
583
- # Custom attribute writer method with validation
584
- # @param [Object] created_at Value to be assigned
585
- def created_at=(created_at)
586
- if created_at.nil?
587
- fail ArgumentError, 'created_at cannot be nil'
588
- end
589
-
590
- @created_at = created_at
591
- end
592
-
593
- # Custom attribute writer method with validation
594
- # @param [Object] updated_at Value to be assigned
595
- def updated_at=(updated_at)
596
- if updated_at.nil?
597
- fail ArgumentError, 'updated_at cannot be nil'
598
- end
599
-
600
- @updated_at = updated_at
601
- end
602
-
603
- # Custom attribute writer method with validation
604
- # @param [Object] version Value to be assigned
605
- def version=(version)
606
- if version.nil?
607
- fail ArgumentError, 'version cannot be nil'
608
- end
609
-
610
- @version = version
611
- end
612
-
613
- # Custom attribute writer method with validation
614
- # @param [Object] api_version Value to be assigned
615
- def api_version=(api_version)
616
- if api_version.nil?
617
- fail ArgumentError, 'api_version cannot be nil'
618
- end
619
-
620
- @api_version = api_version
621
- end
622
-
623
- # Custom attribute writer method with validation
624
- # @param [Object] runner_class Value to be assigned
625
- def runner_class=(runner_class)
626
- if runner_class.nil?
627
- fail ArgumentError, 'runner_class cannot be nil'
628
- end
629
-
630
- @runner_class = runner_class
631
- end
632
-
633
- # Custom attribute writer method with validation
634
- # @param [Object] api_key Value to be assigned
635
- def api_key=(api_key)
636
- if api_key.nil?
637
- fail ArgumentError, 'api_key cannot be nil'
638
- end
639
-
640
- @api_key = api_key
641
- end
642
-
643
- # Checks equality by comparing each attribute.
644
- # @param [Object] Object to be compared
645
- def ==(o)
646
- return true if self.equal?(o)
647
- self.class == o.class &&
648
- id == o.id &&
649
- domain == o.domain &&
650
- api_url == o.api_url &&
651
- proxy_url == o.proxy_url &&
652
- cpu == o.cpu &&
653
- memory == o.memory &&
654
- disk == o.disk &&
655
- gpu == o.gpu &&
656
- gpu_type == o.gpu_type &&
657
- _class == o._class &&
658
- current_cpu_usage_percentage == o.current_cpu_usage_percentage &&
659
- current_memory_usage_percentage == o.current_memory_usage_percentage &&
660
- current_disk_usage_percentage == o.current_disk_usage_percentage &&
661
- current_allocated_cpu == o.current_allocated_cpu &&
662
- current_allocated_memory_gi_b == o.current_allocated_memory_gi_b &&
663
- current_allocated_disk_gi_b == o.current_allocated_disk_gi_b &&
664
- current_snapshot_count == o.current_snapshot_count &&
665
- current_started_sandboxes == o.current_started_sandboxes &&
666
- availability_score == o.availability_score &&
667
- region == o.region &&
668
- name == o.name &&
669
- state == o.state &&
670
- last_checked == o.last_checked &&
671
- unschedulable == o.unschedulable &&
672
- created_at == o.created_at &&
673
- updated_at == o.updated_at &&
674
- version == o.version &&
675
- api_version == o.api_version &&
676
- runner_class == o.runner_class &&
677
- app_version == o.app_version &&
678
- api_key == o.api_key &&
679
- region_type == o.region_type
680
- end
681
-
682
- # @see the `==` method
683
- # @param [Object] Object to be compared
684
- def eql?(o)
685
- self == o
686
- end
687
-
688
- # Calculates hash code according to all attributes.
689
- # @return [Integer] Hash code
690
- def hash
691
- [id, domain, api_url, proxy_url, cpu, memory, disk, gpu, gpu_type, _class, current_cpu_usage_percentage, current_memory_usage_percentage, current_disk_usage_percentage, current_allocated_cpu, current_allocated_memory_gi_b, current_allocated_disk_gi_b, current_snapshot_count, current_started_sandboxes, availability_score, region, name, state, last_checked, unschedulable, created_at, updated_at, version, api_version, runner_class, app_version, api_key, region_type].hash
692
- end
693
-
694
- # Builds the object from hash
695
- # @param [Hash] attributes Model attributes in the form of hash
696
- # @return [Object] Returns the model itself
697
- def self.build_from_hash(attributes)
698
- return nil unless attributes.is_a?(Hash)
699
- attributes = attributes.transform_keys(&:to_sym)
700
- transformed_hash = {}
701
- openapi_types.each_pair do |key, type|
702
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
703
- transformed_hash["#{key}"] = nil
704
- elsif type =~ /\AArray<(.*)>/i
705
- # check to ensure the input is an array given that the attribute
706
- # is documented as an array but the input is not
707
- if attributes[attribute_map[key]].is_a?(Array)
708
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
709
- end
710
- elsif !attributes[attribute_map[key]].nil?
711
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
712
- end
713
- end
714
- new(transformed_hash)
715
- end
716
-
717
- # Deserializes the data based on type
718
- # @param string type Data type
719
- # @param string value Value to be deserialized
720
- # @return [Object] Deserialized data
721
- def self._deserialize(type, value)
722
- case type.to_sym
723
- when :Time
724
- Time.parse(value)
725
- when :Date
726
- Date.parse(value)
727
- when :String
728
- value.to_s
729
- when :Integer
730
- value.to_i
731
- when :Float
732
- value.to_f
733
- when :Boolean
734
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
735
- true
736
- else
737
- false
738
- end
739
- when :Object
740
- # generic object (usually a Hash), return directly
741
- value
742
- when /\AArray<(?<inner_type>.+)>\z/
743
- inner_type = Regexp.last_match[:inner_type]
744
- value.map { |v| _deserialize(inner_type, v) }
745
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
746
- k_type = Regexp.last_match[:k_type]
747
- v_type = Regexp.last_match[:v_type]
748
- {}.tap do |hash|
749
- value.each do |k, v|
750
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
751
- end
752
- end
753
- else # model
754
- # models (e.g. Pet) or oneOf
755
- klass = DaytonaApiClient.const_get(type)
756
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
757
- end
758
- end
759
-
760
- # Returns the string representation of the object
761
- # @return [String] String presentation of the object
762
- def to_s
763
- to_hash.to_s
764
- end
765
-
766
- # to_body is an alias to to_hash (backward compatibility)
767
- # @return [Hash] Returns the object in the form of hash
768
- def to_body
769
- to_hash
770
- end
771
-
772
- # Returns the object in the form of hash
773
- # @return [Hash] Returns the object in the form of hash
774
- def to_hash
775
- hash = {}
776
- self.class.attribute_map.each_pair do |attr, param|
777
- value = self.send(attr)
778
- if value.nil?
779
- is_nullable = self.class.openapi_nullable.include?(attr)
780
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
781
- end
782
-
783
- hash[param] = _to_hash(value)
784
- end
785
- hash
786
- end
787
-
788
- # Outputs non-array value in the form of hash
789
- # For object, use to_hash. Otherwise, just return the value
790
- # @param [Object] value Any valid value
791
- # @return [Hash] Returns the value in the form of hash
792
- def _to_hash(value)
793
- if value.is_a?(Array)
794
- value.compact.map { |v| _to_hash(v) }
795
- elsif value.is_a?(Hash)
796
- {}.tap do |hash|
797
- value.each { |k, v| hash[k] = _to_hash(v) }
798
- end
799
- elsif value.respond_to? :to_hash
800
- value.to_hash
801
- else
802
- value
803
- end
804
- end
805
-
806
- end
807
-
808
- end