daytona_toolbox_api_client 0.0.0.pre.dev

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,229 @@
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 ComputerUseStopResponse
18
+ attr_accessor :message
19
+
20
+ attr_accessor :status
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'message' => :'message',
26
+ :'status' => :'status'
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
+ :'message' => :'String',
44
+ :'status' => :'Hash<String, ProcessStatus>'
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::ComputerUseStopResponse` 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::ComputerUseStopResponse`. 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?(:'message')
71
+ self.message = attributes[:'message']
72
+ end
73
+
74
+ if attributes.key?(:'status')
75
+ if (value = attributes[:'status']).is_a?(Hash)
76
+ self.status = value
77
+ end
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
85
+ invalid_properties = Array.new
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ warn '[DEPRECATED] the `valid?` method is obsolete'
93
+ true
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] Object to be compared
98
+ def ==(o)
99
+ return true if self.equal?(o)
100
+ self.class == o.class &&
101
+ message == o.message &&
102
+ status == o.status
103
+ end
104
+
105
+ # @see the `==` method
106
+ # @param [Object] Object to be compared
107
+ def eql?(o)
108
+ self == o
109
+ end
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Integer] Hash code
113
+ def hash
114
+ [message, status].hash
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def self.build_from_hash(attributes)
121
+ return nil unless attributes.is_a?(Hash)
122
+ attributes = attributes.transform_keys(&:to_sym)
123
+ transformed_hash = {}
124
+ openapi_types.each_pair do |key, type|
125
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
126
+ transformed_hash["#{key}"] = nil
127
+ elsif type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[attribute_map[key]].is_a?(Array)
131
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
132
+ end
133
+ elsif !attributes[attribute_map[key]].nil?
134
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
135
+ end
136
+ end
137
+ new(transformed_hash)
138
+ end
139
+
140
+ # Deserializes the data based on type
141
+ # @param string type Data type
142
+ # @param string value Value to be deserialized
143
+ # @return [Object] Deserialized data
144
+ def self._deserialize(type, value)
145
+ case type.to_sym
146
+ when :Time
147
+ Time.parse(value)
148
+ when :Date
149
+ Date.parse(value)
150
+ when :String
151
+ value.to_s
152
+ when :Integer
153
+ value.to_i
154
+ when :Float
155
+ value.to_f
156
+ when :Boolean
157
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
158
+ true
159
+ else
160
+ false
161
+ end
162
+ when :Object
163
+ # generic object (usually a Hash), return directly
164
+ value
165
+ when /\AArray<(?<inner_type>.+)>\z/
166
+ inner_type = Regexp.last_match[:inner_type]
167
+ value.map { |v| _deserialize(inner_type, v) }
168
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
169
+ k_type = Regexp.last_match[:k_type]
170
+ v_type = Regexp.last_match[:v_type]
171
+ {}.tap do |hash|
172
+ value.each do |k, v|
173
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
174
+ end
175
+ end
176
+ else # model
177
+ # models (e.g. Pet) or oneOf
178
+ klass = DaytonaToolboxApiClient.const_get(type)
179
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
180
+ end
181
+ end
182
+
183
+ # Returns the string representation of the object
184
+ # @return [String] String presentation of the object
185
+ def to_s
186
+ to_hash.to_s
187
+ end
188
+
189
+ # to_body is an alias to to_hash (backward compatibility)
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_body
192
+ to_hash
193
+ end
194
+
195
+ # Returns the object in the form of hash
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_hash
198
+ hash = {}
199
+ self.class.attribute_map.each_pair do |attr, param|
200
+ value = self.send(attr)
201
+ if value.nil?
202
+ is_nullable = self.class.openapi_nullable.include?(attr)
203
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
204
+ end
205
+
206
+ hash[param] = _to_hash(value)
207
+ end
208
+ hash
209
+ end
210
+
211
+ # Outputs non-array value in the form of hash
212
+ # For object, use to_hash. Otherwise, just return the value
213
+ # @param [Object] value Any valid value
214
+ # @return [Hash] Returns the value in the form of hash
215
+ def _to_hash(value)
216
+ if value.is_a?(Array)
217
+ value.compact.map { |v| _to_hash(v) }
218
+ elsif value.is_a?(Hash)
219
+ {}.tap do |hash|
220
+ value.each { |k, v| hash[k] = _to_hash(v) }
221
+ end
222
+ elsif value.respond_to? :to_hash
223
+ value.to_hash
224
+ else
225
+ value
226
+ end
227
+ end
228
+ end
229
+ end
@@ -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 CreateContextRequest
18
+ attr_accessor :cwd
19
+
20
+ attr_accessor :language
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'cwd' => :'cwd',
26
+ :'language' => :'language'
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
+ :'cwd' => :'String',
44
+ :'language' => :'String'
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::CreateContextRequest` 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::CreateContextRequest`. 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?(:'cwd')
71
+ self.cwd = attributes[:'cwd']
72
+ end
73
+
74
+ if attributes.key?(:'language')
75
+ self.language = attributes[:'language']
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
+ cwd == o.cwd &&
100
+ language == o.language
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
+ [cwd, language].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,235 @@
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 CreateSessionRequest
18
+ attr_accessor :session_id
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'session_id' => :'sessionId'
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
+ :'session_id' => :'String'
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::CreateSessionRequest` 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::CreateSessionRequest`. 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?(:'session_id')
67
+ self.session_id = attributes[:'session_id']
68
+ else
69
+ self.session_id = nil
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
+ if @session_id.nil?
79
+ invalid_properties.push('invalid value for "session_id", session_id cannot be nil.')
80
+ end
81
+
82
+ invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+ warn '[DEPRECATED] the `valid?` method is obsolete'
89
+ return false if @session_id.nil?
90
+ true
91
+ end
92
+
93
+ # Custom attribute writer method with validation
94
+ # @param [Object] session_id Value to be assigned
95
+ def session_id=(session_id)
96
+ if session_id.nil?
97
+ fail ArgumentError, 'session_id cannot be nil'
98
+ end
99
+
100
+ @session_id = session_id
101
+ end
102
+
103
+ # Checks equality by comparing each attribute.
104
+ # @param [Object] Object to be compared
105
+ def ==(o)
106
+ return true if self.equal?(o)
107
+ self.class == o.class &&
108
+ session_id == o.session_id
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [session_id].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ attributes = attributes.transform_keys(&:to_sym)
129
+ transformed_hash = {}
130
+ openapi_types.each_pair do |key, type|
131
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = nil
133
+ elsif type =~ /\AArray<(.*)>/i
134
+ # check to ensure the input is an array given that the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[attribute_map[key]].is_a?(Array)
137
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
138
+ end
139
+ elsif !attributes[attribute_map[key]].nil?
140
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
141
+ end
142
+ end
143
+ new(transformed_hash)
144
+ end
145
+
146
+ # Deserializes the data based on type
147
+ # @param string type Data type
148
+ # @param string value Value to be deserialized
149
+ # @return [Object] Deserialized data
150
+ def self._deserialize(type, value)
151
+ case type.to_sym
152
+ when :Time
153
+ Time.parse(value)
154
+ when :Date
155
+ Date.parse(value)
156
+ when :String
157
+ value.to_s
158
+ when :Integer
159
+ value.to_i
160
+ when :Float
161
+ value.to_f
162
+ when :Boolean
163
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
164
+ true
165
+ else
166
+ false
167
+ end
168
+ when :Object
169
+ # generic object (usually a Hash), return directly
170
+ value
171
+ when /\AArray<(?<inner_type>.+)>\z/
172
+ inner_type = Regexp.last_match[:inner_type]
173
+ value.map { |v| _deserialize(inner_type, v) }
174
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
175
+ k_type = Regexp.last_match[:k_type]
176
+ v_type = Regexp.last_match[:v_type]
177
+ {}.tap do |hash|
178
+ value.each do |k, v|
179
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
180
+ end
181
+ end
182
+ else # model
183
+ # models (e.g. Pet) or oneOf
184
+ klass = DaytonaToolboxApiClient.const_get(type)
185
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
186
+ end
187
+ end
188
+
189
+ # Returns the string representation of the object
190
+ # @return [String] String presentation of the object
191
+ def to_s
192
+ to_hash.to_s
193
+ end
194
+
195
+ # to_body is an alias to to_hash (backward compatibility)
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_body
198
+ to_hash
199
+ end
200
+
201
+ # Returns the object in the form of hash
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_hash
204
+ hash = {}
205
+ self.class.attribute_map.each_pair do |attr, param|
206
+ value = self.send(attr)
207
+ if value.nil?
208
+ is_nullable = self.class.openapi_nullable.include?(attr)
209
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
210
+ end
211
+
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end
216
+
217
+ # Outputs non-array value in the form of hash
218
+ # For object, use to_hash. Otherwise, just return the value
219
+ # @param [Object] value Any valid value
220
+ # @return [Hash] Returns the value in the form of hash
221
+ def _to_hash(value)
222
+ if value.is_a?(Array)
223
+ value.compact.map { |v| _to_hash(v) }
224
+ elsif value.is_a?(Hash)
225
+ {}.tap do |hash|
226
+ value.each { |k, v| hash[k] = _to_hash(v) }
227
+ end
228
+ elsif value.respond_to? :to_hash
229
+ value.to_hash
230
+ else
231
+ value
232
+ end
233
+ end
234
+ end
235
+ end