groupdocs_viewer_cloud 21.3 → 21.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,239 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="mail_storage_options.rb">
4
+ # Copyright (c) 2003-2021 Aspose Pty Ltd
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
+ require 'date'
29
+
30
+ module GroupDocsViewerCloud
31
+ # Provides options for rendering Mail storage (Lotus Notes, MBox) data files.
32
+ class MailStorageOptions
33
+
34
+ # The keywords used to filter messages.
35
+ attr_accessor :text_filter
36
+
37
+ # The email-address used to filter messages by sender or recipient.
38
+ attr_accessor :address_filter
39
+
40
+ # The maximum number of messages or items for render. Default value is 0 - all messages will be rendered
41
+ attr_accessor :max_items
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ :'text_filter' => :'TextFilter',
47
+ :'address_filter' => :'AddressFilter',
48
+ :'max_items' => :'MaxItems'
49
+ }
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.swagger_types
54
+ {
55
+ :'text_filter' => :'String',
56
+ :'address_filter' => :'String',
57
+ :'max_items' => :'Integer'
58
+ }
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ return unless attributes.is_a?(Hash)
65
+
66
+ # convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
68
+
69
+ if attributes.key?(:'TextFilter')
70
+ self.text_filter = attributes[:'TextFilter']
71
+ end
72
+
73
+ if attributes.key?(:'AddressFilter')
74
+ self.address_filter = attributes[:'AddressFilter']
75
+ end
76
+
77
+ if attributes.key?(:'MaxItems')
78
+ self.max_items = attributes[:'MaxItems']
79
+ end
80
+
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properies with the reasons
85
+ def list_invalid_properties
86
+ invalid_properties = []
87
+ if @max_items.nil?
88
+ invalid_properties.push("invalid value for 'max_items', max_items cannot be nil.")
89
+ end
90
+
91
+ return invalid_properties
92
+ end
93
+
94
+ # Check to see if the all the properties in the model are valid
95
+ # @return true if the model is valid
96
+ def valid?
97
+ return false if @max_items.nil?
98
+ return true
99
+ end
100
+
101
+ # Checks equality by comparing each attribute.
102
+ # @param [Object] Object to be compared
103
+ def ==(other)
104
+ return true if self.equal?(other)
105
+ self.class == other.class &&
106
+ text_filter == other.text_filter &&
107
+ address_filter == other.address_filter &&
108
+ max_items == other.max_items
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(other)
114
+ self == other
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Fixnum] Hash code
119
+ def hash
120
+ [text_filter, address_filter, max_items].hash
121
+ end
122
+
123
+ # Downcases first letter.
124
+ # @return downcased string
125
+ def uncap(str)
126
+ str[0, 1].downcase + str[1..-1]
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def build_from_hash(attributes)
133
+ return nil unless attributes.is_a?(Hash)
134
+ self.class.swagger_types.each_pair do |key, type|
135
+ pname = uncap(self.class.attribute_map[key]).intern
136
+ value = attributes[pname]
137
+ if type =~ /\AArray<(.*)>/i
138
+ # check to ensure the input is an array given that the the attribute
139
+ # is documented as an array but the input is not
140
+ if value.is_a?(Array)
141
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
142
+ end
143
+ elsif !value.nil?
144
+ self.send("#{key}=", _deserialize(type, value))
145
+ end
146
+ # or else data not found in attributes(hash), not an issue as the data can be optional
147
+ end
148
+
149
+ self
150
+ end
151
+
152
+ # Deserializes the data based on type
153
+ # @param string type Data type
154
+ # @param string value Value to be deserialized
155
+ # @return [Object] Deserialized data
156
+ def _deserialize(type, value)
157
+ case type.to_sym
158
+ when :DateTime
159
+ Date.parse value
160
+ when :Date
161
+ Date.parse value
162
+ when :String
163
+ value.to_s
164
+ when :Integer
165
+ value.to_i
166
+ when :Float
167
+ value.to_f
168
+ when :BOOLEAN
169
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
170
+ true
171
+ else
172
+ false
173
+ end
174
+ when :Object
175
+ # generic object (usually a Hash), return directly
176
+ value
177
+ when /\AArray<(?<inner_type>.+)>\z/
178
+ inner_type = Regexp.last_match[:inner_type]
179
+ value.map { |v| _deserialize(inner_type, v) }
180
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
181
+ k_type = Regexp.last_match[:k_type]
182
+ v_type = Regexp.last_match[:v_type]
183
+ {}.tap do |hash|
184
+ value.each do |k, v|
185
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
186
+ end
187
+ end
188
+ else
189
+ # model
190
+ temp_model = GroupDocsViewerCloud.const_get(type).new
191
+ temp_model.build_from_hash(value)
192
+ end
193
+ end
194
+
195
+ # Returns the string representation of the object
196
+ # @return [String] String presentation of the object
197
+ def to_s
198
+ to_hash.to_s
199
+ end
200
+
201
+ # to_body is an alias to to_hash (backward compatibility)
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_body
204
+ to_hash
205
+ end
206
+
207
+ # Returns the object in the form of hash
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_hash
210
+ hash = {}
211
+ self.class.attribute_map.each_pair do |attr, param|
212
+ value = self.send(attr)
213
+ next if value.nil?
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+
237
+ end
238
+
239
+ end
@@ -45,6 +45,9 @@ module GroupDocsViewerCloud
45
45
 
