aspose_words_cloud 25.10 → 25.12

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 (75) hide show
  1. checksums.yaml +4 -4
  2. data/lib/aspose_words_cloud/api/words_api.rb +6 -132
  3. data/lib/aspose_words_cloud/models/azw3_save_options_data.rb +4 -4
  4. data/lib/aspose_words_cloud/models/bmp_save_options_data.rb +1 -1
  5. data/lib/aspose_words_cloud/models/comment.rb +2 -2
  6. data/lib/aspose_words_cloud/models/comment_insert.rb +2 -2
  7. data/lib/aspose_words_cloud/models/comment_update.rb +2 -2
  8. data/lib/aspose_words_cloud/models/compress_options.rb +2 -2
  9. data/lib/aspose_words_cloud/models/custom_xml_part.rb +1 -1
  10. data/lib/aspose_words_cloud/models/custom_xml_part_insert.rb +1 -1
  11. data/lib/aspose_words_cloud/models/custom_xml_part_update.rb +1 -1
  12. data/lib/aspose_words_cloud/models/doc_save_options_data.rb +1 -1
  13. data/lib/aspose_words_cloud/models/docm_save_options_data.rb +1 -1
  14. data/lib/aspose_words_cloud/models/document.rb +11 -1
  15. data/lib/aspose_words_cloud/models/docx_save_options_data.rb +1 -1
  16. data/lib/aspose_words_cloud/models/dot_save_options_data.rb +1 -1
  17. data/lib/aspose_words_cloud/models/dotm_save_options_data.rb +1 -1
  18. data/lib/aspose_words_cloud/models/dotx_save_options_data.rb +1 -1
  19. data/lib/aspose_words_cloud/models/emf_save_options_data.rb +1 -1
  20. data/lib/aspose_words_cloud/models/eps_save_options_data.rb +1 -1
  21. data/lib/aspose_words_cloud/models/epub_save_options_data.rb +4 -4
  22. data/lib/aspose_words_cloud/models/field_options.rb +1 -1
  23. data/lib/aspose_words_cloud/models/flat_opc_macro_save_options_data.rb +1 -1
  24. data/lib/aspose_words_cloud/models/flat_opc_save_options_data.rb +1 -1
  25. data/lib/aspose_words_cloud/models/flat_opc_template_macro_save_options_data.rb +1 -1
  26. data/lib/aspose_words_cloud/models/flat_opc_template_save_options_data.rb +1 -1
  27. data/lib/aspose_words_cloud/models/footnote.rb +1 -1
  28. data/lib/aspose_words_cloud/models/footnote_insert.rb +1 -1
  29. data/lib/aspose_words_cloud/models/footnote_update.rb +1 -1
  30. data/lib/aspose_words_cloud/models/form_field_checkbox.rb +1 -1
  31. data/lib/aspose_words_cloud/models/form_field_drop_down.rb +1 -1
  32. data/lib/aspose_words_cloud/models/form_field_text_input.rb +1 -1
  33. data/lib/aspose_words_cloud/models/gif_save_options_data.rb +1 -1
  34. data/lib/aspose_words_cloud/models/html_fixed_save_options_data.rb +4 -4
  35. data/lib/aspose_words_cloud/models/html_save_options_data.rb +4 -4
  36. data/lib/aspose_words_cloud/models/jpeg_save_options_data.rb +1 -1
  37. data/lib/aspose_words_cloud/models/list_level.rb +1 -1
  38. data/lib/aspose_words_cloud/models/list_level_update.rb +1 -1
  39. data/lib/aspose_words_cloud/models/markdown_save_options_data.rb +2 -2
  40. data/lib/aspose_words_cloud/models/mhtml_save_options_data.rb +4 -4
  41. data/lib/aspose_words_cloud/models/odt_save_options_data.rb +1 -1
  42. data/lib/aspose_words_cloud/models/open_xps_save_options_data.rb +1 -1
  43. data/lib/aspose_words_cloud/models/ott_save_options_data.rb +1 -1
  44. data/lib/aspose_words_cloud/models/pcl_save_options_data.rb +1 -1
  45. data/lib/aspose_words_cloud/models/pdf_save_options_data.rb +19 -6
  46. data/lib/aspose_words_cloud/models/png_save_options_data.rb +1 -1
  47. data/lib/aspose_words_cloud/models/ps_save_options_data.rb +1 -1
  48. data/lib/aspose_words_cloud/models/requests/build_report_online_request.rb +4 -4
  49. data/lib/aspose_words_cloud/models/requests/build_report_request.rb +4 -4
  50. data/lib/aspose_words_cloud/models/requests/sign_document_online_request.rb +2 -2
  51. data/lib/aspose_words_cloud/models/requests/sign_document_request.rb +2 -2
  52. data/lib/aspose_words_cloud/models/rtf_save_options_data.rb +1 -1
  53. data/lib/aspose_words_cloud/models/sign_options.rb +6 -6
  54. data/lib/aspose_words_cloud/models/signature.rb +1 -1
  55. data/lib/aspose_words_cloud/models/structured_document_tag.rb +21 -21
  56. data/lib/aspose_words_cloud/models/structured_document_tag_insert.rb +21 -21
  57. data/lib/aspose_words_cloud/models/structured_document_tag_update.rb +21 -21
  58. data/lib/aspose_words_cloud/models/style.rb +1 -1
  59. data/lib/aspose_words_cloud/models/style_update.rb +1 -1
  60. data/lib/aspose_words_cloud/models/svg_save_options_data.rb +2 -2
  61. data/lib/aspose_words_cloud/models/text_save_options_data.rb +30 -3
  62. data/lib/aspose_words_cloud/models/tiff_save_options_data.rb +2 -2
  63. data/lib/aspose_words_cloud/models/word_ml_save_options_data.rb +1 -1
  64. data/lib/aspose_words_cloud/models/xaml_fixed_save_options_data.rb +1 -1
  65. data/lib/aspose_words_cloud/models/xaml_flow_pack_save_options_data.rb +2 -2
  66. data/lib/aspose_words_cloud/models/xaml_flow_save_options_data.rb +2 -2
  67. data/lib/aspose_words_cloud/models/xps_save_options_data.rb +1 -1
  68. data/lib/aspose_words_cloud/version.rb +1 -1
  69. data/lib/aspose_words_cloud.rb +0 -5
  70. metadata +2 -7
  71. data/lib/aspose_words_cloud/models/classification_response.rb +0 -246
  72. data/lib/aspose_words_cloud/models/classification_result.rb +0 -215
  73. data/lib/aspose_words_cloud/models/requests/classify_document_online_request.rb +0 -193
  74. data/lib/aspose_words_cloud/models/requests/classify_document_request.rb +0 -192
  75. data/lib/aspose_words_cloud/models/requests/classify_request.rb +0 -158
