groupdocs_viewer_cloud 18.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +7 -0
  2. data/lib/groupdocs_viewer_cloud.rb +104 -0
  3. data/lib/groupdocs_viewer_cloud/api/viewer_api.rb +5296 -0
  4. data/lib/groupdocs_viewer_cloud/api_client.rb +390 -0
  5. data/lib/groupdocs_viewer_cloud/api_error.rb +56 -0
  6. data/lib/groupdocs_viewer_cloud/configuration.rb +95 -0
  7. data/lib/groupdocs_viewer_cloud/models/attachment.rb +216 -0
  8. data/lib/groupdocs_viewer_cloud/models/attachment_collection.rb +228 -0
  9. data/lib/groupdocs_viewer_cloud/models/attachment_info.rb +226 -0
  10. data/lib/groupdocs_viewer_cloud/models/cad_options.rb +270 -0
  11. data/lib/groupdocs_viewer_cloud/models/cells_options.rb +296 -0
  12. data/lib/groupdocs_viewer_cloud/models/document_info.rb +282 -0
  13. data/lib/groupdocs_viewer_cloud/models/document_info_options.rb +348 -0
  14. data/lib/groupdocs_viewer_cloud/models/email_options.rb +228 -0
  15. data/lib/groupdocs_viewer_cloud/models/field_label.rb +216 -0
  16. data/lib/groupdocs_viewer_cloud/models/file_response.rb +196 -0
  17. data/lib/groupdocs_viewer_cloud/models/font_collection.rb +208 -0
  18. data/lib/groupdocs_viewer_cloud/models/font_family.rb +206 -0
  19. data/lib/groupdocs_viewer_cloud/models/format.rb +216 -0
  20. data/lib/groupdocs_viewer_cloud/models/format_collection.rb +208 -0
  21. data/lib/groupdocs_viewer_cloud/models/html_attachment_page_collection.rb +238 -0
  22. data/lib/groupdocs_viewer_cloud/models/html_options.rb +428 -0
  23. data/lib/groupdocs_viewer_cloud/models/html_page.rb +228 -0
  24. data/lib/groupdocs_viewer_cloud/models/html_page_collection.rb +228 -0
  25. data/lib/groupdocs_viewer_cloud/models/image_attachment_page_collection.rb +238 -0
  26. data/lib/groupdocs_viewer_cloud/models/image_options.rb +408 -0
  27. data/lib/groupdocs_viewer_cloud/models/image_page.rb +216 -0
  28. data/lib/groupdocs_viewer_cloud/models/image_page_collection.rb +238 -0
  29. data/lib/groupdocs_viewer_cloud/models/page_info.rb +268 -0
  30. data/lib/groupdocs_viewer_cloud/models/page_info_collection.rb +208 -0
  31. data/lib/groupdocs_viewer_cloud/models/pdf_file_info.rb +236 -0
  32. data/lib/groupdocs_viewer_cloud/models/pdf_file_options.rb +348 -0
  33. data/lib/groupdocs_viewer_cloud/models/pdf_options.rb +236 -0
  34. data/lib/groupdocs_viewer_cloud/models/project_options.rb +216 -0
  35. data/lib/groupdocs_viewer_cloud/models/render_options.rb +368 -0
  36. data/lib/groupdocs_viewer_cloud/models/render_options_base.rb +348 -0
  37. data/lib/groupdocs_viewer_cloud/models/reorder_options.rb +226 -0
  38. data/lib/groupdocs_viewer_cloud/models/requests/html_create_attachment_pages_cache_request.rb +65 -0
  39. data/lib/groupdocs_viewer_cloud/models/requests/html_create_pages_cache_from_content_request.rb +65 -0
  40. data/lib/groupdocs_viewer_cloud/models/requests/html_create_pages_cache_from_url_request.rb +65 -0
  41. data/lib/groupdocs_viewer_cloud/models/requests/html_create_pages_cache_request.rb +61 -0
  42. data/lib/groupdocs_viewer_cloud/models/requests/html_create_pdf_file_from_content_request.rb +65 -0
  43. data/lib/groupdocs_viewer_cloud/models/requests/html_create_pdf_file_from_url_request.rb +65 -0
  44. data/lib/groupdocs_viewer_cloud/models/requests/html_create_pdf_file_request.rb +61 -0
  45. data/lib/groupdocs_viewer_cloud/models/requests/html_delete_attachment_pages_cache_request.rb +57 -0
  46. data/lib/groupdocs_viewer_cloud/models/requests/html_delete_pages_cache_request.rb +53 -0
  47. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_info_request.rb +65 -0
  48. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_info_with_options_request.rb +61 -0
  49. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_page_request.rb +109 -0
  50. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_page_resource_request.rb +65 -0
  51. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_pages_request.rb +113 -0
  52. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_request.rb +61 -0
  53. data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachments_request.rb +57 -0
  54. data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_from_content_request.rb +61 -0
  55. data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_from_url_request.rb +69 -0
  56. data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_from_url_with_options_request.rb +61 -0
  57. data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_request.rb +65 -0
  58. data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_with_options_request.rb +57 -0
  59. data/lib/groupdocs_viewer_cloud/models/requests/html_get_page_request.rb +101 -0
  60. data/lib/groupdocs_viewer_cloud/models/requests/html_get_page_resource_request.rb +61 -0
  61. data/lib/groupdocs_viewer_cloud/models/requests/html_get_pages_from_url_request.rb +109 -0
  62. data/lib/groupdocs_viewer_cloud/models/requests/html_get_pages_request.rb +105 -0
  63. data/lib/groupdocs_viewer_cloud/models/requests/html_get_pdf_file_from_url_request.rb +77 -0
  64. data/lib/groupdocs_viewer_cloud/models/requests/html_get_pdf_file_request.rb +73 -0
  65. data/lib/groupdocs_viewer_cloud/models/requests/html_get_zip_with_attachment_pages_request.rb +113 -0
  66. data/lib/groupdocs_viewer_cloud/models/requests/html_get_zip_with_pages_request.rb +105 -0
  67. data/lib/groupdocs_viewer_cloud/models/requests/html_transform_pages_request.rb +57 -0
  68. data/lib/groupdocs_viewer_cloud/models/requests/image_create_attachment_pages_cache_request.rb +65 -0
  69. data/lib/groupdocs_viewer_cloud/models/requests/image_create_pages_cache_from_content_request.rb +65 -0
  70. data/lib/groupdocs_viewer_cloud/models/requests/image_create_pages_cache_from_url_request.rb +65 -0
  71. data/lib/groupdocs_viewer_cloud/models/requests/image_create_pages_cache_request.rb +61 -0
  72. data/lib/groupdocs_viewer_cloud/models/requests/image_create_pdf_file_from_content_request.rb +65 -0
  73. data/lib/groupdocs_viewer_cloud/models/requests/image_create_pdf_file_from_url_request.rb +65 -0
  74. data/lib/groupdocs_viewer_cloud/models/requests/image_create_pdf_file_request.rb +61 -0
  75. data/lib/groupdocs_viewer_cloud/models/requests/image_delete_attachment_pages_cache_request.rb +57 -0
  76. data/lib/groupdocs_viewer_cloud/models/requests/image_delete_pages_cache_request.rb +53 -0
  77. data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_info_request.rb +69 -0
  78. data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_info_with_options_request.rb +61 -0
  79. data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_page_request.rb +105 -0
  80. data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_pages_request.rb +109 -0
  81. data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_request.rb +61 -0
  82. data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachments_request.rb +57 -0
  83. data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_from_content_request.rb +61 -0
  84. data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_from_url_request.rb +73 -0
  85. data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_from_url_with_options_request.rb +61 -0
  86. data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_request.rb +69 -0
  87. data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_with_options_request.rb +57 -0
  88. data/lib/groupdocs_viewer_cloud/models/requests/image_get_page_request.rb +97 -0
  89. data/lib/groupdocs_viewer_cloud/models/requests/image_get_pages_from_url_request.rb +105 -0
  90. data/lib/groupdocs_viewer_cloud/models/requests/image_get_pages_request.rb +101 -0
  91. data/lib/groupdocs_viewer_cloud/models/requests/image_get_pdf_file_from_url_request.rb +77 -0
  92. data/lib/groupdocs_viewer_cloud/models/requests/image_get_pdf_file_request.rb +73 -0
  93. data/lib/groupdocs_viewer_cloud/models/requests/image_get_zip_with_attachment_pages_request.rb +109 -0
  94. data/lib/groupdocs_viewer_cloud/models/requests/image_get_zip_with_pages_request.rb +101 -0
  95. data/lib/groupdocs_viewer_cloud/models/requests/image_transform_pages_request.rb +57 -0
  96. data/lib/groupdocs_viewer_cloud/models/resource.rb +216 -0
  97. data/lib/groupdocs_viewer_cloud/models/resource_url.rb +206 -0
  98. data/lib/groupdocs_viewer_cloud/models/rotate_options.rb +226 -0
  99. data/lib/groupdocs_viewer_cloud/models/row_info.rb +270 -0
  100. data/lib/groupdocs_viewer_cloud/models/slides_options.rb +206 -0
  101. data/lib/groupdocs_viewer_cloud/models/tile.rb +236 -0
  102. data/lib/groupdocs_viewer_cloud/models/transform_options_base.rb +216 -0
  103. data/lib/groupdocs_viewer_cloud/models/watermark.rb +236 -0
  104. data/lib/groupdocs_viewer_cloud/models/words_options.rb +216 -0
  105. data/lib/groupdocs_viewer_cloud/version.rb +29 -0
  106. metadata +235 -0
