daytona_api_client 0.126.0.pre.alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +39 -0
  3. data/.openapi-generator/FILES +171 -0
  4. data/.openapi-generator/VERSION +1 -0
  5. data/.openapi-generator-ignore +33 -0
  6. data/.rspec +2 -0
  7. data/.rubocop.yml +148 -0
  8. data/Gemfile +9 -0
  9. data/Gemfile.lock +101 -0
  10. data/Rakefile +10 -0
  11. data/daytona_api_client.gemspec +39 -0
  12. data/fix-gemspec.sh +11 -0
  13. data/lib/daytona_api_client/api/api_keys_api.rb +401 -0
  14. data/lib/daytona_api_client/api/audit_api.rb +192 -0
  15. data/lib/daytona_api_client/api/config_api.rb +77 -0
  16. data/lib/daytona_api_client/api/docker_registry_api.rb +472 -0
  17. data/lib/daytona_api_client/api/health_api.rb +75 -0
  18. data/lib/daytona_api_client/api/object_storage_api.rb +80 -0
  19. data/lib/daytona_api_client/api/organizations_api.rb +1902 -0
  20. data/lib/daytona_api_client/api/preview_api.rb +211 -0
  21. data/lib/daytona_api_client/api/regions_api.rb +83 -0
  22. data/lib/daytona_api_client/api/runners_api.rb +376 -0
  23. data/lib/daytona_api_client/api/sandbox_api.rb +1660 -0
  24. data/lib/daytona_api_client/api/snapshots_api.rb +641 -0
  25. data/lib/daytona_api_client/api/toolbox_api.rb +5108 -0
  26. data/lib/daytona_api_client/api/users_api.rb +553 -0
  27. data/lib/daytona_api_client/api/volumes_api.rb +342 -0
  28. data/lib/daytona_api_client/api/webhooks_api.rb +413 -0
  29. data/lib/daytona_api_client/api/workspace_api.rb +955 -0
  30. data/lib/daytona_api_client/api_client.rb +393 -0
  31. data/lib/daytona_api_client/api_error.rb +58 -0
  32. data/lib/daytona_api_client/configuration.rb +306 -0
  33. data/lib/daytona_api_client/models/account_provider.rb +261 -0
  34. data/lib/daytona_api_client/models/announcement.rb +246 -0
  35. data/lib/daytona_api_client/models/api_key_list.rb +384 -0
  36. data/lib/daytona_api_client/models/api_key_response.rb +344 -0
  37. data/lib/daytona_api_client/models/audit_log.rb +422 -0
  38. data/lib/daytona_api_client/models/build_info.rb +285 -0
  39. data/lib/daytona_api_client/models/command.rb +273 -0
  40. data/lib/daytona_api_client/models/completion_context.rb +244 -0
  41. data/lib/daytona_api_client/models/completion_item.rb +289 -0
  42. data/lib/daytona_api_client/models/completion_list.rb +263 -0
  43. data/lib/daytona_api_client/models/compressed_screenshot_response.rb +256 -0
  44. data/lib/daytona_api_client/models/computer_use_start_response.rb +263 -0
  45. data/lib/daytona_api_client/models/computer_use_status_response.rb +260 -0
  46. data/lib/daytona_api_client/models/computer_use_stop_response.rb +263 -0
  47. data/lib/daytona_api_client/models/create_api_key.rb +288 -0
  48. data/lib/daytona_api_client/models/create_audit_log.rb +350 -0
  49. data/lib/daytona_api_client/models/create_build_info.rb +248 -0
  50. data/lib/daytona_api_client/models/create_docker_registry.rb +388 -0
  51. data/lib/daytona_api_client/models/create_linked_account.rb +263 -0
  52. data/lib/daytona_api_client/models/create_organization.rb +263 -0
  53. data/lib/daytona_api_client/models/create_organization_invitation.rb +326 -0
  54. data/lib/daytona_api_client/models/create_organization_quota.rb +290 -0
  55. data/lib/daytona_api_client/models/create_organization_role.rb +304 -0
  56. data/lib/daytona_api_client/models/create_runner.rb +545 -0
  57. data/lib/daytona_api_client/models/create_sandbox.rb +439 -0
  58. data/lib/daytona_api_client/models/create_session_request.rb +236 -0
  59. data/lib/daytona_api_client/models/create_snapshot.rb +318 -0
  60. data/lib/daytona_api_client/models/create_user.rb +340 -0
  61. data/lib/daytona_api_client/models/create_volume.rb +235 -0
  62. data/lib/daytona_api_client/models/create_workspace.rb +411 -0
  63. data/lib/daytona_api_client/models/daytona_configuration.rb +568 -0
  64. data/lib/daytona_api_client/models/display_info_response.rb +238 -0
  65. data/lib/daytona_api_client/models/docker_registry.rb +449 -0
  66. data/lib/daytona_api_client/models/download_files.rb +238 -0
  67. data/lib/daytona_api_client/models/execute_request.rb +255 -0
  68. data/lib/daytona_api_client/models/execute_response.rb +263 -0
  69. data/lib/daytona_api_client/models/file_info.rb +417 -0
  70. data/lib/daytona_api_client/models/file_status.rb +313 -0
  71. data/lib/daytona_api_client/models/git_add_request.rb +264 -0
  72. data/lib/daytona_api_client/models/git_branch_request.rb +261 -0
  73. data/lib/daytona_api_client/models/git_checkout_request.rb +261 -0
  74. data/lib/daytona_api_client/models/git_clone_request.rb +297 -0
  75. data/lib/daytona_api_client/models/git_commit_info.rb +339 -0
  76. data/lib/daytona_api_client/models/git_commit_request.rb +325 -0
  77. data/lib/daytona_api_client/models/git_commit_response.rb +235 -0
  78. data/lib/daytona_api_client/models/git_delete_branch_request.rb +261 -0
  79. data/lib/daytona_api_client/models/git_repo_request.rb +253 -0
  80. data/lib/daytona_api_client/models/git_status.rb +290 -0
  81. data/lib/daytona_api_client/models/health_controller_check200_response.rb +253 -0
  82. data/lib/daytona_api_client/models/health_controller_check200_response_info_value.rb +235 -0
  83. data/lib/daytona_api_client/models/health_controller_check503_response.rb +253 -0
  84. data/lib/daytona_api_client/models/keyboard_hotkey_request.rb +236 -0
  85. data/lib/daytona_api_client/models/keyboard_press_request.rb +248 -0
  86. data/lib/daytona_api_client/models/keyboard_type_request.rb +246 -0
  87. data/lib/daytona_api_client/models/list_branch_response.rb +237 -0
  88. data/lib/daytona_api_client/models/lsp_completion_params.rb +325 -0
  89. data/lib/daytona_api_client/models/lsp_document_request.rb +290 -0
  90. data/lib/daytona_api_client/models/lsp_location.rb +261 -0
  91. data/lib/daytona_api_client/models/lsp_server_request.rb +263 -0
  92. data/lib/daytona_api_client/models/lsp_symbol.rb +287 -0
  93. data/lib/daytona_api_client/models/match.rb +287 -0
  94. data/lib/daytona_api_client/models/mouse_click_request.rb +283 -0
  95. data/lib/daytona_api_client/models/mouse_click_response.rb +263 -0
  96. data/lib/daytona_api_client/models/mouse_drag_request.rb +327 -0
  97. data/lib/daytona_api_client/models/mouse_drag_response.rb +263 -0
  98. data/lib/daytona_api_client/models/mouse_move_request.rb +263 -0
  99. data/lib/daytona_api_client/models/mouse_move_response.rb +263 -0
  100. data/lib/daytona_api_client/models/mouse_position.rb +263 -0
  101. data/lib/daytona_api_client/models/mouse_scroll_request.rb +300 -0
  102. data/lib/daytona_api_client/models/mouse_scroll_response.rb +236 -0
  103. data/lib/daytona_api_client/models/oidc_config.rb +290 -0
  104. data/lib/daytona_api_client/models/organization.rb +663 -0
  105. data/lib/daytona_api_client/models/organization_invitation.rb +534 -0
  106. data/lib/daytona_api_client/models/organization_role.rb +412 -0
  107. data/lib/daytona_api_client/models/organization_sandbox_default_limited_network_egress.rb +236 -0
  108. data/lib/daytona_api_client/models/organization_suspension.rb +290 -0
  109. data/lib/daytona_api_client/models/organization_usage_overview.rb +341 -0
  110. data/lib/daytona_api_client/models/organization_user.rb +451 -0
  111. data/lib/daytona_api_client/models/paginated_audit_logs.rb +325 -0
  112. data/lib/daytona_api_client/models/paginated_sandboxes.rb +315 -0
  113. data/lib/daytona_api_client/models/paginated_snapshots.rb +315 -0
  114. data/lib/daytona_api_client/models/paginated_snapshots_dto.rb +315 -0
  115. data/lib/daytona_api_client/models/port_preview_url.rb +290 -0
  116. data/lib/daytona_api_client/models/position.rb +261 -0
  117. data/lib/daytona_api_client/models/posthog_config.rb +263 -0
  118. data/lib/daytona_api_client/models/process_errors_response.rb +263 -0
  119. data/lib/daytona_api_client/models/process_logs_response.rb +263 -0
  120. data/lib/daytona_api_client/models/process_restart_response.rb +263 -0
  121. data/lib/daytona_api_client/models/process_status_response.rb +263 -0
  122. data/lib/daytona_api_client/models/project_dir_response.rb +218 -0
  123. data/lib/daytona_api_client/models/pty_create_request.rb +288 -0
  124. data/lib/daytona_api_client/models/pty_create_response.rb +236 -0
  125. data/lib/daytona_api_client/models/pty_list_response.rb +238 -0
  126. data/lib/daytona_api_client/models/pty_resize_request.rb +263 -0
  127. data/lib/daytona_api_client/models/pty_session_info.rb +425 -0
  128. data/lib/daytona_api_client/models/range.rb +261 -0
  129. data/lib/daytona_api_client/models/rate_limit_config.rb +249 -0
  130. data/lib/daytona_api_client/models/rate_limit_entry.rb +229 -0
  131. data/lib/daytona_api_client/models/region.rb +328 -0
  132. data/lib/daytona_api_client/models/region_quota.rb +339 -0
  133. data/lib/daytona_api_client/models/region_screenshot_response.rb +256 -0
  134. data/lib/daytona_api_client/models/region_usage_overview.rb +391 -0
  135. data/lib/daytona_api_client/models/registry_push_access_dto.rb +371 -0
  136. data/lib/daytona_api_client/models/replace_request.rb +289 -0
  137. data/lib/daytona_api_client/models/replace_result.rb +236 -0
  138. data/lib/daytona_api_client/models/runner.rb +780 -0
  139. data/lib/daytona_api_client/models/runner_snapshot_dto.rb +290 -0
  140. data/lib/daytona_api_client/models/runner_state.rb +43 -0
  141. data/lib/daytona_api_client/models/sandbox.rb +782 -0
  142. data/lib/daytona_api_client/models/sandbox_class.rb +41 -0
  143. data/lib/daytona_api_client/models/sandbox_desired_state.rb +43 -0
  144. data/lib/daytona_api_client/models/sandbox_info.rb +273 -0
  145. data/lib/daytona_api_client/models/sandbox_labels.rb +238 -0
  146. data/lib/daytona_api_client/models/sandbox_state.rb +54 -0
  147. data/lib/daytona_api_client/models/sandbox_volume.rb +273 -0
  148. data/lib/daytona_api_client/models/screenshot_response.rb +256 -0
  149. data/lib/daytona_api_client/models/search_files_response.rb +237 -0
  150. data/lib/daytona_api_client/models/send_webhook_dto.rb +273 -0
  151. data/lib/daytona_api_client/models/session.rb +251 -0
  152. data/lib/daytona_api_client/models/session_execute_request.rb +256 -0
  153. data/lib/daytona_api_client/models/session_execute_response.rb +239 -0
  154. data/lib/daytona_api_client/models/set_snapshot_general_status_dto.rb +236 -0
  155. data/lib/daytona_api_client/models/snapshot_dto.rb +569 -0
  156. data/lib/daytona_api_client/models/snapshot_state.rb +46 -0
  157. data/lib/daytona_api_client/models/ssh_access_dto.rb +371 -0
  158. data/lib/daytona_api_client/models/ssh_access_validation_dto.rb +263 -0
  159. data/lib/daytona_api_client/models/storage_access_dto.rb +371 -0
  160. data/lib/daytona_api_client/models/update_docker_registry.rb +310 -0
  161. data/lib/daytona_api_client/models/update_organization_default_region.rb +236 -0
  162. data/lib/daytona_api_client/models/update_organization_invitation.rb +299 -0
  163. data/lib/daytona_api_client/models/update_organization_member_access.rb +289 -0
  164. data/lib/daytona_api_client/models/update_organization_quota.rb +317 -0
  165. data/lib/daytona_api_client/models/update_organization_region_quota.rb +245 -0
  166. data/lib/daytona_api_client/models/update_organization_role.rb +304 -0
  167. data/lib/daytona_api_client/models/update_sandbox_state_dto.rb +270 -0
  168. data/lib/daytona_api_client/models/user.rb +346 -0
  169. data/lib/daytona_api_client/models/user_home_dir_response.rb +218 -0
  170. data/lib/daytona_api_client/models/user_public_key.rb +263 -0
  171. data/lib/daytona_api_client/models/volume_dto.rb +417 -0
  172. data/lib/daytona_api_client/models/volume_state.rb +45 -0
  173. data/lib/daytona_api_client/models/webhook_app_portal_access.rb +236 -0
  174. data/lib/daytona_api_client/models/webhook_controller_get_status200_response.rb +218 -0
  175. data/lib/daytona_api_client/models/webhook_initialization_status.rb +343 -0
  176. data/lib/daytona_api_client/models/windows_response.rb +265 -0
  177. data/lib/daytona_api_client/models/work_dir_response.rb +218 -0
  178. data/lib/daytona_api_client/models/workspace.rb +834 -0
  179. data/lib/daytona_api_client/models/workspace_port_preview_url.rb +263 -0
  180. data/lib/daytona_api_client/version.rb +15 -0
  181. data/lib/daytona_api_client.rb +201 -0
  182. data/project.json +59 -0
  183. metadata +261 -0
