daytona_api_client 0.126.0.pre.alpha.5 → 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 (45) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +3 -3
  3. data/daytona_api_client.gemspec +2 -2
  4. data/lib/daytona_api_client/api/audit_api.rb +66 -18
  5. data/lib/daytona_api_client/api/organizations_api.rb +12 -219
  6. data/lib/daytona_api_client/api/preview_api.rb +5 -7
  7. data/lib/daytona_api_client/api/runners_api.rb +0 -55
  8. data/lib/daytona_api_client/api/sandbox_api.rb +222 -309
  9. data/lib/daytona_api_client/api/toolbox_api.rb +711 -711
  10. data/lib/daytona_api_client/api/workspace_api.rb +3 -3
  11. data/lib/daytona_api_client/models/create_organization.rb +4 -31
  12. data/lib/daytona_api_client/models/create_sandbox.rb +1 -11
  13. data/lib/daytona_api_client/models/create_user.rb +1 -10
  14. data/lib/daytona_api_client/models/daytona_configuration.rb +4 -41
  15. data/lib/daytona_api_client/models/organization.rb +85 -53
  16. data/lib/daytona_api_client/models/organization_usage_overview.rb +146 -18
  17. data/lib/daytona_api_client/models/paginated_audit_logs.rb +4 -14
  18. data/lib/daytona_api_client/models/port_preview_url.rb +14 -31
  19. data/lib/daytona_api_client/models/region.rb +4 -96
  20. data/lib/daytona_api_client/models/sandbox.rb +11 -38
  21. data/lib/daytona_api_client/models/sandbox_volume.rb +4 -14
  22. data/lib/daytona_api_client/models/snapshot_state.rb +4 -1
  23. data/lib/daytona_api_client/models/ssh_access_validation_dto.rb +24 -4
  24. data/lib/daytona_api_client/models/update_organization_quota.rb +41 -41
  25. data/lib/daytona_api_client/models/update_sandbox_state_dto.rb +4 -14
  26. data/lib/daytona_api_client/models/workspace.rb +38 -38
  27. data/lib/daytona_api_client/version.rb +1 -1
  28. data/lib/daytona_api_client.rb +1 -8
  29. data/project.json +7 -29
  30. metadata +1 -16
  31. data/.gitignore +0 -39
  32. data/.openapi-generator/FILES +0 -171
  33. data/.openapi-generator/VERSION +0 -1
  34. data/.openapi-generator-ignore +0 -33
  35. data/.rspec +0 -2
  36. data/.rubocop.yml +0 -148
  37. data/fix-gemspec.sh +0 -11
  38. data/lib/daytona_api_client/api/regions_api.rb +0 -83
  39. data/lib/daytona_api_client/models/rate_limit_config.rb +0 -249
  40. data/lib/daytona_api_client/models/rate_limit_entry.rb +0 -229
  41. data/lib/daytona_api_client/models/region_quota.rb +0 -339
  42. data/lib/daytona_api_client/models/region_usage_overview.rb +0 -391
  43. data/lib/daytona_api_client/models/update_organization_default_region.rb +0 -236
  44. data/lib/daytona_api_client/models/update_organization_region_quota.rb +0 -245
  45. data/lib/daytona_api_client/models/workspace_port_preview_url.rb +0 -263
