daytona_api_client 0.197.0 → 0.199.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 (77) hide show
  1. checksums.yaml +4 -4
  2. data/.openapi-generator/FILES +0 -68
  3. data/lib/daytona_api_client/api/sandbox_api.rb +70 -0
  4. data/lib/daytona_api_client/models/create_sandbox.rb +11 -1
  5. data/lib/daytona_api_client/models/sandbox.rb +11 -1
  6. data/lib/daytona_api_client/models/sandbox_list_item.rb +11 -1
  7. data/lib/daytona_api_client/version.rb +1 -1
  8. data/lib/daytona_api_client.rb +0 -68
  9. metadata +1 -69
  10. data/lib/daytona_api_client/api/toolbox_api.rb +0 -5108
  11. data/lib/daytona_api_client/models/command.rb +0 -202
  12. data/lib/daytona_api_client/models/completion_context.rb +0 -173
  13. data/lib/daytona_api_client/models/completion_item.rb +0 -218
  14. data/lib/daytona_api_client/models/completion_list.rb +0 -192
  15. data/lib/daytona_api_client/models/compressed_screenshot_response.rb +0 -185
  16. data/lib/daytona_api_client/models/computer_use_start_response.rb +0 -192
  17. data/lib/daytona_api_client/models/computer_use_status_response.rb +0 -189
  18. data/lib/daytona_api_client/models/computer_use_stop_response.rb +0 -192
  19. data/lib/daytona_api_client/models/create_session_request.rb +0 -165
  20. data/lib/daytona_api_client/models/display_info_response.rb +0 -167
  21. data/lib/daytona_api_client/models/download_files.rb +0 -167
  22. data/lib/daytona_api_client/models/execute_request.rb +0 -184
  23. data/lib/daytona_api_client/models/execute_response.rb +0 -192
  24. data/lib/daytona_api_client/models/file_info.rb +0 -346
  25. data/lib/daytona_api_client/models/file_status.rb +0 -242
  26. data/lib/daytona_api_client/models/git_add_request.rb +0 -193
  27. data/lib/daytona_api_client/models/git_branch_request.rb +0 -190
  28. data/lib/daytona_api_client/models/git_checkout_request.rb +0 -190
  29. data/lib/daytona_api_client/models/git_clone_request.rb +0 -226
  30. data/lib/daytona_api_client/models/git_commit_info.rb +0 -268
  31. data/lib/daytona_api_client/models/git_commit_request.rb +0 -254
  32. data/lib/daytona_api_client/models/git_commit_response.rb +0 -164
  33. data/lib/daytona_api_client/models/git_delete_branch_request.rb +0 -190
  34. data/lib/daytona_api_client/models/git_repo_request.rb +0 -182
  35. data/lib/daytona_api_client/models/git_status.rb +0 -219
  36. data/lib/daytona_api_client/models/keyboard_hotkey_request.rb +0 -165
  37. data/lib/daytona_api_client/models/keyboard_press_request.rb +0 -177
  38. data/lib/daytona_api_client/models/keyboard_type_request.rb +0 -175
  39. data/lib/daytona_api_client/models/list_branch_response.rb +0 -166
  40. data/lib/daytona_api_client/models/lsp_completion_params.rb +0 -254
  41. data/lib/daytona_api_client/models/lsp_document_request.rb +0 -219
  42. data/lib/daytona_api_client/models/lsp_location.rb +0 -190
  43. data/lib/daytona_api_client/models/lsp_server_request.rb +0 -192
  44. data/lib/daytona_api_client/models/lsp_symbol.rb +0 -216
  45. data/lib/daytona_api_client/models/match.rb +0 -216
  46. data/lib/daytona_api_client/models/mouse_click_request.rb +0 -212
  47. data/lib/daytona_api_client/models/mouse_click_response.rb +0 -192
  48. data/lib/daytona_api_client/models/mouse_drag_request.rb +0 -256
  49. data/lib/daytona_api_client/models/mouse_drag_response.rb +0 -192
  50. data/lib/daytona_api_client/models/mouse_move_request.rb +0 -192
  51. data/lib/daytona_api_client/models/mouse_move_response.rb +0 -192
  52. data/lib/daytona_api_client/models/mouse_position.rb +0 -192
  53. data/lib/daytona_api_client/models/mouse_scroll_request.rb +0 -229
  54. data/lib/daytona_api_client/models/mouse_scroll_response.rb +0 -165
  55. data/lib/daytona_api_client/models/position.rb +0 -190
  56. data/lib/daytona_api_client/models/process_errors_response.rb +0 -192
  57. data/lib/daytona_api_client/models/process_logs_response.rb +0 -192
  58. data/lib/daytona_api_client/models/process_restart_response.rb +0 -192
  59. data/lib/daytona_api_client/models/process_status_response.rb +0 -192
  60. data/lib/daytona_api_client/models/project_dir_response.rb +0 -147
  61. data/lib/daytona_api_client/models/pty_create_request.rb +0 -217
  62. data/lib/daytona_api_client/models/pty_create_response.rb +0 -165
  63. data/lib/daytona_api_client/models/pty_list_response.rb +0 -167
  64. data/lib/daytona_api_client/models/pty_resize_request.rb +0 -192
  65. data/lib/daytona_api_client/models/pty_session_info.rb +0 -354
  66. data/lib/daytona_api_client/models/range.rb +0 -190
  67. data/lib/daytona_api_client/models/region_screenshot_response.rb +0 -185
  68. data/lib/daytona_api_client/models/replace_request.rb +0 -218
  69. data/lib/daytona_api_client/models/replace_result.rb +0 -165
  70. data/lib/daytona_api_client/models/screenshot_response.rb +0 -185
  71. data/lib/daytona_api_client/models/search_files_response.rb +0 -166
  72. data/lib/daytona_api_client/models/session.rb +0 -180
  73. data/lib/daytona_api_client/models/session_execute_request.rb +0 -185
  74. data/lib/daytona_api_client/models/session_execute_response.rb +0 -168
  75. data/lib/daytona_api_client/models/user_home_dir_response.rb +0 -147
  76. data/lib/daytona_api_client/models/windows_response.rb +0 -194
  77. data/lib/daytona_api_client/models/work_dir_response.rb +0 -147
