daytona_api_client 0.203.0 → 0.205.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 (39) hide show
  1. checksums.yaml +4 -4
  2. data/.openapi-generator/FILES +13 -0
  3. data/lib/daytona_api_client/api/admin_api.rb +3 -0
  4. data/lib/daytona_api_client/api/audit_api.rb +57 -0
  5. data/lib/daytona_api_client/api/organizations_api.rb +485 -0
  6. data/lib/daytona_api_client/api/runners_api.rb +58 -0
  7. data/lib/daytona_api_client/api/sandbox_api.rb +2 -0
  8. data/lib/daytona_api_client/api/snapshots_api.rb +3 -0
  9. data/lib/daytona_api_client/api/users_api.rb +173 -0
  10. data/lib/daytona_api_client/models/audit_scenarios.rb +167 -0
  11. data/lib/daytona_api_client/models/audit_target_scenario.rb +208 -0
  12. data/lib/daytona_api_client/models/create_identity_provider.rb +269 -0
  13. data/lib/daytona_api_client/models/create_organization_region_quota.rb +16 -5
  14. data/lib/daytona_api_client/models/create_region.rb +16 -5
  15. data/lib/daytona_api_client/models/create_sandbox.rb +34 -2
  16. data/lib/daytona_api_client/models/create_user.rb +26 -21
  17. data/lib/daytona_api_client/models/daytona_configuration.rb +33 -1
  18. data/lib/daytona_api_client/models/identity_provider.rb +439 -0
  19. data/lib/daytona_api_client/models/oidc_id_p_config.rb +229 -0
  20. data/lib/daytona_api_client/models/oidc_id_p_config_response.rb +202 -0
  21. data/lib/daytona_api_client/models/organization.rb +28 -1
  22. data/lib/daytona_api_client/models/organization_sso_enabled.rb +165 -0
  23. data/lib/daytona_api_client/models/pending_sso_link.rb +283 -0
  24. data/lib/daytona_api_client/models/region.rb +16 -5
  25. data/lib/daytona_api_client/models/region_quota.rb +18 -5
  26. data/lib/daytona_api_client/models/sandbox.rb +43 -1
  27. data/lib/daytona_api_client/models/sandbox_list_item.rb +70 -1
  28. data/lib/daytona_api_client/models/snapshot_dto.rb +14 -1
  29. data/lib/daytona_api_client/models/sso_oidc_config.rb +192 -0
  30. data/lib/daytona_api_client/models/test_identity_provider_connection.rb +165 -0
  31. data/lib/daytona_api_client/models/test_identity_provider_connection_response.rb +185 -0
  32. data/lib/daytona_api_client/models/update_identity_provider.rb +212 -0
  33. data/lib/daytona_api_client/models/update_oidc_id_p_config.rb +178 -0
  34. data/lib/daytona_api_client/models/update_organization_region_quota.rb +16 -5
  35. data/lib/daytona_api_client/models/update_region.rb +16 -5
  36. data/lib/daytona_api_client/models/user.rb +38 -1
  37. data/lib/daytona_api_client/version.rb +1 -1
  38. data/lib/daytona_api_client.rb +13 -0
  39. metadata +16 -3
