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,219 @@
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 KeyboardHotkeyRequest
18
+ # e.g., \"ctrl+c\", \"cmd+v\"
19
+ attr_accessor :keys
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'keys' => :'keys'
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
+ :'keys' => :'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 `DaytonaToolboxApiClient::KeyboardHotkeyRequest` 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 `DaytonaToolboxApiClient::KeyboardHotkeyRequest`. 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?(:'keys')
68
+ self.keys = attributes[:'keys']
69
+ end
70
+ end
71
+
72
+ # Show invalid properties with the reasons. Usually used together with valid?
73
+ # @return Array for valid properties with the reasons
74
+ def list_invalid_properties
75
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
76
+ invalid_properties = Array.new
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ warn '[DEPRECATED] the `valid?` method is obsolete'
84
+ true
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ keys == o.keys
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [keys].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def self.build_from_hash(attributes)
111
+ return nil unless attributes.is_a?(Hash)
112
+ attributes = attributes.transform_keys(&:to_sym)
113
+ transformed_hash = {}
114
+ openapi_types.each_pair do |key, type|
115
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
116
+ transformed_hash["#{key}"] = nil
117
+ elsif type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[attribute_map[key]].is_a?(Array)
121
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
122
+ end
123
+ elsif !attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
125
+ end
126
+ end
127
+ new(transformed_hash)
128
+ end
129
+
130
+ # Deserializes the data based on type
131
+ # @param string type Data type
132
+ # @param string value Value to be deserialized
133
+ # @return [Object] Deserialized data
134
+ def self._deserialize(type, value)
135
+ case type.to_sym
136
+ when :Time
137
+ Time.parse(value)
138
+ when :Date
139
+ Date.parse(value)
140
+ when :String
141
+ value.to_s
142
+ when :Integer
143
+ value.to_i
144
+ when :Float
145
+ value.to_f
146
+ when :Boolean
147
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
148
+ true
149
+ else
150
+ false
151
+ end
152
+ when :Object
153
+ # generic object (usually a Hash), return directly
154
+ value
155
+ when /\AArray<(?<inner_type>.+)>\z/
156
+ inner_type = Regexp.last_match[:inner_type]
157
+ value.map { |v| _deserialize(inner_type, v) }
158
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
159
+ k_type = Regexp.last_match[:k_type]
160
+ v_type = Regexp.last_match[:v_type]
161
+ {}.tap do |hash|
162
+ value.each do |k, v|
163
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
+ end
165
+ end
166
+ else # model
167
+ # models (e.g. Pet) or oneOf
168
+ klass = DaytonaToolboxApiClient.const_get(type)
169
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
170
+ end
171
+ end
172
+
173
+ # Returns the string representation of the object
174
+ # @return [String] String presentation of the object
175
+ def to_s
176
+ to_hash.to_s
177
+ end
178
+
179
+ # to_body is an alias to to_hash (backward compatibility)
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_body
182
+ to_hash
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = self.send(attr)
191
+ if value.nil?
192
+ is_nullable = self.class.openapi_nullable.include?(attr)
193
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
194
+ end
195
+
196
+ hash[param] = _to_hash(value)
197
+ end
198
+ hash
199
+ end
200
+
201
+ # Outputs non-array value in the form of hash
202
+ # For object, use to_hash. Otherwise, just return the value
203
+ # @param [Object] value Any valid value
204
+ # @return [Hash] Returns the value in the form of hash
205
+ def _to_hash(value)
206
+ if value.is_a?(Array)
207
+ value.compact.map { |v| _to_hash(v) }
208
+ elsif value.is_a?(Hash)
209
+ {}.tap do |hash|
210
+ value.each { |k, v| hash[k] = _to_hash(v) }
211
+ end
212
+ elsif value.respond_to? :to_hash
213
+ value.to_hash
214
+ else
215
+ value
216
+ end
217
+ end
218
+ end
219
+ end
@@ -0,0 +1,230 @@
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 KeyboardPressRequest
18
+ attr_accessor :key
19
+
20
+ # ctrl, alt, shift, cmd
21
+ attr_accessor :modifiers
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'key' => :'key',
27
+ :'modifiers' => :'modifiers'
28
+ }
29
+ end
30
+
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ acceptable_attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'key' => :'String',
45
+ :'modifiers' => :'Array<String>'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaToolboxApiClient::KeyboardPressRequest` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ acceptable_attribute_map = self.class.acceptable_attribute_map
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!acceptable_attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaToolboxApiClient::KeyboardPressRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'key')
72
+ self.key = attributes[:'key']
73
+ end
74
+
75
+ if attributes.key?(:'modifiers')
76
+ if (value = attributes[:'modifiers']).is_a?(Array)
77
+ self.modifiers = value
78
+ end
79
+ end
80
+ end
81
+
82
+ # Show invalid properties with the reasons. Usually used together with valid?
83
+ # @return Array for valid properties with the reasons
84
+ def list_invalid_properties
85
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
86
+ invalid_properties = Array.new
87
+ invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ warn '[DEPRECATED] the `valid?` method is obsolete'
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ key == o.key &&
103
+ modifiers == o.modifiers
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Integer] Hash code
114
+ def hash
115
+ [key, modifiers].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def self.build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ attributes = attributes.transform_keys(&:to_sym)
124
+ transformed_hash = {}
125
+ openapi_types.each_pair do |key, type|
126
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
127
+ transformed_hash["#{key}"] = nil
128
+ elsif type =~ /\AArray<(.*)>/i
129
+ # check to ensure the input is an array given that the attribute
130
+ # is documented as an array but the input is not
131
+ if attributes[attribute_map[key]].is_a?(Array)
132
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
133
+ end
134
+ elsif !attributes[attribute_map[key]].nil?
135
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
136
+ end
137
+ end
138
+ new(transformed_hash)
139
+ end
140
+
141
+ # Deserializes the data based on type
142
+ # @param string type Data type
143
+ # @param string value Value to be deserialized
144
+ # @return [Object] Deserialized data
145
+ def self._deserialize(type, value)
146
+ case type.to_sym
147
+ when :Time
148
+ Time.parse(value)
149
+ when :Date
150
+ Date.parse(value)
151
+ when :String
152
+ value.to_s
153
+ when :Integer
154
+ value.to_i
155
+ when :Float
156
+ value.to_f
157
+ when :Boolean
158
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
+ true
160
+ else
161
+ false
162
+ end
163
+ when :Object
164
+ # generic object (usually a Hash), return directly
165
+ value
166
+ when /\AArray<(?<inner_type>.+)>\z/
167
+ inner_type = Regexp.last_match[:inner_type]
168
+ value.map { |v| _deserialize(inner_type, v) }
169
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
+ k_type = Regexp.last_match[:k_type]
171
+ v_type = Regexp.last_match[:v_type]
172
+ {}.tap do |hash|
173
+ value.each do |k, v|
174
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
+ end
176
+ end
177
+ else # model
178
+ # models (e.g. Pet) or oneOf
179
+ klass = DaytonaToolboxApiClient.const_get(type)
180
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
181
+ end
182
+ end
183
+
184
+ # Returns the string representation of the object
185
+ # @return [String] String presentation of the object
186
+ def to_s
187
+ to_hash.to_s
188
+ end
189
+
190
+ # to_body is an alias to to_hash (backward compatibility)
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_body
193
+ to_hash
194
+ end
195
+
196
+ # Returns the object in the form of hash
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_hash
199
+ hash = {}
200
+ self.class.attribute_map.each_pair do |attr, param|
201
+ value = self.send(attr)
202
+ if value.nil?
203
+ is_nullable = self.class.openapi_nullable.include?(attr)
204
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
205
+ end
206
+
207
+ hash[param] = _to_hash(value)
208
+ end
209
+ hash
210
+ end
211
+
212
+ # Outputs non-array value in the form of hash
213
+ # For object, use to_hash. Otherwise, just return the value
214
+ # @param [Object] value Any valid value
215
+ # @return [Hash] Returns the value in the form of hash
216
+ def _to_hash(value)
217
+ if value.is_a?(Array)
218
+ value.compact.map { |v| _to_hash(v) }
219
+ elsif value.is_a?(Hash)
220
+ {}.tap do |hash|
221
+ value.each { |k, v| hash[k] = _to_hash(v) }
222
+ end
223
+ elsif value.respond_to? :to_hash
224
+ value.to_hash
225
+ else
226
+ value
227
+ end
228
+ end
229
+ end
230
+ end
@@ -0,0 +1,228 @@
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 KeyboardTypeRequest
18
+ # milliseconds between keystrokes
19
+ attr_accessor :delay
20
+
21
+ attr_accessor :text
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'delay' => :'delay',
27
+ :'text' => :'text'
28
+ }
29
+ end
30
+
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ acceptable_attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'delay' => :'Integer',
45
+ :'text' => :'String'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaToolboxApiClient::KeyboardTypeRequest` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ acceptable_attribute_map = self.class.acceptable_attribute_map
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!acceptable_attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaToolboxApiClient::KeyboardTypeRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'delay')
72
+ self.delay = attributes[:'delay']
73
+ end
74
+
75
+ if attributes.key?(:'text')
76
+ self.text = attributes[:'text']
77
+ end
78
+ end
79
+
80
+ # Show invalid properties with the reasons. Usually used together with valid?
81
+ # @return Array for valid properties with the reasons
82
+ def list_invalid_properties
83
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
84
+ invalid_properties = Array.new
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
+ true
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] Object to be compared
97
+ def ==(o)
98
+ return true if self.equal?(o)
99
+ self.class == o.class &&
100
+ delay == o.delay &&
101
+ text == o.text
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(o)
107
+ self == o
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Integer] Hash code
112
+ def hash
113
+ [delay, text].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def self.build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ attributes = attributes.transform_keys(&:to_sym)
122
+ transformed_hash = {}
123
+ openapi_types.each_pair do |key, type|
124
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = nil
126
+ elsif type =~ /\AArray<(.*)>/i
127
+ # check to ensure the input is an array given that the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[attribute_map[key]].is_a?(Array)
130
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
131
+ end
132
+ elsif !attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
134
+ end
135
+ end
136
+ new(transformed_hash)
137
+ end
138
+
139
+ # Deserializes the data based on type
140
+ # @param string type Data type
141
+ # @param string value Value to be deserialized
142
+ # @return [Object] Deserialized data
143
+ def self._deserialize(type, value)
144
+ case type.to_sym
145
+ when :Time
146
+ Time.parse(value)
147
+ when :Date
148
+ Date.parse(value)
149
+ when :String
150
+ value.to_s
151
+ when :Integer
152
+ value.to_i
153
+ when :Float
154
+ value.to_f
155
+ when :Boolean
156
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
157
+ true
158
+ else
159
+ false
160
+ end
161
+ when :Object
162
+ # generic object (usually a Hash), return directly
163
+ value
164
+ when /\AArray<(?<inner_type>.+)>\z/
165
+ inner_type = Regexp.last_match[:inner_type]
166
+ value.map { |v| _deserialize(inner_type, v) }
167
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
168
+ k_type = Regexp.last_match[:k_type]
169
+ v_type = Regexp.last_match[:v_type]
170
+ {}.tap do |hash|
171
+ value.each do |k, v|
172
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
173
+ end
174
+ end
175
+ else # model
176
+ # models (e.g. Pet) or oneOf
177
+ klass = DaytonaToolboxApiClient.const_get(type)
178
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
179
+ end
180
+ end
181
+
182
+ # Returns the string representation of the object
183
+ # @return [String] String presentation of the object
184
+ def to_s
185
+ to_hash.to_s
186
+ end
187
+
188
+ # to_body is an alias to to_hash (backward compatibility)
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_body
191
+ to_hash
192
+ end
193
+
194
+ # Returns the object in the form of hash
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_hash
197
+ hash = {}
198
+ self.class.attribute_map.each_pair do |attr, param|
199
+ value = self.send(attr)
200
+ if value.nil?
201
+ is_nullable = self.class.openapi_nullable.include?(attr)
202
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
203
+ end
204
+
205
+ hash[param] = _to_hash(value)
206
+ end
207
+ hash
208
+ end
209
+
210
+ # Outputs non-array value in the form of hash
211
+ # For object, use to_hash. Otherwise, just return the value
212
+ # @param [Object] value Any valid value
213
+ # @return [Hash] Returns the value in the form of hash
214
+ def _to_hash(value)
215
+ if value.is_a?(Array)
216
+ value.compact.map { |v| _to_hash(v) }
217
+ elsif value.is_a?(Hash)
218
+ {}.tap do |hash|
219
+ value.each { |k, v| hash[k] = _to_hash(v) }
220
+ end
221
+ elsif value.respond_to? :to_hash
222
+ value.to_hash
223
+ else
224
+ value
225
+ end
226
+ end
227
+ end
228
+ end