daytona_toolbox_api_client 0.166.0 → 0.167.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.
@@ -0,0 +1,295 @@
1
+ =begin
2
+ #Daytona Toolbox API
3
+
4
+ #Daytona Toolbox API
5
+
6
+ The version of the OpenAPI document: v0.0.0-dev
7
+
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 DaytonaToolboxApiClient
17
+ class CodeRunRequest
18
+ attr_accessor :argv
19
+
20
+ attr_accessor :code
21
+
22
+ attr_accessor :envs
23
+
24
+ # python, javascript, typescript
25
+ attr_accessor :language
26
+
27
+ attr_accessor :timeout
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'argv' => :'argv',
33
+ :'code' => :'code',
34
+ :'envs' => :'envs',
35
+ :'language' => :'language',
36
+ :'timeout' => :'timeout'
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
+ :'argv' => :'Array<String>',
54
+ :'code' => :'String',
55
+ :'envs' => :'Hash<String, String>',
56
+ :'language' => :'String',
57
+ :'timeout' => :'Integer'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ ])
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ if (!attributes.is_a?(Hash))
71
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaToolboxApiClient::CodeRunRequest` initialize method"
72
+ end
73
+
74
+ # check to see if the attribute exists and convert string to symbol for hash key
75
+ acceptable_attribute_map = self.class.acceptable_attribute_map
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!acceptable_attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaToolboxApiClient::CodeRunRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
79
+ end
80
+ h[k.to_sym] = v
81
+ }
82
+
83
+ if attributes.key?(:'argv')
84
+ if (value = attributes[:'argv']).is_a?(Array)
85
+ self.argv = value
86
+ end
87
+ end
88
+
89
+ if attributes.key?(:'code')
90
+ self.code = attributes[:'code']
91
+ else
92
+ self.code = nil
93
+ end
94
+
95
+ if attributes.key?(:'envs')
96
+ if (value = attributes[:'envs']).is_a?(Hash)
97
+ self.envs = value
98
+ end
99
+ end
100
+
101
+ if attributes.key?(:'language')
102
+ self.language = attributes[:'language']
103
+ else
104
+ self.language = nil
105
+ end
106
+
107
+ if attributes.key?(:'timeout')
108
+ self.timeout = attributes[:'timeout']
109
+ end
110
+ end
111
+
112
+ # Show invalid properties with the reasons. Usually used together with valid?
113
+ # @return Array for valid properties with the reasons
114
+ def list_invalid_properties
115
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
116
+ invalid_properties = Array.new
117
+ if @code.nil?
118
+ invalid_properties.push('invalid value for "code", code cannot be nil.')
119
+ end
120
+
121
+ if @language.nil?
122
+ invalid_properties.push('invalid value for "language", language cannot be nil.')
123
+ end
124
+
125
+ invalid_properties
126
+ end
127
+
128
+ # Check to see if the all the properties in the model are valid
129
+ # @return true if the model is valid
130
+ def valid?
131
+ warn '[DEPRECATED] the `valid?` method is obsolete'
132
+ return false if @code.nil?
133
+ return false if @language.nil?
134
+ true
135
+ end
136
+
137
+ # Custom attribute writer method with validation
138
+ # @param [Object] code Value to be assigned
139
+ def code=(code)
140
+ if code.nil?
141
+ fail ArgumentError, 'code cannot be nil'
142
+ end
143
+
144
+ @code = code
145
+ end
146
+
147
+ # Custom attribute writer method with validation
148
+ # @param [Object] language Value to be assigned
149
+ def language=(language)
150
+ if language.nil?
151
+ fail ArgumentError, 'language cannot be nil'
152
+ end
153
+
154
+ @language = language
155
+ end
156
+
157
+ # Checks equality by comparing each attribute.
158
+ # @param [Object] Object to be compared
159
+ def ==(o)
160
+ return true if self.equal?(o)
161
+ self.class == o.class &&
162
+ argv == o.argv &&
163
+ code == o.code &&
164
+ envs == o.envs &&
165
+ language == o.language &&
166
+ timeout == o.timeout
167
+ end
168
+
169
+ # @see the `==` method
170
+ # @param [Object] Object to be compared
171
+ def eql?(o)
172
+ self == o
173
+ end
174
+
175
+ # Calculates hash code according to all attributes.
176
+ # @return [Integer] Hash code
177
+ def hash
178
+ [argv, code, envs, language, timeout].hash
179
+ end
180
+
181
+ # Builds the object from hash
182
+ # @param [Hash] attributes Model attributes in the form of hash
183
+ # @return [Object] Returns the model itself
184
+ def self.build_from_hash(attributes)
185
+ return nil unless attributes.is_a?(Hash)
186
+ attributes = attributes.transform_keys(&:to_sym)
187
+ transformed_hash = {}
188
+ openapi_types.each_pair do |key, type|
189
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
190
+ transformed_hash["#{key}"] = nil
191
+ elsif type =~ /\AArray<(.*)>/i
192
+ # check to ensure the input is an array given that the attribute
193
+ # is documented as an array but the input is not
194
+ if attributes[attribute_map[key]].is_a?(Array)
195
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
196
+ end
197
+ elsif !attributes[attribute_map[key]].nil?
198
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
199
+ end
200
+ end
201
+ new(transformed_hash)
202
+ end
203
+
204
+ # Deserializes the data based on type
205
+ # @param string type Data type
206
+ # @param string value Value to be deserialized
207
+ # @return [Object] Deserialized data
208
+ def self._deserialize(type, value)
209
+ case type.to_sym
210
+ when :Time
211
+ Time.parse(value)
212
+ when :Date
213
+ Date.parse(value)
214
+ when :String
215
+ value.to_s
216
+ when :Integer
217
+ value.to_i
218
+ when :Float
219
+ value.to_f
220
+ when :Boolean
221
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
222
+ true
223
+ else
224
+ false
225
+ end
226
+ when :Object
227
+ # generic object (usually a Hash), return directly
228
+ value
229
+ when /\AArray<(?<inner_type>.+)>\z/
230
+ inner_type = Regexp.last_match[:inner_type]
231
+ value.map { |v| _deserialize(inner_type, v) }
232
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
233
+ k_type = Regexp.last_match[:k_type]
234
+ v_type = Regexp.last_match[:v_type]
235
+ {}.tap do |hash|
236
+ value.each do |k, v|
237
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
238
+ end
239
+ end
240
+ else # model
241
+ # models (e.g. Pet) or oneOf
242
+ klass = DaytonaToolboxApiClient.const_get(type)
243
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
244
+ end
245
+ end
246
+
247
+ # Returns the string representation of the object
248
+ # @return [String] String presentation of the object
249
+ def to_s
250
+ to_hash.to_s
251
+ end
252
+
253
+ # to_body is an alias to to_hash (backward compatibility)
254
+ # @return [Hash] Returns the object in the form of hash
255
+ def to_body
256
+ to_hash
257
+ end
258
+
259
+ # Returns the object in the form of hash
260
+ # @return [Hash] Returns the object in the form of hash
261
+ def to_hash
262
+ hash = {}
263
+ self.class.attribute_map.each_pair do |attr, param|
264
+ value = self.send(attr)
265
+ if value.nil?
266
+ is_nullable = self.class.openapi_nullable.include?(attr)
267
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
268
+ end
269
+
270
+ hash[param] = _to_hash(value)
271
+ end
272
+ hash
273
+ end
274
+
275
+ # Outputs non-array value in the form of hash
276
+ # For object, use to_hash. Otherwise, just return the value
277
+ # @param [Object] value Any valid value
278
+ # @return [Hash] Returns the value in the form of hash
279
+ def _to_hash(value)
280
+ if value.is_a?(Array)
281
+ value.compact.map { |v| _to_hash(v) }
282
+ elsif value.is_a?(Hash)
283
+ {}.tap do |hash|
284
+ value.each { |k, v| hash[k] = _to_hash(v) }
285
+ end
286
+ elsif value.respond_to? :to_hash
287
+ value.to_hash
288
+ else
289
+ value
290
+ end
291
+ end
292
+
293
+ end
294
+
295
+ end
@@ -0,0 +1,238 @@
1
+ =begin
2
+ #Daytona Toolbox API
3
+
4
+ #Daytona Toolbox API
5
+
6
+ The version of the OpenAPI document: v0.0.0-dev
7
+
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 DaytonaToolboxApiClient
17
+ class CodeRunResponse
18
+ attr_accessor :artifacts
19
+
20
+ attr_accessor :exit_code
21
+
22
+ attr_accessor :result
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'artifacts' => :'artifacts',
28
+ :'exit_code' => :'exitCode',
29
+ :'result' => :'result'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'artifacts' => :'CodeRunArtifacts',
47
+ :'exit_code' => :'Integer',
48
+ :'result' => :'String'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaToolboxApiClient::CodeRunResponse` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaToolboxApiClient::CodeRunResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'artifacts')
75
+ self.artifacts = attributes[:'artifacts']
76
+ end
77
+
78
+ if attributes.key?(:'exit_code')
79
+ self.exit_code = attributes[:'exit_code']
80
+ end
81
+
82
+ if attributes.key?(:'result')
83
+ self.result = attributes[:'result']
84
+ end
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properties with the reasons
89
+ def list_invalid_properties
90
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
91
+ invalid_properties = Array.new
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ warn '[DEPRECATED] the `valid?` method is obsolete'
99
+ true
100
+ end
101
+
102
+ # Checks equality by comparing each attribute.
103
+ # @param [Object] Object to be compared
104
+ def ==(o)
105
+ return true if self.equal?(o)
106
+ self.class == o.class &&
107
+ artifacts == o.artifacts &&
108
+ exit_code == o.exit_code &&
109
+ result == o.result
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [artifacts, exit_code, result].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ attributes = attributes.transform_keys(&:to_sym)
130
+ transformed_hash = {}
131
+ openapi_types.each_pair do |key, type|
132
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = nil
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[attribute_map[key]].is_a?(Array)
138
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
139
+ end
140
+ elsif !attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
142
+ end
143
+ end
144
+ new(transformed_hash)
145
+ end
146
+
147
+ # Deserializes the data based on type
148
+ # @param string type Data type
149
+ # @param string value Value to be deserialized
150
+ # @return [Object] Deserialized data
151
+ def self._deserialize(type, value)
152
+ case type.to_sym
153
+ when :Time
154
+ Time.parse(value)
155
+ when :Date
156
+ Date.parse(value)
157
+ when :String
158
+ value.to_s
159
+ when :Integer
160
+ value.to_i
161
+ when :Float
162
+ value.to_f
163
+ when :Boolean
164
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
165
+ true
166
+ else
167
+ false
168
+ end
169
+ when :Object
170
+ # generic object (usually a Hash), return directly
171
+ value
172
+ when /\AArray<(?<inner_type>.+)>\z/
173
+ inner_type = Regexp.last_match[:inner_type]
174
+ value.map { |v| _deserialize(inner_type, v) }
175
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
176
+ k_type = Regexp.last_match[:k_type]
177
+ v_type = Regexp.last_match[:v_type]
178
+ {}.tap do |hash|
179
+ value.each do |k, v|
180
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
181
+ end
182
+ end
183
+ else # model
184
+ # models (e.g. Pet) or oneOf
185
+ klass = DaytonaToolboxApiClient.const_get(type)
186
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
187
+ end
188
+ end
189
+
190
+ # Returns the string representation of the object
191
+ # @return [String] String presentation of the object
192
+ def to_s
193
+ to_hash.to_s
194
+ end
195
+
196
+ # to_body is an alias to to_hash (backward compatibility)
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_body
199
+ to_hash
200
+ end
201
+
202
+ # Returns the object in the form of hash
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_hash
205
+ hash = {}
206
+ self.class.attribute_map.each_pair do |attr, param|
207
+ value = self.send(attr)
208
+ if value.nil?
209
+ is_nullable = self.class.openapi_nullable.include?(attr)
210
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
211
+ end
212
+
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ # Outputs non-array value in the form of hash
219
+ # For object, use to_hash. Otherwise, just return the value
220
+ # @param [Object] value Any valid value
221
+ # @return [Hash] Returns the value in the form of hash
222
+ def _to_hash(value)
223
+ if value.is_a?(Array)
224
+ value.compact.map { |v| _to_hash(v) }
225
+ elsif value.is_a?(Hash)
226
+ {}.tap do |hash|
227
+ value.each { |k, v| hash[k] = _to_hash(v) }
228
+ end
229
+ elsif value.respond_to? :to_hash
230
+ value.to_hash
231
+ else
232
+ value
233
+ end
234
+ end
235
+
236
+ end
237
+
238
+ end
@@ -20,6 +20,9 @@ module DaytonaToolboxApiClient
20
20
  # Current working directory
