nightona_toolbox_api_client 0.191.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +39 -0
  3. data/.openapi-generator/FILES +113 -0
  4. data/.openapi-generator/VERSION +1 -0
  5. data/.openapi-generator-ignore +13 -0
  6. data/.rspec +2 -0
  7. data/.rubocop.yml +148 -0
  8. data/Rakefile +10 -0
  9. data/fix-gemspec.sh +13 -0
  10. data/lib/nightona_toolbox_api_client/api/computer_use_api.rb +2179 -0
  11. data/lib/nightona_toolbox_api_client/api/file_system_api.rb +893 -0
  12. data/lib/nightona_toolbox_api_client/api/git_api.rb +744 -0
  13. data/lib/nightona_toolbox_api_client/api/info_api.rb +193 -0
  14. data/lib/nightona_toolbox_api_client/api/interpreter_api.rb +267 -0
  15. data/lib/nightona_toolbox_api_client/api/lsp_api.rb +510 -0
  16. data/lib/nightona_toolbox_api_client/api/port_api.rb +142 -0
  17. data/lib/nightona_toolbox_api_client/api/process_api.rb +1201 -0
  18. data/lib/nightona_toolbox_api_client/api/server_api.rb +85 -0
  19. data/lib/nightona_toolbox_api_client/api_client.rb +397 -0
  20. data/lib/nightona_toolbox_api_client/api_error.rb +58 -0
  21. data/lib/nightona_toolbox_api_client/api_model_base.rb +88 -0
  22. data/lib/nightona_toolbox_api_client/configuration.rb +308 -0
  23. data/lib/nightona_toolbox_api_client/models/accessibility_bounds.rb +174 -0
  24. data/lib/nightona_toolbox_api_client/models/accessibility_invoke_request.rb +173 -0
  25. data/lib/nightona_toolbox_api_client/models/accessibility_node_request.rb +164 -0
  26. data/lib/nightona_toolbox_api_client/models/accessibility_nodes_response.rb +158 -0
  27. data/lib/nightona_toolbox_api_client/models/accessibility_set_value_request.rb +173 -0
  28. data/lib/nightona_toolbox_api_client/models/accessibility_tree_response.rb +156 -0
  29. data/lib/nightona_toolbox_api_client/models/chart.rb +256 -0
  30. data/lib/nightona_toolbox_api_client/models/chart_element.rb +295 -0
  31. data/lib/nightona_toolbox_api_client/models/code_run_artifacts.rb +149 -0
  32. data/lib/nightona_toolbox_api_client/models/code_run_request.rb +222 -0
  33. data/lib/nightona_toolbox_api_client/models/code_run_response.rb +165 -0
  34. data/lib/nightona_toolbox_api_client/models/command.rb +199 -0
  35. data/lib/nightona_toolbox_api_client/models/completion_context.rb +173 -0
  36. data/lib/nightona_toolbox_api_client/models/completion_item.rb +218 -0
  37. data/lib/nightona_toolbox_api_client/models/completion_list.rb +192 -0
  38. data/lib/nightona_toolbox_api_client/models/computer_use_accessibility_node.rb +216 -0
  39. data/lib/nightona_toolbox_api_client/models/computer_use_start_response.rb +158 -0
  40. data/lib/nightona_toolbox_api_client/models/computer_use_status_response.rb +147 -0
  41. data/lib/nightona_toolbox_api_client/models/computer_use_stop_response.rb +158 -0
  42. data/lib/nightona_toolbox_api_client/models/create_context_request.rb +156 -0
  43. data/lib/nightona_toolbox_api_client/models/create_session_request.rb +164 -0
  44. data/lib/nightona_toolbox_api_client/models/display_info.rb +192 -0
  45. data/lib/nightona_toolbox_api_client/models/display_info_response.rb +149 -0
  46. data/lib/nightona_toolbox_api_client/models/execute_request.rb +196 -0
  47. data/lib/nightona_toolbox_api_client/models/execute_response.rb +173 -0
  48. data/lib/nightona_toolbox_api_client/models/file_info.rb +373 -0
  49. data/lib/nightona_toolbox_api_client/models/file_status.rb +264 -0
  50. data/lib/nightona_toolbox_api_client/models/files_download_request.rb +166 -0
  51. data/lib/nightona_toolbox_api_client/models/find_accessibility_nodes_request.rb +204 -0
  52. data/lib/nightona_toolbox_api_client/models/git_add_request.rb +193 -0
  53. data/lib/nightona_toolbox_api_client/models/git_branch_request.rb +190 -0
  54. data/lib/nightona_toolbox_api_client/models/git_checkout_request.rb +190 -0
  55. data/lib/nightona_toolbox_api_client/models/git_clone_request.rb +236 -0
  56. data/lib/nightona_toolbox_api_client/models/git_commit_info.rb +268 -0
  57. data/lib/nightona_toolbox_api_client/models/git_commit_request.rb +251 -0
  58. data/lib/nightona_toolbox_api_client/models/git_commit_response.rb +164 -0
  59. data/lib/nightona_toolbox_api_client/models/git_delete_branch_request.rb +190 -0
  60. data/lib/nightona_toolbox_api_client/models/git_repo_request.rb +182 -0
  61. data/lib/nightona_toolbox_api_client/models/git_status.rb +219 -0
  62. data/lib/nightona_toolbox_api_client/models/initialize_request.rb +164 -0
  63. data/lib/nightona_toolbox_api_client/models/interpreter_context.rb +268 -0
  64. data/lib/nightona_toolbox_api_client/models/is_port_in_use_response.rb +147 -0
  65. data/lib/nightona_toolbox_api_client/models/keyboard_hotkey_request.rb +148 -0
  66. data/lib/nightona_toolbox_api_client/models/keyboard_press_request.rb +159 -0
  67. data/lib/nightona_toolbox_api_client/models/keyboard_type_request.rb +157 -0
  68. data/lib/nightona_toolbox_api_client/models/list_branch_response.rb +166 -0
  69. data/lib/nightona_toolbox_api_client/models/list_contexts_response.rb +166 -0
  70. data/lib/nightona_toolbox_api_client/models/list_recordings_response.rb +166 -0
  71. data/lib/nightona_toolbox_api_client/models/lsp_completion_params.rb +251 -0
  72. data/lib/nightona_toolbox_api_client/models/lsp_document_request.rb +216 -0
  73. data/lib/nightona_toolbox_api_client/models/lsp_location.rb +190 -0
  74. data/lib/nightona_toolbox_api_client/models/lsp_position.rb +190 -0
  75. data/lib/nightona_toolbox_api_client/models/lsp_range.rb +190 -0
  76. data/lib/nightona_toolbox_api_client/models/lsp_server_request.rb +190 -0
  77. data/lib/nightona_toolbox_api_client/models/lsp_symbol.rb +216 -0
  78. data/lib/nightona_toolbox_api_client/models/match.rb +216 -0
  79. data/lib/nightona_toolbox_api_client/models/mouse_click_request.rb +175 -0
  80. data/lib/nightona_toolbox_api_client/models/mouse_click_response.rb +156 -0
  81. data/lib/nightona_toolbox_api_client/models/mouse_drag_request.rb +183 -0
  82. data/lib/nightona_toolbox_api_client/models/mouse_drag_response.rb +156 -0
  83. data/lib/nightona_toolbox_api_client/models/mouse_move_request.rb +156 -0
  84. data/lib/nightona_toolbox_api_client/models/mouse_position_response.rb +156 -0
  85. data/lib/nightona_toolbox_api_client/models/mouse_scroll_request.rb +194 -0
  86. data/lib/nightona_toolbox_api_client/models/port_list.rb +149 -0
  87. data/lib/nightona_toolbox_api_client/models/position.rb +156 -0
  88. data/lib/nightona_toolbox_api_client/models/process_errors_response.rb +156 -0
  89. data/lib/nightona_toolbox_api_client/models/process_logs_response.rb +156 -0
  90. data/lib/nightona_toolbox_api_client/models/process_restart_response.rb +156 -0
  91. data/lib/nightona_toolbox_api_client/models/process_status.rb +174 -0
  92. data/lib/nightona_toolbox_api_client/models/process_status_response.rb +156 -0
  93. data/lib/nightona_toolbox_api_client/models/pty_create_request.rb +195 -0
  94. data/lib/nightona_toolbox_api_client/models/pty_create_response.rb +164 -0
  95. data/lib/nightona_toolbox_api_client/models/pty_list_response.rb +166 -0
  96. data/lib/nightona_toolbox_api_client/models/pty_resize_request.rb +226 -0
  97. data/lib/nightona_toolbox_api_client/models/pty_session_info.rb +349 -0
  98. data/lib/nightona_toolbox_api_client/models/recording.rb +295 -0
  99. data/lib/nightona_toolbox_api_client/models/replace_request.rb +218 -0
  100. data/lib/nightona_toolbox_api_client/models/replace_result.rb +165 -0
  101. data/lib/nightona_toolbox_api_client/models/screenshot_response.rb +165 -0
  102. data/lib/nightona_toolbox_api_client/models/scroll_response.rb +147 -0
  103. data/lib/nightona_toolbox_api_client/models/search_files_response.rb +166 -0
  104. data/lib/nightona_toolbox_api_client/models/session.rb +192 -0
  105. data/lib/nightona_toolbox_api_client/models/session_command_logs_response.rb +216 -0
  106. data/lib/nightona_toolbox_api_client/models/session_execute_request.rb +191 -0
  107. data/lib/nightona_toolbox_api_client/models/session_execute_response.rb +200 -0
  108. data/lib/nightona_toolbox_api_client/models/session_send_input_request.rb +164 -0
  109. data/lib/nightona_toolbox_api_client/models/start_recording_request.rb +147 -0
  110. data/lib/nightona_toolbox_api_client/models/status.rb +47 -0
  111. data/lib/nightona_toolbox_api_client/models/stop_recording_request.rb +164 -0
  112. data/lib/nightona_toolbox_api_client/models/user_home_dir_response.rb +164 -0
  113. data/lib/nightona_toolbox_api_client/models/window_info.rb +201 -0
  114. data/lib/nightona_toolbox_api_client/models/windows_response.rb +149 -0
  115. data/lib/nightona_toolbox_api_client/models/work_dir_response.rb +164 -0
  116. data/lib/nightona_toolbox_api_client/version.rb +15 -0
  117. data/lib/nightona_toolbox_api_client.rb +142 -0
  118. data/nightona_toolbox_api_client.gemspec +39 -0
  119. data/project.json +71 -0
  120. metadata +200 -0
