aspose_words_cloud 18.8 → 18.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,232 @@
1
+
2
+ require 'date'
3
+
4
+ module AsposeWordsCloud
5
+ #
6
+ # --------------------------------------------------------------------------------------------------------------------
7
+ # <copyright company="Aspose" file="ParagraphFormatResponse.rb">
8
+ # Copyright (c) 2017 Aspose.Words for Cloud
9
+ # </copyright>
10
+ # <summary>
11
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ # of this software and associated documentation files (the "Software"), to deal
13
+ # in the Software without restriction, including without limitation the rights
14
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ # copies of the Software, and to permit persons to whom the Software is
16
+ # furnished to do so, subject to the following conditions:
17
+ #
18
+ # The above copyright notice and this permission notice shall be included in all
19
+ # copies or substantial portions of the Software.
20
+ #
21
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ # SOFTWARE.
28
+ # </summary>
29
+ # --------------------------------------------------------------------------------------------------------------------
30
+ #
31
+
32
+ # This response should be returned by the service when handling: GET http://api.aspose.com/v1.1/words/Test.doc/paragraphs/{0}/format
33
+ class ParagraphFormatResponse
34
+ # Response status code.
35
+ attr_accessor :code
36
+
37
+ # Response status.
38
+ attr_accessor :status
39
+
40
+ # Represents all the formatting for a paragraph.
41
+ attr_accessor :paragraph_format
42
+
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'code' => :'Code',
48
+ :'status' => :'Status',
49
+ :'paragraph_format' => :'ParagraphFormat'
50
+ }
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.swagger_types
55
+ {
56
+ :'code' => :'Integer',
57
+ :'status' => :'String',
58
+ :'paragraph_format' => :'ParagraphFormat'
59
+ }
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ return unless attributes.is_a?(Hash)
66
+
67
+ # convert string to symbol for hash key
68
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
69
+
70
+ if attributes.key?(:'Code')
71
+ self.code = attributes[:'Code']
72
+ end
73
+
74
+ if attributes.key?(:'Status')
75
+ self.status = attributes[:'Status']
76
+ end
77
+
78
+ if attributes.key?(:'ParagraphFormat')
79
+ self.paragraph_format = attributes[:'ParagraphFormat']
80
+ end
81
+
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properies with the reasons
86
+ def list_invalid_properties
87
+ invalid_properties = []
88
+ if @code.nil?
89
+ invalid_properties.push("invalid value for 'code', code cannot be nil.")
90
+ end
91
+
92
+ return 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
+ return false if @code.nil?
99
+ return true
100
+ end
101
+
102
+ # Checks equality by comparing each attribute.
103
+ # @param [Object] Object to be compared
104
+ def ==(other)
105
+ return true if self.equal?(other)
106
+ self.class == other.class &&
107
+ code == other.code &&
108
+ status == other.status &&
109
+ paragraph_format == other.paragraph_format
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(other)
115
+ self == other
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Fixnum] Hash code
120
+ def hash
121
+ [code, status, paragraph_format].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 build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ self.class.swagger_types.each_pair do |key, type|
130
+ if type =~ /\AArray<(.*)>/i
131
+ # check to ensure the input is an array given that the the attribute
132
+ # is documented as an array but the input is not
133
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
134
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
135
+ end
136
+ elsif !attributes[self.class.attribute_map[key]].nil?
137
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
138
+ end
139
+ # or else data not found in attributes(hash), not an issue as the data can be optional
140
+ end
141
+
142
+ self
143
+ end
144
+
145
+ # Deserializes the data based on type
146
+ # @param string type Data type
147
+ # @param string value Value to be deserialized
148
+ # @return [Object] Deserialized data
149
+ def _deserialize(type, value)
150
+ case type.to_sym
151
+ when :DateTime
152
+ Time.at(/\d/.match(value)[0].to_f).to_datetime
153
+ when :Date
154
+ Time.at(/\d/.match(value)[0].to_f).to_date
155
+ when :String
156
+ value.to_s
157
+ when :Integer
158
+ value.to_i
159
+ when :Float
160
+ value.to_f
161
+ when :BOOLEAN
162
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
163
+ true
164
+ else
165
+ false
166
+ end
167
+ when :Object
168
+ # generic object (usually a Hash), return directly
169
+ value
170
+ when /\AArray<(?<inner_type>.+)>\z/
171
+ inner_type = Regexp.last_match[:inner_type]
172
+ value.map { |v| _deserialize(inner_type, v) }
173
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
174
+ k_type = Regexp.last_match[:k_type]
175
+ v_type = Regexp.last_match[:v_type]
176
+ {}.tap do |hash|
177
+ value.each do |k, v|
178
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
179
+ end
180
+ end
181
+ else
182
+ # model
183
+ temp_model = AsposeWordsCloud.const_get(type).new
184
+ temp_model.build_from_hash(value)
185
+ end
186
+ end
187
+
188
+ # Returns the string representation of the object
189
+ # @return [String] String presentation of the object
190
+ def to_s
191
+ to_hash.to_s
192
+ end
193
+
194
+ # to_body is an alias to to_hash (backward compatibility)
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_body
197
+ to_hash
198
+ end
199
+
200
+ # Returns the object in the form of hash
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_hash
203
+ hash = {}
204
+ self.class.attribute_map.each_pair do |attr, param|
205
+ value = self.send(attr)
206
+ next if value.nil?
207
+ hash[param] = _to_hash(value)
208
+ end
209
+ hash
210
+ end
211
+
212
+ # Outputs non-array value in the form of hash
213
+ # For object, use to_hash. Otherwise, just return the value
214
+ # @param [Object] value Any valid value
215
+ # @return [Hash] Returns the value in the form of hash
216
+ def _to_hash(value)
217
+ if value.is_a?(Array)
218
+ value.compact.map { |v| _to_hash(v) }
219
+ elsif value.is_a?(Hash)
220
+ {}.tap do |hash|
221
+ value.each { |k, v| hash[k] = _to_hash(v) }
222
+ end
223
+ elsif value.respond_to? :to_hash
224
+ value.to_hash
225
+ else
226
+ value
227
+ end
228
+ end
229
+
230
+ end
231
+
232
+ end
@@ -0,0 +1,69 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose" file="GetDocumentParagraphFormatRequest.rb">
4
+ # Copyright (c) 2018 Aspose.Words for 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
+ #
27
+
28
+ module AsposeWordsCloud
29
+
30
+ #
31
+ # Request model for get_document_paragraph_format operation.
32
+ #
33
+ class GetDocumentParagraphFormatRequest
34
+
35
+ # The document name.
36
+ attr_accessor :name
37
+ # Object's index
38
+ attr_accessor :index
39
+ # Original document folder.
40
+ attr_accessor :folder
41
+ # File storage, which have to be used.
42
+ attr_accessor :storage
43
+ # Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
44
+ attr_accessor :load_encoding
45
+ # Password for opening an encrypted document.
46
+ attr_accessor :password
47
+ # Path to node which contains paragraphs.
48
+ attr_accessor :node_path
49
+
50
+ #
51
+ # Initializes a new instance.
52
+ # @param name The document name.
53
+ # @param index Object's index
54
+ # @param folder Original document folder.
55
+ # @param storage File storage, which have to be used.
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 for opening an encrypted document.
58
+ # @param node_path Path to node which contains paragraphs.
59
+ def initialize(name, index, folder = nil, storage = nil, load_encoding = nil, password = nil, node_path = nil)
60
+ self.name = name
61
+ self.index = index
62
+ self.folder = folder
63
+ self.storage = storage
64
+ self.load_encoding = load_encoding
65
+ self.password = password
66
+ self.node_path = node_path
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,85 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose" file="PostDocumentParagraphFormatRequest.rb">
4
+ # Copyright (c) 2018 Aspose.Words for 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
+ #
27
+
28
+ module AsposeWordsCloud
29
+
30
+ #
31
+ # Request model for post_document_paragraph_format operation.
32
+ #
33
+ class PostDocumentParagraphFormatRequest
34
+
35
+ # The document name.
36
+ attr_accessor :name
37
+ # Paragraph format object
38
+ attr_accessor :dto
39
+ # Path to node which contains paragraphs.
40
+ attr_accessor :node_path
41
+ # Object's index
42
+ attr_accessor :index
43
+ # Original document folder.
44
+ attr_accessor :folder
45
+ # File storage, which have to be used.
46
+ attr_accessor :storage
47
+ # Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
48
+ attr_accessor :load_encoding
49
+ # Password for opening an encrypted document.
50
+ attr_accessor :password
51
+ # Result name of the document after the operation. If this parameter is omitted then result of the operation will be saved as the source document.
52
+ attr_accessor :dest_file_name
53
+ # Initials of the author to use for revisions.If you set this parameter and then make some changes to the document programmatically, save the document and later open the document in MS Word you will see these changes as revisions.
54
+ attr_accessor :revision_author
55
+ # The date and time to use for revisions.
56
+ attr_accessor :revision_date_time
57
+
58
+ #
59
+ # Initializes a new instance.
60
+ # @param name The document name.
61
+ # @param dto Paragraph format object
62
+ # @param node_path Path to node which contains paragraphs.
63
+ # @param index Object's index
64
+ # @param folder Original document folder.
65
+ # @param storage File storage, which have to be used.
66
+ # @param load_encoding Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
67
+ # @param password Password for opening an encrypted document.
68
+ # @param dest_file_name Result name of the document after the operation. If this parameter is omitted then result of the operation will be saved as the source document.
69
+ # @param revision_author Initials of the author to use for revisions.If you set this parameter and then make some changes to the document programmatically, save the document and later open the document in MS Word you will see these changes as revisions.
70
+ # @param revision_date_time The date and time to use for revisions.
71
+ def initialize(name, dto, node_path, index, folder = nil, storage = nil, load_encoding = nil, password = nil, dest_file_name = nil, revision_author = nil, revision_date_time = nil)
72
+ self.name = name
73
+ self.dto = dto
74
+ self.node_path = node_path
75
+ self.index = index
76
+ self.folder = folder
77
+ self.storage = storage
78
+ self.load_encoding = load_encoding
79
+ self.password = password
80
+ self.dest_file_name = dest_file_name
81
+ self.revision_author = revision_author
82
+ self.revision_date_time = revision_date_time
83
+ end
84
+ end
85
+ end
@@ -25,5 +25,5 @@
25
25
  # --------------------------------------------------------------------------------------------------------------------