46
46
  # Specifies output image quality for image resources when rendering into HTML. The default value is Low
47
47
  attr_accessor :image_quality
48
+
49
+ # When this option is set to true, the text is rendered as an image in the output HTML. Enable this option to make text unselectable or to fix characters rendering and make HTML look like PDF. The default value is false. This option is supported when rendering into HTML.
50
+ attr_accessor :render_text_as_image
48
51
  class EnumAttributeValidator
49
52
  attr_reader :datatype
50
53
  attr_reader :allowable_values
@@ -74,7 +77,8 @@ module GroupDocsViewerCloud
74
77
  :'enable_layered_rendering' => :'EnableLayeredRendering',
75
78
  :'enable_font_hinting' => :'EnableFontHinting',
76
79
  :'render_original_page_size' => :'RenderOriginalPageSize',
77
- :'image_quality' => :'ImageQuality'
80
+ :'image_quality' => :'ImageQuality',
81
+ :'render_text_as_image' => :'RenderTextAsImage'
78
82
  }
79
83
  end
80
84
 
@@ -85,7 +89,8 @@ module GroupDocsViewerCloud
85
89
  :'enable_layered_rendering' => :'BOOLEAN',
86
90
  :'enable_font_hinting' => :'BOOLEAN',
87
91
  :'render_original_page_size' => :'BOOLEAN',
88
- :'image_quality' => :'String'
92
+ :'image_quality' => :'String',
93
+ :'render_text_as_image' => :'BOOLEAN'
89
94
  }
90
95
  end
91
96
 
@@ -117,6 +122,10 @@ module GroupDocsViewerCloud
117
122
  self.image_quality = attributes[:'ImageQuality']
118
123
  end
119
124
 
125
+ if attributes.key?(:'RenderTextAsImage')
126
+ self.render_text_as_image = attributes[:'RenderTextAsImage']
127
+ end
128
+
120
129
  end
121
130
 
122
131
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -143,6 +152,10 @@ module GroupDocsViewerCloud
143
152
  invalid_properties.push("invalid value for 'image_quality', image_quality cannot be nil.")
144
153
  end
145
154
 
155
+ if @render_text_as_image.nil?
156
+ invalid_properties.push("invalid value for 'render_text_as_image', render_text_as_image cannot be nil.")
157
+ end
158
+
146
159
  return invalid_properties
147
160
  end
148
161
 
@@ -156,6 +169,7 @@ module GroupDocsViewerCloud
156
169
  return false if @image_quality.nil?
157
170
  image_quality_validator = EnumAttributeValidator.new('String', ["Low", "Medium", "High"])
158
171
  return false unless image_quality_validator.valid?(@image_quality)
172
+ return false if @render_text_as_image.nil?
159
173
  return true
160
174
  end
161
175
 
@@ -182,7 +196,8 @@ module GroupDocsViewerCloud
182
196
  enable_layered_rendering == other.enable_layered_rendering &&
183
197
  enable_font_hinting == other.enable_font_hinting &&
184
198
  render_original_page_size == other.render_original_page_size &&
185
- image_quality == other.image_quality
199
+ image_quality == other.image_quality &&
200
+ render_text_as_image == other.render_text_as_image
186
201
  end
187
202
 
188
203
  # @see the `==` method
@@ -194,7 +209,7 @@ module GroupDocsViewerCloud
194
209
  # Calculates hash code according to all attributes.
195
210
  # @return [Fixnum] Hash code
196
211
  def hash