21
21
  attr_accessor :cwd
22
22
 
23
+ # Environment variables to set for the command
24
+ attr_accessor :envs
25
+
23
26
  # Timeout in seconds, defaults to 10 seconds
24
27
  attr_accessor :timeout
25
28
 
@@ -28,6 +31,7 @@ module DaytonaToolboxApiClient
28
31
  {
29
32
  :'command' => :'command',
30
33
  :'cwd' => :'cwd',
34
+ :'envs' => :'envs',
31
35
  :'timeout' => :'timeout'
32
36
  }
33
37
  end
@@ -47,6 +51,7 @@ module DaytonaToolboxApiClient
47
51
  {
48
52
  :'command' => :'String',
49
53
  :'cwd' => :'String',
54
+ :'envs' => :'Hash<String, String>',
50
55
  :'timeout' => :'Integer'
51
56
  }
52
57
  end
@@ -83,6 +88,12 @@ module DaytonaToolboxApiClient
83
88
  self.cwd = attributes[:'cwd']
84
89
  end
85
90
 
91
+ if attributes.key?(:'envs')
92
+ if (value = attributes[:'envs']).is_a?(Hash)
93
+ self.envs = value
94
+ end
95
+ end
96
+
86
97
  if attributes.key?(:'timeout')
87
98
  self.timeout = attributes[:'timeout']