@@ -0,0 +1,238 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="image_attachment_page_collection.rb">
4
+ # Copyright (c) 2003-2018 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
+ # Describes attachment pages.
32
+ class ImageAttachmentPageCollection
33
+
34
+ # File name.
35
+ attr_accessor :file_name
36
+
37
+ # File folder.
38
+ attr_accessor :folder
39
+
40
+ # Name of the attachment.
41
+ attr_accessor :attachment_name
42
+
43
+ # Pages list.
44
+ attr_accessor :pages
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'file_name' => :'fileName',
50
+ :'folder' => :'folder',
51
+ :'attachment_name' => :'attachmentName',
52
+ :'pages' => :'pages'
53
+ }
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.swagger_types
58
+ {
59
+ :'file_name' => :'String',
60
+ :'folder' => :'String',
61
+ :'attachment_name' => :'String',
62
+ :'pages' => :'Array<ImagePage>'
63
+ }
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ return unless attributes.is_a?(Hash)
70
+
71
+ # convert string to symbol for hash key
72
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
73
+
74
+ if attributes.key?(:'fileName')
75
+ self.file_name = attributes[:'fileName']
76
+ end
77
+
78
+ if attributes.key?(:'folder')
79
+ self.folder = attributes[:'folder']
80
+ end
81
+
82
+ if attributes.key?(:'attachmentName')
83
+ self.attachment_name = attributes[:'attachmentName']
84
+ end
85
+
86
+ if attributes.key?(:'pages')
87
+ if (value = attributes[:'pages']).is_a?(Array)
88
+ self.pages = value
89
+ end
90
+ end
91
+
92
+ end
93
+
94
+ # Show invalid properties with the reasons. Usually used together with valid?
95
+ # @return Array for valid properies with the reasons
96
+ def list_invalid_properties
97
+ invalid_properties = []
98
+ return invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ return true
105
+ end
106
+
107
+ # Checks equality by comparing each attribute.
108
+ # @param [Object] Object to be compared
109
+ def ==(other)
110
+ return true if self.equal?(other)
111
+ self.class == other.class &&
112
+ file_name == other.file_name &&
113
+ folder == other.folder &&
114
+ attachment_name == other.attachment_name &&
115
+ pages == other.pages
116
+ end
117
+
118
+ # @see the `==` method
119
+ # @param [Object] Object to be compared
120
+ def eql?(other)
121
+ self == other
122
+ end
123
+
124
+ # Calculates hash code according to all attributes.
125
+ # @return [Fixnum] Hash code
126
+ def hash
127
+ [file_name, folder, attachment_name, pages].hash
128
+ end
129
+
130
+ # Builds the object from hash
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ # @return [Object] Returns the model itself
133
+ def build_from_hash(attributes)
134
+ return nil unless attributes.is_a?(Hash)
135
+ self.class.swagger_types.each_pair do |key, type|
136
+ if type =~ /\AArray<(.*)>/i
137
+ # check to ensure the input is an array given that the the attribute
138
+ # is documented as an array but the input is not
139
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
140
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
141
+ end
142
+ elsif !attributes[self.class.attribute_map[key]].nil?
143
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
144
+ end
145
+ # or else data not found in attributes(hash), not an issue as the data can be optional
146
+ end
147
+
148
+ self
149
+ end
150
+
151
+ # Deserializes the data based on type
152
+ # @param string type Data type
153
+ # @param string value Value to be deserialized
154
+ # @return [Object] Deserialized data
155
+ def _deserialize(type, value)
156
+ case type.to_sym
157
+ when :DateTime
158
+ Time.at(/\d/.match(value)[0].to_f).to_datetime
159
+ when :Date
160
+ Time.at(/\d/.match(value)[0].to_f).to_date
161
+ when :String
162
+ value.to_s
163
+ when :Integer
164
+ value.to_i
165
+ when :Float
166
+ value.to_f
167
+ when :BOOLEAN
168
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
169
+ true
170
+ else
171
+ false
172
+ end
173
+ when :Object
174
+ # generic object (usually a Hash), return directly
175
+ value
176
+ when /\AArray<(?<inner_type>.+)>\z/
177
+ inner_type = Regexp.last_match[:inner_type]
178
+ value.map { |v| _deserialize(inner_type, v) }
179
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
180
+ k_type = Regexp.last_match[:k_type]
181
+ v_type = Regexp.last_match[:v_type]
182
+ {}.tap do |hash|
183
+ value.each do |k, v|
184
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
185
+ end
186
+ end
187
+ else
188
+ # model
189
+ temp_model = GroupDocsViewerCloud.const_get(type).new
190
+ temp_model.build_from_hash(value)
191
+ end
192
+ end
193
+
194
+ # Returns the string representation of the object
195
+ # @return [String] String presentation of the object
196
+ def to_s
197
+ to_hash.to_s
198
+ end
199
+
200
+ # to_body is an alias to to_hash (backward compatibility)
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_body
203
+ to_hash
204
+ end
205
+
206
+ # Returns the object in the form of hash
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_hash
209
+ hash = {}
210
+ self.class.attribute_map.each_pair do |attr, param|
211
+ value = self.send(attr)
212
+ next if value.nil?
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ # Outputs non-array value in the form of hash
219
+ # For object, use to_hash. Otherwise, just return the value
220
+ # @param [Object] value Any valid value
221
+ # @return [Hash] Returns the value in the form of hash
222
+ def _to_hash(value)
223
+ if value.is_a?(Array)
224
+ value.compact.map { |v| _to_hash(v) }
225
+ elsif value.is_a?(Hash)
226
+ {}.tap do |hash|
227
+ value.each { |k, v| hash[k] = _to_hash(v) }
228
+ end
229
+ elsif value.respond_to? :to_hash
230
+ value.to_hash
231
+ else
232
+ value
233
+ end
234
+ end
235
+
236
+ end
237
+
238
+ end
@@ -0,0 +1,408 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="image_options.rb">
4
+ # Copyright (c) 2003-2018 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 document as image.
32
+ class ImageOptions
33
+
34
+ # Allows to specify document password in case when document is password-protected.
35
+ attr_accessor :password
36
+
37
+ # Allows to specify attachment password in case when attachment is password-protected.
38
+ attr_accessor :attachment_password
39
+
40
+ # Enables document text extraction. For rendering document as image only.
41
+ attr_accessor :extract_text
42
+
43
+ # Enables document comments rendering.
44
+ attr_accessor :render_comments
45
+
46
+ # Enables rendering of document hidden pages, sheets or slides.
47
+ attr_accessor :render_hidden_pages
48
+
49
+ # Transforms to apply. Available transforms [\"Rotate\",\"Reorder\",\"AddPrintAction\"]. 1. Rotate - pages will be rotated on angle if angle was set before. 2. Reorder - for rendering document as PDF only. Pages will be ordered according to rearrangements made before. 3. AddPrintAction - for rendering document as PDF only. An JavaScript action will be added which opens print dialog when PDF document is opened.
50
+ attr_accessor :transforms
51
+
52
+ # The name of the default font. Default font name may be specified in following cases: - You want to generally specify the default font to fall back on, if particular font in the document cannot be found during rendering. - Your document uses fonts, that contain non-English characters and you want to make sure any missing font is replaced with one that has the same character set available.
53
+ attr_accessor :default_font_name
54
+
55
+ # Allows to specify watermark.
56
+ attr_accessor :watermark
57
+
58
+ # The Spreadsheet documents rendering options.
59
+ attr_accessor :cells_options
60
+
61
+ # The CAD documents rendering options.
62
+ attr_accessor :cad_options
63
+
64
+ # The Email documents rendering options.
65
+ attr_accessor :email_options
66
+
67
+ # The Text documents rendering options.
68
+ attr_accessor :words_options
69
+
70
+ # The PDF documents rendering options.
71
+ attr_accessor :pdf_options
72
+
73
+ # The Presentation documents rendering options.
74
+ attr_accessor :slides_options
75
+
76
+ # The Microsoft Project documents rendering options.
77
+ attr_accessor :project_options
78
+
79
+ # Allows to specify document page number as starting page to render.
80
+ attr_accessor :start_page_number
81
+
82
+ # Allows to specify count of document pages to render.
83
+ attr_accessor :count_pages
84
+
85
+ # Allows to set image format (png, jpg, bmp). Default value is png.
86
+ attr_accessor :format
87
+
88
+ # Allows to specify quality when rendering as JPG. Valid values are between 1 and 100. Default value is 90.
89
+ attr_accessor :quality
90
+
91
+ # Allows to specify output image width. Specify image width in case when you want to change output image dimensions. When Width has value and Height value is 0 then Height value will be calculated to save image proportions.
92
+ attr_accessor :width
93
+
94
+ # Allows to specify output image height. Specify image height in case when you want to change output image dimensions. When Height has value and Width value is 0 then Width value will be calculated to save image proportions.
95
+ attr_accessor :height
96
+
97
+ # Attribute mapping from ruby-style variable name to JSON key.
98
+ def self.attribute_map
99
+ {
100
+ :'password' => :'password',
101
+ :'attachment_password' => :'attachmentPassword',
102
+ :'extract_text' => :'extractText',
103
+ :'render_comments' => :'renderComments',
104
+ :'render_hidden_pages' => :'renderHiddenPages',
105
+ :'transforms' => :'transforms',
106
+ :'default_font_name' => :'defaultFontName',
107
+ :'watermark' => :'watermark',
108
+ :'cells_options' => :'cellsOptions',
109
+ :'cad_options' => :'cadOptions',
110
+ :'email_options' => :'emailOptions',
111
+ :'words_options' => :'wordsOptions',
112
+ :'pdf_options' => :'pdfOptions',
113
+ :'slides_options' => :'slidesOptions',
114
+ :'project_options' => :'projectOptions',
115
+ :'start_page_number' => :'startPageNumber',
116
+ :'count_pages' => :'countPages',
117
+ :'format' => :'format',
118
+ :'quality' => :'quality',
119
+ :'width' => :'width',
120
+ :'height' => :'height'
121
+ }
122
+ end
123
+
124
+ # Attribute type mapping.
125
+ def self.swagger_types
126
+ {
127
+ :'password' => :'String',
128
+ :'attachment_password' => :'String',
129
+ :'extract_text' => :'BOOLEAN',
130
+ :'render_comments' => :'BOOLEAN',
131
+ :'render_hidden_pages' => :'BOOLEAN',
132
+ :'transforms' => :'Array<String>',
133
+ :'default_font_name' => :'String',
134
+ :'watermark' => :'Watermark',
135
+ :'cells_options' => :'CellsOptions',
136
+ :'cad_options' => :'CadOptions',
137
+ :'email_options' => :'EmailOptions',
138
+ :'words_options' => :'WordsOptions',
139
+ :'pdf_options' => :'PdfOptions',
140
+ :'slides_options' => :'SlidesOptions',
141
+ :'project_options' => :'ProjectOptions',
142
+ :'start_page_number' => :'Integer',
143
+ :'count_pages' => :'Integer',
144
+ :'format' => :'String',
145
+ :'quality' => :'Integer',
146
+ :'width' => :'Integer',
147
+ :'height' => :'Integer'
148
+ }
149
+ end
150
+
151
+ # Initializes the object
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ def initialize(attributes = {})
154
+ return unless attributes.is_a?(Hash)
155
+
156
+ # convert string to symbol for hash key
157
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
158
+
159
+ if attributes.key?(:'password')
160
+ self.password = attributes[:'password']
161
+ end
162
+
163
+ if attributes.key?(:'attachmentPassword')
164
+ self.attachment_password = attributes[:'attachmentPassword']
165
+ end
166
+
167
+ if attributes.key?(:'extractText')
168
+ self.extract_text = attributes[:'extractText']
169
+ end
170
+
171
+ if attributes.key?(:'renderComments')
172
+ self.render_comments = attributes[:'renderComments']
173
+ end
174
+
175
+ if attributes.key?(:'renderHiddenPages')
176
+ self.render_hidden_pages = attributes[:'renderHiddenPages']
177
+ end
178
+
179
+ if attributes.key?(:'transforms')
180
+ if (value = attributes[:'transforms']).is_a?(Array)
181
+ self.transforms = value
182
+ end
183
+ end
184
+
185
+ if attributes.key?(:'defaultFontName')
186
+ self.default_font_name = attributes[:'defaultFontName']
187
+ end
188
+
189
+ if attributes.key?(:'watermark')
190
+ self.watermark = attributes[:'watermark']
191
+ end
192
+
193
+ if attributes.key?(:'cellsOptions')
194
+ self.cells_options = attributes[:'cellsOptions']
195
+ end
196
+
197
+ if attributes.key?(:'cadOptions')
198
+ self.cad_options = attributes[:'cadOptions']
199
+ end
200
+
201
+ if attributes.key?(:'emailOptions')
202
+ self.email_options = attributes[:'emailOptions']
203
+ end
204
+
205
+ if attributes.key?(:'wordsOptions')
206
+ self.words_options = attributes[:'wordsOptions']
207
+ end
208
+
209
+ if attributes.key?(:'pdfOptions')
210
+ self.pdf_options = attributes[:'pdfOptions']
211
+ end
212
+
213
+ if attributes.key?(:'slidesOptions')
214
+ self.slides_options = attributes[:'slidesOptions']
215
+ end
216
+
217
+ if attributes.key?(:'projectOptions')
218
+ self.project_options = attributes[:'projectOptions']
219
+ end
220
+
221
+ if attributes.key?(:'startPageNumber')
222
+ self.start_page_number = attributes[:'startPageNumber']
223
+ end
224
+
225
+ if attributes.key?(:'countPages')
226
+ self.count_pages = attributes[:'countPages']
227
+ end
228
+
229
+ if attributes.key?(:'format')
230
+ self.format = attributes[:'format']
231
+ end
232
+
233
+ if attributes.key?(:'quality')
234
+ self.quality = attributes[:'quality']
235
+ end
236
+
237
+ if attributes.key?(:'width')
238
+ self.width = attributes[:'width']
239
+ end
240
+
241
+ if attributes.key?(:'height')
242
+ self.height = attributes[:'height']
243
+ end
244
+
245
+ end
246
+
247
+ # Show invalid properties with the reasons. Usually used together with valid?
248
+ # @return Array for valid properies with the reasons
249
+ def list_invalid_properties
250
+ invalid_properties = []
251
+ return invalid_properties
252
+ end
253
+
254
+ # Check to see if the all the properties in the model are valid
255
+ # @return true if the model is valid
256
+ def valid?
257
+ return true
258
+ end
259
+
260
+ # Checks equality by comparing each attribute.
261
+ # @param [Object] Object to be compared
262
+ def ==(other)
263
+ return true if self.equal?(other)
264
+ self.class == other.class &&
265
+ password == other.password &&
266
+ attachment_password == other.attachment_password &&
267
+ extract_text == other.extract_text &&
268
+ render_comments == other.render_comments &&
269
+ render_hidden_pages == other.render_hidden_pages &&
270
+ transforms == other.transforms &&
271
+ default_font_name == other.default_font_name &&
272
+ watermark == other.watermark &&
273
+ cells_options == other.cells_options &&
274
+ cad_options == other.cad_options &&
275
+ email_options == other.email_options &&
276
+ words_options == other.words_options &&
277
+ pdf_options == other.pdf_options &&
278
+ slides_options == other.slides_options &&
279
+ project_options == other.project_options &&
280
+ start_page_number == other.start_page_number &&
281
+ count_pages == other.count_pages &&
282
+ format == other.format &&
283
+ quality == other.quality &&
284
+ width == other.width &&
285
+ height == other.height
286
+ end
287
+
288
+ # @see the `==` method
289
+ # @param [Object] Object to be compared
290
+ def eql?(other)
291
+ self == other
292
+ end
293
+
294
+ # Calculates hash code according to all attributes.
295
+ # @return [Fixnum] Hash code
296
+ def hash
297
+ [password, attachment_password, extract_text, render_comments, render_hidden_pages, transforms, default_font_name, watermark, cells_options, cad_options, email_options, words_options, pdf_options, slides_options, project_options, start_page_number, count_pages, format, quality, width, height].hash
298
+ end
299
+
300
+ # Builds the object from hash
301
+ # @param [Hash] attributes Model attributes in the form of hash
302
+ # @return [Object] Returns the model itself
303
+ def build_from_hash(attributes)
304
+ return nil unless attributes.is_a?(Hash)
305
+ self.class.swagger_types.each_pair do |key, type|
306
+ if type =~ /\AArray<(.*)>/i
307
+ # check to ensure the input is an array given that the the attribute
308
+ # is documented as an array but the input is not
309
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
310
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
311
+ end
312
+ elsif !attributes[self.class.attribute_map[key]].nil?
313
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
314
+ end
315
+ # or else data not found in attributes(hash), not an issue as the data can be optional
316
+ end
317
+
318
+ self
319
+ end
320
+
321
+ # Deserializes the data based on type
322
+ # @param string type Data type
323
+ # @param string value Value to be deserialized
324
+ # @return [Object] Deserialized data
325
+ def _deserialize(type, value)
326
+ case type.to_sym
327
+ when :DateTime
328
+ Time.at(/\d/.match(value)[0].to_f).to_datetime
329
+ when :Date
330
+ Time.at(/\d/.match(value)[0].to_f).to_date
331
+ when :String
332
+ value.to_s
333
+ when :Integer
334
+ value.to_i
335
+ when :Float
336
+ value.to_f
337
+ when :BOOLEAN
338
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
339
+ true
340
+ else
341
+ false
342
+ end
343
+ when :Object
344
+ # generic object (usually a Hash), return directly
345
+ value
346
+ when /\AArray<(?<inner_type>.+)>\z/
347
+ inner_type = Regexp.last_match[:inner_type]
348
+ value.map { |v| _deserialize(inner_type, v) }
349
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
350
+ k_type = Regexp.last_match[:k_type]
351
+ v_type = Regexp.last_match[:v_type]
352
+ {}.tap do |hash|
353
+ value.each do |k, v|
354
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
355
+ end
356
+ end
357
+ else
358
+ # model
359
+ temp_model = GroupDocsViewerCloud.const_get(type).new
360
+ temp_model.build_from_hash(value)
361
+ end
362
+ end
363
+
364
+ # Returns the string representation of the object
365
+ # @return [String] String presentation of the object
366
+ def to_s
367
+ to_hash.to_s
368
+ end
369
+
370
+ # to_body is an alias to to_hash (backward compatibility)
371
+ # @return [Hash] Returns the object in the form of hash
372
+ def to_body
373
+ to_hash
374
+ end
375
+
376
+ # Returns the object in the form of hash
377
+ # @return [Hash] Returns the object in the form of hash
378
+ def to_hash
379
+ hash = {}
380
+ self.class.attribute_map.each_pair do |attr, param|
381
+ value = self.send(attr)
382
+ next if value.nil?
383
+ hash[param] = _to_hash(value)
384
+ end
385
+ hash
386
+ end
387
+
388
+ # Outputs non-array value in the form of hash
389
+ # For object, use to_hash. Otherwise, just return the value
390
+ # @param [Object] value Any valid value
391
+ # @return [Hash] Returns the value in the form of hash
392
+ def _to_hash(value)
393
+ if value.is_a?(Array)
394
+ value.compact.map { |v| _to_hash(v) }
395
+ elsif value.is_a?(Hash)
396
+ {}.tap do |hash|
397
+ value.each { |k, v| hash[k] = _to_hash(v) }
398
+ end
399
+ elsif value.respond_to? :to_hash
400
+ value.to_hash
401
+ else
402
+ value
403
+ end
404
+ end
405
+
406
+ end
407
+
408
+ end