@@ -1,33 +0,0 @@
1
- # OpenAPI Generator Ignore
2
- # Generated by openapi-generator https://github.com/openapitools/openapi-generator
3
-
4
- # Use this file to prevent files from being overwritten by the generator.
5
- # The patterns follow closely to .gitignore or .dockerignore.
6
-
7
- # As an example, the C# client generator defines ApiClient.cs.
8
- # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9
- #ApiClient.cs
10
-
11
- # You can match any string of characters against a directory, file or extension with a single asterisk (*):
12
- #foo/*/qux
13
- # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14
-
15
- # You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16
- #foo/**/qux
17
- # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18
-
19
- # You can also negate patterns with an exclamation (!).
20
- # For example, you can ignore all files in a docs folder with the file extension .md:
21
- #docs/*.md
22
- # Then explicitly reverse the ignore rule for a single file:
23
- #!docs/README.md
24
-
25
- git_push.sh
26
- .travis.yml
27
- spec/**
28
- .gitlab-ci.yml
29
- docs/**
30
- README.md
31
- Gemfile
32
- Gemfile.lock
33
- daytona_api_client.gemspec
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --color
2
- --require spec_helper
data/.rubocop.yml DELETED
@@ -1,148 +0,0 @@
1
- # This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license)
2
- # Automatically generated by OpenAPI Generator (https://openapi-generator.tech)
3
- AllCops:
4
- TargetRubyVersion: 2.4
5
- # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
6
- # to ignore them, so only the ones explicitly set in this file are enabled.
7
- DisabledByDefault: true
8
- Exclude:
9
- - '**/templates/**/*'
10
- - '**/vendor/**/*'
11
- - 'actionpack/lib/action_dispatch/journey/parser.rb'
12
-
13
- # Prefer &&/|| over and/or.
14
- Style/AndOr:
15
- Enabled: true
16
-
17
- # Align `when` with `case`.
18
- Layout/CaseIndentation:
19
- Enabled: true
20
-
21
- # Align comments with method definitions.
22
- Layout/CommentIndentation:
23
- Enabled: true
24
-
25
- Layout/ElseAlignment:
26
- Enabled: true
27
-
28
- Layout/EmptyLineAfterMagicComment:
29
- Enabled: true
30
-
31
- # In a regular class definition, no empty lines around the body.
32
- Layout/EmptyLinesAroundClassBody:
33
- Enabled: true
34
-
35
- # In a regular method definition, no empty lines around the body.
36
- Layout/EmptyLinesAroundMethodBody:
37
- Enabled: true
38
-
39
- # In a regular module definition, no empty lines around the body.
40
- Layout/EmptyLinesAroundModuleBody:
41
- Enabled: true
42
-
43
- Layout/FirstArgumentIndentation:
44
- Enabled: true
45
-
46
- # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
47
- Style/HashSyntax:
48
- Enabled: false
49
-
50
- # Method definitions after `private` or `protected` isolated calls need one
51
- # extra level of indentation.
52
- Layout/IndentationConsistency:
53
- Enabled: true
54
- EnforcedStyle: indented_internal_methods
55
-
56
- # Two spaces, no tabs (for indentation).
57
- Layout/IndentationWidth:
58
- Enabled: true
59
-
60
- Layout/LeadingCommentSpace:
61
- Enabled: true
62
-
63
- Layout/SpaceAfterColon:
64
- Enabled: true
65
-
66
- Layout/SpaceAfterComma:
67
- Enabled: true
68
-
69
- Layout/SpaceAroundEqualsInParameterDefault:
70
- Enabled: true
71
-
72
- Layout/SpaceAroundKeyword:
73
- Enabled: true
74
-
75
- Layout/SpaceAroundOperators:
76
- Enabled: true
77
-
78
- Layout/SpaceBeforeComma:
79
- Enabled: true
80
-
81
- Layout/SpaceBeforeFirstArg:
82
- Enabled: true
83
-
84
- Style/DefWithParentheses:
85
- Enabled: true
86
-
87
- # Defining a method with parameters needs parentheses.
88
- Style/MethodDefParentheses:
89
- Enabled: true
90
-
91
- Style/FrozenStringLiteralComment:
92
- Enabled: false
93
- EnforcedStyle: always
94
-
95
- # Use `foo {}` not `foo{}`.
96
- Layout/SpaceBeforeBlockBraces:
97
- Enabled: true
98
-
99
- # Use `foo { bar }` not `foo {bar}`.
100
- Layout/SpaceInsideBlockBraces:
101
- Enabled: true
102
-
103
- # Use `{ a: 1 }` not `{a:1}`.
104
- Layout/SpaceInsideHashLiteralBraces:
105
- Enabled: true
106
-
107
- Layout/SpaceInsideParens:
108
- Enabled: true
109
-
110
- # Check quotes usage according to lint rule below.
111
- #Style/StringLiterals:
112
- # Enabled: true
113
- # EnforcedStyle: single_quotes
114
-
115
- # Detect hard tabs, no hard tabs.
116
- Layout/IndentationStyle:
117
- Enabled: true
118
-
119
- # Blank lines should not have any spaces.
120
- Layout/TrailingEmptyLines:
121
- Enabled: true
122
-
123
- # No trailing whitespace.
124
- Layout/TrailingWhitespace:
125
- Enabled: false
126
-
127
- # Use quotes for string literals when they are enough.
128
- Style/RedundantPercentQ:
129
- Enabled: true
130
-
131
- # Align `end` with the matching keyword or starting expression except for
132
- # assignments, where it should be aligned with the LHS.
133
- Layout/EndAlignment:
134
- Enabled: true
135
- EnforcedStyleAlignWith: variable
136
- AutoCorrect: true
137
-
138
- # Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
139
- Lint/RequireParentheses:
140
- Enabled: true
141
-
142
- Style/RedundantReturn:
143
- Enabled: true
144
- AllowMultipleReturnValues: true
145
-
146
- Style/Semicolon:
147
- Enabled: true
148
- AllowAsExpressionSeparator: true
data/fix-gemspec.sh DELETED
@@ -1,11 +0,0 @@
1
- #!/bin/bash
2
- # Fix the gemspec and Gemfile generated by OpenAPI Generator
3
- SCRIPT_DIR="$(dirname "$0")"
4
-
5
- # Fix gemspec: replace backtick find commands with git ls-files and Dir.glob
6
- # This is safer and works correctly in CI environments
7
- sed -i "s/\`find \*\`\.split(\"\\\\n\")\.uniq\.sort\.select { |f| !f\.empty? }/\`git ls-files -z\`\.split(\"\\\\x0\")\.reject { |f| f.match(%r{^(test|spec|features)\/}) || f.end_with?('.gem') }/g" "$SCRIPT_DIR/daytona_api_client.gemspec"
8
- sed -i "s/\`find spec\/\*\`\.split(\"\\\\n\")/Dir.exist?('spec') ? Dir.glob('spec\/\*\*\/\*') : []/g" "$SCRIPT_DIR/daytona_api_client.gemspec"
9
-
10
- # Fix Gemfile: update rubocop from ~> 0.66.0 to ~> 1.21
11
- sed -i "s/gem 'rubocop', '~> 0\.66\.0'/gem 'rubocop', '~> 1.21'/g" "$SCRIPT_DIR/Gemfile"
@@ -1,83 +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 'cgi'
14
-
15
- module DaytonaApiClient
16
- class RegionsApi
17
- attr_accessor :api_client
18
-
19
- def initialize(api_client = ApiClient.default)
20
- @api_client = api_client
21
- end
22
- # List all regions
23
- # @param [Hash] opts the optional parameters
24
- # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
25
- # @option opts [Boolean] :include_shared Include shared regions
26
- # @return [Array<Region>]
27
- def list_regions(opts = {})
28
- data, _status_code, _headers = list_regions_with_http_info(opts)
29
- data
30
- end
31
-
32
- # List all regions
33
- # @param [Hash] opts the optional parameters
34
- # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
35
- # @option opts [Boolean] :include_shared Include shared regions
36
- # @return [Array<(Array<Region>, Integer, Hash)>] Array<Region> data, response status code and response headers
37
- def list_regions_with_http_info(opts = {})
38
- if @api_client.config.debugging
39
- @api_client.config.logger.debug 'Calling API: RegionsApi.list_regions ...'
40
- end
41
- # resource path
42
- local_var_path = '/regions'
43
-
44
- # query parameters
45
- query_params = opts[:query_params] || {}
46
- query_params[:'includeShared'] = opts[:'include_shared'] if !opts[:'include_shared'].nil?
47
-
48
- # header parameters
49
- header_params = opts[:header_params] || {}
50
- # HTTP header 'Accept' (if needed)
51
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
52
- header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?
53
-
54
- # form parameters
55
- form_params = opts[:form_params] || {}
56
-
57
- # http body (model)
58
- post_body = opts[:debug_body]
59
-
60
- # return_type
61
- return_type = opts[:debug_return_type] || 'Array<Region>'
62
-
63
- # auth_names
64
- auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
65
-
66
- new_options = opts.merge(
67
- :operation => :"RegionsApi.list_regions",
68
- :header_params => header_params,
69
- :query_params => query_params,
70
- :form_params => form_params,
71
- :body => post_body,
72
- :auth_names => auth_names,
73
- :return_type => return_type
74
- )
75
-
76
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
77
- if @api_client.config.debugging
78
- @api_client.config.logger.debug "API called: RegionsApi#list_regions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
79
- end
80
- return data, status_code, headers
81
- end
82
- end
83
- end
@@ -1,249 +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 RateLimitConfig
18
- # Failed authentication rate limit
19
- attr_accessor :failed_auth
20
-
21
- # Authenticated rate limit
22
- attr_accessor :authenticated
23
-
24
- # Sandbox create rate limit
25
- attr_accessor :sandbox_create
26
-
27
- # Sandbox lifecycle rate limit
28
- attr_accessor :sandbox_lifecycle
29
-
30
- # Attribute mapping from ruby-style variable name to JSON key.
31
- def self.attribute_map
32
- {
33
- :'failed_auth' => :'failedAuth',
34
- :'authenticated' => :'authenticated',
35
- :'sandbox_create' => :'sandboxCreate',
36
- :'sandbox_lifecycle' => :'sandboxLifecycle'
37
- }
38
- end
39
-
40
- # Returns attribute mapping this model knows about
41
- def self.acceptable_attribute_map
42
- attribute_map
43
- end
44
-
45
- # Returns all the JSON keys this model knows about
46
- def self.acceptable_attributes
47
- acceptable_attribute_map.values
48
- end
49
-
50
- # Attribute type mapping.
51
- def self.openapi_types
52
- {
53
- :'failed_auth' => :'RateLimitEntry',
54
- :'authenticated' => :'RateLimitEntry',
55
- :'sandbox_create' => :'RateLimitEntry',
56
- :'sandbox_lifecycle' => :'RateLimitEntry'
57
- }
58
- end
59
-
60
- # List of attributes with nullable: true
61
- def self.openapi_nullable
62
- Set.new([
63
- ])
64
- end
65
-
66
- # Initializes the object
67
- # @param [Hash] attributes Model attributes in the form of hash
68
- def initialize(attributes = {})
69
- if (!attributes.is_a?(Hash))
70
- fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::RateLimitConfig` initialize method"
71
- end
72
-
73
- # check to see if the attribute exists and convert string to symbol for hash key
74
- acceptable_attribute_map = self.class.acceptable_attribute_map
75
- attributes = attributes.each_with_object({}) { |(k, v), h|
76
- if (!acceptable_attribute_map.key?(k.to_sym))
77
- fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::RateLimitConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
78
- end
79
- h[k.to_sym] = v
80
- }
81
-
82
- if attributes.key?(:'failed_auth')
83
- self.failed_auth = attributes[:'failed_auth']
84
- end
85
-
86
- if attributes.key?(:'authenticated')
87
- self.authenticated = attributes[:'authenticated']
88
- end
89
-
90
- if attributes.key?(:'sandbox_create')
91
- self.sandbox_create = attributes[:'sandbox_create']
92
- end
93
-
94
- if attributes.key?(:'sandbox_lifecycle')
95
- self.sandbox_lifecycle = attributes[:'sandbox_lifecycle']
96
- end
97
- end
98
-
99
- # Show invalid properties with the reasons. Usually used together with valid?
100
- # @return Array for valid properties with the reasons
101
- def list_invalid_properties
102
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
103
- invalid_properties = Array.new
104
- invalid_properties
105
- end
106
-
107
- # Check to see if the all the properties in the model are valid
108
- # @return true if the model is valid
109
- def valid?
110
- warn '[DEPRECATED] the `valid?` method is obsolete'
111
- true
112
- end
113
-
114
- # Checks equality by comparing each attribute.
115
- # @param [Object] Object to be compared
116
- def ==(o)
117
- return true if self.equal?(o)
118
- self.class == o.class &&
119
- failed_auth == o.failed_auth &&
120
- authenticated == o.authenticated &&
121
- sandbox_create == o.sandbox_create &&
122
- sandbox_lifecycle == o.sandbox_lifecycle
123
- end
124
-
125
- # @see the `==` method
126
- # @param [Object] Object to be compared
127
- def eql?(o)
128
- self == o
129
- end
130
-
131
- # Calculates hash code according to all attributes.
132
- # @return [Integer] Hash code
133
- def hash
134
- [failed_auth, authenticated, sandbox_create, sandbox_lifecycle].hash
135
- end
136
-
137
- # Builds the object from hash
138
- # @param [Hash] attributes Model attributes in the form of hash
139
- # @return [Object] Returns the model itself
140
- def self.build_from_hash(attributes)
141
- return nil unless attributes.is_a?(Hash)
142
- attributes = attributes.transform_keys(&:to_sym)
143
- transformed_hash = {}
144
- openapi_types.each_pair do |key, type|
145
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
146
- transformed_hash["#{key}"] = nil
147
- elsif type =~ /\AArray<(.*)>/i
148
- # check to ensure the input is an array given that the attribute
149
- # is documented as an array but the input is not
150
- if attributes[attribute_map[key]].is_a?(Array)
151
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
152
- end
153
- elsif !attributes[attribute_map[key]].nil?
154
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
155
- end
156
- end
157
- new(transformed_hash)
158
- end
159
-
160
- # Deserializes the data based on type
161
- # @param string type Data type
162
- # @param string value Value to be deserialized
163
- # @return [Object] Deserialized data
164
- def self._deserialize(type, value)
165
- case type.to_sym
166
- when :Time
167
- Time.parse(value)
168
- when :Date
169
- Date.parse(value)
170
- when :String
171
- value.to_s
172
- when :Integer
173
- value.to_i
174
- when :Float
175
- value.to_f
176
- when :Boolean
177
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
178
- true
179
- else
180
- false
181
- end
182
- when :Object
183
- # generic object (usually a Hash), return directly
184
- value
185
- when /\AArray<(?<inner_type>.+)>\z/
186
- inner_type = Regexp.last_match[:inner_type]
187
- value.map { |v| _deserialize(inner_type, v) }
188
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
189
- k_type = Regexp.last_match[:k_type]
190
- v_type = Regexp.last_match[:v_type]
191
- {}.tap do |hash|
192
- value.each do |k, v|
193
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
194
- end
195
- end
196
- else # model
197
- # models (e.g. Pet) or oneOf
198
- klass = DaytonaApiClient.const_get(type)
199
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
200
- end
201
- end
202
-
203
- # Returns the string representation of the object
204
- # @return [String] String presentation of the object
205
- def to_s
206
- to_hash.to_s
207
- end
208
-
209
- # to_body is an alias to to_hash (backward compatibility)
210
- # @return [Hash] Returns the object in the form of hash
211
- def to_body
212
- to_hash
213
- end
214
-
215
- # Returns the object in the form of hash
216
- # @return [Hash] Returns the object in the form of hash
217
- def to_hash
218
- hash = {}
219
- self.class.attribute_map.each_pair do |attr, param|
220
- value = self.send(attr)
221
- if value.nil?
222
- is_nullable = self.class.openapi_nullable.include?(attr)
223
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
224
- end
225
-
226
- hash[param] = _to_hash(value)
227
- end
228
- hash
229
- end
230
-
231
- # Outputs non-array value in the form of hash
232
- # For object, use to_hash. Otherwise, just return the value
233
- # @param [Object] value Any valid value
234
- # @return [Hash] Returns the value in the form of hash
235
- def _to_hash(value)
236
- if value.is_a?(Array)
237
- value.compact.map { |v| _to_hash(v) }
238
- elsif value.is_a?(Hash)
239
- {}.tap do |hash|
240
- value.each { |k, v| hash[k] = _to_hash(v) }
241
- end
242
- elsif value.respond_to? :to_hash
243
- value.to_hash
244
- else
245
- value
246
- end
247
- end
248
- end
249
- end