197
- [disable_chars_grouping, enable_layered_rendering, enable_font_hinting, render_original_page_size, image_quality].hash
212
+ [disable_chars_grouping, enable_layered_rendering, enable_font_hinting, render_original_page_size, image_quality, render_text_as_image].hash
198
213
  end
199
214
 
200
215
  # Downcases first letter.
@@ -82,6 +82,15 @@ module GroupDocsViewerCloud
82
82
  # Rendering options for Archive source file formats
83
83
  attr_accessor :archive_options
84
84
 
85
+ # Rendering options for Text source file formats
86
+ attr_accessor :text_options
87
+
88
+ # Rendering options for Mail storage (Lotus Notes, MBox) data files.
89
+ attr_accessor :mail_storage_options
90
+
91
+ # Rendering options for Visio source file formats
92
+ attr_accessor :visio_rendering_options
93
+
85
94
  # The quality of the JPG images contained by output PDF document; Valid values are between 1 and 100; Default value is 90
86
95
  attr_accessor :jpg_quality
87
96
 
@@ -94,6 +103,18 @@ module GroupDocsViewerCloud
94
103
  # The array of PDF document permissions. Allowed values are: AllowAll, DenyPrinting, DenyModification, DenyDataExtraction, DenyAll Default value is AllowAll, if now permissions are set.
95
104
  attr_accessor :permissions
96
105
 
106
+ # Max width of an output image in pixels. (When converting single image to HTML only)
107
+ attr_accessor :image_max_width
108
+
109
+ # Max height of an output image in pixels. (When converting single image to HTML only)
110
+ attr_accessor :image_max_height
111
+
112
+ # The width of the output image in pixels. (When converting single image to HTML only)
113
+ attr_accessor :image_width
114
+
115
+ # The height of an output image in pixels. (When converting single image to HTML only)
116
+ attr_accessor :image_height
117
+
97
118
  # Attribute mapping from ruby-style variable name to JSON key.
98
119
  def self.attribute_map
99
120
  {
@@ -114,10 +135,17 @@ module GroupDocsViewerCloud
114
135
  :'word_processing_options' => :'WordProcessingOptions',
115
136
  :'outlook_options' => :'OutlookOptions',
116
137
  :'archive_options' => :'ArchiveOptions',
138
+ :'text_options' => :'TextOptions',
139
+ :'mail_storage_options' => :'MailStorageOptions',
140
+ :'visio_rendering_options' => :'VisioRenderingOptions',
117
141
  :'jpg_quality' => :'JpgQuality',
118
142
  :'document_open_password' => :'DocumentOpenPassword',
119
143
  :'permissions_password' => :'PermissionsPassword',
120
- :'permissions' => :'Permissions'
144
+ :'permissions' => :'Permissions',
145
+ :'image_max_width' => :'ImageMaxWidth',
146
+ :'image_max_height' => :'ImageMaxHeight',
147
+ :'image_width' => :'ImageWidth',
148
+ :'image_height' => :'ImageHeight'
121
149
  }
122
150
  end
123
151
 
@@ -141,10 +169,17 @@ module GroupDocsViewerCloud
141
169
  :'word_processing_options' => :'WordProcessingOptions',
142
170
  :'outlook_options' => :'OutlookOptions',
143
171
  :'archive_options' => :'ArchiveOptions',
172
+ :'text_options' => :'TextOptions',
173
+ :'mail_storage_options' => :'MailStorageOptions',
174
+ :'visio_rendering_options' => :'VisioRenderingOptions',
144
175
  :'jpg_quality' => :'Integer',
145
176
  :'document_open_password' => :'String',
146
177
  :'permissions_password' => :'String',
147
- :'permissions' => :'Array<String>'
178
+ :'permissions' => :'Array<String>',
179
+ :'image_max_width' => :'Integer',
180
+ :'image_max_height' => :'Integer',
181
+ :'image_width' => :'Integer',
182
+ :'image_height' => :'Integer'
148
183
  }
149
184
  end
150
185
 
@@ -228,6 +263,18 @@ module GroupDocsViewerCloud
228
263
  self.archive_options = attributes[:'ArchiveOptions']
229
264
  end
230
265
 
266
+ if attributes.key?(:'TextOptions')
267
+ self.text_options = attributes[:'TextOptions']
268
+ end
269
+
270
+ if attributes.key?(:'MailStorageOptions')
271
+ self.mail_storage_options = attributes[:'MailStorageOptions']
272
+ end
273
+
274
+ if attributes.key?(:'VisioRenderingOptions')
275
+ self.visio_rendering_options = attributes[:'VisioRenderingOptions']
276
+ end
277
+
231
278
  if attributes.key?(:'JpgQuality')
