daytona_toolbox_api_client 0.126.0.alpha.1

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 (100) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +39 -0
  3. data/.openapi-generator/FILES +92 -0
  4. data/.openapi-generator/VERSION +1 -0
  5. data/.openapi-generator-ignore +12 -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_toolbox_api_client.gemspec +39 -0
  12. data/fix-gemspec.sh +13 -0
  13. data/lib/daytona_toolbox_api_client/api/computer_use_api.rb +1463 -0
  14. data/lib/daytona_toolbox_api_client/api/file_system_api.rb +893 -0
  15. data/lib/daytona_toolbox_api_client/api/git_api.rb +744 -0
  16. data/lib/daytona_toolbox_api_client/api/info_api.rb +193 -0
  17. data/lib/daytona_toolbox_api_client/api/interpreter_api.rb +267 -0
  18. data/lib/daytona_toolbox_api_client/api/lsp_api.rb +510 -0
  19. data/lib/daytona_toolbox_api_client/api/port_api.rb +142 -0
  20. data/lib/daytona_toolbox_api_client/api/process_api.rb +938 -0
  21. data/lib/daytona_toolbox_api_client/api_client.rb +392 -0
  22. data/lib/daytona_toolbox_api_client/api_error.rb +58 -0
  23. data/lib/daytona_toolbox_api_client/configuration.rb +297 -0
  24. data/lib/daytona_toolbox_api_client/models/command.rb +270 -0
  25. data/lib/daytona_toolbox_api_client/models/completion_context.rb +244 -0
  26. data/lib/daytona_toolbox_api_client/models/completion_item.rb +289 -0
  27. data/lib/daytona_toolbox_api_client/models/completion_list.rb +263 -0
  28. data/lib/daytona_toolbox_api_client/models/computer_use_start_response.rb +229 -0
  29. data/lib/daytona_toolbox_api_client/models/computer_use_status_response.rb +218 -0
  30. data/lib/daytona_toolbox_api_client/models/computer_use_stop_response.rb +229 -0
  31. data/lib/daytona_toolbox_api_client/models/create_context_request.rb +227 -0
  32. data/lib/daytona_toolbox_api_client/models/create_session_request.rb +235 -0
  33. data/lib/daytona_toolbox_api_client/models/display_info.rb +263 -0
  34. data/lib/daytona_toolbox_api_client/models/display_info_response.rb +220 -0
  35. data/lib/daytona_toolbox_api_client/models/execute_request.rb +255 -0
  36. data/lib/daytona_toolbox_api_client/models/execute_response.rb +244 -0
  37. data/lib/daytona_toolbox_api_client/models/file_info.rb +417 -0
  38. data/lib/daytona_toolbox_api_client/models/file_status.rb +335 -0
  39. data/lib/daytona_toolbox_api_client/models/files_download_request.rb +237 -0
  40. data/lib/daytona_toolbox_api_client/models/git_add_request.rb +264 -0
  41. data/lib/daytona_toolbox_api_client/models/git_branch_request.rb +261 -0
  42. data/lib/daytona_toolbox_api_client/models/git_checkout_request.rb +261 -0
  43. data/lib/daytona_toolbox_api_client/models/git_clone_request.rb +297 -0
  44. data/lib/daytona_toolbox_api_client/models/git_commit_info.rb +339 -0
  45. data/lib/daytona_toolbox_api_client/models/git_commit_request.rb +322 -0
  46. data/lib/daytona_toolbox_api_client/models/git_commit_response.rb +235 -0
  47. data/lib/daytona_toolbox_api_client/models/git_git_delete_branch_request.rb +261 -0
  48. data/lib/daytona_toolbox_api_client/models/git_repo_request.rb +253 -0
  49. data/lib/daytona_toolbox_api_client/models/git_status.rb +290 -0
  50. data/lib/daytona_toolbox_api_client/models/interpreter_context.rb +339 -0
  51. data/lib/daytona_toolbox_api_client/models/is_port_in_use_response.rb +218 -0
  52. data/lib/daytona_toolbox_api_client/models/keyboard_hotkey_request.rb +219 -0
  53. data/lib/daytona_toolbox_api_client/models/keyboard_press_request.rb +230 -0
  54. data/lib/daytona_toolbox_api_client/models/keyboard_type_request.rb +228 -0
  55. data/lib/daytona_toolbox_api_client/models/list_branch_response.rb +237 -0
  56. data/lib/daytona_toolbox_api_client/models/list_contexts_response.rb +237 -0
  57. data/lib/daytona_toolbox_api_client/models/lsp_completion_params.rb +322 -0
  58. data/lib/daytona_toolbox_api_client/models/lsp_document_request.rb +287 -0
  59. data/lib/daytona_toolbox_api_client/models/lsp_location.rb +261 -0
  60. data/lib/daytona_toolbox_api_client/models/lsp_position.rb +261 -0
  61. data/lib/daytona_toolbox_api_client/models/lsp_range.rb +261 -0
  62. data/lib/daytona_toolbox_api_client/models/lsp_server_request.rb +261 -0
  63. data/lib/daytona_toolbox_api_client/models/lsp_symbol.rb +287 -0
  64. data/lib/daytona_toolbox_api_client/models/match.rb +287 -0
  65. data/lib/daytona_toolbox_api_client/models/mouse_click_request.rb +246 -0
  66. data/lib/daytona_toolbox_api_client/models/mouse_click_response.rb +227 -0
  67. data/lib/daytona_toolbox_api_client/models/mouse_drag_request.rb +254 -0
  68. data/lib/daytona_toolbox_api_client/models/mouse_drag_response.rb +227 -0
  69. data/lib/daytona_toolbox_api_client/models/mouse_move_request.rb +227 -0
  70. data/lib/daytona_toolbox_api_client/models/mouse_position_response.rb +227 -0
  71. data/lib/daytona_toolbox_api_client/models/mouse_scroll_request.rb +246 -0
  72. data/lib/daytona_toolbox_api_client/models/port_list.rb +220 -0
  73. data/lib/daytona_toolbox_api_client/models/position.rb +227 -0
  74. data/lib/daytona_toolbox_api_client/models/process_errors_response.rb +227 -0
  75. data/lib/daytona_toolbox_api_client/models/process_logs_response.rb +227 -0
  76. data/lib/daytona_toolbox_api_client/models/process_restart_response.rb +227 -0
  77. data/lib/daytona_toolbox_api_client/models/process_status.rb +245 -0
  78. data/lib/daytona_toolbox_api_client/models/process_status_response.rb +227 -0
  79. data/lib/daytona_toolbox_api_client/models/pty_create_request.rb +266 -0
  80. data/lib/daytona_toolbox_api_client/models/pty_create_response.rb +218 -0
  81. data/lib/daytona_toolbox_api_client/models/pty_list_response.rb +220 -0
  82. data/lib/daytona_toolbox_api_client/models/pty_resize_request.rb +297 -0
  83. data/lib/daytona_toolbox_api_client/models/pty_session_info.rb +284 -0
  84. data/lib/daytona_toolbox_api_client/models/replace_request.rb +289 -0
  85. data/lib/daytona_toolbox_api_client/models/replace_result.rb +236 -0
  86. data/lib/daytona_toolbox_api_client/models/screenshot_response.rb +236 -0
  87. data/lib/daytona_toolbox_api_client/models/scroll_response.rb +218 -0
  88. data/lib/daytona_toolbox_api_client/models/search_files_response.rb +237 -0
  89. data/lib/daytona_toolbox_api_client/models/session.rb +263 -0
  90. data/lib/daytona_toolbox_api_client/models/session_execute_request.rb +253 -0
  91. data/lib/daytona_toolbox_api_client/models/session_execute_response.rb +254 -0
  92. data/lib/daytona_toolbox_api_client/models/status.rb +46 -0
  93. data/lib/daytona_toolbox_api_client/models/user_home_dir_response.rb +218 -0
  94. data/lib/daytona_toolbox_api_client/models/window_info.rb +272 -0
  95. data/lib/daytona_toolbox_api_client/models/windows_response.rb +220 -0
  96. data/lib/daytona_toolbox_api_client/models/work_dir_response.rb +218 -0
  97. data/lib/daytona_toolbox_api_client/version.rb +15 -0
  98. data/lib/daytona_toolbox_api_client.rb +120 -0
  99. data/project.json +65 -0
  100. metadata +178 -0
