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,195 @@
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 PtyCreateRequest < ApiModelBase
18
+ attr_accessor :cols
19
+
20
+ attr_accessor :cwd
21
+
22
+ attr_accessor :envs
23
+
24
+ attr_accessor :id
25
+
26
+ # Don't start PTY until first client connects
27
+ attr_accessor :lazy_start
28
+
29
+ attr_accessor :rows
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'cols' => :'cols',
35
+ :'cwd' => :'cwd',
36
+ :'envs' => :'envs',
37
+ :'id' => :'id',
38
+ :'lazy_start' => :'lazyStart',
39
+ :'rows' => :'rows'
40
+ }
41
+ end
42
+
43
+ # Returns attribute mapping this model knows about
44
+ def self.acceptable_attribute_map
45
+ attribute_map
46
+ end
47
+
48
+ # Returns all the JSON keys this model knows about
49
+ def self.acceptable_attributes
50
+ acceptable_attribute_map.values
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.openapi_types
55
+ {
56
+ :'cols' => :'Integer',
57
+ :'cwd' => :'String',
58
+ :'envs' => :'Hash<String, String>',
59
+ :'id' => :'String',
60
+ :'lazy_start' => :'Boolean',
61
+ :'rows' => :'Integer'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `NightonaToolboxApiClient::PtyCreateRequest` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ acceptable_attribute_map = self.class.acceptable_attribute_map
80
+ attributes = attributes.each_with_object({}) { |(k, v), h|
81
+ if (!acceptable_attribute_map.key?(k.to_sym))
82
+ fail ArgumentError, "`#{k}` is not a valid attribute in `NightonaToolboxApiClient::PtyCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
83
+ end
84
+ h[k.to_sym] = v
85
+ }
86
+
87
+ if attributes.key?(:'cols')
88
+ self.cols = attributes[:'cols']
89
+ end
90
+
91
+ if attributes.key?(:'cwd')
92
+ self.cwd = attributes[:'cwd']
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?(:'id')
102
+ self.id = attributes[:'id']
103
+ end
104
+
105
+ if attributes.key?(:'lazy_start')
106
+ self.lazy_start = attributes[:'lazy_start']
107
+ end
108
+
109
+ if attributes.key?(:'rows')
110
+ self.rows = attributes[:'rows']
111
+ end
112
+ end
113
+
114
+ # Show invalid properties with the reasons. Usually used together with valid?
115
+ # @return Array for valid properties with the reasons
116
+ def list_invalid_properties
117
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
118
+ invalid_properties = Array.new
119
+ invalid_properties
120
+ end
121
+
122
+ # Check to see if the all the properties in the model are valid
123
+ # @return true if the model is valid
124
+ def valid?
125
+ warn '[DEPRECATED] the `valid?` method is obsolete'
126
+ true
127
+ end
128
+
129
+ # Checks equality by comparing each attribute.
130
+ # @param [Object] Object to be compared
131
+ def ==(o)
132
+ return true if self.equal?(o)
133
+ self.class == o.class &&
134
+ cols == o.cols &&
135
+ cwd == o.cwd &&
136
+ envs == o.envs &&
137
+ id == o.id &&
138
+ lazy_start == o.lazy_start &&
139
+ rows == o.rows
140
+ end
141
+
142
+ # @see the `==` method
143
+ # @param [Object] Object to be compared
144
+ def eql?(o)
145
+ self == o
146
+ end
147
+
148
+ # Calculates hash code according to all attributes.
149
+ # @return [Integer] Hash code
150
+ def hash
151
+ [cols, cwd, envs, id, lazy_start, rows].hash
152
+ end
153
+
154
+ # Builds the object from hash
155
+ # @param [Hash] attributes Model attributes in the form of hash
156
+ # @return [Object] Returns the model itself
157
+ def self.build_from_hash(attributes)
158
+ return nil unless attributes.is_a?(Hash)
159
+ attributes = attributes.transform_keys(&:to_sym)
160
+ transformed_hash = {}
161
+ openapi_types.each_pair do |key, type|
162
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
163
+ transformed_hash["#{key}"] = nil
164
+ elsif type =~ /\AArray<(.*)>/i
165
+ # check to ensure the input is an array given that the attribute
166
+ # is documented as an array but the input is not
167
+ if attributes[attribute_map[key]].is_a?(Array)
168
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
169
+ end
170
+ elsif !attributes[attribute_map[key]].nil?
171
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
172
+ end
173
+ end
174
+ new(transformed_hash)
175
+ end
176
+
177
+ # Returns the object in the form of hash
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_hash
180
+ hash = {}
181
+ self.class.attribute_map.each_pair do |attr, param|
182
+ value = self.send(attr)
183
+ if value.nil?
184
+ is_nullable = self.class.openapi_nullable.include?(attr)
185
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
186
+ end
187
+
188
+ hash[param] = _to_hash(value)
189
+ end
190
+ hash
191
+ end
192
+
193
+ end
194
+
195
+ end
@@ -0,0 +1,164 @@
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 PtyCreateResponse < ApiModelBase
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 `NightonaToolboxApiClient::PtyCreateResponse` 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 `NightonaToolboxApiClient::PtyCreateResponse`. 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
+ # Returns the object in the form of hash
147
+ # @return [Hash] Returns the object in the form of hash
148
+ def to_hash
149
+ hash = {}
150
+ self.class.attribute_map.each_pair do |attr, param|
151
+ value = self.send(attr)
152
+ if value.nil?
153
+ is_nullable = self.class.openapi_nullable.include?(attr)
154
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
155
+ end
156
+
157
+ hash[param] = _to_hash(value)
158
+ end
159
+ hash
160
+ end
161
+
162
+ end
163
+
164
+ end
@@ -0,0 +1,166 @@
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 PtyListResponse < ApiModelBase
18
+ attr_accessor :sessions
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'sessions' => :'sessions'
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
+ :'sessions' => :'Array<PtySessionInfo>'
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 `NightonaToolboxApiClient::PtyListResponse` 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 `NightonaToolboxApiClient::PtyListResponse`. 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?(:'sessions')
67
+ if (value = attributes[:'sessions']).is_a?(Array)
68
+ self.sessions = value
69
+ end
70
+ else
71
+ self.sessions = nil
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
79
+ invalid_properties = Array.new
80
+ if @sessions.nil?
81
+ invalid_properties.push('invalid value for "sessions", sessions cannot be nil.')
82
+ end
83
+
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
+ return false if @sessions.nil?
92
+ true
93
+ end
94
+
95
+ # Custom attribute writer method with validation
96
+ # @param [Object] sessions Value to be assigned
97
+ def sessions=(sessions)
98
+ if sessions.nil?
99
+ fail ArgumentError, 'sessions cannot be nil'
100
+ end
101
+
102
+ @sessions = sessions
103
+ end
104
+
105
+ # Checks equality by comparing each attribute.
106
+ # @param [Object] Object to be compared
107
+ def ==(o)
108
+ return true if self.equal?(o)
109
+ self.class == o.class &&
110
+ sessions == o.sessions
111
+ end
112
+
113
+ # @see the `==` method
114
+ # @param [Object] Object to be compared
115
+ def eql?(o)
116
+ self == o
117
+ end
118
+
119
+ # Calculates hash code according to all attributes.
120
+ # @return [Integer] Hash code
121
+ def hash
122
+ [sessions].hash
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def self.build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ attributes = attributes.transform_keys(&:to_sym)
131
+ transformed_hash = {}
132
+ openapi_types.each_pair do |key, type|
133
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
134
+ transformed_hash["#{key}"] = nil
135
+ elsif type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[attribute_map[key]].is_a?(Array)
139
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
140
+ end
141
+ elsif !attributes[attribute_map[key]].nil?
142
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
143
+ end
144
+ end
145
+ new(transformed_hash)
146
+ end
147
+
148
+ # Returns the object in the form of hash
149
+ # @return [Hash] Returns the object in the form of hash
150
+ def to_hash
151
+ hash = {}
152
+ self.class.attribute_map.each_pair do |attr, param|
153
+ value = self.send(attr)
154
+ if value.nil?
155
+ is_nullable = self.class.openapi_nullable.include?(attr)
156
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
157
+ end
158
+
159
+ hash[param] = _to_hash(value)
160
+ end
161
+ hash
162
+ end
163
+
164
+ end
165
+
166
+ end