232
279
  self.jpg_quality = attributes[:'JpgQuality']
233
280
  end
@@ -246,6 +293,22 @@ module GroupDocsViewerCloud
246
293
  end
247
294
  end
248
295
 
296
+ if attributes.key?(:'ImageMaxWidth')
297
+ self.image_max_width = attributes[:'ImageMaxWidth']
298
+ end
299
+
300
+ if attributes.key?(:'ImageMaxHeight')
301
+ self.image_max_height = attributes[:'ImageMaxHeight']
302
+ end
303
+
304
+ if attributes.key?(:'ImageWidth')
305
+ self.image_width = attributes[:'ImageWidth']
306
+ end
307
+
308
+ if attributes.key?(:'ImageHeight')
309
+ self.image_height = attributes[:'ImageHeight']
310
+ end
311
+
249
312
  end
250
313
 
251
314
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -276,6 +339,22 @@ module GroupDocsViewerCloud
276
339
  invalid_properties.push("invalid value for 'jpg_quality', jpg_quality cannot be nil.")
277
340
  end
278
341
 
342
+ if @image_max_width.nil?
343
+ invalid_properties.push("invalid value for 'image_max_width', image_max_width cannot be nil.")
344
+ end
345
+
346
+ if @image_max_height.nil?
347
+ invalid_properties.push("invalid value for 'image_max_height', image_max_height cannot be nil.")
348
+ end
349
+
350
+ if @image_width.nil?
351
+ invalid_properties.push("invalid value for 'image_width', image_width cannot be nil.")
352
+ end
353
+
354
+ if @image_height.nil?
355
+ invalid_properties.push("invalid value for 'image_height', image_height cannot be nil.")
356
+ end
357
+
279
358
  return invalid_properties
280
359
  end
281
360
 
@@ -288,6 +367,10 @@ module GroupDocsViewerCloud
288
367
  return false if @render_notes.nil?
289
368
  return false if @render_hidden_pages.nil?
290
369
  return false if @jpg_quality.nil?
370
+ return false if @image_max_width.nil?
371
+ return false if @image_max_height.nil?
372
+ return false if @image_width.nil?
373
+ return false if @image_height.nil?
291
374
  return true
292
375
  end
293
376
 
@@ -313,10 +396,17 @@ module GroupDocsViewerCloud
313
396
  word_processing_options == other.word_processing_options &&
314
397
  outlook_options == other.outlook_options &&
315
398
  archive_options == other.archive_options &&
399
+ text_options == other.text_options &&
400
+ mail_storage_options == other.mail_storage_options &&
401
+ visio_rendering_options == other.visio_rendering_options &&
316
402
  jpg_quality == other.jpg_quality &&
317
403
  document_open_password == other.document_open_password &&
318
404
  permissions_password == other.permissions_password &&
319
- permissions == other.permissions
405
+ permissions == other.permissions &&
406
+ image_max_width == other.image_max_width &&
407
+ image_max_height == other.image_max_height &&
408
+ image_width == other.image_width &&
409
+ image_height == other.image_height
320
410
  end
321
411
 
322
412
  # @see the `==` method
@@ -328,7 +418,7 @@ module GroupDocsViewerCloud
328
418
  # Calculates hash code according to all attributes.
329
419
  # @return [Fixnum] Hash code
330
420
  def hash
331
- [start_page_number, count_pages_to_render, pages_to_render, page_rotations, default_font_name, default_encoding, render_comments, render_notes, render_hidden_pages, spreadsheet_options, cad_options, email_options, project_management_options, pdf_document_options, word_processing_options, outlook_options, archive_options, jpg_quality, document_open_password, permissions_password, permissions].hash
421
+ [start_page_number, count_pages_to_render, pages_to_render, page_rotations, default_font_name, default_encoding, render_comments, render_notes, render_hidden_pages, spreadsheet_options, cad_options, email_options, project_management_options, pdf_document_options, word_processing_options, outlook_options, archive_options, text_options, mail_storage_options, visio_rendering_options, jpg_quality, document_open_password, permissions_password, permissions, image_max_width, image_max_height, image_width, image_height].hash
332
422
  end
333
423
 
334
424
  # Downcases first letter.