groupdocs_viewer_cloud 18.7
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 +7 -0
- data/lib/groupdocs_viewer_cloud.rb +104 -0
- data/lib/groupdocs_viewer_cloud/api/viewer_api.rb +5296 -0
- data/lib/groupdocs_viewer_cloud/api_client.rb +390 -0
- data/lib/groupdocs_viewer_cloud/api_error.rb +56 -0
- data/lib/groupdocs_viewer_cloud/configuration.rb +95 -0
- data/lib/groupdocs_viewer_cloud/models/attachment.rb +216 -0
- data/lib/groupdocs_viewer_cloud/models/attachment_collection.rb +228 -0
- data/lib/groupdocs_viewer_cloud/models/attachment_info.rb +226 -0
- data/lib/groupdocs_viewer_cloud/models/cad_options.rb +270 -0
- data/lib/groupdocs_viewer_cloud/models/cells_options.rb +296 -0
- data/lib/groupdocs_viewer_cloud/models/document_info.rb +282 -0
- data/lib/groupdocs_viewer_cloud/models/document_info_options.rb +348 -0
- data/lib/groupdocs_viewer_cloud/models/email_options.rb +228 -0
- data/lib/groupdocs_viewer_cloud/models/field_label.rb +216 -0
- data/lib/groupdocs_viewer_cloud/models/file_response.rb +196 -0
- data/lib/groupdocs_viewer_cloud/models/font_collection.rb +208 -0
- data/lib/groupdocs_viewer_cloud/models/font_family.rb +206 -0
- data/lib/groupdocs_viewer_cloud/models/format.rb +216 -0
- data/lib/groupdocs_viewer_cloud/models/format_collection.rb +208 -0
- data/lib/groupdocs_viewer_cloud/models/html_attachment_page_collection.rb +238 -0
- data/lib/groupdocs_viewer_cloud/models/html_options.rb +428 -0
- data/lib/groupdocs_viewer_cloud/models/html_page.rb +228 -0
- data/lib/groupdocs_viewer_cloud/models/html_page_collection.rb +228 -0
- data/lib/groupdocs_viewer_cloud/models/image_attachment_page_collection.rb +238 -0
- data/lib/groupdocs_viewer_cloud/models/image_options.rb +408 -0
- data/lib/groupdocs_viewer_cloud/models/image_page.rb +216 -0
- data/lib/groupdocs_viewer_cloud/models/image_page_collection.rb +238 -0
- data/lib/groupdocs_viewer_cloud/models/page_info.rb +268 -0
- data/lib/groupdocs_viewer_cloud/models/page_info_collection.rb +208 -0
- data/lib/groupdocs_viewer_cloud/models/pdf_file_info.rb +236 -0
- data/lib/groupdocs_viewer_cloud/models/pdf_file_options.rb +348 -0
- data/lib/groupdocs_viewer_cloud/models/pdf_options.rb +236 -0
- data/lib/groupdocs_viewer_cloud/models/project_options.rb +216 -0
- data/lib/groupdocs_viewer_cloud/models/render_options.rb +368 -0
- data/lib/groupdocs_viewer_cloud/models/render_options_base.rb +348 -0
- data/lib/groupdocs_viewer_cloud/models/reorder_options.rb +226 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_create_attachment_pages_cache_request.rb +65 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_create_pages_cache_from_content_request.rb +65 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_create_pages_cache_from_url_request.rb +65 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_create_pages_cache_request.rb +61 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_create_pdf_file_from_content_request.rb +65 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_create_pdf_file_from_url_request.rb +65 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_create_pdf_file_request.rb +61 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_delete_attachment_pages_cache_request.rb +57 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_delete_pages_cache_request.rb +53 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_info_request.rb +65 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_info_with_options_request.rb +61 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_page_request.rb +109 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_page_resource_request.rb +65 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_pages_request.rb +113 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_request.rb +61 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachments_request.rb +57 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_from_content_request.rb +61 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_from_url_request.rb +69 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_from_url_with_options_request.rb +61 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_request.rb +65 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_with_options_request.rb +57 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_page_request.rb +101 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_page_resource_request.rb +61 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_pages_from_url_request.rb +109 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_pages_request.rb +105 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_pdf_file_from_url_request.rb +77 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_pdf_file_request.rb +73 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_zip_with_attachment_pages_request.rb +113 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_zip_with_pages_request.rb +105 -0
- data/lib/groupdocs_viewer_cloud/models/requests/html_transform_pages_request.rb +57 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_create_attachment_pages_cache_request.rb +65 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_create_pages_cache_from_content_request.rb +65 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_create_pages_cache_from_url_request.rb +65 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_create_pages_cache_request.rb +61 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_create_pdf_file_from_content_request.rb +65 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_create_pdf_file_from_url_request.rb +65 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_create_pdf_file_request.rb +61 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_delete_attachment_pages_cache_request.rb +57 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_delete_pages_cache_request.rb +53 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_info_request.rb +69 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_info_with_options_request.rb +61 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_page_request.rb +105 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_pages_request.rb +109 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_request.rb +61 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachments_request.rb +57 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_from_content_request.rb +61 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_from_url_request.rb +73 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_from_url_with_options_request.rb +61 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_request.rb +69 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_with_options_request.rb +57 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_page_request.rb +97 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_pages_from_url_request.rb +105 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_pages_request.rb +101 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_pdf_file_from_url_request.rb +77 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_pdf_file_request.rb +73 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_zip_with_attachment_pages_request.rb +109 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_zip_with_pages_request.rb +101 -0
- data/lib/groupdocs_viewer_cloud/models/requests/image_transform_pages_request.rb +57 -0
- data/lib/groupdocs_viewer_cloud/models/resource.rb +216 -0
- data/lib/groupdocs_viewer_cloud/models/resource_url.rb +206 -0
- data/lib/groupdocs_viewer_cloud/models/rotate_options.rb +226 -0
- data/lib/groupdocs_viewer_cloud/models/row_info.rb +270 -0
- data/lib/groupdocs_viewer_cloud/models/slides_options.rb +206 -0
- data/lib/groupdocs_viewer_cloud/models/tile.rb +236 -0
- data/lib/groupdocs_viewer_cloud/models/transform_options_base.rb +216 -0
- data/lib/groupdocs_viewer_cloud/models/watermark.rb +236 -0
- data/lib/groupdocs_viewer_cloud/models/words_options.rb +216 -0
- data/lib/groupdocs_viewer_cloud/version.rb +29 -0
- metadata +235 -0
@@ -0,0 +1,228 @@
|
|
1
|
+
#
|
2
|
+
# --------------------------------------------------------------------------------------------------------------------
|
3
|
+
# <copyright company="Aspose Pty Ltd" file="email_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
|
+
# The Email documents rendering options.
|
32
|
+
class EmailOptions
|
33
|
+
|
34
|
+
# The document encoding e.g. \"utf-8\".
|
35
|
+
attr_accessor :encoding
|
36
|
+
|
37
|
+
# The size of the output page when rendering as PDF or image. Supported values {Unknown|Letter|Ledger|A0|A1|A2|A3}: 1. Unknown - the default, unspecified page size. 2. Letter - the size of the Letter page in points is 792x612. 3. Ledger - the size of the Letter page in points is 1224x792. 4. A0 - the size of the A0 page in points is 3371x2384. 5. A1 - the size of the A1 page in points is 2384x1685. 6. A2 - the size of the A2 page in points is 1684x1190. 7. A3 - the size of the A3 page in points is 1190x842. 8. A4 - the size of the A4 page in points is 842x595.
|
38
|
+
attr_accessor :page_size
|
39
|
+
|
40
|
+
# The list of supported email message field labels: 1. Field: \"Anniversary\" - default value is \"Anniversary\". 2. Field: \"Attachments\" - default value is \"Attachments\". 3. Field: \"Bcc\" - default value is \"Bcc\". 4. Field: \"Birthday\" - default value is \"Birthday\". 5. Field: \"Business\" - default value is \"Business\". 6. Field: \"BusinessAddress\" - default value is \"Business Address\". 7. Field: \"BusinessFax\" - default value is \"Business Fax\". 8. Field: \"BusinessHomepage\" - default value is \"BusinessHomePage\". 9. Field: \"Cc\" - default value is \"Cc\". 10. Field: \"Company\" - default value is \"Company\". 11. Field: \"Department\" - default value is \"Department\". 12. Field: \"Email\" - default value is \"Email\". 13. Field: \"EmailDisplayAs\" - default value is \"Email Display As\". 14. Field: \"Email2\" - default value is \"Email2\". 15. Field: \"Email2DisplayAs\" - default value is \"Email2 Display As\". 16. Field: \"Email3\" - default value is \"Email3\". 17. Field: \"Email3DisplayAs\" - default value is \"Email3 Display As\". 18. Field: \"End\" - default value is \"End\". 19. Field: \"FirstName\" - default value is \"First Name\". 20. Field: \"From\" - default value is \"From\". 21. Field: \"FullName\" - default value is \"Full Name\". 22. Field: \"Gender\" - default value is \"Gender\". 23. Field: \"Hobbies\" - default value is \"Hobbies\". 24. Field: \"Home\" - default value is \"Home\". 25. Field: \"HomeAddress\" - default value is \"Home Address\". 26. Field: \"Importance\" - default value is \"Importance\". 27. Field: \"JobTitle\" - default value is \"Job Title\". 28. Field: \"LastName\" - default value is \"Last Name\". 29. Field: \"Location\" - default value is \"Location\". 30. Field: \"MiddleName\" - default value is \"Middle Name\". 31. Field: \"Mobile\" - default value is \"Mobile\". 32. Field: \"Organizer\" - default value is \"Organizer\". 33. Field: \"OtherAddress\" - default value is \"Other Address\". 34. Field: \"PersonalHomepage\" - default value is \"PersonalHomePage\". 35. Field: \"Profession\" - default value is \"Profession\". 36. Field: \"Recurrence\" - default value is \"Recurrence\". 37. Field: \"RecurrencePattern\" - default value is \"Recurrence Pattern\". 38. Field: \"RequiredAttendees\" - default value is \"Required Attendees\". 39. Field: \"Sent\" - default value is \"Sent\". 40. Field: \"ShowTimeAs\" - default value is \"Show Time As\". 41. Field: \"SpousePartner\" - default value is \"Spouse/Partner\". 42. Field: \"Start\" - default value is \"Start\". 43. Field: \"Subject\" - default value is \"Subject\". 44. Field: \"To\" - default value is \"To\". 45. Field: \"UserField1\" - default value is \"User Field 1\". 46. Field: \"UserField2\" - default value is \"User Field 2\". 47. Field: \"UserField3\" - default value is \"User Field 3\". 48. Field: \"UserField4\" - default value is \"User Field 4\".
|
41
|
+
attr_accessor :field_labels
|
42
|
+
|
43
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
44
|
+
def self.attribute_map
|
45
|
+
{
|
46
|
+
:'encoding' => :'encoding',
|
47
|
+
:'page_size' => :'pageSize',
|
48
|
+
:'field_labels' => :'fieldLabels'
|
49
|
+
}
|
50
|
+
end
|
51
|
+
|
52
|
+
# Attribute type mapping.
|
53
|
+
def self.swagger_types
|
54
|
+
{
|
55
|
+
:'encoding' => :'String',
|
56
|
+
:'page_size' => :'String',
|
57
|
+
:'field_labels' => :'Array<FieldLabel>'
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
# Initializes the object
|
62
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
63
|
+
def initialize(attributes = {})
|
64
|
+
return unless attributes.is_a?(Hash)
|
65
|
+
|
66
|
+
# convert string to symbol for hash key
|
67
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
68
|
+
|
69
|
+
if attributes.key?(:'encoding')
|
70
|
+
self.encoding = attributes[:'encoding']
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.key?(:'pageSize')
|
74
|
+
self.page_size = attributes[:'pageSize']
|
75
|
+
end
|
76
|
+
|
77
|
+
if attributes.key?(:'fieldLabels')
|
78
|
+
if (value = attributes[:'fieldLabels']).is_a?(Array)
|
79
|
+
self.field_labels = value
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
84
|
+
|
85
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
86
|
+
# @return Array for valid properies with the reasons
|
87
|
+
def list_invalid_properties
|
88
|
+
invalid_properties = []
|
89
|
+
return invalid_properties
|
90
|
+
end
|
91
|
+
|
92
|
+
# Check to see if the all the properties in the model are valid
|
93
|
+
# @return true if the model is valid
|
94
|
+
def valid?
|
95
|
+
return true
|
96
|
+
end
|
97
|
+
|
98
|
+
# Checks equality by comparing each attribute.
|
99
|
+
# @param [Object] Object to be compared
|
100
|
+
def ==(other)
|
101
|
+
return true if self.equal?(other)
|
102
|
+
self.class == other.class &&
|
103
|
+
encoding == other.encoding &&
|
104
|
+
page_size == other.page_size &&
|
105
|
+
field_labels == other.field_labels
|
106
|
+
end
|
107
|
+
|
108
|
+
# @see the `==` method
|
109
|
+
# @param [Object] Object to be compared
|
110
|
+
def eql?(other)
|
111
|
+
self == other
|
112
|
+
end
|
113
|
+
|
114
|
+
# Calculates hash code according to all attributes.
|
115
|
+
# @return [Fixnum] Hash code
|
116
|
+
def hash
|
117
|
+
[encoding, page_size, field_labels].hash
|
118
|
+
end
|
119
|
+
|
120
|
+
# Builds the object from hash
|
121
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
122
|
+
# @return [Object] Returns the model itself
|
123
|
+
def build_from_hash(attributes)
|
124
|
+
return nil unless attributes.is_a?(Hash)
|
125
|
+
self.class.swagger_types.each_pair do |key, type|
|
126
|
+
if type =~ /\AArray<(.*)>/i
|
127
|
+
# check to ensure the input is an array given that the the attribute
|
128
|
+
# is documented as an array but the input is not
|
129
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
130
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
131
|
+
end
|
132
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
133
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
134
|
+
end
|
135
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
136
|
+
end
|
137
|
+
|
138
|
+
self
|
139
|
+
end
|
140
|
+
|
141
|
+
# Deserializes the data based on type
|
142
|
+
# @param string type Data type
|
143
|
+
# @param string value Value to be deserialized
|
144
|
+
# @return [Object] Deserialized data
|
145
|
+
def _deserialize(type, value)
|
146
|
+
case type.to_sym
|
147
|
+
when :DateTime
|
148
|
+
Time.at(/\d/.match(value)[0].to_f).to_datetime
|
149
|
+
when :Date
|
150
|
+
Time.at(/\d/.match(value)[0].to_f).to_date
|
151
|
+
when :String
|
152
|
+
value.to_s
|
153
|
+
when :Integer
|
154
|
+
value.to_i
|
155
|
+
when :Float
|
156
|
+
value.to_f
|
157
|
+
when :BOOLEAN
|
158
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
159
|
+
true
|
160
|
+
else
|
161
|
+
false
|
162
|
+
end
|
163
|
+
when :Object
|
164
|
+
# generic object (usually a Hash), return directly
|
165
|
+
value
|
166
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
167
|
+
inner_type = Regexp.last_match[:inner_type]
|
168
|
+
value.map { |v| _deserialize(inner_type, v) }
|
169
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
170
|
+
k_type = Regexp.last_match[:k_type]
|
171
|
+
v_type = Regexp.last_match[:v_type]
|
172
|
+
{}.tap do |hash|
|
173
|
+
value.each do |k, v|
|
174
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
175
|
+
end
|
176
|
+
end
|
177
|
+
else
|
178
|
+
# model
|
179
|
+
temp_model = GroupDocsViewerCloud.const_get(type).new
|
180
|
+
temp_model.build_from_hash(value)
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
# Returns the string representation of the object
|
185
|
+
# @return [String] String presentation of the object
|
186
|
+
def to_s
|
187
|
+
to_hash.to_s
|
188
|
+
end
|
189
|
+
|
190
|
+
# to_body is an alias to to_hash (backward compatibility)
|
191
|
+
# @return [Hash] Returns the object in the form of hash
|
192
|
+
def to_body
|
193
|
+
to_hash
|
194
|
+
end
|
195
|
+
|
196
|
+
# Returns the object in the form of hash
|
197
|
+
# @return [Hash] Returns the object in the form of hash
|
198
|
+
def to_hash
|
199
|
+
hash = {}
|
200
|
+
self.class.attribute_map.each_pair do |attr, param|
|
201
|
+
value = self.send(attr)
|
202
|
+
next if value.nil?
|
203
|
+
hash[param] = _to_hash(value)
|
204
|
+
end
|
205
|
+
hash
|
206
|
+
end
|
207
|
+
|
208
|
+
# Outputs non-array value in the form of hash
|
209
|
+
# For object, use to_hash. Otherwise, just return the value
|
210
|
+
# @param [Object] value Any valid value
|
211
|
+
# @return [Hash] Returns the value in the form of hash
|
212
|
+
def _to_hash(value)
|
213
|
+
if value.is_a?(Array)
|
214
|
+
value.compact.map { |v| _to_hash(v) }
|
215
|
+
elsif value.is_a?(Hash)
|
216
|
+
{}.tap do |hash|
|
217
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
218
|
+
end
|
219
|
+
elsif value.respond_to? :to_hash
|
220
|
+
value.to_hash
|
221
|
+
else
|
222
|
+
value
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
226
|
+
end
|
227
|
+
|
228
|
+
end
|
@@ -0,0 +1,216 @@
|
|
1
|
+
#
|
2
|
+
# --------------------------------------------------------------------------------------------------------------------
|
3
|
+
# <copyright company="Aspose Pty Ltd" file="field_label.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
|
+
# Represents field label
|
32
|
+
class FieldLabel
|
33
|
+
|
34
|
+
# The field name e.g. \"From\"
|
35
|
+
attr_accessor :field
|
36
|
+
|
37
|
+
# The label e.g. \"Sender\"
|
38
|
+
attr_accessor :label
|
39
|
+
|
40
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
41
|
+
def self.attribute_map
|
42
|
+
{
|
43
|
+
:'field' => :'field',
|
44
|
+
:'label' => :'label'
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# Attribute type mapping.
|
49
|
+
def self.swagger_types
|
50
|
+
{
|
51
|
+
:'field' => :'String',
|
52
|
+
:'label' => :'String'
|
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?(:'field')
|
65
|
+
self.field = attributes[:'field']
|
66
|
+
end
|
67
|
+
|
68
|
+
if attributes.key?(:'label')
|
69
|
+
self.label = attributes[:'label']
|
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
|
+
return invalid_properties
|
79
|
+
end
|
80
|
+
|
81
|
+
# Check to see if the all the properties in the model are valid
|
82
|
+
# @return true if the model is valid
|
83
|
+
def valid?
|
84
|
+
return true
|
85
|
+
end
|
86
|
+
|
87
|
+
# Checks equality by comparing each attribute.
|
88
|
+
# @param [Object] Object to be compared
|
89
|
+
def ==(other)
|
90
|
+
return true if self.equal?(other)
|
91
|
+
self.class == other.class &&
|
92
|
+
field == other.field &&
|
93
|
+
label == other.label
|
94
|
+
end
|
95
|
+
|
96
|
+
# @see the `==` method
|
97
|
+
# @param [Object] Object to be compared
|
98
|
+
def eql?(other)
|
99
|
+
self == other
|
100
|
+
end
|
101
|
+
|
102
|
+
# Calculates hash code according to all attributes.
|
103
|
+
# @return [Fixnum] Hash code
|
104
|
+
def hash
|
105
|
+
[field, label].hash
|
106
|
+
end
|
107
|
+
|
108
|
+
# Builds the object from hash
|
109
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
110
|
+
# @return [Object] Returns the model itself
|
111
|
+
def build_from_hash(attributes)
|
112
|
+
return nil unless attributes.is_a?(Hash)
|
113
|
+
self.class.swagger_types.each_pair do |key, type|
|
114
|
+
if type =~ /\AArray<(.*)>/i
|
115
|
+
# check to ensure the input is an array given that the the attribute
|
116
|
+
# is documented as an array but the input is not
|
117
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
118
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
119
|
+
end
|
120
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
121
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
122
|
+
end
|
123
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
124
|
+
end
|
125
|
+
|
126
|
+
self
|
127
|
+
end
|
128
|
+
|
129
|
+
# Deserializes the data based on type
|
130
|
+
# @param string type Data type
|
131
|
+
# @param string value Value to be deserialized
|
132
|
+
# @return [Object] Deserialized data
|
133
|
+
def _deserialize(type, value)
|
134
|
+
case type.to_sym
|
135
|
+
when :DateTime
|
136
|
+
Time.at(/\d/.match(value)[0].to_f).to_datetime
|
137
|
+
when :Date
|
138
|
+
Time.at(/\d/.match(value)[0].to_f).to_date
|
139
|
+
when :String
|
140
|
+
value.to_s
|
141
|
+
when :Integer
|
142
|
+
value.to_i
|
143
|
+
when :Float
|
144
|
+
value.to_f
|
145
|
+
when :BOOLEAN
|
146
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
147
|
+
true
|
148
|
+
else
|
149
|
+
false
|
150
|
+
end
|
151
|
+
when :Object
|
152
|
+
# generic object (usually a Hash), return directly
|
153
|
+
value
|
154
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
155
|
+
inner_type = Regexp.last_match[:inner_type]
|
156
|
+
value.map { |v| _deserialize(inner_type, v) }
|
157
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
158
|
+
k_type = Regexp.last_match[:k_type]
|
159
|
+
v_type = Regexp.last_match[:v_type]
|
160
|
+
{}.tap do |hash|
|
161
|
+
value.each do |k, v|
|
162
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
163
|
+
end
|
164
|
+
end
|
165
|
+
else
|
166
|
+
# model
|
167
|
+
temp_model = GroupDocsViewerCloud.const_get(type).new
|
168
|
+
temp_model.build_from_hash(value)
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
# Returns the string representation of the object
|
173
|
+
# @return [String] String presentation of the object
|
174
|
+
def to_s
|
175
|
+
to_hash.to_s
|
176
|
+
end
|
177
|
+
|
178
|
+
# to_body is an alias to to_hash (backward compatibility)
|
179
|
+
# @return [Hash] Returns the object in the form of hash
|
180
|
+
def to_body
|
181
|
+
to_hash
|
182
|
+
end
|
183
|
+
|
184
|
+
# Returns the object in the form of hash
|
185
|
+
# @return [Hash] Returns the object in the form of hash
|
186
|
+
def to_hash
|
187
|
+
hash = {}
|
188
|
+
self.class.attribute_map.each_pair do |attr, param|
|
189
|
+
value = self.send(attr)
|
190
|
+
next if value.nil?
|
191
|
+
hash[param] = _to_hash(value)
|
192
|
+
end
|
193
|
+
hash
|
194
|
+
end
|
195
|
+
|
196
|
+
# Outputs non-array value in the form of hash
|
197
|
+
# For object, use to_hash. Otherwise, just return the value
|
198
|
+
# @param [Object] value Any valid value
|
199
|
+
# @return [Hash] Returns the value in the form of hash
|
200
|
+
def _to_hash(value)
|
201
|
+
if value.is_a?(Array)
|
202
|
+
value.compact.map { |v| _to_hash(v) }
|
203
|
+
elsif value.is_a?(Hash)
|
204
|
+
{}.tap do |hash|
|
205
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
206
|
+
end
|
207
|
+
elsif value.respond_to? :to_hash
|
208
|
+
value.to_hash
|
209
|
+
else
|
210
|
+
value
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
end
|
215
|
+
|
216
|
+
end
|
@@ -0,0 +1,196 @@
|
|
1
|
+
#
|
2
|
+
# --------------------------------------------------------------------------------------------------------------------
|
3
|
+
# <copyright company="Aspose Pty Ltd" file="file_response.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
|
+
# The empty type used as a flag.
|
32
|
+
class FileResponse
|
33
|
+
|
34
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
35
|
+
def self.attribute_map
|
36
|
+
{
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# Attribute type mapping.
|
41
|
+
def self.swagger_types
|
42
|
+
{
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
# Initializes the object
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
48
|
+
def initialize(attributes = {})
|
49
|
+
return unless attributes.is_a?(Hash)
|
50
|
+
|
51
|
+
# convert string to symbol for hash key
|
52
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
57
|
+
# @return Array for valid properies with the reasons
|
58
|
+
def list_invalid_properties
|
59
|
+
invalid_properties = []
|
60
|
+
return invalid_properties
|
61
|
+
end
|
62
|
+
|
63
|
+
# Check to see if the all the properties in the model are valid
|
64
|
+
# @return true if the model is valid
|
65
|
+
def valid?
|
66
|
+
return true
|
67
|
+
end
|
68
|
+
|
69
|
+
# Checks equality by comparing each attribute.
|
70
|
+
# @param [Object] Object to be compared
|
71
|
+
def ==(other)
|
72
|
+
return true if self.equal?(other)
|
73
|
+
self.class == other.class
|
74
|
+
end
|
75
|
+
|
76
|
+
# @see the `==` method
|
77
|
+
# @param [Object] Object to be compared
|
78
|
+
def eql?(other)
|
79
|
+
self == other
|
80
|
+
end
|
81
|
+
|
82
|
+
# Calculates hash code according to all attributes.
|
83
|
+
# @return [Fixnum] Hash code
|
84
|
+
def hash
|
85
|
+
[].hash
|
86
|
+
end
|
87
|
+
|
88
|
+
# Builds the object from hash
|
89
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
90
|
+
# @return [Object] Returns the model itself
|
91
|
+
def build_from_hash(attributes)
|
92
|
+
return nil unless attributes.is_a?(Hash)
|
93
|
+
self.class.swagger_types.each_pair do |key, type|
|
94
|
+
if type =~ /\AArray<(.*)>/i
|
95
|
+
# check to ensure the input is an array given that the the attribute
|
96
|
+
# is documented as an array but the input is not
|
97
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
98
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
99
|
+
end
|
100
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
101
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
102
|
+
end
|
103
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
104
|
+
end
|
105
|
+
|
106
|
+
self
|
107
|
+
end
|
108
|
+
|
109
|
+
# Deserializes the data based on type
|
110
|
+
# @param string type Data type
|
111
|
+
# @param string value Value to be deserialized
|
112
|
+
# @return [Object] Deserialized data
|
113
|
+
def _deserialize(type, value)
|
114
|
+
case type.to_sym
|
115
|
+
when :DateTime
|
116
|
+
Time.at(/\d/.match(value)[0].to_f).to_datetime
|
117
|
+
when :Date
|
118
|
+
Time.at(/\d/.match(value)[0].to_f).to_date
|
119
|
+
when :String
|
120
|
+
value.to_s
|
121
|
+
when :Integer
|
122
|
+
value.to_i
|
123
|
+
when :Float
|
124
|
+
value.to_f
|
125
|
+
when :BOOLEAN
|
126
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
127
|
+
true
|
128
|
+
else
|
129
|
+
false
|
130
|
+
end
|
131
|
+
when :Object
|
132
|
+
# generic object (usually a Hash), return directly
|
133
|
+
value
|
134
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
135
|
+
inner_type = Regexp.last_match[:inner_type]
|
136
|
+
value.map { |v| _deserialize(inner_type, v) }
|
137
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
138
|
+
k_type = Regexp.last_match[:k_type]
|
139
|
+
v_type = Regexp.last_match[:v_type]
|
140
|
+
{}.tap do |hash|
|
141
|
+
value.each do |k, v|
|
142
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
143
|
+
end
|
144
|
+
end
|
145
|
+
else
|
146
|
+
# model
|
147
|
+
temp_model = GroupDocsViewerCloud.const_get(type).new
|
148
|
+
temp_model.build_from_hash(value)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
# Returns the string representation of the object
|
153
|
+
# @return [String] String presentation of the object
|
154
|
+
def to_s
|
155
|
+
to_hash.to_s
|
156
|
+
end
|
157
|
+
|
158
|
+
# to_body is an alias to to_hash (backward compatibility)
|
159
|
+
# @return [Hash] Returns the object in the form of hash
|
160
|
+
def to_body
|
161
|
+
to_hash
|
162
|
+
end
|
163
|
+
|
164
|
+
# Returns the object in the form of hash
|
165
|
+
# @return [Hash] Returns the object in the form of hash
|
166
|
+
def to_hash
|
167
|
+
hash = {}
|
168
|
+
self.class.attribute_map.each_pair do |attr, param|
|
169
|
+
value = self.send(attr)
|
170
|
+
next if value.nil?
|
171
|
+
hash[param] = _to_hash(value)
|
172
|
+
end
|
173
|
+
hash
|
174
|
+
end
|
175
|
+
|
176
|
+
# Outputs non-array value in the form of hash
|
177
|
+
# For object, use to_hash. Otherwise, just return the value
|
178
|
+
# @param [Object] value Any valid value
|
179
|
+
# @return [Hash] Returns the value in the form of hash
|
180
|
+
def _to_hash(value)
|
181
|
+
if value.is_a?(Array)
|
182
|
+
value.compact.map { |v| _to_hash(v) }
|
183
|
+
elsif value.is_a?(Hash)
|
184
|
+
{}.tap do |hash|
|
185
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
186
|
+
end
|
187
|
+
elsif value.respond_to? :to_hash
|
188
|
+
value.to_hash
|
189
|
+
else
|
190
|
+
value
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
end
|
195
|
+
|
196
|
+
end
|