@@ -1,215 +0,0 @@
1
- # ------------------------------------------------------------------------------------
2
- # <copyright company="Aspose" file="classification_result.rb">
3
- # Copyright (c) 2025 Aspose.Words for Cloud
4
- # </copyright>
5
- # <summary>
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in all
14
- # copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- # SOFTWARE.
23
- # </summary>
24
- # ------------------------------------------------------------------------------------
25
-
26
- require 'date'
27
-
28
- module AsposeWordsCloud
29
-
30
- # Represents a single classification result.
31
- class ClassificationResult
32
- # Gets or sets the name of the class.
33
- attr_accessor :class_name
34
-
35
- # Gets or sets the probability of class.
36
- attr_accessor :class_probability
37
- # Attribute mapping from ruby-style variable name to JSON key.
38
- def self.attribute_map
39
- {
40
- :'class_name' => :'ClassName',
41
- :'class_probability' => :'ClassProbability'
42
- }
43
- end
44
-
45
- # Attribute type mapping.
46
- def self.swagger_types
47
- {
48
- :'class_name' => :'String',
49
- :'class_probability' => :'Float'
50
- }
51
- end
52
-
53
- # Initializes the object
54
- # @param [Hash] attributes Model attributes in the form of hash
55
- def initialize(attributes = {})
56
- return unless attributes.is_a?(Hash)
57
-
58
- # convert string to symbol for hash key
59
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
60
-
61
- if attributes.key?(:'ClassName')
62
- self.class_name = attributes[:'ClassName']
63
- end
64
-
65
- if attributes.key?(:'ClassProbability')
66
- self.class_probability = attributes[:'ClassProbability']
67
- end
68
- end
69
-
70
- # Check to see if the all the properties in the model are valid
71
- # @return true if the model is valid
72
- def valid?
73
- return true
74
- end
75
-
76
- # Checks equality by comparing each attribute.
77
- # @param [Object] Object to be compared
78
- def ==(other)
79
- return true if self.equal?(other)
80
- self.class == other.class &&
81
- class_name == other.class_name &&
82
- class_probability == other.class_probability
83
- end
84
-
85
- # @see the `==` method
86
- # @param [Object] Object to be compared
87
- def eql?(other)
88
- self == other
89
- end
90
-
91
- # Calculates hash code according to all attributes.
92
- # @return [Fixnum] Hash code
93
- def hash
94
- [class_name, class_probability].hash
95
- end
96
-
97
- # Builds the object from hash
98
- # @param [Hash] attributes Model attributes in the form of hash
99
- # @return [Object] Returns the model itself
100
- def build_from_hash(attributes)
101
- return nil unless attributes.is_a?(Hash)
102
- self.class.swagger_types.each_pair do |key, type|
103
- if type =~ /\AArray<(.*)>/i
104
- # check to ensure the input is an array given that the the attribute
105
- # is documented as an array but the input is not
106
- if attributes[self.class.attribute_map[key]].is_a?(Array)
107
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
108
- end
109
- elsif !attributes[self.class.attribute_map[key]].nil?
110
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
111
- end
112
- # or else data not found in attributes(hash), not an issue as the data can be optional
113
- end
114
-
115
- self
116
- end
117
-
118
- # Deserializes the data based on type
119
- # @param string type Data type
120
- # @param string value Value to be deserialized
121
- # @return [Object] Deserialized data
122
- def _deserialize(type, value)
123
- case type.to_sym
124
- when :DateTime
125
- Time.at(/\d/.match(value)[0].to_f).to_datetime
126
- when :Date
127
- Time.at(/\d/.match(value)[0].to_f).to_date
128
- when :String
129
- value.to_s
130
- when :Integer
131
- value.to_i
132
- when :Float
133
- value.to_f
134
- when :BOOLEAN
135
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
136
- true
137
- else
138
- false
139
- end
140
- when :Object
141
- # generic object (usually a Hash), return directly
142
- value
143
- when /\AArray<(?<inner_type>.+)>\z/
144
- inner_type = Regexp.last_match[:inner_type]
145
- value.map { |v| _deserialize(inner_type, v) }
146
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
147
- k_type = Regexp.last_match[:k_type]
148
- v_type = Regexp.last_match[:v_type]
149
- {}.tap do |hash|
150
- value.each do |k, v|
151
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
152
- end
153
- end
154
- else
155
- # model
156
- if value[:'$type']
157
- type = value[:'$type'][0..-4]
158
- end
159
-
160
- temp_model = AsposeWordsCloud.const_get(type).new
161
- temp_model.build_from_hash(value)
162
- end
163
- end
164
-
165
- # Returns the string representation of the object
166
- # @return [String] String presentation of the object
167
- def to_s
168
- to_hash.to_s
169
- end
170
-
171
- # to_body is an alias to to_hash (backward compatibility)
172
- # @return [Hash] Returns the object in the form of hash
173
- def to_body
174
- to_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
- next if value.nil?
184
- hash[param] = _to_hash(value)
185
- end
186
- hash
187
- end
188
-
189
- # Outputs non-array value in the form of hash
190
- # For object, use to_hash. Otherwise, just return the value
191
- # @param [Object] value Any valid value
192
- # @return [Hash] Returns the value in the form of hash
193
- def _to_hash(value)
194
- if value.is_a?(Array)
195
- value.compact.map { |v| _to_hash(v) }
196
- elsif value.is_a?(Hash)
197
- {}.tap do |hash|
198
- value.each { |k, v| hash[k] = _to_hash(v) }
199
- end
200
- elsif value.respond_to? :to_hash
201
- value.to_hash
202
- else
203
- value
204
- end
205
- end
206
-
207
- def collectFilesContent(resultFilesContent)
208
- end
209
-
210
- def validate()
211
- raise ArgumentError, 'Property class_probability in ClassificationResult is required.' if self.class_probability.nil?
212
- end
213
-
214
- end
215
- end
@@ -1,193 +0,0 @@
1
- # ------------------------------------------------------------------------------------
2
- # <copyright company="Aspose" file="classify_document_online_request.rb">
3
- # Copyright (c) 2025 Aspose.Words for Cloud
4
- # </copyright>
5
- # <summary>
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in all
14
- # copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- # SOFTWARE.
23
- # </summary>
24
- # ------------------------------------------------------------------------------------
25
-
26
- module AsposeWordsCloud
27
-
28
- #
29
- # Request model for classify_document_online operation.
30
- #
31
- class ClassifyDocumentOnlineRequest
32
- # The document.
33
- attr_accessor :document
34
-
35
- # Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
36
- attr_accessor :load_encoding
37
-
38
- # Password of protected Word document. Use the parameter to pass a password via SDK. SDK encrypts it automatically. We don't recommend to use the parameter to pass a plain password for direct call of API.
39
- attr_accessor :password
40
-
41
- # Password of protected Word document. Use the parameter to pass an encrypted password for direct calls of API. See SDK code for encyption details.
42
- attr_accessor :encrypted_password
43
-
44
- # The value indicates whether OpenType support is on.
45
- attr_accessor :open_type_support
46
-
47
- # The number of the best classes to return.
48
- attr_accessor :best_classes_count
49
-
50
- # The taxonomy to use.
51
- attr_accessor :taxonomy
52
-
53
- #
54
- # Initializes a new instance.
55
- # @param document The document.
56
- # @param load_encoding Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
57
- # @param password Password of protected Word document. Use the parameter to pass a password via SDK. SDK encrypts it automatically. We don't recommend to use the parameter to pass a plain password for direct call of API.
58
- # @param encrypted_password Password of protected Word document. Use the parameter to pass an encrypted password for direct calls of API. See SDK code for encyption details.
59
- # @param open_type_support The value indicates whether OpenType support is on.
60
- # @param best_classes_count The number of the best classes to return.
61
- # @param taxonomy The taxonomy to use.
62
-
63
- def initialize(document:, load_encoding: nil, password: nil, encrypted_password: nil, open_type_support: nil, best_classes_count: nil, taxonomy: nil)
64
- self.document = document
65
- self.load_encoding = load_encoding
66
- self.password = password
67
- self.encrypted_password = encrypted_password
68
- self.open_type_support = open_type_support
69
- self.best_classes_count = best_classes_count
70
- self.taxonomy = taxonomy
71
- end
72
-
73
- # Creating batch part from request
74
- def to_batch_part(api_client, requestId, parentRequestId = nil)
75
- # verify the required parameter 'document' is set
76
- raise ArgumentError, 'Missing the required parameter document when calling WordsApi.classify_document_online' if api_client.config.client_side_validation && self.document.nil?
77
-
78
- # resource path
79
- local_var_path = '/words/online/get/classify'[7..-1]
80
- local_var_path = local_var_path.sub('//', '/')
81
-
82
- # query parameters
83
- query_params = {}
84
- query_params[downcase_first_letter('LoadEncoding')] = self.load_encoding unless self.load_encoding.nil?
85
- query_params[downcase_first_letter('Password')] = self.password unless self.password.nil?
86
- query_params[downcase_first_letter('EncryptedPassword')] = self.encrypted_password unless self.encrypted_password.nil?
87
- query_params[downcase_first_letter('OpenTypeSupport')] = self.open_type_support unless self.open_type_support.nil?
88
- query_params[downcase_first_letter('BestClassesCount')] = self.best_classes_count unless self.best_classes_count.nil?
89
- query_params[downcase_first_letter('Taxonomy')] = self.taxonomy unless self.taxonomy.nil?
90
-
91
- if query_params
92
- query_params.each { |key, value| local_var_path = api_client.add_param_to_query(local_var_path, key, value) }
93
- end
94
-
95
- header_params = {}
96
- # header parameters
97
- # HTTP header 'Content-Type'
98
- header_params['Content-Type'] = api_client.select_header_content_type(['multipart/form-data'])
99
- header_params['RequestId'] = requestId
100
-
101
- if parentRequestId != nil
102
- header_params['DependsOn'] = parentRequestId
103
- end
104
-
105
- # form parameters
106
- form_params = []
107
- files_content = []
108
- if self.document.nil?
109
- raise "Parameter Document is required."
110
- end
111
- unless self.document.nil?
112
- form_params.push({:'Name' => 'document', :'Data' => self.document, :'MimeType' =>'application/octet-stream'})
113
- end
114
-
115
-
116
- # http body (model)
117
- body = api_client.build_request_body_batch(header_params, form_params, files_content)
118
- part = ""
119
- part.concat("PUT".force_encoding('UTF-8'))
120
- part.concat(" ".force_encoding('UTF-8'))
121
- part.concat(local_var_path.force_encoding('UTF-8'))
122
- part.concat(" \r\n".force_encoding('UTF-8'))
123
-
124
- header_params.each_pair {|key, value| part.concat(key.dup.force_encoding('UTF-8') , ": ".force_encoding('UTF-8'), value.dup.force_encoding('UTF-8'), "\r\n".force_encoding('UTF-8')) }
125
- part.concat("\r\n".force_encoding('UTF-8'))
126
- if body
127
- if body.is_a?(Hash)
128
- body.each do |key, value|
129
- part.concat(value, "\r\n")
130
- end
131
- else
132
- part.concat(body)
133
- end
134
- end
135
- part
136
- end
137
-
138
- def create_http_request(api_client)
139
- # verify the required parameter 'document' is set
140
- raise ArgumentError, 'Missing the required parameter document when calling WordsApi.classify_document_online' if api_client.config.client_side_validation && self.document.nil?
141
-
142
- # resource path
143
- local_var_path = '/words/online/get/classify'[1..-1]
144
- local_var_path = local_var_path.sub('//', '/')
145
-
146
- # query parameters
147
- query_params = {}
148
- query_params[downcase_first_letter('LoadEncoding')] = self.load_encoding unless self.load_encoding.nil?
149
- query_params[downcase_first_letter('Password')] = self.password unless self.password.nil?
150
- query_params[downcase_first_letter('EncryptedPassword')] = self.encrypted_password unless self.encrypted_password.nil?
151
- query_params[downcase_first_letter('OpenTypeSupport')] = self.open_type_support unless self.open_type_support.nil?
152
- query_params[downcase_first_letter('BestClassesCount')] = self.best_classes_count unless self.best_classes_count.nil?
153
- query_params[downcase_first_letter('Taxonomy')] = self.taxonomy unless self.taxonomy.nil?
154
-
155
- # header parameters
156
- header_params = {}
157
- # HTTP header 'Content-Type'
158
- header_params['Content-Type'] = api_client.select_header_content_type(['multipart/form-data'])
159
-
160
- # form parameters
161
- form_params = []
162
- files_content = []
163
- if self.document.nil?
164
- raise "Parameter Document is required."
165
- end
166
- unless self.document.nil?
167
- form_params.push({:'Name' => 'document', :'Data' => self.document, :'MimeType' =>'application/octet-stream'})
168
- end
169
-
170
- body = api_client.build_request_body(header_params, form_params, files_content)
171
- {
172
- 'method': :PUT,
173
- 'path': local_var_path,
174
- 'header_params': header_params,
175
- 'query_params': query_params,
176
- 'body': body,
177
- 'auth_names': ['JWT']
178
- }
179
- end
180
-
181
- #
182
- # Helper method to convert first letter to downcase
183
- #
184
- def downcase_first_letter(str)
185
- str[0].downcase + str[1..-1]
186
- end
187
-
188
- # Get response type
189
- def get_response_type
190
- 'ClassificationResponse'
191
- end
192
- end
193
- end
@@ -1,192 +0,0 @@
1
- # ------------------------------------------------------------------------------------
2
- # <copyright company="Aspose" file="classify_document_request.rb">
3
- # Copyright (c) 2025 Aspose.Words for Cloud
4
- # </copyright>
5
- # <summary>
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in all
14
- # copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- # SOFTWARE.
23
- # </summary>
24
- # ------------------------------------------------------------------------------------
25
-
26
- module AsposeWordsCloud
27
-
28
- #
29
- # Request model for classify_document operation.
30
- #
31
- class ClassifyDocumentRequest
32
- # The document name.
33
- attr_accessor :name
34
-
35
- # Original document folder.
36
- attr_accessor :folder
37
-
38
- # Original document storage.
39
- attr_accessor :storage
40
-
41
- # Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
42
- attr_accessor :load_encoding
43
-
44
- # Password of protected Word document. Use the parameter to pass a password via SDK. SDK encrypts it automatically. We don't recommend to use the parameter to pass a plain password for direct call of API.
45
- attr_accessor :password
46
-
47
- # Password of protected Word document. Use the parameter to pass an encrypted password for direct calls of API. See SDK code for encyption details.
48
- attr_accessor :encrypted_password
49
-
50
- # The value indicates whether OpenType support is on.
51
- attr_accessor :open_type_support
52
-
53
- # The number of the best classes to return.
54
- attr_accessor :best_classes_count
55
-
56
- # The taxonomy to use.
57
- attr_accessor :taxonomy
58
-
59
- #
60
- # Initializes a new instance.
61
- # @param name The document name.
62
- # @param folder Original document folder.
63
- # @param storage Original document storage.
64
- # @param load_encoding Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
65
- # @param password Password of protected Word document. Use the parameter to pass a password via SDK. SDK encrypts it automatically. We don't recommend to use the parameter to pass a plain password for direct call of API.
66
- # @param encrypted_password Password of protected Word document. Use the parameter to pass an encrypted password for direct calls of API. See SDK code for encyption details.
67
- # @param open_type_support The value indicates whether OpenType support is on.
68
- # @param best_classes_count The number of the best classes to return.
69
- # @param taxonomy The taxonomy to use.
70
-
71
- def initialize(name:, folder: nil, storage: nil, load_encoding: nil, password: nil, encrypted_password: nil, open_type_support: nil, best_classes_count: nil, taxonomy: nil)
72
- self.name = name
73
- self.folder = folder
74
- self.storage = storage
75
- self.load_encoding = load_encoding
76
- self.password = password
77
- self.encrypted_password = encrypted_password
78
- self.open_type_support = open_type_support
79
- self.best_classes_count = best_classes_count
80
- self.taxonomy = taxonomy
81
- end
82
-
83
- # Creating batch part from request
84
- def to_batch_part(api_client, requestId, parentRequestId = nil)
85
- # verify the required parameter 'name' is set
86
- raise ArgumentError, 'Missing the required parameter name when calling WordsApi.classify_document' if api_client.config.client_side_validation && self.name.nil?
87
-
88
- # resource path
89
- local_var_path = '/words/{name}/classify'[7..-1]
90
- local_var_path = local_var_path.sub('{' + downcase_first_letter('Name') + '}', self.name.nil? ? '' : self.name.to_s)
91
- local_var_path = local_var_path.sub('//', '/')
92
-
93
- # query parameters
94
- query_params = {}
95
- query_params[downcase_first_letter('Folder')] = self.folder unless self.folder.nil?
96
- query_params[downcase_first_letter('Storage')] = self.storage unless self.storage.nil?
97
- query_params[downcase_first_letter('LoadEncoding')] = self.load_encoding unless self.load_encoding.nil?
98
- query_params[downcase_first_letter('Password')] = self.password unless self.password.nil?
99
- query_params[downcase_first_letter('EncryptedPassword')] = self.encrypted_password unless self.encrypted_password.nil?
100
- query_params[downcase_first_letter('OpenTypeSupport')] = self.open_type_support unless self.open_type_support.nil?
101
- query_params[downcase_first_letter('BestClassesCount')] = self.best_classes_count unless self.best_classes_count.nil?
102
- query_params[downcase_first_letter('Taxonomy')] = self.taxonomy unless self.taxonomy.nil?
103
-
104
- if query_params
105
- query_params.each { |key, value| local_var_path = api_client.add_param_to_query(local_var_path, key, value) }
106
- end
107
-
108
- header_params = {}
109
- header_params['RequestId'] = requestId
110
-
111
- if parentRequestId != nil
112
- header_params['DependsOn'] = parentRequestId
113
- end
114
-
115
- # form parameters
116
- form_params = []
117
- files_content = []
118
-
119
- # http body (model)
120
- body = api_client.build_request_body_batch(header_params, form_params, files_content)
121
- part = ""
122
- part.concat("GET".force_encoding('UTF-8'))
123
- part.concat(" ".force_encoding('UTF-8'))
124
- part.concat(local_var_path.force_encoding('UTF-8'))
125
- part.concat(" \r\n".force_encoding('UTF-8'))
126
-
127
- header_params.each_pair {|key, value| part.concat(key.dup.force_encoding('UTF-8') , ": ".force_encoding('UTF-8'), value.dup.force_encoding('UTF-8'), "\r\n".force_encoding('UTF-8')) }
128
- part.concat("\r\n".force_encoding('UTF-8'))
129
- if body
130
- if body.is_a?(Hash)
131
- body.each do |key, value|
132
- part.concat(value, "\r\n")
133
- end
134
- else
135
- part.concat(body)
136
- end
137
- end
138
- part
139
- end
140
-
141
- def create_http_request(api_client)
142
- # verify the required parameter 'name' is set
143
- raise ArgumentError, 'Missing the required parameter name when calling WordsApi.classify_document' if api_client.config.client_side_validation && self.name.nil?
144
-
145
- # resource path
146
- local_var_path = '/words/{name}/classify'[1..-1]
147
- local_var_path = local_var_path.sub('{' + downcase_first_letter('Name') + '}', self.name.nil? ? '' : self.name.to_s)
148
- local_var_path = local_var_path.sub('//', '/')
149
-
150
- # query parameters
151
- query_params = {}
152
- query_params[downcase_first_letter('Folder')] = self.folder unless self.folder.nil?
153
- query_params[downcase_first_letter('Storage')] = self.storage unless self.storage.nil?
154
- query_params[downcase_first_letter('LoadEncoding')] = self.load_encoding unless self.load_encoding.nil?
155
- query_params[downcase_first_letter('Password')] = self.password unless self.password.nil?
156
- query_params[downcase_first_letter('EncryptedPassword')] = self.encrypted_password unless self.encrypted_password.nil?
157
- query_params[downcase_first_letter('OpenTypeSupport')] = self.open_type_support unless self.open_type_support.nil?
158
- query_params[downcase_first_letter('BestClassesCount')] = self.best_classes_count unless self.best_classes_count.nil?
159
- query_params[downcase_first_letter('Taxonomy')] = self.taxonomy unless self.taxonomy.nil?
160
-
161
- # header parameters
162
- header_params = {}
163
- # HTTP header 'Content-Type'
164
- header_params['Content-Type'] = api_client.select_header_content_type(['application/xml', 'application/json'])
165
-
166
- # form parameters
167
- form_params = []
168
- files_content = []
169
- body = api_client.build_request_body(header_params, form_params, files_content)
170
- {
171
- 'method': :GET,
172
- 'path': local_var_path,
173
- 'header_params': header_params,
174
- 'query_params': query_params,
175
- 'body': body,
176
- 'auth_names': ['JWT']
177
- }
178
- end
179
-
180
- #
181
- # Helper method to convert first letter to downcase
182
- #
183
- def downcase_first_letter(str)
184
- str[0].downcase + str[1..-1]
185
- end
186
-
187
- # Get response type
188
- def get_response_type
189
- 'ClassificationResponse'
190
- end
191
- end
192
- end