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,208 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="format_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 object which contains list of supported file formats.
32
+ class FormatCollection
33
+
34
+ # Supported file formats.
35
+ attr_accessor :formats
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'formats' => :'formats'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.swagger_types
46
+ {
47
+ :'formats' => :'Array<Format>'
48
+ }
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ return unless attributes.is_a?(Hash)
55
+
56
+ # convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
58
+
59
+ if attributes.key?(:'formats')
60
+ if (value = attributes[:'formats']).is_a?(Array)
61
+ self.formats = value
62
+ end
63
+ end
64
+
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properies with the reasons
69
+ def list_invalid_properties
70
+ invalid_properties = []
71
+ return invalid_properties
72
+ end
73
+
74
+ # Check to see if the all the properties in the model are valid
75
+ # @return true if the model is valid
76
+ def valid?
77
+ return true
78
+ end
79
+
80
+ # Checks equality by comparing each attribute.
81
+ # @param [Object] Object to be compared
82
+ def ==(other)
83
+ return true if self.equal?(other)
84
+ self.class == other.class &&
85
+ formats == other.formats
86
+ end
87
+
88
+ # @see the `==` method
89
+ # @param [Object] Object to be compared
90
+ def eql?(other)
91
+ self == other
92
+ end
93
+
94
+ # Calculates hash code according to all attributes.
95
+ # @return [Fixnum] Hash code
96
+ def hash
97
+ [formats].hash
98
+ end
99
+
100
+ # Builds the object from hash
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ # @return [Object] Returns the model itself
103
+ def build_from_hash(attributes)
104
+ return nil unless attributes.is_a?(Hash)
105
+ self.class.swagger_types.each_pair do |key, type|
106
+ if type =~ /\AArray<(.*)>/i
107
+ # check to ensure the input is an array given that the the attribute
108
+ # is documented as an array but the input is not
109
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
110
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
111
+ end
112
+ elsif !attributes[self.class.attribute_map[key]].nil?
113
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
114
+ end
115
+ # or else data not found in attributes(hash), not an issue as the data can be optional
116
+ end
117
+
118
+ self
119
+ end
120
+
121
+ # Deserializes the data based on type
122
+ # @param string type Data type
123
+ # @param string value Value to be deserialized
124
+ # @return [Object] Deserialized data
125
+ def _deserialize(type, value)
126
+ case type.to_sym
127
+ when :DateTime
128
+ Time.at(/\d/.match(value)[0].to_f).to_datetime
129
+ when :Date
130
+ Time.at(/\d/.match(value)[0].to_f).to_date
131
+ when :String
132
+ value.to_s
133
+ when :Integer
134
+ value.to_i
135
+ when :Float
136
+ value.to_f
137
+ when :BOOLEAN
138
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
139
+ true
140
+ else
141
+ false
142
+ end
143
+ when :Object
144
+ # generic object (usually a Hash), return directly
145
+ value
146
+ when /\AArray<(?<inner_type>.+)>\z/
147
+ inner_type = Regexp.last_match[:inner_type]
148
+ value.map { |v| _deserialize(inner_type, v) }
149
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
150
+ k_type = Regexp.last_match[:k_type]
151
+ v_type = Regexp.last_match[:v_type]
152
+ {}.tap do |hash|
153
+ value.each do |k, v|
154
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
155
+ end
156
+ end
157
+ else
158
+ # model
159
+ temp_model = GroupDocsViewerCloud.const_get(type).new
160
+ temp_model.build_from_hash(value)
161
+ end
162
+ end
163
+
164
+ # Returns the string representation of the object
165
+ # @return [String] String presentation of the object
166
+ def to_s
167
+ to_hash.to_s
168
+ end
169
+
170
+ # to_body is an alias to to_hash (backward compatibility)
171
+ # @return [Hash] Returns the object in the form of hash
172
+ def to_body
173
+ to_hash
174
+ end
175
+
176
+ # Returns the object in the form of hash
177
+ # @return [Hash] Returns the object in the form of hash
178
+ def to_hash
179
+ hash = {}
180
+ self.class.attribute_map.each_pair do |attr, param|
181
+ value = self.send(attr)
182
+ next if value.nil?
183
+ hash[param] = _to_hash(value)
184
+ end
185
+ hash
186
+ end
187
+
188
+ # Outputs non-array value in the form of hash
189
+ # For object, use to_hash. Otherwise, just return the value
190
+ # @param [Object] value Any valid value
191
+ # @return [Hash] Returns the value in the form of hash
192
+ def _to_hash(value)
193
+ if value.is_a?(Array)
194
+ value.compact.map { |v| _to_hash(v) }
195
+ elsif value.is_a?(Hash)
196
+ {}.tap do |hash|
197
+ value.each { |k, v| hash[k] = _to_hash(v) }
198
+ end
199
+ elsif value.respond_to? :to_hash
200
+ value.to_hash
201
+ else
202
+ value
203
+ end
204
+ end
205
+
206
+ end
207
+
208
+ end
@@ -0,0 +1,238 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="html_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 HtmlAttachmentPageCollection
33
+
34
+ # The file name.
35
+ attr_accessor :file_name
36
+
37
+ # File folder.
38
+ attr_accessor :folder
39
+
40
+ # Attachment name.
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<HtmlPage>'
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,428 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="html_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 pages as HTML.
32
+ class HtmlOptions
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 specify HTML resources (styles, images and fonts) path. For example when resource path is http://example.com/api/pages/{page-number}/resources/{resource-name} the {page-number} and {resource-name} templates will be replaced with page number and resource name accordingly. Ignored when EmbedResources option is set to true.
86
+ attr_accessor :resource_path
87
+
88
+ # Allows to ignore ResourcePath when processing *.css files. When this options is enabled ResourcePath won't be added to resource references in *.css file.
89
+ attr_accessor :ignore_resource_path_in_resources
90
+
91
+ # Controls output HTML document resources (styles, images and fonts) saving. When this options set to true all resources will be embedded into HTML document and ResourcePath option value will be ignored.
92
+ attr_accessor :embed_resources
93
+
94
+ # Enables content (HTML, CSS and SVG) minification.
95
+ attr_accessor :enable_minification
96
+
97
+ # Indicates whether rendering will provide responsive web pages, that look well on different device types.
98
+ attr_accessor :enable_responsive_rendering
99
+
100
+ # Prevents adding fonts to the output HTML document.
101
+ attr_accessor :exclude_fonts
102
+
103
+ # Attribute mapping from ruby-style variable name to JSON key.
104
+ def self.attribute_map
105
+ {
106
+ :'password' => :'password',
107
+ :'attachment_password' => :'attachmentPassword',
108
+ :'extract_text' => :'extractText',
109
+ :'render_comments' => :'renderComments',
110
+ :'render_hidden_pages' => :'renderHiddenPages',
111
+ :'transforms' => :'transforms',
112
+ :'default_font_name' => :'defaultFontName',
113
+ :'watermark' => :'watermark',
114
+ :'cells_options' => :'cellsOptions',
115
+ :'cad_options' => :'cadOptions',
116
+ :'email_options' => :'emailOptions',
117
+ :'words_options' => :'wordsOptions',
118
+ :'pdf_options' => :'pdfOptions',
119
+ :'slides_options' => :'slidesOptions',
120
+ :'project_options' => :'projectOptions',
121
+ :'start_page_number' => :'startPageNumber',
122
+ :'count_pages' => :'countPages',
123
+ :'resource_path' => :'resourcePath',
124
+ :'ignore_resource_path_in_resources' => :'ignoreResourcePathInResources',
125
+ :'embed_resources' => :'embedResources',
126
+ :'enable_minification' => :'enableMinification',
127
+ :'enable_responsive_rendering' => :'enableResponsiveRendering',
128
+ :'exclude_fonts' => :'excludeFonts'
129
+ }
130
+ end
131
+
132
+ # Attribute type mapping.
133
+ def self.swagger_types
134
+ {
135
+ :'password' => :'String',
136
+ :'attachment_password' => :'String',
137
+ :'extract_text' => :'BOOLEAN',
138
+ :'render_comments' => :'BOOLEAN',
139
+ :'render_hidden_pages' => :'BOOLEAN',
140
+ :'transforms' => :'Array<String>',
141
+ :'default_font_name' => :'String',
142
+ :'watermark' => :'Watermark',
143
+ :'cells_options' => :'CellsOptions',
144
+ :'cad_options' => :'CadOptions',
145
+ :'email_options' => :'EmailOptions',
146
+ :'words_options' => :'WordsOptions',
147
+ :'pdf_options' => :'PdfOptions',
148
+ :'slides_options' => :'SlidesOptions',
149
+ :'project_options' => :'ProjectOptions',
150
+ :'start_page_number' => :'Integer',
151
+ :'count_pages' => :'Integer',
152
+ :'resource_path' => :'String',
153
+ :'ignore_resource_path_in_resources' => :'BOOLEAN',
154
+ :'embed_resources' => :'BOOLEAN',
155
+ :'enable_minification' => :'BOOLEAN',
156
+ :'enable_responsive_rendering' => :'BOOLEAN',
157
+ :'exclude_fonts' => :'BOOLEAN'
158
+ }
159
+ end
160
+
161
+ # Initializes the object
162
+ # @param [Hash] attributes Model attributes in the form of hash
163
+ def initialize(attributes = {})
164
+ return unless attributes.is_a?(Hash)
165
+
166
+ # convert string to symbol for hash key
167
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
168
+
169
+ if attributes.key?(:'password')
170
+ self.password = attributes[:'password']
171
+ end
172
+
173
+ if attributes.key?(:'attachmentPassword')
174
+ self.attachment_password = attributes[:'attachmentPassword']
175
+ end
176
+
177
+ if attributes.key?(:'extractText')
178
+ self.extract_text = attributes[:'extractText']
179
+ end
180
+
181
+ if attributes.key?(:'renderComments')
182
+ self.render_comments = attributes[:'renderComments']
183
+ end
184
+
185
+ if attributes.key?(:'renderHiddenPages')
186
+ self.render_hidden_pages = attributes[:'renderHiddenPages']
187
+ end
188
+
189
+ if attributes.key?(:'transforms')
190
+ if (value = attributes[:'transforms']).is_a?(Array)
191
+ self.transforms = value
192
+ end
193
+ end
194
+
195
+ if attributes.key?(:'defaultFontName')
196
+ self.default_font_name = attributes[:'defaultFontName']
197
+ end
198
+
199
+ if attributes.key?(:'watermark')
200
+ self.watermark = attributes[:'watermark']
201
+ end
202
+
203
+ if attributes.key?(:'cellsOptions')
204
+ self.cells_options = attributes[:'cellsOptions']
205
+ end
206
+
207
+ if attributes.key?(:'cadOptions')
208
+ self.cad_options = attributes[:'cadOptions']
209
+ end
210
+
211
+ if attributes.key?(:'emailOptions')
212
+ self.email_options = attributes[:'emailOptions']
213
+ end
214
+
215
+ if attributes.key?(:'wordsOptions')
216
+ self.words_options = attributes[:'wordsOptions']
217
+ end
218
+
219
+ if attributes.key?(:'pdfOptions')
220
+ self.pdf_options = attributes[:'pdfOptions']
221
+ end
222
+
223
+ if attributes.key?(:'slidesOptions')
224
+ self.slides_options = attributes[:'slidesOptions']
225
+ end
226
+
227
+ if attributes.key?(:'projectOptions')
228
+ self.project_options = attributes[:'projectOptions']
229
+ end
230
+
231
+ if attributes.key?(:'startPageNumber')
232
+ self.start_page_number = attributes[:'startPageNumber']
233
+ end
234
+
235
+ if attributes.key?(:'countPages')
236
+ self.count_pages = attributes[:'countPages']
237
+ end
238
+
239
+ if attributes.key?(:'resourcePath')
240
+ self.resource_path = attributes[:'resourcePath']
241
+ end
242
+
243
+ if attributes.key?(:'ignoreResourcePathInResources')
244
+ self.ignore_resource_path_in_resources = attributes[:'ignoreResourcePathInResources']
245
+ end
246
+
247
+ if attributes.key?(:'embedResources')
248
+ self.embed_resources = attributes[:'embedResources']
249
+ end
250
+
251
+ if attributes.key?(:'enableMinification')
252
+ self.enable_minification = attributes[:'enableMinification']
253
+ end
254
+
255
+ if attributes.key?(:'enableResponsiveRendering')
256
+ self.enable_responsive_rendering = attributes[:'enableResponsiveRendering']
257
+ end
258
+
259
+ if attributes.key?(:'excludeFonts')
260
+ self.exclude_fonts = attributes[:'excludeFonts']
261
+ end
262
+
263
+ end
264
+
265
+ # Show invalid properties with the reasons. Usually used together with valid?
266
+ # @return Array for valid properies with the reasons
267
+ def list_invalid_properties
268
+ invalid_properties = []
269
+ return invalid_properties
270
+ end
271
+
272
+ # Check to see if the all the properties in the model are valid
273
+ # @return true if the model is valid
274
+ def valid?
275
+ return true
276
+ end
277
+
278
+ # Checks equality by comparing each attribute.
279
+ # @param [Object] Object to be compared
280
+ def ==(other)
281
+ return true if self.equal?(other)
282
+ self.class == other.class &&
283
+ password == other.password &&
284
+ attachment_password == other.attachment_password &&
285
+ extract_text == other.extract_text &&
286
+ render_comments == other.render_comments &&
287
+ render_hidden_pages == other.render_hidden_pages &&
288
+ transforms == other.transforms &&
289
+ default_font_name == other.default_font_name &&
290
+ watermark == other.watermark &&
291
+ cells_options == other.cells_options &&
292
+ cad_options == other.cad_options &&
293
+ email_options == other.email_options &&
294
+ words_options == other.words_options &&
295
+ pdf_options == other.pdf_options &&
296
+ slides_options == other.slides_options &&
297
+ project_options == other.project_options &&
298
+ start_page_number == other.start_page_number &&
299
+ count_pages == other.count_pages &&
300
+ resource_path == other.resource_path &&
301
+ ignore_resource_path_in_resources == other.ignore_resource_path_in_resources &&
302
+ embed_resources == other.embed_resources &&
303
+ enable_minification == other.enable_minification &&
304
+ enable_responsive_rendering == other.enable_responsive_rendering &&
305
+ exclude_fonts == other.exclude_fonts
306
+ end
307
+
308
+ # @see the `==` method
309
+ # @param [Object] Object to be compared
310
+ def eql?(other)
311
+ self == other
312
+ end
313
+
314
+ # Calculates hash code according to all attributes.
315
+ # @return [Fixnum] Hash code
316
+ def hash
317
+ [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, resource_path, ignore_resource_path_in_resources, embed_resources, enable_minification, enable_responsive_rendering, exclude_fonts].hash
318
+ end
319
+
320
+ # Builds the object from hash
321
+ # @param [Hash] attributes Model attributes in the form of hash
322
+ # @return [Object] Returns the model itself
323
+ def build_from_hash(attributes)
324
+ return nil unless attributes.is_a?(Hash)
325
+ self.class.swagger_types.each_pair do |key, type|
326
+ if type =~ /\AArray<(.*)>/i
327
+ # check to ensure the input is an array given that the the attribute
328
+ # is documented as an array but the input is not
329
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
330
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
331
+ end
332
+ elsif !attributes[self.class.attribute_map[key]].nil?
333
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
334
+ end
335
+ # or else data not found in attributes(hash), not an issue as the data can be optional
336
+ end
337
+
338
+ self
339
+ end
340
+
341
+ # Deserializes the data based on type
342
+ # @param string type Data type
343
+ # @param string value Value to be deserialized
344
+ # @return [Object] Deserialized data
345
+ def _deserialize(type, value)
346
+ case type.to_sym
347
+ when :DateTime
348
+ Time.at(/\d/.match(value)[0].to_f).to_datetime
349
+ when :Date
350
+ Time.at(/\d/.match(value)[0].to_f).to_date
351
+ when :String
352
+ value.to_s
353
+ when :Integer
354
+ value.to_i
355
+ when :Float
356
+ value.to_f
357
+ when :BOOLEAN
358
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
359
+ true
360
+ else
361
+ false
362
+ end
363
+ when :Object
364
+ # generic object (usually a Hash), return directly
365
+ value
366
+ when /\AArray<(?<inner_type>.+)>\z/
367
+ inner_type = Regexp.last_match[:inner_type]
368
+ value.map { |v| _deserialize(inner_type, v) }
369
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
370
+ k_type = Regexp.last_match[:k_type]
371
+ v_type = Regexp.last_match[:v_type]
372
+ {}.tap do |hash|
373
+ value.each do |k, v|
374
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
375
+ end
376
+ end
377
+ else
378
+ # model
379
+ temp_model = GroupDocsViewerCloud.const_get(type).new
380
+ temp_model.build_from_hash(value)
381
+ end
382
+ end
383
+
384
+ # Returns the string representation of the object
385
+ # @return [String] String presentation of the object
386
+ def to_s
387
+ to_hash.to_s
388
+ end
389
+
390
+ # to_body is an alias to to_hash (backward compatibility)
391
+ # @return [Hash] Returns the object in the form of hash
392
+ def to_body
393
+ to_hash
394
+ end
395
+
396
+ # Returns the object in the form of hash
397
+ # @return [Hash] Returns the object in the form of hash
398
+ def to_hash
399
+ hash = {}
400
+ self.class.attribute_map.each_pair do |attr, param|
401
+ value = self.send(attr)
402
+ next if value.nil?
403
+ hash[param] = _to_hash(value)
404
+ end
405
+ hash
406
+ end
407
+
408
+ # Outputs non-array value in the form of hash
409
+ # For object, use to_hash. Otherwise, just return the value
410
+ # @param [Object] value Any valid value
411
+ # @return [Hash] Returns the value in the form of hash
412
+ def _to_hash(value)
413
+ if value.is_a?(Array)
414
+ value.compact.map { |v| _to_hash(v) }
415
+ elsif value.is_a?(Hash)
416
+ {}.tap do |hash|
417
+ value.each { |k, v| hash[k] = _to_hash(v) }
418
+ end
419
+ elsif value.respond_to? :to_hash
420
+ value.to_hash
421
+ else
422
+ value
423
+ end
424
+ end
425
+
426
+ end
427
+
428
+ end