@@ -19,6 +19,124 @@ module DaytonaApiClient
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Confirm (link) a pending SSO account link
23
+ # @param id [String]
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [nil]
26
+ def confirm_pending_sso_link(id, opts = {})
27
+ confirm_pending_sso_link_with_http_info(id, opts)
28
+ nil
29
+ end
30
+
31
+ # Confirm (link) a pending SSO account link
32
+ # @param id [String]
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
35
+ def confirm_pending_sso_link_with_http_info(id, opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: UsersApi.confirm_pending_sso_link ...'
38
+ end
39
+ # verify the required parameter 'id' is set
40
+ if @api_client.config.client_side_validation && id.nil?
41
+ fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.confirm_pending_sso_link"
42
+ end
43
+ # resource path
44
+ local_var_path = '/users/me/pending-sso-links/{id}/confirm'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
45
+
46
+ # query parameters
47
+ query_params = opts[:query_params] || {}
48
+
49
+ # header parameters
50
+ header_params = opts[:header_params] || {}
51
+
52
+ # form parameters
53
+ form_params = opts[:form_params] || {}
54
+
55
+ # http body (model)
56
+ post_body = opts[:debug_body]
57
+
58
+ # return_type
59
+ return_type = opts[:debug_return_type]
60
+
61
+ # auth_names
62
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
63
+
64
+ new_options = opts.merge(
65
+ :operation => :"UsersApi.confirm_pending_sso_link",
66
+ :header_params => header_params,
67
+ :query_params => query_params,
68
+ :form_params => form_params,
69
+ :body => post_body,
70
+ :auth_names => auth_names,
71
+ :return_type => return_type
72
+ )
73
+
74
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
75
+ if @api_client.config.debugging
76
+ @api_client.config.logger.debug "API called: UsersApi#confirm_pending_sso_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
77
+ end
78
+ return data, status_code, headers
79
+ end
80
+
81
+ # Dismiss a pending SSO account link
82
+ # @param id [String]
83
+ # @param [Hash] opts the optional parameters
84
+ # @return [nil]
85
+ def dismiss_pending_sso_link(id, opts = {})
86
+ dismiss_pending_sso_link_with_http_info(id, opts)
87
+ nil
88
+ end
89
+
90
+ # Dismiss a pending SSO account link
91
+ # @param id [String]
92
+ # @param [Hash] opts the optional parameters
93
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
94
+ def dismiss_pending_sso_link_with_http_info(id, opts = {})
95
+ if @api_client.config.debugging
96
+ @api_client.config.logger.debug 'Calling API: UsersApi.dismiss_pending_sso_link ...'
97
+ end
98
+ # verify the required parameter 'id' is set
99
+ if @api_client.config.client_side_validation && id.nil?
100
+ fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.dismiss_pending_sso_link"
101
+ end
102
+ # resource path
103
+ local_var_path = '/users/me/pending-sso-links/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
104
+
105
+ # query parameters
106
+ query_params = opts[:query_params] || {}
107
+
108
+ # header parameters
109
+ header_params = opts[:header_params] || {}
110
+
111
+ # form parameters
112
+ form_params = opts[:form_params] || {}
113
+
114
+ # http body (model)
115
+ post_body = opts[:debug_body]
116
+
117
+ # return_type
118
+ return_type = opts[:debug_return_type]
119
+
120
+ # auth_names
121
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
122
+
123
+ new_options = opts.merge(
124
+ :operation => :"UsersApi.dismiss_pending_sso_link",
125
+ :header_params => header_params,
126
+ :query_params => query_params,
127
+ :form_params => form_params,
128
+ :body => post_body,
129
+ :auth_names => auth_names,
130
+ :return_type => return_type
131
+ )
132
+
133
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
134
+ if @api_client.config.debugging
135
+ @api_client.config.logger.debug "API called: UsersApi#dismiss_pending_sso_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
136
+ end
137
+ return data, status_code, headers
138
+ end
139
+
22
140
  # Enroll in SMS MFA
23
141
  # @param [Hash] opts the optional parameters
24
142
  # @return [String]
@@ -248,6 +366,61 @@ module DaytonaApiClient
248
366
  return data, status_code, headers
249
367
  end
250
368
 
369
+ # List pending SSO account links for the authenticated user
370
+ # @param [Hash] opts the optional parameters
371
+ # @return [Array<PendingSsoLink>]
372
+ def list_pending_sso_links(opts = {})
373
+ data, _status_code, _headers = list_pending_sso_links_with_http_info(opts)
374
+ data
375
+ end
376
+
377
+ # List pending SSO account links for the authenticated user
378
+ # @param [Hash] opts the optional parameters
379
+ # @return [Array<(Array<PendingSsoLink>, Integer, Hash)>] Array<PendingSsoLink> data, response status code and response headers
380
+ def list_pending_sso_links_with_http_info(opts = {})
381
+ if @api_client.config.debugging
382
+ @api_client.config.logger.debug 'Calling API: UsersApi.list_pending_sso_links ...'
383
+ end
384
+ # resource path
385
+ local_var_path = '/users/me/pending-sso-links'
386
+
387
+ # query parameters
388
+ query_params = opts[:query_params] || {}
389
+
390
+ # header parameters
391
+ header_params = opts[:header_params] || {}
392
+ # HTTP header 'Accept' (if needed)
393
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
394
+
395
+ # form parameters
396
+ form_params = opts[:form_params] || {}
397
+
398
+ # http body (model)
399
+ post_body = opts[:debug_body]
400
+
401
+ # return_type
402
+ return_type = opts[:debug_return_type] || 'Array<PendingSsoLink>'
403
+
404
+ # auth_names
405
+ auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']
406
+
407
+ new_options = opts.merge(
408
+ :operation => :"UsersApi.list_pending_sso_links",
409
+ :header_params => header_params,
410
+ :query_params => query_params,
411
+ :form_params => form_params,
412
+ :body => post_body,
413
+ :auth_names => auth_names,
414
+ :return_type => return_type
415
+ )
416
+
417
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
418
+ if @api_client.config.debugging
419
+ @api_client.config.logger.debug "API called: UsersApi#list_pending_sso_links\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
420
+ end
421
+ return data, status_code, headers
422
+ end
423
+
251
424
  # Unlink account
252
425
  # @param provider [String]
253
426
  # @param provider_user_id [String]
@@ -0,0 +1,167 @@
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.21.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DaytonaApiClient
17
+ class AuditScenarios < ApiModelBase
18
+ # Supported audit log scenarios grouped by target type. Derived at runtime from the audited routes and system events, sorted by target type.
19
+ attr_accessor :targets
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'targets' => :'targets'
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
+ :'targets' => :'Array<AuditTargetScenario>'
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::AuditScenarios` 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::AuditScenarios`. 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?(:'targets')
68
+ if (value = attributes[:'targets']).is_a?(Array)
69
+ self.targets = value
70
+ end
71
+ else
72
+ self.targets = 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 @targets.nil?
82
+ invalid_properties.push('invalid value for "targets", targets 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 @targets.nil?
93
+ true
94
+ end
95
+
96
+ # Custom attribute writer method with validation
97
+ # @param [Object] targets Value to be assigned
98
+ def targets=(targets)
99
+ if targets.nil?
100
+ fail ArgumentError, 'targets cannot be nil'
101
+ end
102
+
103
+ @targets = targets
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
+ targets == o.targets
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
+ [targets].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
+ # Returns the object in the form of hash
150
+ # @return [Hash] Returns the object in the form of hash
151
+ def to_hash
152
+ hash = {}
153
+ self.class.attribute_map.each_pair do |attr, param|
154
+ value = self.send(attr)
155
+ if value.nil?
156
+ is_nullable = self.class.openapi_nullable.include?(attr)
157
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
158
+ end
159
+
160
+ hash[param] = _to_hash(value)
161
+ end
162
+ hash
163
+ end
164
+
165
+ end
166
+
167
+ end
@@ -0,0 +1,208 @@
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.21.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DaytonaApiClient
17
+ class AuditTargetScenario < ApiModelBase
18
+ # Resource type the actions apply to. Scenarios that are not scoped to a specific resource type (e.g. leaving an organization) are grouped under \"other\".
19
+ attr_accessor :target_type
20
+
21
+ # Actions that can be audited against this target type, sorted alphabetically.
22
+ attr_accessor :actions
23
+
24
+ class EnumAttributeValidator
25
+ attr_reader :datatype
26
+ attr_reader :allowable_values
27
+
28
+ def initialize(datatype, allowable_values)
29
+ @allowable_values = allowable_values.map do |value|
30
+ case datatype.to_s
31
+ when /Integer/i
32
+ value.to_i
33
+ when /Float/i
34
+ value.to_f
35
+ else
36
+ value
37
+ end
38
+ end
39
+ end
40
+
41
+ def valid?(value)
42
+ !value || allowable_values.include?(value)
43
+ end
44
+ end
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'target_type' => :'targetType',
50
+ :'actions' => :'actions'
51
+ }
52
+ end
53
+
54
+ # Returns attribute mapping this model knows about
55
+ def self.acceptable_attribute_map
56
+ attribute_map
57
+ end
58
+
59
+ # Returns all the JSON keys this model knows about
60
+ def self.acceptable_attributes
61
+ acceptable_attribute_map.values
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ def self.openapi_types
66
+ {
67
+ :'target_type' => :'String',
68
+ :'actions' => :'Array<String>'
69
+ }
70
+ end
71
+
72
+ # List of attributes with nullable: true
73
+ def self.openapi_nullable
74
+ Set.new([
75
+ ])
76
+ end
77
+
78
+ # Initializes the object
79
+ # @param [Hash] attributes Model attributes in the form of hash
80
+ def initialize(attributes = {})
81
+ if (!attributes.is_a?(Hash))
82
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::AuditTargetScenario` initialize method"
83
+ end
84
+
85
+ # check to see if the attribute exists and convert string to symbol for hash key
86
+ acceptable_attribute_map = self.class.acceptable_attribute_map
87
+ attributes = attributes.each_with_object({}) { |(k, v), h|
88
+ if (!acceptable_attribute_map.key?(k.to_sym))
89
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::AuditTargetScenario`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
90
+ end
91
+ h[k.to_sym] = v
92
+ }
93
+
94
+ if attributes.key?(:'target_type')
95
+ self.target_type = attributes[:'target_type']
96
+ else
97
+ self.target_type = nil
98
+ end
99
+
100
+ if attributes.key?(:'actions')
101
+ if (value = attributes[:'actions']).is_a?(Array)
102
+ self.actions = value
103
+ end
104
+ else
105
+ self.actions = nil
106
+ end
107
+ end
108
+
109
+ # Show invalid properties with the reasons. Usually used together with valid?
110
+ # @return Array for valid properties with the reasons
111
+ def list_invalid_properties
112
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
113
+ invalid_properties = Array.new
114
+ if @target_type.nil?
115
+ invalid_properties.push('invalid value for "target_type", target_type cannot be nil.')
116
+ end
117
+
118
+ if @actions.nil?
119
+ invalid_properties.push('invalid value for "actions", actions cannot be nil.')
120
+ end
121
+
122
+ invalid_properties
123
+ end
124
+
125
+ # Check to see if the all the properties in the model are valid
126
+ # @return true if the model is valid
127
+ def valid?
128
+ warn '[DEPRECATED] the `valid?` method is obsolete'
129
+ return false if @target_type.nil?
130
+ target_type_validator = EnumAttributeValidator.new('String', ["api_key", "organization", "organization_invitation", "organization_role", "organization_user", "docker_registry", "runner", "sandbox", "snapshot", "user", "volume", "warm_pool", "region", "secret", "other", "identity_provider", "unknown_default_open_api"])
131
+ return false unless target_type_validator.valid?(@target_type)
132
+ return false if @actions.nil?
133
+ true
134
+ end
135
+
136
+ # Custom attribute writer method checking allowed values (enum).
137
+ # @param [Object] target_type Object to be assigned
138
+ def target_type=(target_type)
139
+ validator = EnumAttributeValidator.new('String', ["api_key", "organization", "organization_invitation", "organization_role", "organization_user", "docker_registry", "runner", "sandbox", "snapshot", "user", "volume", "warm_pool", "region", "secret", "other", "identity_provider", "unknown_default_open_api"])
140
+ unless validator.valid?(target_type)
141
+ fail ArgumentError, "invalid value for \"target_type\", must be one of #{validator.allowable_values}."
142
+ end
143
+ @target_type = target_type
144
+ end
145
+
146
+ # Checks equality by comparing each attribute.
147
+ # @param [Object] Object to be compared
148
+ def ==(o)
149
+ return true if self.equal?(o)
150
+ self.class == o.class &&
151
+ target_type == o.target_type &&
152
+ actions == o.actions
153
+ end
154
+
155
+ # @see the `==` method
156
+ # @param [Object] Object to be compared
157
+ def eql?(o)
158
+ self == o
159
+ end
160
+
161
+ # Calculates hash code according to all attributes.
162
+ # @return [Integer] Hash code
163
+ def hash
164
+ [target_type, actions].hash
165
+ end
166
+
167
+ # Builds the object from hash
168
+ # @param [Hash] attributes Model attributes in the form of hash
169
+ # @return [Object] Returns the model itself
170
+ def self.build_from_hash(attributes)
171
+ return nil unless attributes.is_a?(Hash)
172
+ attributes = attributes.transform_keys(&:to_sym)
173
+ transformed_hash = {}
174
+ openapi_types.each_pair do |key, type|
175
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
176
+ transformed_hash["#{key}"] = nil
177
+ elsif type =~ /\AArray<(.*)>/i
178
+ # check to ensure the input is an array given that the attribute
179
+ # is documented as an array but the input is not
180
+ if attributes[attribute_map[key]].is_a?(Array)
181
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
182
+ end
183
+ elsif !attributes[attribute_map[key]].nil?
184
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
185
+ end
186
+ end
187
+ new(transformed_hash)
188
+ end
189
+
190
+ # Returns the object in the form of hash
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_hash
193
+ hash = {}
194
+ self.class.attribute_map.each_pair do |attr, param|
195
+ value = self.send(attr)
196
+ if value.nil?
197
+ is_nullable = self.class.openapi_nullable.include?(attr)
198
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
199
+ end
200
+
201
+ hash[param] = _to_hash(value)
202
+ end
203
+ hash
204
+ end
205
+
206
+ end
207
+
208
+ end