@@ -0,0 +1,227 @@
1
+ =begin
2
+ #Daytona Daemon API
3
+
4
+ #Daytona Daemon 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 MousePositionResponse
18
+ attr_accessor :x
19
+
20
+ attr_accessor :y
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'x' => :'x',
26
+ :'y' => :'y'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'x' => :'Integer',
44
+ :'y' => :'Integer'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaToolboxApiClient::MousePositionResponse` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaToolboxApiClient::MousePositionResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'x')
71
+ self.x = attributes[:'x']
72
+ end
73
+
74
+ if attributes.key?(:'y')
75
+ self.y = attributes[:'y']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83
+ invalid_properties = Array.new
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ warn '[DEPRECATED] the `valid?` method is obsolete'
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ x == o.x &&
100
+ y == o.y
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Integer] Hash code
111
+ def hash
112
+ [x, y].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def self.build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ attributes = attributes.transform_keys(&:to_sym)
121
+ transformed_hash = {}
122
+ openapi_types.each_pair do |key, type|
123
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = nil
125
+ elsif type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[attribute_map[key]].is_a?(Array)
129
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
130
+ end
131
+ elsif !attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
133
+ end
134
+ end
135
+ new(transformed_hash)
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def self._deserialize(type, value)
143
+ case type.to_sym
144
+ when :Time
145
+ Time.parse(value)
146
+ when :Date
147
+ Date.parse(value)
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :Boolean
155
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
+ true
157
+ else
158
+ false
159
+ end
160
+ when :Object
161
+ # generic object (usually a Hash), return directly
162
+ value
163
+ when /\AArray<(?<inner_type>.+)>\z/
164
+ inner_type = Regexp.last_match[:inner_type]
165
+ value.map { |v| _deserialize(inner_type, v) }
166
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167
+ k_type = Regexp.last_match[:k_type]
168
+ v_type = Regexp.last_match[:v_type]
169
+ {}.tap do |hash|
170
+ value.each do |k, v|
171
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172
+ end
173
+ end
174
+ else # model
175
+ # models (e.g. Pet) or oneOf
176
+ klass = DaytonaToolboxApiClient.const_get(type)
177
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ if value.nil?
200
+ is_nullable = self.class.openapi_nullable.include?(attr)
201
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
202
+ end
203
+
204
+ hash[param] = _to_hash(value)
205
+ end
206
+ hash
207
+ end
208
+
209
+ # Outputs non-array value in the form of hash
210
+ # For object, use to_hash. Otherwise, just return the value
211
+ # @param [Object] value Any valid value
212
+ # @return [Hash] Returns the value in the form of hash
213
+ def _to_hash(value)
214
+ if value.is_a?(Array)
215
+ value.compact.map { |v| _to_hash(v) }
216
+ elsif value.is_a?(Hash)
217
+ {}.tap do |hash|
218
+ value.each { |k, v| hash[k] = _to_hash(v) }
219
+ end
220
+ elsif value.respond_to? :to_hash
221
+ value.to_hash
222
+ else
223
+ value
224
+ end
225
+ end
226
+ end
227
+ end
@@ -0,0 +1,246 @@
1
+ =begin
2
+ #Daytona Daemon API
3
+
4
+ #Daytona Daemon 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 MouseScrollRequest
18
+ attr_accessor :amount
19
+
20
+ # up, down
21
+ attr_accessor :direction
22
+
23
+ attr_accessor :x
24
+
25
+ attr_accessor :y
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'amount' => :'amount',
31
+ :'direction' => :'direction',
32
+ :'x' => :'x',
33
+ :'y' => :'y'
34
+ }
35
+ end
36
+
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ acceptable_attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'amount' => :'Integer',
51
+ :'direction' => :'String',
52
+ :'x' => :'Integer',
53
+ :'y' => :'Integer'
54
+ }
55
+ end
56
+
57
+ # List of attributes with nullable: true
58
+ def self.openapi_nullable
59
+ Set.new([
60
+ ])
61
+ end
62
+
63
+ # Initializes the object
64
+ # @param [Hash] attributes Model attributes in the form of hash
65
+ def initialize(attributes = {})
66
+ if (!attributes.is_a?(Hash))
67
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaToolboxApiClient::MouseScrollRequest` initialize method"
68
+ end
69
+
70
+ # check to see if the attribute exists and convert string to symbol for hash key
71
+ acceptable_attribute_map = self.class.acceptable_attribute_map
72
+ attributes = attributes.each_with_object({}) { |(k, v), h|
73
+ if (!acceptable_attribute_map.key?(k.to_sym))
74
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaToolboxApiClient::MouseScrollRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
75
+ end
76
+ h[k.to_sym] = v
77
+ }
78
+
79
+ if attributes.key?(:'amount')
80
+ self.amount = attributes[:'amount']
81
+ end
82
+
83
+ if attributes.key?(:'direction')
84
+ self.direction = attributes[:'direction']
85
+ end
86
+
87
+ if attributes.key?(:'x')
88
+ self.x = attributes[:'x']
89
+ end
90
+
91
+ if attributes.key?(:'y')
92
+ self.y = attributes[:'y']
93
+ end
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
100
+ invalid_properties = Array.new
101
+ invalid_properties
102
+ end
103
+
104
+ # Check to see if the all the properties in the model are valid
105
+ # @return true if the model is valid
106
+ def valid?
107
+ warn '[DEPRECATED] the `valid?` method is obsolete'
108
+ true
109
+ end
110
+
111
+ # Checks equality by comparing each attribute.
112
+ # @param [Object] Object to be compared
113
+ def ==(o)
114
+ return true if self.equal?(o)
115
+ self.class == o.class &&
116
+ amount == o.amount &&
117
+ direction == o.direction &&
118
+ x == o.x &&
119
+ y == o.y
120
+ end
121
+
122
+ # @see the `==` method
123
+ # @param [Object] Object to be compared
124
+ def eql?(o)
125
+ self == o
126
+ end
127
+
128
+ # Calculates hash code according to all attributes.
129
+ # @return [Integer] Hash code
130
+ def hash
131
+ [amount, direction, x, y].hash
132
+ end
133
+
134
+ # Builds the object from hash
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ # @return [Object] Returns the model itself
137
+ def self.build_from_hash(attributes)
138
+ return nil unless attributes.is_a?(Hash)
139
+ attributes = attributes.transform_keys(&:to_sym)
140
+ transformed_hash = {}
141
+ openapi_types.each_pair do |key, type|
142
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
143
+ transformed_hash["#{key}"] = nil
144
+ elsif type =~ /\AArray<(.*)>/i
145
+ # check to ensure the input is an array given that the attribute
146
+ # is documented as an array but the input is not
147
+ if attributes[attribute_map[key]].is_a?(Array)
148
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
149
+ end
150
+ elsif !attributes[attribute_map[key]].nil?
151
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
152
+ end
153
+ end
154
+ new(transformed_hash)
155
+ end
156
+
157
+ # Deserializes the data based on type
158
+ # @param string type Data type
159
+ # @param string value Value to be deserialized
160
+ # @return [Object] Deserialized data
161
+ def self._deserialize(type, value)
162
+ case type.to_sym
163
+ when :Time
164
+ Time.parse(value)
165
+ when :Date
166
+ Date.parse(value)
167
+ when :String
168
+ value.to_s
169
+ when :Integer
170
+ value.to_i
171
+ when :Float
172
+ value.to_f
173
+ when :Boolean
174
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
175
+ true
176
+ else
177
+ false
178
+ end
179
+ when :Object
180
+ # generic object (usually a Hash), return directly
181
+ value
182
+ when /\AArray<(?<inner_type>.+)>\z/
183
+ inner_type = Regexp.last_match[:inner_type]
184
+ value.map { |v| _deserialize(inner_type, v) }
185
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
186
+ k_type = Regexp.last_match[:k_type]
187
+ v_type = Regexp.last_match[:v_type]
188
+ {}.tap do |hash|
189
+ value.each do |k, v|
190
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
191
+ end
192
+ end
193
+ else # model
194
+ # models (e.g. Pet) or oneOf
195
+ klass = DaytonaToolboxApiClient.const_get(type)
196
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
197
+ end
198
+ end
199
+
200
+ # Returns the string representation of the object
201
+ # @return [String] String presentation of the object
202
+ def to_s
203
+ to_hash.to_s
204
+ end
205
+
206
+ # to_body is an alias to to_hash (backward compatibility)
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_body
209
+ to_hash
210
+ end
211
+
212
+ # Returns the object in the form of hash
213
+ # @return [Hash] Returns the object in the form of hash
214
+ def to_hash
215
+ hash = {}
216
+ self.class.attribute_map.each_pair do |attr, param|
217
+ value = self.send(attr)
218
+ if value.nil?
219
+ is_nullable = self.class.openapi_nullable.include?(attr)
220
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
221
+ end
222
+
223
+ hash[param] = _to_hash(value)
224
+ end
225
+ hash
226
+ end
227
+
228
+ # Outputs non-array value in the form of hash
229
+ # For object, use to_hash. Otherwise, just return the value
230
+ # @param [Object] value Any valid value
231
+ # @return [Hash] Returns the value in the form of hash
232
+ def _to_hash(value)
233
+ if value.is_a?(Array)
234
+ value.compact.map { |v| _to_hash(v) }
235
+ elsif value.is_a?(Hash)
236
+ {}.tap do |hash|
237
+ value.each { |k, v| hash[k] = _to_hash(v) }
238
+ end
239
+ elsif value.respond_to? :to_hash
240
+ value.to_hash
241
+ else
242
+ value
243
+ end
244
+ end
245
+ end
246
+ end
@@ -0,0 +1,220 @@
1
+ =begin
2
+ #Daytona Daemon API
3
+
4
+ #Daytona Daemon 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 PortList
18
+ attr_accessor :ports
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'ports' => :'ports'
24
+ }
25
+ end
26
+
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ acceptable_attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'ports' => :'Array<Integer>'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaToolboxApiClient::PortList` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaToolboxApiClient::PortList`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'ports')
67
+ if (value = attributes[:'ports']).is_a?(Array)
68
+ self.ports = value
69
+ end
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ invalid_properties = Array.new
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ warn '[DEPRECATED] the `valid?` method is obsolete'
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ ports == o.ports
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(o)
99
+ self == o
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Integer] Hash code
104
+ def hash
105
+ [ports].hash
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def self.build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ attributes = attributes.transform_keys(&:to_sym)
114
+ transformed_hash = {}
115
+ openapi_types.each_pair do |key, type|
116
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
117
+ transformed_hash["#{key}"] = nil
118
+ elsif type =~ /\AArray<(.*)>/i
119
+ # check to ensure the input is an array given that the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[attribute_map[key]].is_a?(Array)
122
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
123
+ end
124
+ elsif !attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
126
+ end
127
+ end
128
+ new(transformed_hash)
129
+ end
130
+
131
+ # Deserializes the data based on type
132
+ # @param string type Data type
133
+ # @param string value Value to be deserialized
134
+ # @return [Object] Deserialized data
135
+ def self._deserialize(type, value)
136
+ case type.to_sym
137
+ when :Time
138
+ Time.parse(value)
139
+ when :Date
140
+ Date.parse(value)
141
+ when :String
142
+ value.to_s
143
+ when :Integer
144
+ value.to_i
145
+ when :Float
146
+ value.to_f
147
+ when :Boolean
148
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
149
+ true
150
+ else
151
+ false
152
+ end
153
+ when :Object
154
+ # generic object (usually a Hash), return directly
155
+ value
156
+ when /\AArray<(?<inner_type>.+)>\z/
157
+ inner_type = Regexp.last_match[:inner_type]
158
+ value.map { |v| _deserialize(inner_type, v) }
159
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
160
+ k_type = Regexp.last_match[:k_type]
161
+ v_type = Regexp.last_match[:v_type]
162
+ {}.tap do |hash|
163
+ value.each do |k, v|
164
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
165
+ end
166
+ end
167
+ else # model
168
+ # models (e.g. Pet) or oneOf
169
+ klass = DaytonaToolboxApiClient.const_get(type)
170
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
171
+ end
172
+ end
173
+
174
+ # Returns the string representation of the object
175
+ # @return [String] String presentation of the object
176
+ def to_s
177
+ to_hash.to_s
178
+ end
179
+
180
+ # to_body is an alias to to_hash (backward compatibility)
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_body
183
+ to_hash
184
+ end
185
+
186
+ # Returns the object in the form of hash
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_hash
189
+ hash = {}
190
+ self.class.attribute_map.each_pair do |attr, param|
191
+ value = self.send(attr)
192
+ if value.nil?
193
+ is_nullable = self.class.openapi_nullable.include?(attr)
194
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
195
+ end
196
+
197
+ hash[param] = _to_hash(value)
198
+ end
199
+ hash
200
+ end
201
+
202
+ # Outputs non-array value in the form of hash
203
+ # For object, use to_hash. Otherwise, just return the value
204
+ # @param [Object] value Any valid value
205
+ # @return [Hash] Returns the value in the form of hash
206
+ def _to_hash(value)
207
+ if value.is_a?(Array)
208
+ value.compact.map { |v| _to_hash(v) }
209
+ elsif value.is_a?(Hash)
210
+ {}.tap do |hash|
211
+ value.each { |k, v| hash[k] = _to_hash(v) }
212
+ end
213
+ elsif value.respond_to? :to_hash
214
+ value.to_hash
215
+ else
216
+ value
217
+ end
218
+ end
219
+ end
220
+ end