88
99
  end
@@ -125,6 +136,7 @@ module DaytonaToolboxApiClient
125
136
  self.class == o.class &&
126
137
  command == o.command &&
127
138
  cwd == o.cwd &&
139
+ envs == o.envs &&
128
140
  timeout == o.timeout
129
141
  end
130
142
 
@@ -137,7 +149,7 @@ module DaytonaToolboxApiClient
137
149
  # Calculates hash code according to all attributes.
138
150
  # @return [Integer] Hash code
139
151
  def hash
140
- [command, cwd, timeout].hash
152
+ [command, cwd, envs, timeout].hash
141
153
  end
142
154
 
143
155
  # Builds the object from hash
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module DaytonaToolboxApiClient
17
- class GitGitDeleteBranchRequest
17
+ class GitDeleteBranchRequest
18
18
  attr_accessor :name
19
19
 
20
20
  attr_accessor :path
@@ -55,14 +55,14 @@ module DaytonaToolboxApiClient
55
55
  # @param [Hash] attributes Model attributes in the form of hash
56
56
  def initialize(attributes = {})
57
57
  if (!attributes.is_a?(Hash))
58
- fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaToolboxApiClient::GitGitDeleteBranchRequest` initialize method"
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaToolboxApiClient::GitDeleteBranchRequest` initialize method"
59
59
  end
60
60
 
61
61
  # check to see if the attribute exists and convert string to symbol for hash key
62
62
  acceptable_attribute_map = self.class.acceptable_attribute_map
63
63
  attributes = attributes.each_with_object({}) { |(k, v), h|
64
64
  if (!acceptable_attribute_map.key?(k.to_sym))
65
- fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaToolboxApiClient::GitGitDeleteBranchRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaToolboxApiClient::GitDeleteBranchRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
66
  end
67
67
  h[k.to_sym] = v
68
68
  }