26
26
  #
27
27
  module AsposeWordsCloud
28
- VERSION = "18.8".freeze
28
+ VERSION = "18.9".freeze
29
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aspose_words_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: '18.8'
4
+ version: '18.9'
5
5
  platform: ruby
6
6
  authors:
7
7
  - YaroslawEkimov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-14 00:00:00.000000000 Z
11
+ date: 2018-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -190,6 +190,8 @@ files:
190
190
  - lib/aspose_words_cloud/models/page_setup.rb
191
191
  - lib/aspose_words_cloud/models/page_stat_data.rb
192
192
  - lib/aspose_words_cloud/models/paragraph.rb
193
+ - lib/aspose_words_cloud/models/paragraph_format.rb
194
+ - lib/aspose_words_cloud/models/paragraph_format_response.rb
193
195
  - lib/aspose_words_cloud/models/paragraph_insert.rb
194
196
  - lib/aspose_words_cloud/models/paragraph_link.rb
195
197
  - lib/aspose_words_cloud/models/paragraph_link_collection.rb
@@ -246,6 +248,7 @@ files:
246
248
  - lib/aspose_words_cloud/models/requests/GetDocumentFieldNamesRequest.rb
247
249
  - lib/aspose_words_cloud/models/requests/GetDocumentHyperlinkByIndexRequest.rb
