aspose_cells_cloud 25.10 → 25.11

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.
@@ -32,13 +32,10 @@ module AsposeCellsCloud
32
32
  class RemoveCharactersRequest
33
33
 
34
34
  attr_accessor :spreadsheet
35
- attr_accessor :the_first_n_characters
36
- attr_accessor :the_last_n_characters
37
- attr_accessor :all_characters_before_text
38
- attr_accessor :all_characters_after_text
39
35
  attr_accessor :remove_text_method
40
36
  attr_accessor :character_sets
41
37
  attr_accessor :remove_custom_value
38
+ attr_accessor :case_sensitive
42
39
  attr_accessor :worksheet
43
40
  attr_accessor :range
44
41
  attr_accessor :out_path
@@ -56,22 +53,6 @@ module AsposeCellsCloud
56
53
  self.spreadsheet = attributes[:'Spreadsheet']
57
54
  end
58
55
 
59
- if attributes.has_key?(:'theFirstNCharacters')
60
- self.the_first_n_characters = attributes[:'theFirstNCharacters']
61
- end
62
-
63
- if attributes.has_key?(:'theLastNCharacters')
64
- self.the_last_n_characters = attributes[:'theLastNCharacters']
65
- end
66
-
67
- if attributes.has_key?(:'allCharactersBeforeText')
68
- self.all_characters_before_text = attributes[:'allCharactersBeforeText']
69
- end
70
-
71
- if attributes.has_key?(:'allCharactersAfterText')
72
- self.all_characters_after_text = attributes[:'allCharactersAfterText']
73
- end
74
-
75
56
  if attributes.has_key?(:'removeTextMethod')
76
57
  self.remove_text_method = attributes[:'removeTextMethod']
77
58
  end
@@ -84,6 +65,10 @@ module AsposeCellsCloud
84
65
  self.remove_custom_value = attributes[:'removeCustomValue']
85
66
  end
86
67
 
68
+ if attributes.has_key?(:'caseSensitive')
69
+ self.case_sensitive = attributes[:'caseSensitive']
70
+ end
71
+
87
72
  if attributes.has_key?(:'worksheet')
88
73
  self.worksheet = attributes[:'worksheet']
89
74
  end
@@ -113,13 +98,10 @@ module AsposeCellsCloud
113
98
  def self.attribute_map