@@ -0,0 +1,41 @@
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 SandboxClass
18
+ SMALL = "small".freeze
19
+ MEDIUM = "medium".freeze
20
+ LARGE = "large".freeze
21
+
22
+ def self.all_vars
23
+ @all_vars ||= [SMALL, MEDIUM, LARGE].freeze
24
+ end
25
+
26
+ # Builds the enum from string
27
+ # @param [String] The enum value in the form of the string
28
+ # @return [String] The enum value
29
+ def self.build_from_hash(value)
30
+ new.build_from_hash(value)
31
+ end
32
+
33
+ # Builds the enum from string
34
+ # @param [String] The enum value in the form of the string
35
+ # @return [String] The enum value
36
+ def build_from_hash(value)
37
+ return value if SandboxClass.all_vars.include?(value)
38
+ raise "Invalid ENUM value #{value} for class #SandboxClass"
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,43 @@
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 SandboxDesiredState
18
+ DESTROYED = "destroyed".freeze
19
+ STARTED = "started".freeze
20
+ STOPPED = "stopped".freeze
21
+ RESIZED = "resized".freeze
22
+ ARCHIVED = "archived".freeze
23
+
24
+ def self.all_vars
25
+ @all_vars ||= [DESTROYED, STARTED, STOPPED, RESIZED, ARCHIVED].freeze
26
+ end
27
+
28
+ # Builds the enum from string
29
+ # @param [String] The enum value in the form of the string
30
+ # @return [String] The enum value
31
+ def self.build_from_hash(value)
32
+ new.build_from_hash(value)
33
+ end
34
+
35
+ # Builds the enum from string
36
+ # @param [String] The enum value in the form of the string
37
+ # @return [String] The enum value
38
+ def build_from_hash(value)
39
+ return value if SandboxDesiredState.all_vars.include?(value)
40
+ raise "Invalid ENUM value #{value} for class #SandboxDesiredState"
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,273 @@
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 SandboxInfo
18
+ # The creation timestamp of the project
19
+ attr_accessor :created
20
+
21
+ # Deprecated: The name of the sandbox
22
+ attr_accessor :name
23
+
24
+ # Additional metadata provided by the provider
25
+ attr_accessor :provider_metadata
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'created' => :'created',
31
+ :'name' => :'name',
32
+ :'provider_metadata' => :'providerMetadata'
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
+ :'created' => :'String',
50
+ :'name' => :'String',
51
+ :'provider_metadata' => :'String'
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::SandboxInfo` 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::SandboxInfo`. 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?(:'created')
78
+ self.created = attributes[:'created']
79
+ else
80
+ self.created = nil
81
+ end
82
+
83
+ if attributes.key?(:'name')
84
+ self.name = attributes[:'name']
85
+ else
86
+ self.name = ''
87
+ end
88
+
89
+ if attributes.key?(:'provider_metadata')
90
+ self.provider_metadata = attributes[:'provider_metadata']
91
+ end
92
+ end
93
+
94
+ # Show invalid properties with the reasons. Usually used together with valid?
95
+ # @return Array for valid properties with the reasons
96
+ def list_invalid_properties
97
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
98
+ invalid_properties = Array.new
99
+ if @created.nil?
100
+ invalid_properties.push('invalid value for "created", created cannot be nil.')
101
+ end
102
+
103
+ if @name.nil?
104
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
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 @created.nil?
115
+ return false if @name.nil?
116
+ true
117
+ end
118
+
119
+ # Custom attribute writer method with validation
120
+ # @param [Object] created Value to be assigned
121
+ def created=(created)
122
+ if created.nil?
123
+ fail ArgumentError, 'created cannot be nil'
124
+ end
125
+
126
+ @created = created
127
+ end
128
+
129
+ # Custom attribute writer method with validation
130
+ # @param [Object] name Value to be assigned
131
+ def name=(name)
132
+ if name.nil?
133
+ fail ArgumentError, 'name cannot be nil'
134
+ end
135
+
136
+ @name = name
137
+ end
138
+
139
+ # Checks equality by comparing each attribute.
140
+ # @param [Object] Object to be compared
141
+ def ==(o)
142
+ return true if self.equal?(o)
143
+ self.class == o.class &&
144
+ created == o.created &&
145
+ name == o.name &&
146
+ provider_metadata == o.provider_metadata
147
+ end
148
+
149
+ # @see the `==` method
150
+ # @param [Object] Object to be compared
151
+ def eql?(o)
152
+ self == o
153
+ end
154
+
155
+ # Calculates hash code according to all attributes.
156
+ # @return [Integer] Hash code
157
+ def hash
158
+ [created, name, provider_metadata].hash
159
+ end
160
+
161
+ # Builds the object from hash
162
+ # @param [Hash] attributes Model attributes in the form of hash
163
+ # @return [Object] Returns the model itself
164
+ def self.build_from_hash(attributes)
165
+ return nil unless attributes.is_a?(Hash)
166
+ attributes = attributes.transform_keys(&:to_sym)
167
+ transformed_hash = {}
168
+ openapi_types.each_pair do |key, type|
169
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
170
+ transformed_hash["#{key}"] = nil
171
+ elsif type =~ /\AArray<(.*)>/i
172
+ # check to ensure the input is an array given that the attribute
173
+ # is documented as an array but the input is not
174
+ if attributes[attribute_map[key]].is_a?(Array)
175
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
176
+ end
177
+ elsif !attributes[attribute_map[key]].nil?
178
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
179
+ end
180
+ end
181
+ new(transformed_hash)
182
+ end
183
+
184
+ # Deserializes the data based on type
185
+ # @param string type Data type
186
+ # @param string value Value to be deserialized
187
+ # @return [Object] Deserialized data
188
+ def self._deserialize(type, value)
189
+ case type.to_sym
190
+ when :Time
191
+ Time.parse(value)
192
+ when :Date
193
+ Date.parse(value)
194
+ when :String
195
+ value.to_s
196
+ when :Integer
197
+ value.to_i
198
+ when :Float
199
+ value.to_f
200
+ when :Boolean
201
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
202
+ true
203
+ else
204
+ false
205
+ end
206
+ when :Object
207
+ # generic object (usually a Hash), return directly
208
+ value
209
+ when /\AArray<(?<inner_type>.+)>\z/
210
+ inner_type = Regexp.last_match[:inner_type]
211
+ value.map { |v| _deserialize(inner_type, v) }
212
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
213
+ k_type = Regexp.last_match[:k_type]
214
+ v_type = Regexp.last_match[:v_type]
215
+ {}.tap do |hash|
216
+ value.each do |k, v|
217
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
218
+ end
219
+ end
220
+ else # model
221
+ # models (e.g. Pet) or oneOf
222
+ klass = DaytonaApiClient.const_get(type)
223
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
224
+ end
225
+ end
226
+
227
+ # Returns the string representation of the object
228
+ # @return [String] String presentation of the object
229
+ def to_s
230
+ to_hash.to_s
231
+ end
232
+
233
+ # to_body is an alias to to_hash (backward compatibility)
234
+ # @return [Hash] Returns the object in the form of hash
235
+ def to_body
236
+ to_hash
237
+ end
238
+
239
+ # Returns the object in the form of hash
240
+ # @return [Hash] Returns the object in the form of hash
241
+ def to_hash
242
+ hash = {}
243
+ self.class.attribute_map.each_pair do |attr, param|
244
+ value = self.send(attr)
245
+ if value.nil?
246
+ is_nullable = self.class.openapi_nullable.include?(attr)
247
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
248
+ end
249
+
250
+ hash[param] = _to_hash(value)
251
+ end
252
+ hash
253
+ end
254
+
255
+ # Outputs non-array value in the form of hash
256
+ # For object, use to_hash. Otherwise, just return the value
257
+ # @param [Object] value Any valid value
258
+ # @return [Hash] Returns the value in the form of hash
259
+ def _to_hash(value)
260
+ if value.is_a?(Array)
261
+ value.compact.map { |v| _to_hash(v) }
262
+ elsif value.is_a?(Hash)
263
+ {}.tap do |hash|
264
+ value.each { |k, v| hash[k] = _to_hash(v) }
265
+ end
266
+ elsif value.respond_to? :to_hash
267
+ value.to_hash
268
+ else
269
+ value
270
+ end
271
+ end
272
+ end
273
+ end
@@ -0,0 +1,238 @@
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 SandboxLabels
18
+ # Key-value pairs of labels
19
+ attr_accessor :labels
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'labels' => :'labels'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'labels' => :'Hash<String, String>'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::SandboxLabels` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::SandboxLabels`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'labels')
68
+ if (value = attributes[:'labels']).is_a?(Hash)
69
+ self.labels = value
70
+ end
71
+ else
72
+ self.labels = nil
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
80
+ invalid_properties = Array.new
81
+ if @labels.nil?
82
+ invalid_properties.push('invalid value for "labels", labels cannot be nil.')
83
+ end
84
+
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ warn '[DEPRECATED] the `valid?` method is obsolete'
92
+ return false if @labels.nil?
93
+ true
94
+ end
95
+
96
+ # Custom attribute writer method with validation
97
+ # @param [Object] labels Value to be assigned
98
+ def labels=(labels)
99
+ if labels.nil?
100
+ fail ArgumentError, 'labels cannot be nil'
101
+ end
102
+
103
+ @labels = labels
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ labels == o.labels
112
+ end
113
+
114
+ # @see the `==` method
115
+ # @param [Object] Object to be compared
116
+ def eql?(o)
117
+ self == o
118
+ end
119
+
120
+ # Calculates hash code according to all attributes.
121
+ # @return [Integer] Hash code
122
+ def hash
123
+ [labels].hash
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def self.build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ attributes = attributes.transform_keys(&:to_sym)
132
+ transformed_hash = {}
133
+ openapi_types.each_pair do |key, type|
134
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
135
+ transformed_hash["#{key}"] = nil
136
+ elsif type =~ /\AArray<(.*)>/i
137
+ # check to ensure the input is an array given that the attribute
138
+ # is documented as an array but the input is not
139
+ if attributes[attribute_map[key]].is_a?(Array)
140
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
141
+ end
142
+ elsif !attributes[attribute_map[key]].nil?
143
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
144
+ end
145
+ end
146
+ new(transformed_hash)
147
+ end
148
+
149
+ # Deserializes the data based on type
150
+ # @param string type Data type
151
+ # @param string value Value to be deserialized
152
+ # @return [Object] Deserialized data
153
+ def self._deserialize(type, value)
154
+ case type.to_sym
155
+ when :Time
156
+ Time.parse(value)
157
+ when :Date
158
+ Date.parse(value)
159
+ when :String
160
+ value.to_s
161
+ when :Integer
162
+ value.to_i
163
+ when :Float
164
+ value.to_f
165
+ when :Boolean
166
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
167
+ true
168
+ else
169
+ false
170
+ end
171
+ when :Object
172
+ # generic object (usually a Hash), return directly
173
+ value
174
+ when /\AArray<(?<inner_type>.+)>\z/
175
+ inner_type = Regexp.last_match[:inner_type]
176
+ value.map { |v| _deserialize(inner_type, v) }
177
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
178
+ k_type = Regexp.last_match[:k_type]
179
+ v_type = Regexp.last_match[:v_type]
180
+ {}.tap do |hash|
181
+ value.each do |k, v|
182
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
183
+ end
184
+ end
185
+ else # model
186
+ # models (e.g. Pet) or oneOf
187
+ klass = DaytonaApiClient.const_get(type)
188
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
189
+ end
190
+ end
191
+
192
+ # Returns the string representation of the object
193
+ # @return [String] String presentation of the object
194
+ def to_s
195
+ to_hash.to_s
196
+ end
197
+
198
+ # to_body is an alias to to_hash (backward compatibility)
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_body
201
+ to_hash
202
+ end
203
+
204
+ # Returns the object in the form of hash
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_hash
207
+ hash = {}
208
+ self.class.attribute_map.each_pair do |attr, param|
209
+ value = self.send(attr)
210
+ if value.nil?
211
+ is_nullable = self.class.openapi_nullable.include?(attr)
212
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
213
+ end
214
+
215
+ hash[param] = _to_hash(value)
216
+ end
217
+ hash
218
+ end
219
+
220
+ # Outputs non-array value in the form of hash
221
+ # For object, use to_hash. Otherwise, just return the value
222
+ # @param [Object] value Any valid value
223
+ # @return [Hash] Returns the value in the form of hash
224
+ def _to_hash(value)
225
+ if value.is_a?(Array)
226
+ value.compact.map { |v| _to_hash(v) }
227
+ elsif value.is_a?(Hash)
228
+ {}.tap do |hash|
229
+ value.each { |k, v| hash[k] = _to_hash(v) }
230
+ end
231
+ elsif value.respond_to? :to_hash
232
+ value.to_hash
233
+ else
234
+ value
235
+ end
236
+ end
237
+ end
238
+ end
@@ -0,0 +1,54 @@
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 SandboxState
18
+ CREATING = "creating".freeze
19
+ RESTORING = "restoring".freeze
20
+ DESTROYED = "destroyed".freeze
21
+ DESTROYING = "destroying".freeze
22
+ STARTED = "started".freeze
23
+ STOPPED = "stopped".freeze
24
+ STARTING = "starting".freeze
25
+ STOPPING = "stopping".freeze
26
+ ERROR = "error".freeze
27
+ BUILD_FAILED = "build_failed".freeze
28
+ PENDING_BUILD = "pending_build".freeze
29
+ BUILDING_SNAPSHOT = "building_snapshot".freeze
30
+ UNKNOWN = "unknown".freeze
31
+ PULLING_SNAPSHOT = "pulling_snapshot".freeze
32
+ ARCHIVED = "archived".freeze
33
+ ARCHIVING = "archiving".freeze
34
+
35
+ def self.all_vars
36
+ @all_vars ||= [CREATING, RESTORING, DESTROYED, DESTROYING, STARTED, STOPPED, STARTING, STOPPING, ERROR, BUILD_FAILED, PENDING_BUILD, BUILDING_SNAPSHOT, UNKNOWN, PULLING_SNAPSHOT, ARCHIVED, ARCHIVING].freeze
37
+ end
38
+
39
+ # Builds the enum from string
40
+ # @param [String] The enum value in the form of the string
41
+ # @return [String] The enum value
42
+ def self.build_from_hash(value)
43
+ new.build_from_hash(value)
44
+ end
45
+
46
+ # Builds the enum from string
47
+ # @param [String] The enum value in the form of the string
48
+ # @return [String] The enum value
49
+ def build_from_hash(value)
50
+ return value if SandboxState.all_vars.include?(value)
51
+ raise "Invalid ENUM value #{value} for class #SandboxState"
52
+ end
53
+ end
54
+ end