@@ -0,0 +1,222 @@
1
+ =begin
2
+ #Nightona Toolbox API
3
+
4
+ #Nightona Toolbox API. The base URL comes from the sandbox's `toolboxProxyUrl` field (returned in sandbox DTO by the main Nightona API) plus the sandbox ID: `{toolboxProxyUrl}/{sandboxId}/{endpoint}`. Default for Nightona Cloud: `https://proxy.app.daytona.io/toolbox/{sandboxId}`.
5
+
6
+ The version of the OpenAPI document: v0.0.0-dev
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.21.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module NightonaToolboxApiClient
17
+ class CodeRunRequest < ApiModelBase
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 `NightonaToolboxApiClient::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 `NightonaToolboxApiClient::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
+ # Returns the object in the form of hash
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_hash
207
+ hash = {}
208
+ self.class.attribute_map.each_pair do |attr, param|
209
+ value = self.send(attr)
210
+ if value.nil?
211
+ is_nullable = self.class.openapi_nullable.include?(attr)
212
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
213
+ end
214
+
215
+ hash[param] = _to_hash(value)
216
+ end
217
+ hash
218
+ end
219
+
220
+ end
221
+
222
+ end
@@ -0,0 +1,165 @@
1
+ =begin
2
+ #Nightona Toolbox API
3
+
4
+ #Nightona Toolbox API. The base URL comes from the sandbox's `toolboxProxyUrl` field (returned in sandbox DTO by the main Nightona API) plus the sandbox ID: `{toolboxProxyUrl}/{sandboxId}/{endpoint}`. Default for Nightona Cloud: `https://proxy.app.daytona.io/toolbox/{sandboxId}`.
5
+
6
+ The version of the OpenAPI document: v0.0.0-dev
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.21.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module NightonaToolboxApiClient
17
+ class CodeRunResponse < ApiModelBase
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 `NightonaToolboxApiClient::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 `NightonaToolboxApiClient::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
+ # Returns the object in the form of hash
148
+ # @return [Hash] Returns the object in the form of hash
149
+ def to_hash
150
+ hash = {}
151
+ self.class.attribute_map.each_pair do |attr, param|
152
+ value = self.send(attr)
153
+ if value.nil?
154
+ is_nullable = self.class.openapi_nullable.include?(attr)
155
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
156
+ end
157
+
158
+ hash[param] = _to_hash(value)
159
+ end
160
+ hash
161
+ end
162
+
163
+ end
164
+
165
+ end
@@ -0,0 +1,199 @@
1
+ =begin
2
+ #Nightona Toolbox API
3
+
4
+ #Nightona Toolbox API. The base URL comes from the sandbox's `toolboxProxyUrl` field (returned in sandbox DTO by the main Nightona API) plus the sandbox ID: `{toolboxProxyUrl}/{sandboxId}/{endpoint}`. Default for Nightona Cloud: `https://proxy.app.daytona.io/toolbox/{sandboxId}`.
5
+
6
+ The version of the OpenAPI document: v0.0.0-dev
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.21.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module NightonaToolboxApiClient
17
+ class Command < ApiModelBase
18
+ attr_accessor :command
19
+
20
+ attr_accessor :exit_code
21
+
22
+ attr_accessor :id
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'command' => :'command',
28
+ :'exit_code' => :'exitCode',
29
+ :'id' => :'id'
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
+ :'command' => :'String',
47
+ :'exit_code' => :'Integer',
48
+ :'id' => :'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 `NightonaToolboxApiClient::Command` 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 `NightonaToolboxApiClient::Command`. 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?(:'command')
75
+ self.command = attributes[:'command']
76
+ else
77
+ self.command = nil
78
+ end
79
+
80
+ if attributes.key?(:'exit_code')
81
+ self.exit_code = attributes[:'exit_code']
82
+ end
83
+
84
+ if attributes.key?(:'id')
85
+ self.id = attributes[:'id']
86
+ else
87
+ self.id = nil
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
95
+ invalid_properties = Array.new
96
+ if @command.nil?
97
+ invalid_properties.push('invalid value for "command", command cannot be nil.')
98
+ end
99
+
100
+ if @id.nil?
101
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
102
+ end
103
+
104
+ invalid_properties
105
+ end
106
+
107
+ # Check to see if the all the properties in the model are valid
108
+ # @return true if the model is valid
109
+ def valid?
110
+ warn '[DEPRECATED] the `valid?` method is obsolete'
111
+ return false if @command.nil?
112
+ return false if @id.nil?
113
+ true
114
+ end
115
+
116
+ # Custom attribute writer method with validation
117
+ # @param [Object] command Value to be assigned
118
+ def command=(command)
119
+ if command.nil?
120
+ fail ArgumentError, 'command cannot be nil'
121
+ end
122
+
123
+ @command = command
124
+ end
125
+
126
+ # Custom attribute writer method with validation
127
+ # @param [Object] id Value to be assigned
128
+ def id=(id)
129
+ if id.nil?
130
+ fail ArgumentError, 'id cannot be nil'
131
+ end
132
+
133
+ @id = id
134
+ end
135
+
136
+ # Checks equality by comparing each attribute.
137
+ # @param [Object] Object to be compared
138
+ def ==(o)
139
+ return true if self.equal?(o)
140
+ self.class == o.class &&
141
+ command == o.command &&
142
+ exit_code == o.exit_code &&
143
+ id == o.id
144
+ end
145
+
146
+ # @see the `==` method
147
+ # @param [Object] Object to be compared
148
+ def eql?(o)
149
+ self == o
150
+ end
151
+
152
+ # Calculates hash code according to all attributes.
153
+ # @return [Integer] Hash code
154
+ def hash
155
+ [command, exit_code, id].hash
156
+ end
157
+
158
+ # Builds the object from hash
159
+ # @param [Hash] attributes Model attributes in the form of hash
160
+ # @return [Object] Returns the model itself
161
+ def self.build_from_hash(attributes)
162
+ return nil unless attributes.is_a?(Hash)
163
+ attributes = attributes.transform_keys(&:to_sym)
164
+ transformed_hash = {}
165
+ openapi_types.each_pair do |key, type|
166
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
167
+ transformed_hash["#{key}"] = nil
168
+ elsif type =~ /\AArray<(.*)>/i
169
+ # check to ensure the input is an array given that the attribute
170
+ # is documented as an array but the input is not
171
+ if attributes[attribute_map[key]].is_a?(Array)
172
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
173
+ end
174
+ elsif !attributes[attribute_map[key]].nil?
175
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
176
+ end
177
+ end
178
+ new(transformed_hash)
179
+ end
180
+
181
+ # Returns the object in the form of hash
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_hash
184
+ hash = {}
185
+ self.class.attribute_map.each_pair do |attr, param|
186
+ value = self.send(attr)
187
+ if value.nil?
188
+ is_nullable = self.class.openapi_nullable.include?(attr)
189
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
190
+ end
191
+
192
+ hash[param] = _to_hash(value)
193
+ end
194
+ hash
195
+ end
196
+
197
+ end
198
+
199
+ end