@@ -1,165 +0,0 @@
1
- =begin
2
- #Daytona
3
-
4
- #Daytona AI platform API Docs
5
-
6
- The version of the OpenAPI document: 1.0
7
- Contact: support@daytona.com
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 DaytonaApiClient
17
- class ReplaceResult < ApiModelBase
18
- attr_accessor :file
19
-
20
- attr_accessor :success
21
-
22
- attr_accessor :error
23
-
24
- # Attribute mapping from ruby-style variable name to JSON key.
25
- def self.attribute_map
26
- {
27
- :'file' => :'file',
28
- :'success' => :'success',
29
- :'error' => :'error'
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
- :'file' => :'String',
47
- :'success' => :'Boolean',
48
- :'error' => :'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 `DaytonaApiClient::ReplaceResult` 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 `DaytonaApiClient::ReplaceResult`. 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?(:'file')
75
- self.file = attributes[:'file']
76
- end
77
-
78
- if attributes.key?(:'success')
79
- self.success = attributes[:'success']
80
- end
81
-
82
- if attributes.key?(:'error')
83
- self.error = attributes[:'error']
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
- file == o.file &&
108
- success == o.success &&
109
- error == o.error
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
- [file, success, error].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
@@ -1,185 +0,0 @@
1
- =begin
2
- #Daytona
3
-
4
- #Daytona AI platform API Docs
5
-
6
- The version of the OpenAPI document: 1.0
7
- Contact: support@daytona.com
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 DaytonaApiClient
17
- class ScreenshotResponse < ApiModelBase
18
- # Base64 encoded screenshot image data
19
- attr_accessor :screenshot
20
-
21
- # The current cursor position when the screenshot was taken
22
- attr_accessor :cursor_position
23
-
24
- # The size of the screenshot data in bytes
25
- attr_accessor :size_bytes
26
-
27
- # Attribute mapping from ruby-style variable name to JSON key.
28
- def self.attribute_map
29
- {
30
- :'screenshot' => :'screenshot',
31
- :'cursor_position' => :'cursorPosition',
32
- :'size_bytes' => :'sizeBytes'
33
- }
34
- end
35
-
36
- # Returns attribute mapping this model knows about
37
- def self.acceptable_attribute_map
38
- attribute_map
39
- end
40
-
41
- # Returns all the JSON keys this model knows about
42
- def self.acceptable_attributes
43
- acceptable_attribute_map.values
44
- end
45
-
46
- # Attribute type mapping.
47
- def self.openapi_types
48
- {
49
- :'screenshot' => :'String',
50
- :'cursor_position' => :'Object',
51
- :'size_bytes' => :'Float'
52
- }
53
- end
54
-
55
- # List of attributes with nullable: true
56
- def self.openapi_nullable
57
- Set.new([
58
- ])
59
- end
60
-
61
- # Initializes the object
62
- # @param [Hash] attributes Model attributes in the form of hash
63
- def initialize(attributes = {})
64
- if (!attributes.is_a?(Hash))
65
- fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::ScreenshotResponse` initialize method"
66
- end
67
-
68
- # check to see if the attribute exists and convert string to symbol for hash key
69
- acceptable_attribute_map = self.class.acceptable_attribute_map
70
- attributes = attributes.each_with_object({}) { |(k, v), h|
71
- if (!acceptable_attribute_map.key?(k.to_sym))
72
- fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::ScreenshotResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
- end
74
- h[k.to_sym] = v
75
- }
76
-
77
- if attributes.key?(:'screenshot')
78
- self.screenshot = attributes[:'screenshot']
79
- else
80
- self.screenshot = nil
81
- end
82
-
83
- if attributes.key?(:'cursor_position')
84
- self.cursor_position = attributes[:'cursor_position']
85
- end
86
-
87
- if attributes.key?(:'size_bytes')
88
- self.size_bytes = attributes[:'size_bytes']
89
- end
90
- end
91
-
92
- # Show invalid properties with the reasons. Usually used together with valid?
93
- # @return Array for valid properties with the reasons
94
- def list_invalid_properties
95
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
96
- invalid_properties = Array.new
97
- if @screenshot.nil?
98
- invalid_properties.push('invalid value for "screenshot", screenshot cannot be nil.')
99
- end
100
-
101
- invalid_properties
102
- end
103
-
104
- # Check to see if the all the properties in the model are valid
105
- # @return true if the model is valid
106
- def valid?
107
- warn '[DEPRECATED] the `valid?` method is obsolete'
108
- return false if @screenshot.nil?
109
- true
110
- end
111
-
112
- # Custom attribute writer method with validation
113
- # @param [Object] screenshot Value to be assigned
114
- def screenshot=(screenshot)
115
- if screenshot.nil?
116
- fail ArgumentError, 'screenshot cannot be nil'
117
- end
118
-
119
- @screenshot = screenshot
120
- end
121
-
122
- # Checks equality by comparing each attribute.
123
- # @param [Object] Object to be compared
124
- def ==(o)
125
- return true if self.equal?(o)
126
- self.class == o.class &&
127
- screenshot == o.screenshot &&
128
- cursor_position == o.cursor_position &&
129
- size_bytes == o.size_bytes
130
- end
131
-
132
- # @see the `==` method
133
- # @param [Object] Object to be compared
134
- def eql?(o)
135
- self == o
136
- end
137
-
138
- # Calculates hash code according to all attributes.
139
- # @return [Integer] Hash code
140
- def hash
141
- [screenshot, cursor_position, size_bytes].hash
142
- end
143
-
144
- # Builds the object from hash
145
- # @param [Hash] attributes Model attributes in the form of hash
146
- # @return [Object] Returns the model itself
147
- def self.build_from_hash(attributes)
148
- return nil unless attributes.is_a?(Hash)
149
- attributes = attributes.transform_keys(&:to_sym)
150
- transformed_hash = {}
151
- openapi_types.each_pair do |key, type|
152
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
153
- transformed_hash["#{key}"] = nil
154
- elsif type =~ /\AArray<(.*)>/i
155
- # check to ensure the input is an array given that the attribute
156
- # is documented as an array but the input is not
157
- if attributes[attribute_map[key]].is_a?(Array)
158
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
159
- end
160
- elsif !attributes[attribute_map[key]].nil?
161
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
162
- end
163
- end
164
- new(transformed_hash)
165
- end
166
-
167
- # Returns the object in the form of hash
168
- # @return [Hash] Returns the object in the form of hash
169
- def to_hash
170
- hash = {}
171
- self.class.attribute_map.each_pair do |attr, param|
172
- value = self.send(attr)
173
- if value.nil?
174
- is_nullable = self.class.openapi_nullable.include?(attr)
175
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
176
- end
177
-
178
- hash[param] = _to_hash(value)
179
- end
180
- hash
181
- end
182
-
183
- end
184
-
185
- end
@@ -1,166 +0,0 @@
1
- =begin
2
- #Daytona
3
-
4
- #Daytona AI platform API Docs
5
-
6
- The version of the OpenAPI document: 1.0
7
- Contact: support@daytona.com
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 DaytonaApiClient
17
- class SearchFilesResponse < ApiModelBase
18
- attr_accessor :files
19
-
20
- # Attribute mapping from ruby-style variable name to JSON key.
21
- def self.attribute_map
22
- {
23
- :'files' => :'files'
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
- :'files' => :'Array<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 `DaytonaApiClient::SearchFilesResponse` 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 `DaytonaApiClient::SearchFilesResponse`. 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?(:'files')
67
- if (value = attributes[:'files']).is_a?(Array)
68
- self.files = value
69
- end
70
- else
71
- self.files = 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 @files.nil?
81
- invalid_properties.push('invalid value for "files", files 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 @files.nil?
92
- true
93
- end
94
-
95
- # Custom attribute writer method with validation
96
- # @param [Object] files Value to be assigned
97
- def files=(files)
98
- if files.nil?
99
- fail ArgumentError, 'files cannot be nil'
100
- end
101
-
102
- @files = files
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
- files == o.files
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
- [files].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
@@ -1,180 +0,0 @@
1
- =begin
2
- #Daytona
3
-
4
- #Daytona AI platform API Docs
5
-
6
- The version of the OpenAPI document: 1.0
7
- Contact: support@daytona.com
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 DaytonaApiClient
17
- class Session < ApiModelBase
18
- # The ID of the session
19
- attr_accessor :session_id
20
-
21
- # The list of commands executed in this session
22
- attr_accessor :commands
23
-
24
- # Attribute mapping from ruby-style variable name to JSON key.
25
- def self.attribute_map
26
- {
27
- :'session_id' => :'sessionId',
28
- :'commands' => :'commands'
29
- }
30
- end
31
-
32
- # Returns attribute mapping this model knows about
33
- def self.acceptable_attribute_map
34
- attribute_map
35
- end
36
-
37
- # Returns all the JSON keys this model knows about
38
- def self.acceptable_attributes
39
- acceptable_attribute_map.values
40
- end
41
-
42
- # Attribute type mapping.
43
- def self.openapi_types
44
- {
45
- :'session_id' => :'String',
46
- :'commands' => :'Array<Command>'
47
- }
48
- end
49
-
50
- # List of attributes with nullable: true
51
- def self.openapi_nullable
52
- Set.new([
53
- :'commands'
54
- ])
55
- end
56
-
57
- # Initializes the object
58
- # @param [Hash] attributes Model attributes in the form of hash
59
- def initialize(attributes = {})
60
- if (!attributes.is_a?(Hash))
61
- fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::Session` initialize method"
62
- end
63
-
64
- # check to see if the attribute exists and convert string to symbol for hash key
65
- acceptable_attribute_map = self.class.acceptable_attribute_map
66
- attributes = attributes.each_with_object({}) { |(k, v), h|
67
- if (!acceptable_attribute_map.key?(k.to_sym))
68
- fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::Session`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
69
- end
70
- h[k.to_sym] = v
71
- }
72
-
73
- if attributes.key?(:'session_id')
74
- self.session_id = attributes[:'session_id']
75
- else
76
- self.session_id = nil
77
- end
78
-
79
- if attributes.key?(:'commands')
80
- if (value = attributes[:'commands']).is_a?(Array)
81
- self.commands = value
82
- end
83
- else
84
- self.commands = nil
85
- end
86
- end
87
-
88
- # Show invalid properties with the reasons. Usually used together with valid?
89
- # @return Array for valid properties with the reasons
90
- def list_invalid_properties
91
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
92
- invalid_properties = Array.new
93
- if @session_id.nil?
94
- invalid_properties.push('invalid value for "session_id", session_id cannot be nil.')
95
- end
96
-
97
- invalid_properties
98
- end
99
-
100
- # Check to see if the all the properties in the model are valid
101
- # @return true if the model is valid
102
- def valid?
103
- warn '[DEPRECATED] the `valid?` method is obsolete'
104
- return false if @session_id.nil?
105
- true
106
- end
107
-
108
- # Custom attribute writer method with validation
109
- # @param [Object] session_id Value to be assigned
110
- def session_id=(session_id)
111
- if session_id.nil?
112
- fail ArgumentError, 'session_id cannot be nil'
113
- end
114
-
115
- @session_id = session_id
116
- end
117
-
118
- # Checks equality by comparing each attribute.
119
- # @param [Object] Object to be compared
120
- def ==(o)
121
- return true if self.equal?(o)
122
- self.class == o.class &&
123
- session_id == o.session_id &&
124
- commands == o.commands
125
- end
126
-
127
- # @see the `==` method
128
- # @param [Object] Object to be compared
129
- def eql?(o)
130
- self == o
131
- end
132
-
133
- # Calculates hash code according to all attributes.
134
- # @return [Integer] Hash code
135
- def hash
136
- [session_id, commands].hash
137
- end
138
-
139
- # Builds the object from hash
140
- # @param [Hash] attributes Model attributes in the form of hash
141
- # @return [Object] Returns the model itself
142
- def self.build_from_hash(attributes)
143
- return nil unless attributes.is_a?(Hash)
144
- attributes = attributes.transform_keys(&:to_sym)
145
- transformed_hash = {}
146
- openapi_types.each_pair do |key, type|
147
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
148
- transformed_hash["#{key}"] = nil
149
- elsif type =~ /\AArray<(.*)>/i
150
- # check to ensure the input is an array given that the attribute
151
- # is documented as an array but the input is not
152
- if attributes[attribute_map[key]].is_a?(Array)
153
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
154
- end
155
- elsif !attributes[attribute_map[key]].nil?
156
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
157
- end
158
- end
159
- new(transformed_hash)
160
- end
161
-
162
- # Returns the object in the form of hash
163
- # @return [Hash] Returns the object in the form of hash
164
- def to_hash
165
- hash = {}
166
- self.class.attribute_map.each_pair do |attr, param|
167
- value = self.send(attr)
168
- if value.nil?
169
- is_nullable = self.class.openapi_nullable.include?(attr)
170
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
171
- end
172
-
173
- hash[param] = _to_hash(value)
174
- end
175
- hash
176
- end
177
-
178
- end
179
-
180
- end