groupdocs_viewer_cloud 18.11 → 19.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/groupdocs_viewer_cloud.rb +27 -32
- data/lib/groupdocs_viewer_cloud/api/file_api.rb +729 -0
- data/lib/groupdocs_viewer_cloud/api/folder_api.rb +694 -0
- data/lib/groupdocs_viewer_cloud/api/storage_api.rb +541 -0
- data/lib/groupdocs_viewer_cloud/api/viewer_api.rb +232 -5069
- data/lib/groupdocs_viewer_cloud/api_client.rb +5 -5
- data/lib/groupdocs_viewer_cloud/api_error.rb +6 -6
- data/lib/groupdocs_viewer_cloud/configuration.rb +4 -4
- data/lib/groupdocs_viewer_cloud/models/attachment_info.rb +22 -34
- data/lib/groupdocs_viewer_cloud/models/{html_page.rb → attachment_view.rb} +39 -33
- data/lib/groupdocs_viewer_cloud/models/cad_options.rb +44 -65
- data/lib/groupdocs_viewer_cloud/models/{font_family.rb → delete_view_options.rb} +25 -17
- data/lib/groupdocs_viewer_cloud/models/{reorder_options.rb → disc_usage.rb} +42 -34
- data/lib/groupdocs_viewer_cloud/models/email_options.rb +23 -25
- data/lib/groupdocs_viewer_cloud/models/{image_page_collection.rb → error.rb} +46 -40
- data/lib/groupdocs_viewer_cloud/models/{outlook_options.rb → error_details.rb} +40 -17
- data/lib/groupdocs_viewer_cloud/models/field_label.rb +20 -12
- data/lib/groupdocs_viewer_cloud/models/{transform_options_base.rb → file_info.rb} +49 -21
- data/lib/groupdocs_viewer_cloud/models/{html_attachment_page_collection.rb → file_version.rb} +91 -40
- data/lib/groupdocs_viewer_cloud/models/{page_info_collection.rb → file_versions.rb} +26 -18
- data/lib/groupdocs_viewer_cloud/models/{font_collection.rb → files_list.rb} +26 -18
- data/lib/groupdocs_viewer_cloud/models/{image_page.rb → files_upload_result.rb} +36 -24
- data/lib/groupdocs_viewer_cloud/models/format.rb +30 -22
- data/lib/groupdocs_viewer_cloud/models/{format_collection.rb → formats_result.rb} +19 -11
- data/lib/groupdocs_viewer_cloud/models/html_options.rb +108 -209
- data/lib/groupdocs_viewer_cloud/models/html_resource.rb +234 -0
- data/lib/groupdocs_viewer_cloud/models/image_options.rb +129 -163
- data/lib/groupdocs_viewer_cloud/models/{attachment_collection.rb → info_result.rb} +32 -32
- data/lib/groupdocs_viewer_cloud/models/{rotate_options.rb → object_exist.rb} +42 -34
- data/lib/groupdocs_viewer_cloud/models/page_info.rb +48 -55
- data/lib/groupdocs_viewer_cloud/models/{pdf_file_info.rb → page_view.rb} +53 -38
- data/lib/groupdocs_viewer_cloud/models/{project_options.rb → project_management_options.rb} +39 -21
- data/lib/groupdocs_viewer_cloud/models/render_options.rb +92 -146
- data/lib/groupdocs_viewer_cloud/models/resource.rb +30 -22
- data/lib/groupdocs_viewer_cloud/models/{row_info.rb → row.rb} +65 -37
- data/lib/groupdocs_viewer_cloud/models/{cells_options.rb → spreadsheet_options.rb} +95 -67
- data/lib/groupdocs_viewer_cloud/models/{attachment.rb → storage_exist.rb} +30 -27
- data/lib/groupdocs_viewer_cloud/models/{image_attachment_page_collection.rb → storage_file.rb} +66 -40
- data/lib/groupdocs_viewer_cloud/models/{document_info.rb → view_options.rb} +99 -105
- data/lib/groupdocs_viewer_cloud/models/{html_page_collection.rb → view_result.rb} +43 -33
- data/lib/groupdocs_viewer_cloud/models/watermark.rb +35 -22
- data/lib/groupdocs_viewer_cloud/version.rb +2 -2
- metadata +27 -110
- data/lib/groupdocs_viewer_cloud/models/document_info_options.rb +0 -358
- data/lib/groupdocs_viewer_cloud/models/file_response.rb +0 -196
- data/lib/groupdocs_viewer_cloud/models/pdf_file_options.rb +0 -358
- data/lib/groupdocs_viewer_cloud/models/pdf_options.rb +0 -236
- data/lib/groupdocs_viewer_cloud/models/render_options_base.rb +0 -358
- data/lib/groupdocs_viewer_cloud/models/requests/html_create_attachment_pages_cache_request.rb +0 -65
- data/lib/groupdocs_viewer_cloud/models/requests/html_create_pages_cache_from_content_request.rb +0 -65
- data/lib/groupdocs_viewer_cloud/models/requests/html_create_pages_cache_from_url_request.rb +0 -65
- data/lib/groupdocs_viewer_cloud/models/requests/html_create_pages_cache_request.rb +0 -61
- data/lib/groupdocs_viewer_cloud/models/requests/html_create_pdf_file_from_content_request.rb +0 -65
- data/lib/groupdocs_viewer_cloud/models/requests/html_create_pdf_file_from_url_request.rb +0 -65
- data/lib/groupdocs_viewer_cloud/models/requests/html_create_pdf_file_request.rb +0 -61
- data/lib/groupdocs_viewer_cloud/models/requests/html_delete_attachment_pages_cache_request.rb +0 -57
- data/lib/groupdocs_viewer_cloud/models/requests/html_delete_pages_cache_request.rb +0 -53
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_info_request.rb +0 -65
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_info_with_options_request.rb +0 -61
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_page_request.rb +0 -109
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_page_resource_request.rb +0 -65
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_pages_request.rb +0 -113
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachment_request.rb +0 -61
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_attachments_request.rb +0 -57
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_from_content_request.rb +0 -61
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_from_url_request.rb +0 -69
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_from_url_with_options_request.rb +0 -61
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_request.rb +0 -65
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_document_info_with_options_request.rb +0 -57
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_page_request.rb +0 -101
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_page_resource_request.rb +0 -61
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_pages_from_url_request.rb +0 -109
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_pages_request.rb +0 -105
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_pdf_file_from_url_request.rb +0 -77
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_pdf_file_request.rb +0 -73
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_zip_with_attachment_pages_request.rb +0 -113
- data/lib/groupdocs_viewer_cloud/models/requests/html_get_zip_with_pages_request.rb +0 -105
- data/lib/groupdocs_viewer_cloud/models/requests/html_transform_pages_request.rb +0 -57
- data/lib/groupdocs_viewer_cloud/models/requests/image_create_attachment_pages_cache_request.rb +0 -65
- data/lib/groupdocs_viewer_cloud/models/requests/image_create_pages_cache_from_content_request.rb +0 -65
- data/lib/groupdocs_viewer_cloud/models/requests/image_create_pages_cache_from_url_request.rb +0 -65
- data/lib/groupdocs_viewer_cloud/models/requests/image_create_pages_cache_request.rb +0 -61
- data/lib/groupdocs_viewer_cloud/models/requests/image_create_pdf_file_from_content_request.rb +0 -65
- data/lib/groupdocs_viewer_cloud/models/requests/image_create_pdf_file_from_url_request.rb +0 -65
- data/lib/groupdocs_viewer_cloud/models/requests/image_create_pdf_file_request.rb +0 -61
- data/lib/groupdocs_viewer_cloud/models/requests/image_delete_attachment_pages_cache_request.rb +0 -57
- data/lib/groupdocs_viewer_cloud/models/requests/image_delete_pages_cache_request.rb +0 -53
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_info_request.rb +0 -69
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_info_with_options_request.rb +0 -61
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_page_request.rb +0 -105
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_pages_request.rb +0 -109
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachment_request.rb +0 -61
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_attachments_request.rb +0 -57
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_from_content_request.rb +0 -61
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_from_url_request.rb +0 -73
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_from_url_with_options_request.rb +0 -61
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_request.rb +0 -69
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_document_info_with_options_request.rb +0 -57
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_page_request.rb +0 -97
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_pages_from_url_request.rb +0 -105
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_pages_request.rb +0 -101
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_pdf_file_from_url_request.rb +0 -77
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_pdf_file_request.rb +0 -73
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_zip_with_attachment_pages_request.rb +0 -109
- data/lib/groupdocs_viewer_cloud/models/requests/image_get_zip_with_pages_request.rb +0 -101
- data/lib/groupdocs_viewer_cloud/models/requests/image_transform_pages_request.rb +0 -57
- data/lib/groupdocs_viewer_cloud/models/resource_url.rb +0 -206
- data/lib/groupdocs_viewer_cloud/models/slides_options.rb +0 -206
- data/lib/groupdocs_viewer_cloud/models/tile.rb +0 -236
- data/lib/groupdocs_viewer_cloud/models/words_options.rb +0 -216
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# --------------------------------------------------------------------------------------------------------------------
|
3
|
-
# <copyright company="Aspose Pty Ltd" file="
|
4
|
-
# Copyright (c) 2003-
|
3
|
+
# <copyright company="Aspose Pty Ltd" file="storage_exist.rb">
|
4
|
+
# Copyright (c) 2003-2019 Aspose Pty Ltd
|
5
5
|
# </copyright>
|
6
6
|
# <summary>
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
@@ -28,28 +28,23 @@
|
|
28
28
|
require 'date'
|
29
29
|
|
30
30
|
module GroupDocsViewerCloud
|
31
|
-
#
|
32
|
-
class
|
31
|
+
# Storage exists
|
32
|
+
class StorageExist
|
33
33
|
|
34
|
-
#
|
35
|
-
attr_accessor :
|
36
|
-
|
37
|
-
# Attachment name.
|
38
|
-
attr_accessor :name
|
34
|
+
# Shows that the storage exists.
|
35
|
+
attr_accessor :exists
|
39
36
|
|
40
37
|
# Attribute mapping from ruby-style variable name to JSON key.
|
41
38
|
def self.attribute_map
|
42
39
|
{
|
43
|
-
:'
|
44
|
-
:'name' => :'name'
|
40
|
+
:'exists' => :'Exists'
|
45
41
|
}
|
46
42
|
end
|
47
43
|
|
48
44
|
# Attribute type mapping.
|
49
45
|
def self.swagger_types
|
50
46
|
{
|
51
|
-
:'
|
52
|
-
:'name' => :'String'
|
47
|
+
:'exists' => :'BOOLEAN'
|
53
48
|
}
|
54
49
|
end
|
55
50
|
|
@@ -61,12 +56,8 @@ module GroupDocsViewerCloud
|
|
61
56
|
# convert string to symbol for hash key
|
62
57
|
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
63
58
|
|
64
|
-
if attributes.key?(:'
|
65
|
-
self.
|
66
|
-
end
|
67
|
-
|
68
|
-
if attributes.key?(:'name')
|
69
|
-
self.name = attributes[:'name']
|
59
|
+
if attributes.key?(:'Exists')
|
60
|
+
self.exists = attributes[:'Exists']
|
70
61
|
end
|
71
62
|
|
72
63
|
end
|
@@ -75,12 +66,17 @@ module GroupDocsViewerCloud
|
|
75
66
|
# @return Array for valid properies with the reasons
|
76
67
|
def list_invalid_properties
|
77
68
|
invalid_properties = []
|
69
|
+
if @exists.nil?
|
70
|
+
invalid_properties.push("invalid value for 'exists', exists cannot be nil.")
|
71
|
+
end
|
72
|
+
|
78
73
|
return invalid_properties
|
79
74
|
end
|
80
75
|
|
81
76
|
# Check to see if the all the properties in the model are valid
|
82
77
|
# @return true if the model is valid
|
83
78
|
def valid?
|
79
|
+
return false if @exists.nil?
|
84
80
|
return true
|
85
81
|
end
|
86
82
|
|
@@ -89,8 +85,7 @@ module GroupDocsViewerCloud
|
|
89
85
|
def ==(other)
|
90
86
|
return true if self.equal?(other)
|
91
87
|
self.class == other.class &&
|
92
|
-
|
93
|
-
name == other.name
|
88
|
+
exists == other.exists
|
94
89
|
end
|
95
90
|
|
96
91
|
# @see the `==` method
|
@@ -102,7 +97,13 @@ module GroupDocsViewerCloud
|
|
102
97
|
# Calculates hash code according to all attributes.
|
103
98
|
# @return [Fixnum] Hash code
|
104
99
|
def hash
|
105
|
-
[
|
100
|
+
[exists].hash
|
101
|
+
end
|
102
|
+
|
103
|
+
# Downcases first letter.
|
104
|
+
# @return downcased string
|
105
|
+
def uncap(str)
|
106
|
+
str[0, 1].downcase + str[1..-1]
|
106
107
|
end
|
107
108
|
|
108
109
|
# Builds the object from hash
|
@@ -111,14 +112,16 @@ module GroupDocsViewerCloud
|
|
111
112
|
def build_from_hash(attributes)
|
112
113
|
return nil unless attributes.is_a?(Hash)
|
113
114
|
self.class.swagger_types.each_pair do |key, type|
|
115
|
+
pname = uncap(self.class.attribute_map[key]).intern
|
116
|
+
value = attributes[pname]
|
114
117
|
if type =~ /\AArray<(.*)>/i
|
115
118
|
# 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
|
118
|
-
self.send("#{key}=",
|
119
|
+
# is documented as an array but the input is not
|
120
|
+
if value.is_a?(Array)
|
121
|
+
self.send("#{key}=", value.map { |v| _deserialize($1, v) })
|
119
122
|
end
|
120
|
-
elsif !
|
121
|
-
self.send("#{key}=", _deserialize(type,
|
123
|
+
elsif !value.nil?
|
124
|
+
self.send("#{key}=", _deserialize(type, value))
|
122
125
|
end
|
123
126
|
# or else data not found in attributes(hash), not an issue as the data can be optional
|
124
127
|
end
|
data/lib/groupdocs_viewer_cloud/models/{image_attachment_page_collection.rb → storage_file.rb}
RENAMED
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# --------------------------------------------------------------------------------------------------------------------
|
3
|
-
# <copyright company="Aspose Pty Ltd" file="
|
4
|
-
# Copyright (c) 2003-
|
3
|
+
# <copyright company="Aspose Pty Ltd" file="storage_file.rb">
|
4
|
+
# Copyright (c) 2003-2019 Aspose Pty Ltd
|
5
5
|
# </copyright>
|
6
6
|
# <summary>
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
@@ -28,38 +28,43 @@
|
|
28
28
|
require 'date'
|
29
29
|
|
30
30
|
module GroupDocsViewerCloud
|
31
|
-
#
|
32
|
-
class
|
31
|
+
# File or folder information
|
32
|
+
class StorageFile
|
33
33
|
|
34
|
-
# File name.
|
35
|
-
attr_accessor :
|
34
|
+
# File or folder name.
|
35
|
+
attr_accessor :name
|
36
36
|
|
37
|
-
#
|
38
|
-
attr_accessor :
|
37
|
+
# True if it is a folder.
|
38
|
+
attr_accessor :is_folder
|
39
39
|
|
40
|
-
#
|
41
|
-
attr_accessor :
|
40
|
+
# File or folder last modified DateTime.
|
41
|
+
attr_accessor :modified_date
|
42
42
|
|
43
|
-
#
|
44
|
-
attr_accessor :
|
43
|
+
# File or folder size.
|
44
|
+
attr_accessor :size
|
45
|
+
|
46
|
+
# File or folder path.
|
47
|
+
attr_accessor :path
|
45
48
|
|
46
49
|
# Attribute mapping from ruby-style variable name to JSON key.
|
47
50
|
def self.attribute_map
|
48
51
|
{
|
49
|
-
:'
|
50
|
-
:'
|
51
|
-
:'
|
52
|
-
:'
|
52
|
+
:'name' => :'Name',
|
53
|
+
:'is_folder' => :'IsFolder',
|
54
|
+
:'modified_date' => :'ModifiedDate',
|
55
|
+
:'size' => :'Size',
|
56
|
+
:'path' => :'Path'
|
53
57
|
}
|
54
58
|
end
|
55
59
|
|
56
60
|
# Attribute type mapping.
|
57
61
|
def self.swagger_types
|
58
62
|
{
|
59
|
-
:'
|
60
|
-
:'
|
61
|
-
:'
|
62
|
-
:'
|
63
|
+
:'name' => :'String',
|
64
|
+
:'is_folder' => :'BOOLEAN',
|
65
|
+
:'modified_date' => :'DateTime',
|
66
|
+
:'size' => :'Integer',
|
67
|
+
:'path' => :'String'
|
63
68
|
}
|
64
69
|
end
|
65
70
|
|
@@ -71,22 +76,24 @@ module GroupDocsViewerCloud
|
|
71
76
|
# convert string to symbol for hash key
|
72
77
|
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
73
78
|
|
74
|
-
if attributes.key?(:'
|
75
|
-
self.
|
79
|
+
if attributes.key?(:'Name')
|
80
|
+
self.name = attributes[:'Name']
|
76
81
|
end
|
77
82
|
|
78
|
-
if attributes.key?(:'
|
79
|
-
self.
|
83
|
+
if attributes.key?(:'IsFolder')
|
84
|
+
self.is_folder = attributes[:'IsFolder']
|
80
85
|
end
|
81
86
|
|
82
|
-
if attributes.key?(:'
|
83
|
-
self.
|
87
|
+
if attributes.key?(:'ModifiedDate')
|
88
|
+
self.modified_date = attributes[:'ModifiedDate']
|
84
89
|
end
|
85
90
|
|
86
|
-
if attributes.key?(:'
|
87
|
-
|
88
|
-
|
89
|
-
|
91
|
+
if attributes.key?(:'Size')
|
92
|
+
self.size = attributes[:'Size']
|
93
|
+
end
|
94
|
+
|
95
|
+
if attributes.key?(:'Path')
|
96
|
+
self.path = attributes[:'Path']
|
90
97
|
end
|
91
98
|
|
92
99
|
end
|
@@ -95,12 +102,22 @@ module GroupDocsViewerCloud
|
|
95
102
|
# @return Array for valid properies with the reasons
|
96
103
|
def list_invalid_properties
|
97
104
|
invalid_properties = []
|
105
|
+
if @is_folder.nil?
|
106
|
+
invalid_properties.push("invalid value for 'is_folder', is_folder cannot be nil.")
|
107
|
+
end
|
108
|
+
|
109
|
+
if @size.nil?
|
110
|
+
invalid_properties.push("invalid value for 'size', size cannot be nil.")
|
111
|
+
end
|
112
|
+
|
98
113
|
return invalid_properties
|
99
114
|
end
|
100
115
|
|
101
116
|
# Check to see if the all the properties in the model are valid
|
102
117
|
# @return true if the model is valid
|
103
118
|
def valid?
|
119
|
+
return false if @is_folder.nil?
|
120
|
+
return false if @size.nil?
|
104
121
|
return true
|
105
122
|
end
|
106
123
|
|
@@ -109,10 +126,11 @@ module GroupDocsViewerCloud
|
|
109
126
|
def ==(other)
|
110
127
|
return true if self.equal?(other)
|
111
128
|
self.class == other.class &&
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
129
|
+
name == other.name &&
|
130
|
+
is_folder == other.is_folder &&
|
131
|
+
modified_date == other.modified_date &&
|
132
|
+
size == other.size &&
|
133
|
+
path == other.path
|
116
134
|
end
|
117
135
|
|
118
136
|
# @see the `==` method
|
@@ -124,7 +142,13 @@ module GroupDocsViewerCloud
|
|
124
142
|
# Calculates hash code according to all attributes.
|
125
143
|
# @return [Fixnum] Hash code
|
126
144
|
def hash
|
127
|
-
[
|
145
|
+
[name, is_folder, modified_date, size, path].hash
|
146
|
+
end
|
147
|
+
|
148
|
+
# Downcases first letter.
|
149
|
+
# @return downcased string
|
150
|
+
def uncap(str)
|
151
|
+
str[0, 1].downcase + str[1..-1]
|
128
152
|
end
|
129
153
|
|
130
154
|
# Builds the object from hash
|
@@ -133,14 +157,16 @@ module GroupDocsViewerCloud
|
|
133
157
|
def build_from_hash(attributes)
|
134
158
|
return nil unless attributes.is_a?(Hash)
|
135
159
|
self.class.swagger_types.each_pair do |key, type|
|
160
|
+
pname = uncap(self.class.attribute_map[key]).intern
|
161
|
+
value = attributes[pname]
|
136
162
|
if type =~ /\AArray<(.*)>/i
|
137
163
|
# 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
|
140
|
-
self.send("#{key}=",
|
164
|
+
# is documented as an array but the input is not
|
165
|
+
if value.is_a?(Array)
|
166
|
+
self.send("#{key}=", value.map { |v| _deserialize($1, v) })
|
141
167
|
end
|
142
|
-
elsif !
|
143
|
-
self.send("#{key}=", _deserialize(type,
|
168
|
+
elsif !value.nil?
|
169
|
+
self.send("#{key}=", _deserialize(type, value))
|
144
170
|
end
|
145
171
|
# or else data not found in attributes(hash), not an issue as the data can be optional
|
146
172
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# --------------------------------------------------------------------------------------------------------------------
|
3
|
-
# <copyright company="Aspose Pty Ltd" file="
|
4
|
-
# Copyright (c) 2003-
|
3
|
+
# <copyright company="Aspose Pty Ltd" file="view_options.rb">
|
4
|
+
# Copyright (c) 2003-2019 Aspose Pty Ltd
|
5
5
|
# </copyright>
|
6
6
|
# <summary>
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
@@ -28,68 +28,64 @@
|
|
28
28
|
require 'date'
|
29
29
|
|
30
30
|
module GroupDocsViewerCloud
|
31
|
-
#
|
32
|
-
class
|
33
|
-
|
34
|
-
# File
|
35
|
-
attr_accessor :
|
36
|
-
|
37
|
-
#
|
38
|
-
attr_accessor :
|
39
|
-
|
40
|
-
#
|
41
|
-
attr_accessor :
|
42
|
-
|
43
|
-
#
|
44
|
-
attr_accessor :
|
45
|
-
|
46
|
-
#
|
47
|
-
attr_accessor :
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
31
|
+
# View options
|
32
|
+
class ViewOptions
|
33
|
+
|
34
|
+
# File info
|
35
|
+
attr_accessor :file_info
|
36
|
+
|
37
|
+
# View format (HTML, PNG, JPG, BMP or PDF) Default value is HTML.
|
38
|
+
attr_accessor :view_format
|
39
|
+
|
40
|
+
# The path to directory containing custom fonts in storage
|
41
|
+
attr_accessor :fonts_path
|
42
|
+
|
43
|
+
# Text watermark
|
44
|
+
attr_accessor :watermark
|
45
|
+
|
46
|
+
# Rendering options
|
47
|
+
attr_accessor :render_options
|
48
|
+
class EnumAttributeValidator
|
49
|
+
attr_reader :datatype
|
50
|
+
attr_reader :allowable_values
|
51
|
+
|
52
|
+
def initialize(datatype, allowable_values)
|
53
|
+
@allowable_values = allowable_values.map do |value|
|
54
|
+
case datatype.to_s
|
55
|
+
when /Integer/i
|
56
|
+
value.to_i
|
57
|
+
when /Float/i
|
58
|
+
value.to_f
|
59
|
+
else
|
60
|
+
value
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
60
64
|
|
61
|
-
|
62
|
-
|
65
|
+
def valid?(value)
|
66
|
+
!value || allowable_values.include?(value)
|
67
|
+
end
|
68
|
+
end
|
63
69
|
|
64
70
|
# Attribute mapping from ruby-style variable name to JSON key.
|
65
71
|
def self.attribute_map
|
66
72
|
{
|
67
|
-
:'
|
68
|
-
:'
|
69
|
-
:'
|
70
|
-
:'
|
71
|
-
:'
|
72
|
-
:'pages' => :'pages',
|
73
|
-
:'attachments' => :'attachments',
|
74
|
-
:'layers' => :'layers',
|
75
|
-
:'start_date' => :'startDate',
|
76
|
-
:'end_date' => :'endDate'
|
73
|
+
:'file_info' => :'FileInfo',
|
74
|
+
:'view_format' => :'ViewFormat',
|
75
|
+
:'fonts_path' => :'FontsPath',
|
76
|
+
:'watermark' => :'Watermark',
|
77
|
+
:'render_options' => :'RenderOptions'
|
77
78
|
}
|
78
79
|
end
|
79
80
|
|
80
81
|
# Attribute type mapping.
|
81
82
|
def self.swagger_types
|
82
83
|
{
|
83
|
-
:'
|
84
|
-
:'
|
85
|
-
:'
|
86
|
-
:'
|
87
|
-
:'
|
88
|
-
:'pages' => :'Array<PageInfo>',
|
89
|
-
:'attachments' => :'Array<AttachmentInfo>',
|
90
|
-
:'layers' => :'Array<String>',
|
91
|
-
:'start_date' => :'DateTime',
|
92
|
-
:'end_date' => :'DateTime'
|
84
|
+
:'file_info' => :'FileInfo',
|
85
|
+
:'view_format' => :'String',
|
86
|
+
:'fonts_path' => :'String',
|
87
|
+
:'watermark' => :'Watermark',
|
88
|
+
:'render_options' => :'RenderOptions'
|
93
89
|
}
|
94
90
|
end
|
95
91
|
|
@@ -101,50 +97,24 @@ module GroupDocsViewerCloud
|
|
101
97
|
# convert string to symbol for hash key
|
102
98
|
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
103
99
|
|
104
|
-
if attributes.key?(:'
|
105
|
-
self.
|
106
|
-
end
|
107
|
-
|
108
|
-
if attributes.key?(:'extension')
|
109
|
-
self.extension = attributes[:'extension']
|
110
|
-
end
|
111
|
-
|
112
|
-
if attributes.key?(:'fileFormat')
|
113
|
-
self.file_format = attributes[:'fileFormat']
|
100
|
+
if attributes.key?(:'FileInfo')
|
101
|
+
self.file_info = attributes[:'FileInfo']
|
114
102
|
end
|
115
103
|
|
116
|
-
if attributes.key?(:'
|
117
|
-
self.
|
104
|
+
if attributes.key?(:'ViewFormat')
|
105
|
+
self.view_format = attributes[:'ViewFormat']
|
118
106
|
end
|
119
107
|
|
120
|
-
if attributes.key?(:'
|
121
|
-
self.
|
108
|
+
if attributes.key?(:'FontsPath')
|
109
|
+
self.fonts_path = attributes[:'FontsPath']
|
122
110
|
end
|
123
111
|
|
124
|
-
if attributes.key?(:'
|
125
|
-
|
126
|
-
self.pages = value
|
127
|
-
end
|
128
|
-
end
|
129
|
-
|
130
|
-
if attributes.key?(:'attachments')
|
131
|
-
if (value = attributes[:'attachments']).is_a?(Array)
|
132
|
-
self.attachments = value
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
|
-
if attributes.key?(:'layers')
|
137
|
-
if (value = attributes[:'layers']).is_a?(Array)
|
138
|
-
self.layers = value
|
139
|
-
end
|
140
|
-
end
|
141
|
-
|
142
|
-
if attributes.key?(:'startDate')
|
143
|
-
self.start_date = attributes[:'startDate']
|
112
|
+
if attributes.key?(:'Watermark')
|
113
|
+
self.watermark = attributes[:'Watermark']
|
144
114
|
end
|
145
115
|
|
146
|
-
if attributes.key?(:'
|
147
|
-
self.
|
116
|
+
if attributes.key?(:'RenderOptions')
|
117
|
+
self.render_options = attributes[:'RenderOptions']
|
148
118
|
end
|
149
119
|
|
150
120
|
end
|
@@ -153,30 +123,46 @@ module GroupDocsViewerCloud
|
|
153
123
|
# @return Array for valid properies with the reasons
|
154
124
|
def list_invalid_properties
|
155
125
|
invalid_properties = []
|
126
|
+
if @view_format.nil?
|
127
|
+
invalid_properties.push("invalid value for 'view_format', view_format cannot be nil.")
|
128
|
+
end
|
129
|
+
|
156
130
|
return invalid_properties
|
157
131
|
end
|
158
132
|
|
159
133
|
# Check to see if the all the properties in the model are valid
|
160
134
|
# @return true if the model is valid
|
161
135
|
def valid?
|
136
|
+
return false if @view_format.nil?
|
137
|
+
view_format_validator = EnumAttributeValidator.new('String', ["HTML", "PNG", "JPG", "BMP", "PDF"])
|
138
|
+
return false unless view_format_validator.valid?(@view_format)
|
162
139
|
return true
|
163
140
|
end
|
164
141
|
|
142
|
+
# Custom attribute writer method checking allowed values (enum).
|
143
|
+
# @param [Object] view_format Object to be assigned
|
144
|
+
def view_format=(view_format)
|
145
|
+
validator = EnumAttributeValidator.new('String', ["HTML", "PNG", "JPG", "BMP", "PDF"])
|
146
|
+
if view_format.to_i == 0
|
147
|
+
unless validator.valid?(view_format)
|
148
|
+
raise ArgumentError, "invalid value for 'view_format', must be one of #{validator.allowable_values}."
|
149
|
+
end
|
150
|
+
@view_format = view_format
|
151
|
+
else
|
152
|
+
@view_format = validator.allowable_values[view_format.to_i]
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
165
156
|
# Checks equality by comparing each attribute.
|
166
157
|
# @param [Object] Object to be compared
|
167
158
|
def ==(other)
|
168
159
|
return true if self.equal?(other)
|
169
160
|
self.class == other.class &&
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
pages == other.pages &&
|
176
|
-
attachments == other.attachments &&
|
177
|
-
layers == other.layers &&
|
178
|
-
start_date == other.start_date &&
|
179
|
-
end_date == other.end_date
|
161
|
+
file_info == other.file_info &&
|
162
|
+
view_format == other.view_format &&
|
163
|
+
fonts_path == other.fonts_path &&
|
164
|
+
watermark == other.watermark &&
|
165
|
+
render_options == other.render_options
|
180
166
|
end
|
181
167
|
|
182
168
|
# @see the `==` method
|
@@ -188,7 +174,13 @@ module GroupDocsViewerCloud
|
|
188
174
|
# Calculates hash code according to all attributes.
|
189
175
|
# @return [Fixnum] Hash code
|
190
176
|
def hash
|
191
|
-
[
|
177
|
+
[file_info, view_format, fonts_path, watermark, render_options].hash
|
178
|
+
end
|
179
|
+
|
180
|
+
# Downcases first letter.
|
181
|
+
# @return downcased string
|
182
|
+
def uncap(str)
|
183
|
+
str[0, 1].downcase + str[1..-1]
|
192
184
|
end
|
193
185
|
|
194
186
|
# Builds the object from hash
|
@@ -197,14 +189,16 @@ module GroupDocsViewerCloud
|
|
197
189
|
def build_from_hash(attributes)
|
198
190
|
return nil unless attributes.is_a?(Hash)
|
199
191
|
self.class.swagger_types.each_pair do |key, type|
|
192
|
+
pname = uncap(self.class.attribute_map[key]).intern
|
193
|
+
value = attributes[pname]
|
200
194
|
if type =~ /\AArray<(.*)>/i
|
201
195
|
# check to ensure the input is an array given that the the attribute
|
202
|
-
# is documented as an array but the input is not
|
203
|
-
if
|
204
|
-
self.send("#{key}=",
|
196
|
+
# is documented as an array but the input is not
|
197
|
+
if value.is_a?(Array)
|
198
|
+
self.send("#{key}=", value.map { |v| _deserialize($1, v) })
|
205
199
|
end
|
206
|
-
elsif !
|
207
|
-
self.send("#{key}=", _deserialize(type,
|
200
|
+
elsif !value.nil?
|
201
|
+
self.send("#{key}=", _deserialize(type, value))
|
208
202
|
end
|
209
203
|
# or else data not found in attributes(hash), not an issue as the data can be optional
|
210
204
|
end
|