114
99
  {
115
100
  :'spreadsheet' => :'Spreadsheet',
116
- :'the_first_n_characters' => :'theFirstNCharacters',
117
- :'the_last_n_characters' => :'theLastNCharacters',
118
- :'all_characters_before_text' => :'allCharactersBeforeText',
119
- :'all_characters_after_text' => :'allCharactersAfterText',
120
101
  :'remove_text_method' => :'removeTextMethod',
121
102
  :'character_sets' => :'characterSets',
122
103
  :'remove_custom_value' => :'removeCustomValue',
104
+ :'case_sensitive' => :'caseSensitive',
123
105
  :'worksheet' => :'worksheet',
124
106
  :'range' => :'range',
125
107
  :'out_path' => :'outPath',
@@ -133,13 +115,10 @@ module AsposeCellsCloud
133
115
  def self.swagger_types
134
116
  {
135
117
  :'spreadsheet' => :'String',
136
- :'the_first_n_characters' => :'Integer',
137
- :'the_last_n_characters' => :'Integer',
138
- :'all_characters_before_text' => :'String',
139
- :'all_characters_after_text' => :'String',
140
118
  :'remove_text_method' => :'String',
141
119
  :'character_sets' => :'String',
142
120
  :'remove_custom_value' => :'String',
121
+ :'case_sensitive' => :'BOOLEAN',
143
122
  :'worksheet' => :'String',
144
123
  :'range' => :'String',
145
124
  :'out_path' => :'String',
@@ -158,54 +137,15 @@ module AsposeCellsCloud
158
137
  if api_client.config.client_side_validation && spreadsheet.nil?
159
138
  fail ArgumentError, "Missing the required parameter 'spreadsheet' when calling CellsApi.remove_characters "
160
139
  end
161
- # verify the required parameter 'the_first_n_characters' is set
162
- if api_client.config.client_side_validation && the_first_n_characters.nil?
163
- fail ArgumentError, "Missing the required parameter 'the_first_n_characters' when calling CellsApi.remove_characters "
164
- end
165
- # verify the required parameter 'the_last_n_characters' is set
166
- if api_client.config.client_side_validation && the_last_n_characters.nil?
167
- fail ArgumentError, "Missing the required parameter 'the_last_n_characters' when calling CellsApi.remove_characters "
168
- end
169
- # verify the required parameter 'all_characters_before_text' is set
170
- if api_client.config.client_side_validation && all_characters_before_text.nil?
171
- fail ArgumentError, "Missing the required parameter 'all_characters_before_text' when calling CellsApi.remove_characters "
172
- end
173
- # verify the required parameter 'all_characters_after_text' is set
174
- if api_client.config.client_side_validation && all_characters_after_text.nil?
175
- fail ArgumentError, "Missing the required parameter 'all_characters_after_text' when calling CellsApi.remove_characters "
176
- end
177
- # verify the required parameter 'remove_text_method' is set
178
- if api_client.config.client_side_validation && remove_text_method.nil?
179
- fail ArgumentError, "Missing the required parameter 'remove_text_method' when calling CellsApi.remove_characters "
180
- end
181
- # verify the required parameter 'character_sets' is set
182
- if api_client.config.client_side_validation && character_sets.nil?
183
- fail ArgumentError, "Missing the required parameter 'character_sets' when calling CellsApi.remove_characters "
184
- end
185
- # verify the required parameter 'remove_custom_value' is set
186
- if api_client.config.client_side_validation && remove_custom_value.nil?
187
- fail ArgumentError, "Missing the required parameter 'remove_custom_value' when calling CellsApi.remove_characters "
188
- end
189
- # verify the required parameter 'worksheet' is set
190
- if api_client.config.client_side_validation && worksheet.nil?
191
- fail ArgumentError, "Missing the required parameter 'worksheet' when calling CellsApi.remove_characters "
192
- end
193
- # verify the required parameter 'range' is set
194
- if api_client.config.client_side_validation && range.nil?
195
- fail ArgumentError, "Missing the required parameter 'range' when calling CellsApi.remove_characters "
196
- end
197
140
 
198
141
  # resource path
199
142
  local_var_path = "v4.0/cells/content/remove/characters"
200
143
  # query parameters
201
144
  query_params = {}
202
- query_params[:'theFirstNCharacters'] = self.the_first_n_characters if !self.the_first_n_characters.nil?
203
- query_params[:'theLastNCharacters'] = self.the_last_n_characters if !self.the_last_n_characters.nil?
204
- query_params[:'allCharactersBeforeText'] = self.all_characters_before_text if !self.all_characters_before_text.nil?
205
- query_params[:'allCharactersAfterText'] = self.all_characters_after_text if !self.all_characters_after_text.nil?
206
145
  query_params[:'removeTextMethod'] = self.remove_text_method if !self.remove_text_method.nil?
207
146
  query_params[:'characterSets'] = self.character_sets if !self.character_sets.nil?
208
147
  query_params[:'removeCustomValue'] = self.remove_custom_value if !self.remove_custom_value.nil?
148
+ query_params[:'caseSensitive'] = self.case_sensitive if !self.case_sensitive.nil?
209
149
  query_params[:'worksheet'] = self.worksheet if !self.worksheet.nil?
210
150
  query_params[:'range'] = self.range if !self.range.nil?
211
151
  query_params[:'outPath'] = self.out_path if !self.out_path.nil?
@@ -0,0 +1,182 @@
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ <copyright company="Aspose" file="RemoveDuplicateSubstrings_request.rb.cs">
4
+ Copyright (c) 2025 Aspose.Cells Cloud
5
+ </copyright>
6
+ <summary>
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.
24
+ </summary>
25
+ --------------------------------------------------------------------------------------------------------------------
26
+ =end
27
+
28
+
29
+ require "uri"
30
+
31
+ module AsposeCellsCloud
32
+ class RemoveDuplicateSubstringsRequest
33
+
34
+ attr_accessor :spreadsheet
35
+ attr_accessor :delimiters
36
+ attr_accessor :treat_consecutive_delimiters_as_one
37
+ attr_accessor :case_sensitive
38
+ attr_accessor :worksheet
39
+ attr_accessor :range
40
+ attr_accessor :out_path
41
+ attr_accessor :out_storage_name
42
+ attr_accessor :region
43
+ attr_accessor :password
44
+
45
+ def initialize(attributes = {})
46
+ return unless attributes.is_a?(Hash)
47
+
48
+ # convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
50
+
51
+ if attributes.has_key?(:'Spreadsheet')
52
+ self.spreadsheet = attributes[:'Spreadsheet']
53
+ end
54
+
55
+ if attributes.has_key?(:'delimiters')
56
+ self.delimiters = attributes[:'delimiters']
57
+ end
58
+
59
+ if attributes.has_key?(:'treatConsecutiveDelimitersAsOne')
60
+ self.treat_consecutive_delimiters_as_one = attributes[:'treatConsecutiveDelimitersAsOne']
61
+ end
62
+
63
+ if attributes.has_key?(:'caseSensitive')
64
+ self.case_sensitive = attributes[:'caseSensitive']
65
+ end
66
+
67
+ if attributes.has_key?(:'worksheet')
68
+ self.worksheet = attributes[:'worksheet']
69
+ end
70
+
71
+ if attributes.has_key?(:'range')
72
+ self.range = attributes[:'range']
73
+ end
74
+
75
+ if attributes.has_key?(:'outPath')
76
+ self.out_path = attributes[:'outPath']
77
+ end
78
+
79
+ if attributes.has_key?(:'outStorageName')
80
+ self.out_storage_name = attributes[:'outStorageName']
81
+ end
82
+
83
+ if attributes.has_key?(:'region')
84
+ self.region = attributes[:'region']
85
+ end
86
+
87
+ if attributes.has_key?(:'password')
88
+ self.password = attributes[:'password']
89
+ end
90
+
91
+ end
92
+ # Attribute mapping from ruby-style variable name to JSON key.
93
+ def self.attribute_map
94
+ {
95
+ :'spreadsheet' => :'Spreadsheet',
96
+ :'delimiters' => :'delimiters',
97
+ :'treat_consecutive_delimiters_as_one' => :'treatConsecutiveDelimitersAsOne',
98
+ :'case_sensitive' => :'caseSensitive',
99
+ :'worksheet' => :'worksheet',
100
+ :'range' => :'range',
101
+ :'out_path' => :'outPath',
102
+ :'out_storage_name' => :'outStorageName',
103
+ :'region' => :'region',
104
+ :'password' => :'password'
105
+ }
106
+ end
107
+
108
+ # Attribute type mapping.
109
+ def self.swagger_types
110
+ {
111
+ :'spreadsheet' => :'String',
112
+ :'delimiters' => :'String',
113
+ :'treat_consecutive_delimiters_as_one' => :'BOOLEAN',
114
+ :'case_sensitive' => :'BOOLEAN',
115
+ :'worksheet' => :'String',
116
+ :'range' => :'String',
117
+ :'out_path' => :'String',
118
+ :'out_storage_name' => :'String',
119
+ :'region' => :'String',
120
+ :'password' => :'String'
121
+ }
122
+ end
123
+
124
+ def create_http_request(api_client,opts = {})
125
+ if api_client.config.debugging
126
+ api_client.config.logger.debug "Calling API: CellsApi.remove_duplicate_substrings ..."
127
+ end
128
+ api_client.request_token_if_needed
129
+ # verify the required parameter 'spreadsheet' is set
130
+ if api_client.config.client_side_validation && spreadsheet.nil?
131
+ fail ArgumentError, "Missing the required parameter 'spreadsheet' when calling CellsApi.remove_duplicate_substrings "
132
+ end
133
+ # verify the required parameter 'delimiters' is set
134
+ if api_client.config.client_side_validation && delimiters.nil?
135
+ fail ArgumentError, "Missing the required parameter 'delimiters' when calling CellsApi.remove_duplicate_substrings "
136
+ end
137
+
138
+ # resource path
139
+ local_var_path = "v4.0/cells/content/remove/duplicate-substrings"
140
+ # query parameters
141
+ query_params = {}
142
+ query_params[:'delimiters'] = self.delimiters if !self.delimiters.nil?
143
+ query_params[:'treatConsecutiveDelimitersAsOne'] = self.treat_consecutive_delimiters_as_one if !self.treat_consecutive_delimiters_as_one.nil?
144
+ query_params[:'caseSensitive'] = self.case_sensitive if !self.case_sensitive.nil?
145
+ query_params[:'worksheet'] = self.worksheet if !self.worksheet.nil?
146
+ query_params[:'range'] = self.range if !self.range.nil?
147
+ query_params[:'outPath'] = self.out_path if !self.out_path.nil?
148
+ query_params[:'outStorageName'] = self.out_storage_name if !self.out_storage_name.nil?
149
+ query_params[:'region'] = self.region if !self.region.nil?
150
+ query_params[:'password'] = self.password if !self.password.nil?
151
+
152
+ # header parameters
153
+ header_params = {}
154
+ # HTTP header 'Accept' (if needed)
155
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
156
+ # HTTP header 'Content-Type'
157
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
158
+
159
+ # form parameters
160
+ form_params = {}
161
+ post_body = nil
162
+ header_params['Content-Type'] = api_client.select_header_content_type(['multipart/form-data'])
163
+ if !spreadsheet.empty? && File.exist?(spreadsheet )
164
+ form_params[File.basename(spreadsheet)] = ::File.open(spreadsheet,"r")
165
+ end
166
+
167
+ #auth_names = []
168
+ auth_names = ['JWT']
169
+ data, status_code, headers = api_client.call_api(:PUT, local_var_path,
170
+ :header_params => header_params,
171
+ :query_params => query_params,
172
+ :form_params => form_params,
173
+ :body => post_body,
174
+ :auth_names => auth_names,
175
+ :return_type => 'File')
176
+ if api_client.config.debugging
177
+ api_client.config.logger.debug "API called: Specification.Name>Api.remove_duplicate_substrings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
178
+ end
179
+ return data, status_code, headers
180
+ end
181
+ end
182
+ end
@@ -119,7 +119,7 @@ module AsposeCellsCloud
119
119
  end
120
120
 
121
121
  # resource path
122
- local_var_path = "v4.0/cells/{name}/worksheets/{worksheet}/ranges/{cellArea}search/broken-links".sub('{' + 'name' + '}', name.to_s).sub('{' + 'worksheet' + '}', worksheet.to_s).sub('{' + 'cellArea' + '}', cell_area.to_s)
122
+ local_var_path = "v4.0/cells/{name}/worksheets/{worksheet}/ranges/{cellArea}/search/broken-links".sub('{' + 'name' + '}', name.to_s).sub('{' + 'worksheet' + '}', worksheet.to_s).sub('{' + 'cellArea' + '}', cell_area.to_s)
123
123
  # query parameters
124
124
  query_params = {}
125
125
  query_params[:'folder'] = self.folder if !self.folder.nil?
@@ -32,11 +32,11 @@ module AsposeCellsCloud
32
32
  class SplitTextRequest
33
33
 
34
34
  attr_accessor :spreadsheet
35
- attr_accessor :split_delimiters_type
36
- attr_accessor :custom_delimiter
35
+ attr_accessor :delimiters
37
36
  attr_accessor :keep_delimiters_in_resulting_cells
38
37
  attr_accessor :keep_delimiters_position
39
38
  attr_accessor :how_to_split
39
+ attr_accessor :out_position_range
40
40
  attr_accessor :worksheet
41
41
  attr_accessor :range
42
42
  attr_accessor :out_path
@@ -54,12 +54,8 @@ module AsposeCellsCloud
54
54
  self.spreadsheet = attributes[:'Spreadsheet']
55
55
  end
56
56
 
57
- if attributes.has_key?(:'splitDelimitersType')
58
- self.split_delimiters_type = attributes[:'splitDelimitersType']
59
- end
60
-
61
- if attributes.has_key?(:'customDelimiter')
62
- self.custom_delimiter = attributes[:'customDelimiter']
57
+ if attributes.has_key?(:'delimiters')
58
+ self.delimiters = attributes[:'delimiters']
63
59
  end
64
60
 
65
61
  if attributes.has_key?(:'keepDelimitersInResultingCells')
@@ -74,6 +70,10 @@ module AsposeCellsCloud
74
70
  self.how_to_split = attributes[:'HowToSplit']
75
71
  end
76
72
 
73
+ if attributes.has_key?(:'outPositionRange')
74
+ self.out_position_range = attributes[:'outPositionRange']
75
+ end
76
+
77
77
  if attributes.has_key?(:'worksheet')
78
78
  self.worksheet = attributes[:'worksheet']
79
79
  end
@@ -103,11 +103,11 @@ module AsposeCellsCloud
103
103
  def self.attribute_map
104
104
  {
105
105
  :'spreadsheet' => :'Spreadsheet',
106
- :'split_delimiters_type' => :'splitDelimitersType',
107
- :'custom_delimiter' => :'customDelimiter',
106
+ :'delimiters' => :'delimiters',
108
107
  :'keep_delimiters_in_resulting_cells' => :'keepDelimitersInResultingCells',
109
108
  :'keep_delimiters_position' => :'keepDelimitersPosition',
110
109
  :'how_to_split' => :'HowToSplit',
110
+ :'out_position_range' => :'outPositionRange',
111
111
  :'worksheet' => :'worksheet',
112
112
  :'range' => :'range',
113
113
  :'out_path' => :'outPath',
@@ -121,11 +121,11 @@ module AsposeCellsCloud
121
121
  def self.swagger_types
122
122
  {
123
123
  :'spreadsheet' => :'String',
124
- :'split_delimiters_type' => :'String',
125
- :'custom_delimiter' => :'String',
124
+ :'delimiters' => :'String',
126
125
  :'keep_delimiters_in_resulting_cells' => :'BOOLEAN',
127
126
  :'keep_delimiters_position' => :'String',
128
127
  :'how_to_split' => :'String',
128
+ :'out_position_range' => :'String',
129
129
  :'worksheet' => :'String',
130
130
  :'range' => :'String',
131
131
  :'out_path' => :'String',
@@ -144,36 +144,20 @@ module AsposeCellsCloud
144
144
  if api_client.config.client_side_validation && spreadsheet.nil?
145
145
  fail ArgumentError, "Missing the required parameter 'spreadsheet' when calling CellsApi.split_text "
146
146
  end
147
- # verify the required parameter 'split_delimiters_type' is set
148
- if api_client.config.client_side_validation && split_delimiters_type.nil?
149
- fail ArgumentError, "Missing the required parameter 'split_delimiters_type' when calling CellsApi.split_text "
150
- end
151
- # verify the required parameter 'custom_delimiter' is set
152
- if api_client.config.client_side_validation && custom_delimiter.nil?
153
- fail ArgumentError, "Missing the required parameter 'custom_delimiter' when calling CellsApi.split_text "
154
- end
155
- # verify the required parameter 'keep_delimiters_in_resulting_cells' is set
156
- if api_client.config.client_side_validation && keep_delimiters_in_resulting_cells.nil?
157
- fail ArgumentError, "Missing the required parameter 'keep_delimiters_in_resulting_cells' when calling CellsApi.split_text "
158
- end
159
- # verify the required parameter 'keep_delimiters_position' is set
160
- if api_client.config.client_side_validation && keep_delimiters_position.nil?
161
- fail ArgumentError, "Missing the required parameter 'keep_delimiters_position' when calling CellsApi.split_text "
162
- end
163
- # verify the required parameter 'how_to_split' is set
164
- if api_client.config.client_side_validation && how_to_split.nil?
165
- fail ArgumentError, "Missing the required parameter 'how_to_split' when calling CellsApi.split_text "
147
+ # verify the required parameter 'delimiters' is set
148
+ if api_client.config.client_side_validation && delimiters.nil?
149
+ fail ArgumentError, "Missing the required parameter 'delimiters' when calling CellsApi.split_text "
166
150
  end
167
151
 
168
152
  # resource path
169
153
  local_var_path = "v4.0/cells/content/split/text"
170
154
  # query parameters
171
155
  query_params = {}
172
- query_params[:'splitDelimitersType'] = self.split_delimiters_type if !self.split_delimiters_type.nil?
173
- query_params[:'customDelimiter'] = self.custom_delimiter if !self.custom_delimiter.nil?
156
+ query_params[:'delimiters'] = self.delimiters if !self.delimiters.nil?
174
157
  query_params[:'keepDelimitersInResultingCells'] = self.keep_delimiters_in_resulting_cells if !self.keep_delimiters_in_resulting_cells.nil?
175
158
  query_params[:'keepDelimitersPosition'] = self.keep_delimiters_position if !self.keep_delimiters_position.nil?
176
159
  query_params[:'HowToSplit'] = self.how_to_split if !self.how_to_split.nil?
160
+ query_params[:'outPositionRange'] = self.out_position_range if !self.out_position_range.nil?
177
161
  query_params[:'worksheet'] = self.worksheet if !self.worksheet.nil?
178
162
  query_params[:'range'] = self.range if !self.range.nil?
179
163
  query_params[:'outPath'] = self.out_path if !self.out_path.nil?
@@ -0,0 +1,134 @@
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ <copyright company="Aspose" file="TranslateTextFile_request.rb.cs">
4
+ Copyright (c) 2025 Aspose.Cells Cloud
5
+ </copyright>
6
+ <summary>
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.
24
+ </summary>
25
+ --------------------------------------------------------------------------------------------------------------------
26
+ =end
27
+
28
+
29
+ require "uri"
30
+
31
+ module AsposeCellsCloud
32
+ class TranslateTextFileRequest
33
+
34
+ attr_accessor :spreadsheet
35
+ attr_accessor :target_language
36
+ attr_accessor :region
37
+ attr_accessor :password
38
+
39
+ def initialize(attributes = {})
40
+ return unless attributes.is_a?(Hash)
41
+
42
+ # convert string to symbol for hash key
43
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
44
+
45
+ if attributes.has_key?(:'Spreadsheet')
46
+ self.spreadsheet = attributes[:'Spreadsheet']
47
+ end
48
+
49
+ if attributes.has_key?(:'targetLanguage')
50
+ self.target_language = attributes[:'targetLanguage']
51
+ end
52
+
53
+ if attributes.has_key?(:'region')
54
+ self.region = attributes[:'region']
55
+ end
56
+
57
+ if attributes.has_key?(:'password')
58
+ self.password = attributes[:'password']
59
+ end
60
+
61
+ end
62
+ # Attribute mapping from ruby-style variable name to JSON key.
63
+ def self.attribute_map
64
+ {
65
+ :'spreadsheet' => :'Spreadsheet',
66
+ :'target_language' => :'targetLanguage',
67
+ :'region' => :'region',
68
+ :'password' => :'password'
69
+ }
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.swagger_types
74
+ {
75
+ :'spreadsheet' => :'String',
76
+ :'target_language' => :'String',
77
+ :'region' => :'String',
78
+ :'password' => :'String'
79
+ }
80
+ end
81
+
82
+ def create_http_request(api_client,opts = {})
83
+ if api_client.config.debugging
84
+ api_client.config.logger.debug "Calling API: CellsApi.translate_text_file ..."
85
+ end
86
+ api_client.request_token_if_needed
87
+ # verify the required parameter 'spreadsheet' is set
88
+ if api_client.config.client_side_validation && spreadsheet.nil?
89
+ fail ArgumentError, "Missing the required parameter 'spreadsheet' when calling CellsApi.translate_text_file "
90
+ end
91
+ # verify the required parameter 'target_language' is set
92
+ if api_client.config.client_side_validation && target_language.nil?
93
+ fail ArgumentError, "Missing the required parameter 'target_language' when calling CellsApi.translate_text_file "
94
+ end
95
+
96
+ # resource path
97
+ local_var_path = "v4.0/cells/translate/text"
98
+ # query parameters
99
+ query_params = {}
100
+ query_params[:'targetLanguage'] = self.target_language if !self.target_language.nil?
101
+ query_params[:'region'] = self.region if !self.region.nil?
102
+ query_params[:'password'] = self.password if !self.password.nil?
103
+
104
+ # header parameters
105
+ header_params = {}
106
+ # HTTP header 'Accept' (if needed)
107
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
108
+ # HTTP header 'Content-Type'
109
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
110
+
111
+ # form parameters
112
+ form_params = {}
113
+ post_body = nil
114
+ header_params['Content-Type'] = api_client.select_header_content_type(['multipart/form-data'])
115
+ if !spreadsheet.empty? && File.exist?(spreadsheet )
116
+ form_params[File.basename(spreadsheet)] = ::File.open(spreadsheet,"r")
117
+ end
118
+
119
+ #auth_names = []
120
+ auth_names = ['JWT']
121
+ data, status_code, headers = api_client.call_api(:PUT, local_var_path,
122
+ :header_params => header_params,
123
+ :query_params => query_params,
124
+ :form_params => form_params,
125
+ :body => post_body,
126
+ :auth_names => auth_names,
127
+ :return_type => 'File')
128
+ if api_client.config.debugging
129
+ api_client.config.logger.debug "API called: Specification.Name>Api.translate_text_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
130
+ end
131
+ return data, status_code, headers
132
+ end
133
+ end
134
+ end