248
250
  - lib/aspose_words_cloud/models/requests/GetDocumentHyperlinksRequest.rb
251
+ - lib/aspose_words_cloud/models/requests/GetDocumentParagraphFormatRequest.rb
249
252
  - lib/aspose_words_cloud/models/requests/GetDocumentParagraphRequest.rb
250
253
  - lib/aspose_words_cloud/models/requests/GetDocumentParagraphRunFontRequest.rb
251
254
  - lib/aspose_words_cloud/models/requests/GetDocumentParagraphRunRequest.rb
@@ -287,6 +290,7 @@ files:
287
290
  - lib/aspose_words_cloud/models/requests/PostCommentRequest.rb
288
291
  - lib/aspose_words_cloud/models/requests/PostCompareDocumentRequest.rb
289
292
  - lib/aspose_words_cloud/models/requests/PostDocumentExecuteMailMergeRequest.rb
293
+ - lib/aspose_words_cloud/models/requests/PostDocumentParagraphFormatRequest.rb
290
294
  - lib/aspose_words_cloud/models/requests/PostDocumentParagraphRunFontRequest.rb
291
295
  - lib/aspose_words_cloud/models/requests/PostDocumentSaveAsRequest.rb
292
296
  - lib/aspose_words_cloud/models/requests/PostDrawingObjectRequest.rb