groupdocs_viewer_cloud 21.3 → 21.8
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.
- checksums.yaml +4 -4
- data/lib/groupdocs_viewer_cloud.rb +3 -0
- data/lib/groupdocs_viewer_cloud/models/archive_options.rb +29 -4
- data/lib/groupdocs_viewer_cloud/models/email_options.rb +24 -4
- data/lib/groupdocs_viewer_cloud/models/html_options.rb +124 -4
- data/lib/groupdocs_viewer_cloud/models/image_options.rb +64 -4
- data/lib/groupdocs_viewer_cloud/models/mail_storage_options.rb +239 -0
- data/lib/groupdocs_viewer_cloud/models/pdf_document_options.rb +19 -4
- data/lib/groupdocs_viewer_cloud/models/pdf_options.rb +94 -4
- data/lib/groupdocs_viewer_cloud/models/render_options.rb +34 -4
- data/lib/groupdocs_viewer_cloud/models/spreadsheet_options.rb +31 -1
- data/lib/groupdocs_viewer_cloud/models/text_options.rb +234 -0
- data/lib/groupdocs_viewer_cloud/models/visio_rendering_options.rb +234 -0
- data/lib/groupdocs_viewer_cloud/models/word_processing_options.rb +64 -4
- data/lib/groupdocs_viewer_cloud/version.rb +1 -1
- metadata +5 -16
@@ -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
|
# Attribute mapping from ruby-style variable name to JSON key.
|
86
95
|
def self.attribute_map
|
87
96
|
{
|
@@ -101,7 +110,10 @@ module GroupDocsViewerCloud
|
|
101
110
|
:'pdf_document_options' => :'PdfDocumentOptions',
|
102
111
|
:'word_processing_options' => :'WordProcessingOptions',
|
103
112
|
:'outlook_options' => :'OutlookOptions',
|
104
|
-
:'archive_options' => :'ArchiveOptions'
|
113
|
+
:'archive_options' => :'ArchiveOptions',
|
114
|
+
:'text_options' => :'TextOptions',
|
115
|
+
:'mail_storage_options' => :'MailStorageOptions',
|
116
|
+
:'visio_rendering_options' => :'VisioRenderingOptions'
|
105
117
|
}
|
106
118
|
end
|
107
119
|
|
@@ -124,7 +136,10 @@ module GroupDocsViewerCloud
|
|
124
136
|
:'pdf_document_options' => :'PdfDocumentOptions',
|
125
137
|
:'word_processing_options' => :'WordProcessingOptions',
|
126
138
|
:'outlook_options' => :'OutlookOptions',
|
127
|
-
:'archive_options' => :'ArchiveOptions'
|
139
|
+
:'archive_options' => :'ArchiveOptions',
|
140
|
+
:'text_options' => :'TextOptions',
|
141
|
+
:'mail_storage_options' => :'MailStorageOptions',
|
142
|
+
:'visio_rendering_options' => :'VisioRenderingOptions'
|
128
143
|
}
|
129
144
|
end
|
130
145
|
|
@@ -208,6 +223,18 @@ module GroupDocsViewerCloud
|
|
208
223
|
self.archive_options = attributes[:'ArchiveOptions']
|
209
224
|
end
|
210
225
|
|
226
|
+
if attributes.key?(:'TextOptions')
|
227
|
+
self.text_options = attributes[:'TextOptions']
|
228
|
+
end
|
229
|
+
|
230
|
+
if attributes.key?(:'MailStorageOptions')
|
231
|
+
self.mail_storage_options = attributes[:'MailStorageOptions']
|
232
|
+
end
|
233
|
+
|
234
|
+
if attributes.key?(:'VisioRenderingOptions')
|
235
|
+
self.visio_rendering_options = attributes[:'VisioRenderingOptions']
|
236
|
+
end
|
237
|
+
|
211
238
|
end
|
212
239
|
|
213
240
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -269,7 +296,10 @@ module GroupDocsViewerCloud
|
|
269
296
|
pdf_document_options == other.pdf_document_options &&
|
270
297
|
word_processing_options == other.word_processing_options &&
|
271
298
|
outlook_options == other.outlook_options &&
|
272
|
-
archive_options == other.archive_options
|
299
|
+
archive_options == other.archive_options &&
|
300
|
+
text_options == other.text_options &&
|
301
|
+
mail_storage_options == other.mail_storage_options &&
|
302
|
+
visio_rendering_options == other.visio_rendering_options
|
273
303
|
end
|
274
304
|
|
275
305
|
# @see the `==` method
|
@@ -281,7 +311,7 @@ module GroupDocsViewerCloud
|
|
281
311
|
# Calculates hash code according to all attributes.
|
282
312
|
# @return [Fixnum] Hash code
|
283
313
|
def hash
|
284
|
-
[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].hash
|
314
|
+
[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].hash
|
285
315
|
end
|
286
316
|
|
287
317
|
# Downcases first letter.
|
@@ -37,6 +37,9 @@ module GroupDocsViewerCloud
|
|
37
37
|
# The number of rows rendered into one page when PaginateSheets is enabled. Default value is 50.
|
38
38
|
attr_accessor :count_rows_per_page
|
39
39
|
|
40
|
+
# The columns count to include into each page when splitting worksheet into pages.
|
41
|
+
attr_accessor :count_columns_per_page
|
42
|
+
|
40
43
|
# Indicates whether to render grid lines
|
41
44
|
attr_accessor :render_grid_lines
|
42
45
|
|
@@ -52,6 +55,9 @@ module GroupDocsViewerCloud
|
|
52
55
|
# Enables rendering of hidden columns.
|
53
56
|
attr_accessor :render_hidden_columns
|
54
57
|
|
58
|
+
# Enables headings rendering.
|
59
|
+
attr_accessor :render_headings
|
60
|
+
|
55
61
|
# Enables rendering worksheet(s) sections which is defined as print area. Renders each print area in a worksheet as a separate page.
|
56
62
|
attr_accessor :render_print_area_only
|
57
63
|
|
@@ -84,11 +90,13 @@ module GroupDocsViewerCloud
|
|
84
90
|
{
|
85
91
|
:'paginate_sheets' => :'PaginateSheets',
|
86
92
|
:'count_rows_per_page' => :'CountRowsPerPage',
|
93
|
+
:'count_columns_per_page' => :'CountColumnsPerPage',
|
87
94
|
:'render_grid_lines' => :'RenderGridLines',
|
88
95
|
:'render_empty_rows' => :'RenderEmptyRows',
|
89
96
|
:'render_empty_columns' => :'RenderEmptyColumns',
|
90
97
|
:'render_hidden_rows' => :'RenderHiddenRows',
|
91
98
|
:'render_hidden_columns' => :'RenderHiddenColumns',
|
99
|
+
:'render_headings' => :'RenderHeadings',
|
92
100
|
:'render_print_area_only' => :'RenderPrintAreaOnly',
|
93
101
|
:'text_overflow_mode' => :'TextOverflowMode'
|
94
102
|
}
|
@@ -99,11 +107,13 @@ module GroupDocsViewerCloud
|
|
99
107
|
{
|
100
108
|
:'paginate_sheets' => :'BOOLEAN',
|
101
109
|
:'count_rows_per_page' => :'Integer',
|
110
|
+
:'count_columns_per_page' => :'Integer',
|
102
111
|
:'render_grid_lines' => :'BOOLEAN',
|
103
112
|
:'render_empty_rows' => :'BOOLEAN',
|
104
113
|
:'render_empty_columns' => :'BOOLEAN',
|
105
114
|
:'render_hidden_rows' => :'BOOLEAN',
|
106
115
|
:'render_hidden_columns' => :'BOOLEAN',
|
116
|
+
:'render_headings' => :'BOOLEAN',
|
107
117
|
:'render_print_area_only' => :'BOOLEAN',
|
108
118
|
:'text_overflow_mode' => :'String'
|
109
119
|
}
|
@@ -125,6 +135,10 @@ module GroupDocsViewerCloud
|
|
125
135
|
self.count_rows_per_page = attributes[:'CountRowsPerPage']
|
126
136
|
end
|
127
137
|
|
138
|
+
if attributes.key?(:'CountColumnsPerPage')
|
139
|
+
self.count_columns_per_page = attributes[:'CountColumnsPerPage']
|
140
|
+
end
|
141
|
+
|
128
142
|
if attributes.key?(:'RenderGridLines')
|
129
143
|
self.render_grid_lines = attributes[:'RenderGridLines']
|
130
144
|
end
|
@@ -145,6 +159,10 @@ module GroupDocsViewerCloud
|
|
145
159
|
self.render_hidden_columns = attributes[:'RenderHiddenColumns']
|
146
160
|
end
|
147
161
|
|
162
|
+
if attributes.key?(:'RenderHeadings')
|
163
|
+
self.render_headings = attributes[:'RenderHeadings']
|
164
|
+
end
|
165
|
+
|
148
166
|
if attributes.key?(:'RenderPrintAreaOnly')
|
149
167
|
self.render_print_area_only = attributes[:'RenderPrintAreaOnly']
|
150
168
|
end
|
@@ -167,6 +185,10 @@ module GroupDocsViewerCloud
|
|
167
185
|
invalid_properties.push("invalid value for 'count_rows_per_page', count_rows_per_page cannot be nil.")
|
168
186
|
end
|
169
187
|
|
188
|
+
if @count_columns_per_page.nil?
|
189
|
+
invalid_properties.push("invalid value for 'count_columns_per_page', count_columns_per_page cannot be nil.")
|
190
|
+
end
|
191
|
+
|
170
192
|
if @render_grid_lines.nil?
|
171
193
|
invalid_properties.push("invalid value for 'render_grid_lines', render_grid_lines cannot be nil.")
|
172
194
|
end
|
@@ -187,6 +209,10 @@ module GroupDocsViewerCloud
|
|
187
209
|
invalid_properties.push("invalid value for 'render_hidden_columns', render_hidden_columns cannot be nil.")
|
188
210
|
end
|
189
211
|
|
212
|
+
if @render_headings.nil?
|
213
|
+
invalid_properties.push("invalid value for 'render_headings', render_headings cannot be nil.")
|
214
|
+
end
|
215
|
+
|
190
216
|
if @render_print_area_only.nil?
|
191
217
|
invalid_properties.push("invalid value for 'render_print_area_only', render_print_area_only cannot be nil.")
|
192
218
|
end
|
@@ -203,11 +229,13 @@ module GroupDocsViewerCloud
|
|
203
229
|
def valid?
|
204
230
|
return false if @paginate_sheets.nil?
|
205
231
|
return false if @count_rows_per_page.nil?
|
232
|
+
return false if @count_columns_per_page.nil?
|
206
233
|
return false if @render_grid_lines.nil?
|
207
234
|
return false if @render_empty_rows.nil?
|
208
235
|
return false if @render_empty_columns.nil?
|
209
236
|
return false if @render_hidden_rows.nil?
|
210
237
|
return false if @render_hidden_columns.nil?
|
238
|
+
return false if @render_headings.nil?
|
211
239
|
return false if @render_print_area_only.nil?
|
212
240
|
return false if @text_overflow_mode.nil?
|
213
241
|
text_overflow_mode_validator = EnumAttributeValidator.new('String', ["Overlay", "OverlayIfNextIsEmpty", "AutoFitColumn", "HideText"])
|
@@ -236,11 +264,13 @@ module GroupDocsViewerCloud
|
|
236
264
|
self.class == other.class &&
|
237
265
|
paginate_sheets == other.paginate_sheets &&
|
238
266
|
count_rows_per_page == other.count_rows_per_page &&
|
267
|
+
count_columns_per_page == other.count_columns_per_page &&
|
239
268
|
render_grid_lines == other.render_grid_lines &&
|
240
269
|
render_empty_rows == other.render_empty_rows &&
|
241
270
|
render_empty_columns == other.render_empty_columns &&
|
242
271
|
render_hidden_rows == other.render_hidden_rows &&
|
243
272
|
render_hidden_columns == other.render_hidden_columns &&
|
273
|
+
render_headings == other.render_headings &&
|
244
274
|
render_print_area_only == other.render_print_area_only &&
|
245
275
|
text_overflow_mode == other.text_overflow_mode
|
246
276
|
end
|
@@ -254,7 +284,7 @@ module GroupDocsViewerCloud
|
|
254
284
|
# Calculates hash code according to all attributes.
|
255
285
|
# @return [Fixnum] Hash code
|
256
286
|
def hash
|
257
|
-
[paginate_sheets, count_rows_per_page, render_grid_lines, render_empty_rows, render_empty_columns, render_hidden_rows, render_hidden_columns, render_print_area_only, text_overflow_mode].hash
|
287
|
+
[paginate_sheets, count_rows_per_page, count_columns_per_page, render_grid_lines, render_empty_rows, render_empty_columns, render_hidden_rows, render_hidden_columns, render_headings, render_print_area_only, text_overflow_mode].hash
|
258
288
|
end
|
259
289
|
|
260
290
|
# Downcases first letter.
|
@@ -0,0 +1,234 @@
|
|
1
|
+
#
|
2
|
+
# --------------------------------------------------------------------------------------------------------------------
|
3
|
+
# <copyright company="Aspose Pty Ltd" file="text_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 text documents
|
32
|
+
class TextOptions
|
33
|
+
|
34
|
+
# Max chars per row on page. Default value is 85.
|
35
|
+
attr_accessor :max_chars_per_row
|
36
|
+
|
37
|
+
# Max rows per page. Default value is 55.
|
38
|
+
attr_accessor :max_rows_per_page
|
39
|
+
|
40
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
41
|
+
def self.attribute_map
|
42
|
+
{
|
43
|
+
:'max_chars_per_row' => :'MaxCharsPerRow',
|
44
|
+
:'max_rows_per_page' => :'MaxRowsPerPage'
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# Attribute type mapping.
|
49
|
+
def self.swagger_types
|
50
|
+
{
|
51
|
+
:'max_chars_per_row' => :'Integer',
|
52
|
+
:'max_rows_per_page' => :'Integer'
|
53
|
+
}
|
54
|
+
end
|
55
|
+
|
56
|
+
# Initializes the object
|
57
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
58
|
+
def initialize(attributes = {})
|
59
|
+
return unless attributes.is_a?(Hash)
|
60
|
+
|
61
|
+
# convert string to symbol for hash key
|
62
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
63
|
+
|
64
|
+
if attributes.key?(:'MaxCharsPerRow')
|
65
|
+
self.max_chars_per_row = attributes[:'MaxCharsPerRow']
|
66
|
+
end
|
67
|
+
|
68
|
+
if attributes.key?(:'MaxRowsPerPage')
|
69
|
+
self.max_rows_per_page = attributes[:'MaxRowsPerPage']
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
|
74
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
75
|
+
# @return Array for valid properies with the reasons
|
76
|
+
def list_invalid_properties
|
77
|
+
invalid_properties = []
|
78
|
+
if @max_chars_per_row.nil?
|
79
|
+
invalid_properties.push("invalid value for 'max_chars_per_row', max_chars_per_row cannot be nil.")
|
80
|
+
end
|
81
|
+
|
82
|
+
if @max_rows_per_page.nil?
|
83
|
+
invalid_properties.push("invalid value for 'max_rows_per_page', max_rows_per_page cannot be nil.")
|
84
|
+
end
|
85
|
+
|
86
|
+
return invalid_properties
|
87
|
+
end
|
88
|
+
|
89
|
+
# Check to see if the all the properties in the model are valid
|
90
|
+
# @return true if the model is valid
|
91
|
+
def valid?
|
92
|
+
return false if @max_chars_per_row.nil?
|
93
|
+
return false if @max_rows_per_page.nil?
|
94
|
+
return true
|
95
|
+
end
|
96
|
+
|
97
|
+
# Checks equality by comparing each attribute.
|
98
|
+
# @param [Object] Object to be compared
|
99
|
+
def ==(other)
|
100
|
+
return true if self.equal?(other)
|
101
|
+
self.class == other.class &&
|
102
|
+
max_chars_per_row == other.max_chars_per_row &&
|
103
|
+
max_rows_per_page == other.max_rows_per_page
|
104
|
+
end
|
105
|
+
|
106
|
+
# @see the `==` method
|
107
|
+
# @param [Object] Object to be compared
|
108
|
+
def eql?(other)
|
109
|
+
self == other
|
110
|
+
end
|
111
|
+
|
112
|
+
# Calculates hash code according to all attributes.
|
113
|
+
# @return [Fixnum] Hash code
|
114
|
+
def hash
|
115
|
+
[max_chars_per_row, max_rows_per_page].hash
|
116
|
+
end
|
117
|
+
|
118
|
+
# Downcases first letter.
|
119
|
+
# @return downcased string
|
120
|
+
def uncap(str)
|
121
|
+
str[0, 1].downcase + str[1..-1]
|
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
|
+
pname = uncap(self.class.attribute_map[key]).intern
|
131
|
+
value = attributes[pname]
|
132
|
+
if type =~ /\AArray<(.*)>/i
|
133
|
+
# check to ensure the input is an array given that the the attribute
|
134
|
+
# is documented as an array but the input is not
|
135
|
+
if value.is_a?(Array)
|
136
|
+
self.send("#{key}=", value.map { |v| _deserialize($1, v) })
|
137
|
+
end
|
138
|
+
elsif !value.nil?
|
139
|
+
self.send("#{key}=", _deserialize(type, value))
|
140
|
+
end
|
141
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
142
|
+
end
|
143
|
+
|
144
|
+
self
|
145
|
+
end
|
146
|
+
|
147
|
+
# Deserializes the data based on type
|
148
|
+
# @param string type Data type
|
149
|
+
# @param string value Value to be deserialized
|
150
|
+
# @return [Object] Deserialized data
|
151
|
+
def _deserialize(type, value)
|
152
|
+
case type.to_sym
|
153
|
+
when :DateTime
|
154
|
+
Date.parse value
|
155
|
+
when :Date
|
156
|
+
Date.parse value
|
157
|
+
when :String
|
158
|
+
value.to_s
|
159
|
+
when :Integer
|
160
|
+
value.to_i
|
161
|
+
when :Float
|
162
|
+
value.to_f
|
163
|
+
when :BOOLEAN
|
164
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
165
|
+
true
|
166
|
+
else
|
167
|
+
false
|
168
|
+
end
|
169
|
+
when :Object
|
170
|
+
# generic object (usually a Hash), return directly
|
171
|
+
value
|
172
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
173
|
+
inner_type = Regexp.last_match[:inner_type]
|
174
|
+
value.map { |v| _deserialize(inner_type, v) }
|
175
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
176
|
+
k_type = Regexp.last_match[:k_type]
|
177
|
+
v_type = Regexp.last_match[:v_type]
|
178
|
+
{}.tap do |hash|
|
179
|
+
value.each do |k, v|
|
180
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
181
|
+
end
|
182
|
+
end
|
183
|
+
else
|
184
|
+
# model
|
185
|
+
temp_model = GroupDocsViewerCloud.const_get(type).new
|
186
|
+
temp_model.build_from_hash(value)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
# Returns the string representation of the object
|
191
|
+
# @return [String] String presentation of the object
|
192
|
+
def to_s
|
193
|
+
to_hash.to_s
|
194
|
+
end
|
195
|
+
|
196
|
+
# to_body is an alias to to_hash (backward compatibility)
|
197
|
+
# @return [Hash] Returns the object in the form of hash
|
198
|
+
def to_body
|
199
|
+
to_hash
|
200
|
+
end
|
201
|
+
|
202
|
+
# Returns the object in the form of hash
|
203
|
+
# @return [Hash] Returns the object in the form of hash
|
204
|
+
def to_hash
|
205
|
+
hash = {}
|
206
|
+
self.class.attribute_map.each_pair do |attr, param|
|
207
|
+
value = self.send(attr)
|
208
|
+
next if value.nil?
|
209
|
+
hash[param] = _to_hash(value)
|
210
|
+
end
|
211
|
+
hash
|
212
|
+
end
|
213
|
+
|
214
|
+
# Outputs non-array value in the form of hash
|
215
|
+
# For object, use to_hash. Otherwise, just return the value
|
216
|
+
# @param [Object] value Any valid value
|
217
|
+
# @return [Hash] Returns the value in the form of hash
|
218
|
+
def _to_hash(value)
|
219
|
+
if value.is_a?(Array)
|
220
|
+
value.compact.map { |v| _to_hash(v) }
|
221
|
+
elsif value.is_a?(Hash)
|
222
|
+
{}.tap do |hash|
|
223
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
224
|
+
end
|
225
|
+
elsif value.respond_to? :to_hash
|
226
|
+
value.to_hash
|
227
|
+
else
|
228
|
+
value
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
232
|
+
end
|
233
|
+
|
234
|
+
end
|
@@ -0,0 +1,234 @@
|
|
1
|
+
#
|
2
|
+
# --------------------------------------------------------------------------------------------------------------------
|
3
|
+
# <copyright company="Aspose Pty Ltd" file="visio_rendering_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
|
+
# The Visio files processing documents view options.
|
32
|
+
class VisioRenderingOptions
|
33
|
+
|
34
|
+
# Render only Visio figures, not a diagram.
|
35
|
+
attr_accessor :render_figures_only
|
36
|
+
|
37
|
+
# Figure width, height will be calculated automatically. Default value is 100.
|
38
|
+
attr_accessor :figure_width
|
39
|
+
|
40
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
41
|
+
def self.attribute_map
|
42
|
+
{
|
43
|
+
:'render_figures_only' => :'RenderFiguresOnly',
|
44
|
+
:'figure_width' => :'FigureWidth'
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# Attribute type mapping.
|
49
|
+
def self.swagger_types
|
50
|
+
{
|
51
|
+
:'render_figures_only' => :'BOOLEAN',
|
52
|
+
:'figure_width' => :'Integer'
|
53
|
+
}
|
54
|
+
end
|
55
|
+
|
56
|
+
# Initializes the object
|
57
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
58
|
+
def initialize(attributes = {})
|
59
|
+
return unless attributes.is_a?(Hash)
|
60
|
+
|
61
|
+
# convert string to symbol for hash key
|
62
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
63
|
+
|
64
|
+
if attributes.key?(:'RenderFiguresOnly')
|
65
|
+
self.render_figures_only = attributes[:'RenderFiguresOnly']
|
66
|
+
end
|
67
|
+
|
68
|
+
if attributes.key?(:'FigureWidth')
|
69
|
+
self.figure_width = attributes[:'FigureWidth']
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
|
74
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
75
|
+
# @return Array for valid properies with the reasons
|
76
|
+
def list_invalid_properties
|
77
|
+
invalid_properties = []
|
78
|
+
if @render_figures_only.nil?
|
79
|
+
invalid_properties.push("invalid value for 'render_figures_only', render_figures_only cannot be nil.")
|
80
|
+
end
|
81
|
+
|
82
|
+
if @figure_width.nil?
|
83
|
+
invalid_properties.push("invalid value for 'figure_width', figure_width cannot be nil.")
|
84
|
+
end
|
85
|
+
|
86
|
+
return invalid_properties
|
87
|
+
end
|
88
|
+
|
89
|
+
# Check to see if the all the properties in the model are valid
|
90
|
+
# @return true if the model is valid
|
91
|
+
def valid?
|
92
|
+
return false if @render_figures_only.nil?
|
93
|
+
return false if @figure_width.nil?
|
94
|
+
return true
|
95
|
+
end
|
96
|
+
|
97
|
+
# Checks equality by comparing each attribute.
|
98
|
+
# @param [Object] Object to be compared
|
99
|
+
def ==(other)
|
100
|
+
return true if self.equal?(other)
|
101
|
+
self.class == other.class &&
|
102
|
+
render_figures_only == other.render_figures_only &&
|
103
|
+
figure_width == other.figure_width
|
104
|
+
end
|
105
|
+
|
106
|
+
# @see the `==` method
|
107
|
+
# @param [Object] Object to be compared
|
108
|
+
def eql?(other)
|
109
|
+
self == other
|
110
|
+
end
|
111
|
+
|
112
|
+
# Calculates hash code according to all attributes.
|
113
|
+
# @return [Fixnum] Hash code
|
114
|
+
def hash
|
115
|
+
[render_figures_only, figure_width].hash
|
116
|
+
end
|
117
|
+
|
118
|
+
# Downcases first letter.
|
119
|
+
# @return downcased string
|
120
|
+
def uncap(str)
|
121
|
+
str[0, 1].downcase + str[1..-1]
|
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
|
+
pname = uncap(self.class.attribute_map[key]).intern
|
131
|
+
value = attributes[pname]
|
132
|
+
if type =~ /\AArray<(.*)>/i
|
133
|
+
# check to ensure the input is an array given that the the attribute
|
134
|
+
# is documented as an array but the input is not
|
135
|
+
if value.is_a?(Array)
|
136
|
+
self.send("#{key}=", value.map { |v| _deserialize($1, v) })
|
137
|
+
end
|
138
|
+
elsif !value.nil?
|
139
|
+
self.send("#{key}=", _deserialize(type, value))
|
140
|
+
end
|
141
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
142
|
+
end
|
143
|
+
|
144
|
+
self
|
145
|
+
end
|
146
|
+
|
147
|
+
# Deserializes the data based on type
|
148
|
+
# @param string type Data type
|
149
|
+
# @param string value Value to be deserialized
|
150
|
+
# @return [Object] Deserialized data
|
151
|
+
def _deserialize(type, value)
|
152
|
+
case type.to_sym
|
153
|
+
when :DateTime
|
154
|
+
Date.parse value
|
155
|
+
when :Date
|
156
|
+
Date.parse value
|
157
|
+
when :String
|
158
|
+
value.to_s
|
159
|
+
when :Integer
|
160
|
+
value.to_i
|
161
|
+
when :Float
|
162
|
+
value.to_f
|
163
|
+
when :BOOLEAN
|
164
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
165
|
+
true
|
166
|
+
else
|
167
|
+
false
|
168
|
+
end
|
169
|
+
when :Object
|
170
|
+
# generic object (usually a Hash), return directly
|
171
|
+
value
|
172
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
173
|
+
inner_type = Regexp.last_match[:inner_type]
|
174
|
+
value.map { |v| _deserialize(inner_type, v) }
|
175
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
176
|
+
k_type = Regexp.last_match[:k_type]
|
177
|
+
v_type = Regexp.last_match[:v_type]
|
178
|
+
{}.tap do |hash|
|
179
|
+
value.each do |k, v|
|
180
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
181
|
+
end
|
182
|
+
end
|
183
|
+
else
|
184
|
+
# model
|
185
|
+
temp_model = GroupDocsViewerCloud.const_get(type).new
|
186
|
+
temp_model.build_from_hash(value)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
# Returns the string representation of the object
|
191
|
+
# @return [String] String presentation of the object
|
192
|
+
def to_s
|
193
|
+
to_hash.to_s
|
194
|
+
end
|
195
|
+
|
196
|
+
# to_body is an alias to to_hash (backward compatibility)
|
197
|
+
# @return [Hash] Returns the object in the form of hash
|
198
|
+
def to_body
|
199
|
+
to_hash
|
200
|
+
end
|
201
|
+
|
202
|
+
# Returns the object in the form of hash
|
203
|
+
# @return [Hash] Returns the object in the form of hash
|
204
|
+
def to_hash
|
205
|
+
hash = {}
|
206
|
+
self.class.attribute_map.each_pair do |attr, param|
|
207
|
+
value = self.send(attr)
|
208
|
+
next if value.nil?
|
209
|
+
hash[param] = _to_hash(value)
|
210
|
+
end
|
211
|
+
hash
|
212
|
+
end
|
213
|
+
|
214
|
+
# Outputs non-array value in the form of hash
|
215
|
+
# For object, use to_hash. Otherwise, just return the value
|
216
|
+
# @param [Object] value Any valid value
|
217
|
+
# @return [Hash] Returns the value in the form of hash
|
218
|
+
def _to_hash(value)
|
219
|
+
if value.is_a?(Array)
|
220
|
+
value.compact.map { |v| _to_hash(v) }
|
221
|
+
elsif value.is_a?(Hash)
|
222
|
+
{}.tap do |hash|
|
223
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
224
|
+
end
|
225
|
+
elsif value.respond_to? :to_hash
|
226
|
+
value.to_hash
|
227
|
+
else
|
228
|
+
value
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
232
|
+
end
|
233
|
+
|
234
|
+
end
|