groupdocs_conversion_cloud 19.4 → 19.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/groupdocs_conversion_cloud.rb +3 -1
- data/lib/groupdocs_conversion_cloud/api/convert_api.rb +218 -0
- data/lib/groupdocs_conversion_cloud/api/file_api.rb +1 -1
- data/lib/groupdocs_conversion_cloud/api/folder_api.rb +1 -1
- data/lib/groupdocs_conversion_cloud/api/{conversion_api.rb → info_api.rb} +51 -40
- data/lib/groupdocs_conversion_cloud/models/bmp_convert_options.rb +101 -4
- data/lib/groupdocs_conversion_cloud/models/cgm_convert_options.rb +101 -4
- data/lib/groupdocs_conversion_cloud/models/dcm_convert_options.rb +101 -4
- data/lib/groupdocs_conversion_cloud/models/djvu_convert_options.rb +101 -4
- data/lib/groupdocs_conversion_cloud/models/dng_convert_options.rb +101 -4
- data/lib/groupdocs_conversion_cloud/models/document_metadata.rb +396 -0
- data/lib/groupdocs_conversion_cloud/models/emf_convert_options.rb +101 -4
- data/lib/groupdocs_conversion_cloud/models/gif_convert_options.rb +101 -4
- data/lib/groupdocs_conversion_cloud/models/ico_convert_options.rb +101 -4
- data/lib/groupdocs_conversion_cloud/models/image_convert_options.rb +101 -4
- data/lib/groupdocs_conversion_cloud/models/j2c_convert_options.rb +98 -1
- data/lib/groupdocs_conversion_cloud/models/j2k_convert_options.rb +98 -1
- data/lib/groupdocs_conversion_cloud/models/jp2_convert_options.rb +98 -1
- data/lib/groupdocs_conversion_cloud/models/jpeg_convert_options.rb +98 -1
- data/lib/groupdocs_conversion_cloud/models/jpf_convert_options.rb +98 -1
- data/lib/groupdocs_conversion_cloud/models/jpg_convert_options.rb +98 -1
- data/lib/groupdocs_conversion_cloud/models/jpm_convert_options.rb +98 -1
- data/lib/groupdocs_conversion_cloud/models/jpx_convert_options.rb +98 -1
- data/lib/groupdocs_conversion_cloud/models/odg_convert_options.rb +101 -4
- data/lib/groupdocs_conversion_cloud/models/png_convert_options.rb +101 -4
- data/lib/groupdocs_conversion_cloud/models/psd_convert_options.rb +77 -1
- data/lib/groupdocs_conversion_cloud/models/tif_convert_options.rb +77 -1
- data/lib/groupdocs_conversion_cloud/models/tiff_convert_options.rb +77 -1
- data/lib/groupdocs_conversion_cloud/models/webp_convert_options.rb +98 -1
- data/lib/groupdocs_conversion_cloud/models/wmf_convert_options.rb +101 -4
- data/lib/groupdocs_conversion_cloud/version.rb +1 -1
- metadata +5 -3
@@ -64,6 +64,39 @@ module GroupDocsConversionCloud
|
|
64
64
|
# Watermark specific options
|
65
65
|
attr_accessor :watermark_options
|
66
66
|
|
67
|
+
# Adjust image brightness
|
68
|
+
attr_accessor :brightness
|
69
|
+
|
70
|
+
# Adjust image contrast
|
71
|
+
attr_accessor :contrast
|
72
|
+
|
73
|
+
# Adjust image gamma
|
74
|
+
attr_accessor :gamma
|
75
|
+
|
76
|
+
# Image flip mode
|
77
|
+
attr_accessor :flip_mode
|
78
|
+
class EnumAttributeValidator
|
79
|
+
attr_reader :datatype
|
80
|
+
attr_reader :allowable_values
|
81
|
+
|
82
|
+
def initialize(datatype, allowable_values)
|
83
|
+
@allowable_values = allowable_values.map do |value|
|
84
|
+
case datatype.to_s
|
85
|
+
when /Integer/i
|
86
|
+
value.to_i
|
87
|
+
when /Float/i
|
88
|
+
value.to_f
|
89
|
+
else
|
90
|
+
value
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
def valid?(value)
|
96
|
+
!value || allowable_values.include?(value)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
67
100
|
# Attribute mapping from ruby-style variable name to JSON key.
|
68
101
|
def self.attribute_map
|
69
102
|
{
|
@@ -77,7 +110,11 @@ module GroupDocsConversionCloud
|
|
77
110
|
:'grayscale' => :'Grayscale',
|
78
111
|
:'rotate_angle' => :'RotateAngle',
|
79
112
|
:'use_pdf' => :'UsePdf',
|
80
|
-
:'watermark_options' => :'WatermarkOptions'
|
113
|
+
:'watermark_options' => :'WatermarkOptions',
|
114
|
+
:'brightness' => :'Brightness',
|
115
|
+
:'contrast' => :'Contrast',
|
116
|
+
:'gamma' => :'Gamma',
|
117
|
+
:'flip_mode' => :'FlipMode'
|
81
118
|
}
|
82
119
|
end
|
83
120
|
|
@@ -94,7 +131,11 @@ module GroupDocsConversionCloud
|
|
94
131
|
:'grayscale' => :'BOOLEAN',
|
95
132
|
:'rotate_angle' => :'Integer',
|
96
133
|
:'use_pdf' => :'BOOLEAN',
|
97
|
-
:'watermark_options' => :'WatermarkOptions'
|
134
|
+
:'watermark_options' => :'WatermarkOptions',
|
135
|
+
:'brightness' => :'Integer',
|
136
|
+
:'contrast' => :'Integer',
|
137
|
+
:'gamma' => :'Float',
|
138
|
+
:'flip_mode' => :'String'
|
98
139
|
}
|
99
140
|
end
|
100
141
|
|
@@ -152,6 +193,22 @@ module GroupDocsConversionCloud
|
|
152
193
|
self.watermark_options = attributes[:'WatermarkOptions']
|
153
194
|
end
|
154
195
|
|
196
|
+
if attributes.key?(:'Brightness')
|
197
|
+
self.brightness = attributes[:'Brightness']
|
198
|
+
end
|
199
|
+
|
200
|
+
if attributes.key?(:'Contrast')
|
201
|
+
self.contrast = attributes[:'Contrast']
|
202
|
+
end
|
203
|
+
|
204
|
+
if attributes.key?(:'Gamma')
|
205
|
+
self.gamma = attributes[:'Gamma']
|
206
|
+
end
|
207
|
+
|
208
|
+
if attributes.key?(:'FlipMode')
|
209
|
+
self.flip_mode = attributes[:'FlipMode']
|
210
|
+
end
|
211
|
+
|
155
212
|
end
|
156
213
|
|
157
214
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -194,6 +251,22 @@ module GroupDocsConversionCloud
|
|
194
251
|
invalid_properties.push("invalid value for 'use_pdf', use_pdf cannot be nil.")
|
195
252
|
end
|
196
253
|
|
254
|
+
if @brightness.nil?
|
255
|
+
invalid_properties.push("invalid value for 'brightness', brightness cannot be nil.")
|
256
|
+
end
|
257
|
+
|
258
|
+
if @contrast.nil?
|
259
|
+
invalid_properties.push("invalid value for 'contrast', contrast cannot be nil.")
|
260
|
+
end
|
261
|
+
|
262
|
+
if @gamma.nil?
|
263
|
+
invalid_properties.push("invalid value for 'gamma', gamma cannot be nil.")
|
264
|
+
end
|
265
|
+
|
266
|
+
if @flip_mode.nil?
|
267
|
+
invalid_properties.push("invalid value for 'flip_mode', flip_mode cannot be nil.")
|
268
|
+
end
|
269
|
+
|
197
270
|
return invalid_properties
|
198
271
|
end
|
199
272
|
|
@@ -209,9 +282,29 @@ module GroupDocsConversionCloud
|
|
209
282
|
return false if @grayscale.nil?
|
210
283
|
return false if @rotate_angle.nil?
|
211
284
|
return false if @use_pdf.nil?
|
285
|
+
return false if @brightness.nil?
|
286
|
+
return false if @contrast.nil?
|
287
|
+
return false if @gamma.nil?
|
288
|
+
return false if @flip_mode.nil?
|
289
|
+
flip_mode_validator = EnumAttributeValidator.new('String', ["None", "FlipX", "FlipY", "FlipXY"])
|
290
|
+
return false unless flip_mode_validator.valid?(@flip_mode)
|
212
291
|
return true
|
213
292
|
end
|
214
293
|
|
294
|
+
# Custom attribute writer method checking allowed values (enum).
|
295
|
+
# @param [Object] flip_mode Object to be assigned
|
296
|
+
def flip_mode=(flip_mode)
|
297
|
+
validator = EnumAttributeValidator.new('String', ["None", "FlipX", "FlipY", "FlipXY"])
|
298
|
+
if flip_mode.to_i == 0
|
299
|
+
unless validator.valid?(flip_mode)
|
300
|
+
raise ArgumentError, "invalid value for 'flip_mode', must be one of #{validator.allowable_values}."
|
301
|
+
end
|
302
|
+
@flip_mode = flip_mode
|
303
|
+
else
|
304
|
+
@flip_mode = validator.allowable_values[flip_mode.to_i]
|
305
|
+
end
|
306
|
+
end
|
307
|
+
|
215
308
|
# Checks equality by comparing each attribute.
|
216
309
|
# @param [Object] Object to be compared
|
217
310
|
def ==(other)
|
@@ -227,7 +320,11 @@ module GroupDocsConversionCloud
|
|
227
320
|
grayscale == other.grayscale &&
|
228
321
|
rotate_angle == other.rotate_angle &&
|
229
322
|
use_pdf == other.use_pdf &&
|
230
|
-
watermark_options == other.watermark_options
|
323
|
+
watermark_options == other.watermark_options &&
|
324
|
+
brightness == other.brightness &&
|
325
|
+
contrast == other.contrast &&
|
326
|
+
gamma == other.gamma &&
|
327
|
+
flip_mode == other.flip_mode
|
231
328
|
end
|
232
329
|
|
233
330
|
# @see the `==` method
|
@@ -239,7 +336,7 @@ module GroupDocsConversionCloud
|
|
239
336
|
# Calculates hash code according to all attributes.
|
240
337
|
# @return [Fixnum] Hash code
|
241
338
|
def hash
|
242
|
-
[from_page, pages_count, pages, width, height, horizontal_resolution, vertical_resolution, grayscale, rotate_angle, use_pdf, watermark_options].hash
|
339
|
+
[from_page, pages_count, pages, width, height, horizontal_resolution, vertical_resolution, grayscale, rotate_angle, use_pdf, watermark_options, brightness, contrast, gamma, flip_mode].hash
|
243
340
|
end
|
244
341
|
|
245
342
|
# Downcases first letter.
|
@@ -64,6 +64,39 @@ module GroupDocsConversionCloud
|
|
64
64
|
# Watermark specific options
|
65
65
|
attr_accessor :watermark_options
|
66
66
|
|
67
|
+
# Adjust image brightness
|
68
|
+
attr_accessor :brightness
|
69
|
+
|
70
|
+
# Adjust image contrast
|
71
|
+
attr_accessor :contrast
|
72
|
+
|
73
|
+
# Adjust image gamma
|
74
|
+
attr_accessor :gamma
|
75
|
+
|
76
|
+
# Image flip mode
|
77
|
+
attr_accessor :flip_mode
|
78
|
+
class EnumAttributeValidator
|
79
|
+
attr_reader :datatype
|
80
|
+
attr_reader :allowable_values
|
81
|
+
|
82
|
+
def initialize(datatype, allowable_values)
|
83
|
+
@allowable_values = allowable_values.map do |value|
|
84
|
+
case datatype.to_s
|
85
|
+
when /Integer/i
|
86
|
+
value.to_i
|
87
|
+
when /Float/i
|
88
|
+
value.to_f
|
89
|
+
else
|
90
|
+
value
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
def valid?(value)
|
96
|
+
!value || allowable_values.include?(value)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
67
100
|
# Attribute mapping from ruby-style variable name to JSON key.
|
68
101
|
def self.attribute_map
|
69
102
|
{
|
@@ -77,7 +110,11 @@ module GroupDocsConversionCloud
|
|
77
110
|
:'grayscale' => :'Grayscale',
|
78
111
|
:'rotate_angle' => :'RotateAngle',
|
79
112
|
:'use_pdf' => :'UsePdf',
|
80
|
-
:'watermark_options' => :'WatermarkOptions'
|
113
|
+
:'watermark_options' => :'WatermarkOptions',
|
114
|
+
:'brightness' => :'Brightness',
|
115
|
+
:'contrast' => :'Contrast',
|
116
|
+
:'gamma' => :'Gamma',
|
117
|
+
:'flip_mode' => :'FlipMode'
|
81
118
|
}
|
82
119
|
end
|
83
120
|
|
@@ -94,7 +131,11 @@ module GroupDocsConversionCloud
|
|
94
131
|
:'grayscale' => :'BOOLEAN',
|
95
132
|
:'rotate_angle' => :'Integer',
|
96
133
|
:'use_pdf' => :'BOOLEAN',
|
97
|
-
:'watermark_options' => :'WatermarkOptions'
|
134
|
+
:'watermark_options' => :'WatermarkOptions',
|
135
|
+
:'brightness' => :'Integer',
|
136
|
+
:'contrast' => :'Integer',
|
137
|
+
:'gamma' => :'Float',
|
138
|
+
:'flip_mode' => :'String'
|
98
139
|
}
|
99
140
|
end
|
100
141
|
|
@@ -152,6 +193,22 @@ module GroupDocsConversionCloud
|
|
152
193
|
self.watermark_options = attributes[:'WatermarkOptions']
|
153
194
|
end
|
154
195
|
|
196
|
+
if attributes.key?(:'Brightness')
|
197
|
+
self.brightness = attributes[:'Brightness']
|
198
|
+
end
|
199
|
+
|
200
|
+
if attributes.key?(:'Contrast')
|
201
|
+
self.contrast = attributes[:'Contrast']
|
202
|
+
end
|
203
|
+
|
204
|
+
if attributes.key?(:'Gamma')
|
205
|
+
self.gamma = attributes[:'Gamma']
|
206
|
+
end
|
207
|
+
|
208
|
+
if attributes.key?(:'FlipMode')
|
209
|
+
self.flip_mode = attributes[:'FlipMode']
|
210
|
+
end
|
211
|
+
|
155
212
|
end
|
156
213
|
|
157
214
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -194,6 +251,22 @@ module GroupDocsConversionCloud
|
|
194
251
|
invalid_properties.push("invalid value for 'use_pdf', use_pdf cannot be nil.")
|
195
252
|
end
|
196
253
|
|
254
|
+
if @brightness.nil?
|
255
|
+
invalid_properties.push("invalid value for 'brightness', brightness cannot be nil.")
|
256
|
+
end
|
257
|
+
|
258
|
+
if @contrast.nil?
|
259
|
+
invalid_properties.push("invalid value for 'contrast', contrast cannot be nil.")
|
260
|
+
end
|
261
|
+
|
262
|
+
if @gamma.nil?
|
263
|
+
invalid_properties.push("invalid value for 'gamma', gamma cannot be nil.")
|
264
|
+
end
|
265
|
+
|
266
|
+
if @flip_mode.nil?
|
267
|
+
invalid_properties.push("invalid value for 'flip_mode', flip_mode cannot be nil.")
|
268
|
+
end
|
269
|
+
|
197
270
|
return invalid_properties
|
198
271
|
end
|
199
272
|
|
@@ -209,9 +282,29 @@ module GroupDocsConversionCloud
|
|
209
282
|
return false if @grayscale.nil?
|
210
283
|
return false if @rotate_angle.nil?
|
211
284
|
return false if @use_pdf.nil?
|
285
|
+
return false if @brightness.nil?
|
286
|
+
return false if @contrast.nil?
|
287
|
+
return false if @gamma.nil?
|
288
|
+
return false if @flip_mode.nil?
|
289
|
+
flip_mode_validator = EnumAttributeValidator.new('String', ["None", "FlipX", "FlipY", "FlipXY"])
|
290
|
+
return false unless flip_mode_validator.valid?(@flip_mode)
|
212
291
|
return true
|
213
292
|
end
|
214
293
|
|
294
|
+
# Custom attribute writer method checking allowed values (enum).
|
295
|
+
# @param [Object] flip_mode Object to be assigned
|
296
|
+
def flip_mode=(flip_mode)
|
297
|
+
validator = EnumAttributeValidator.new('String', ["None", "FlipX", "FlipY", "FlipXY"])
|
298
|
+
if flip_mode.to_i == 0
|
299
|
+
unless validator.valid?(flip_mode)
|
300
|
+
raise ArgumentError, "invalid value for 'flip_mode', must be one of #{validator.allowable_values}."
|
301
|
+
end
|
302
|
+
@flip_mode = flip_mode
|
303
|
+
else
|
304
|
+
@flip_mode = validator.allowable_values[flip_mode.to_i]
|
305
|
+
end
|
306
|
+
end
|
307
|
+
|
215
308
|
# Checks equality by comparing each attribute.
|
216
309
|
# @param [Object] Object to be compared
|
217
310
|
def ==(other)
|
@@ -227,7 +320,11 @@ module GroupDocsConversionCloud
|
|
227
320
|
grayscale == other.grayscale &&
|
228
321
|
rotate_angle == other.rotate_angle &&
|
229
322
|
use_pdf == other.use_pdf &&
|
230
|
-
watermark_options == other.watermark_options
|
323
|
+
watermark_options == other.watermark_options &&
|
324
|
+
brightness == other.brightness &&
|
325
|
+
contrast == other.contrast &&
|
326
|
+
gamma == other.gamma &&
|
327
|
+
flip_mode == other.flip_mode
|
231
328
|
end
|
232
329
|
|
233
330
|
# @see the `==` method
|
@@ -239,7 +336,7 @@ module GroupDocsConversionCloud
|
|
239
336
|
# Calculates hash code according to all attributes.
|
240
337
|
# @return [Fixnum] Hash code
|
241
338
|
def hash
|
242
|
-
[from_page, pages_count, pages, width, height, horizontal_resolution, vertical_resolution, grayscale, rotate_angle, use_pdf, watermark_options].hash
|
339
|
+
[from_page, pages_count, pages, width, height, horizontal_resolution, vertical_resolution, grayscale, rotate_angle, use_pdf, watermark_options, brightness, contrast, gamma, flip_mode].hash
|
243
340
|
end
|
244
341
|
|
245
342
|
# Downcases first letter.
|
@@ -0,0 +1,396 @@
|
|
1
|
+
#
|
2
|
+
# --------------------------------------------------------------------------------------------------------------------
|
3
|
+
# <copyright company="Aspose Pty Ltd" file="document_metadata.rb">
|
4
|
+
# Copyright (c) 2003-2019 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 GroupDocsConversionCloud
|
31
|
+
# Contains a document metadata
|
32
|
+
class DocumentMetadata
|
33
|
+
|
34
|
+
# Document file type
|
35
|
+
attr_accessor :file_type
|
36
|
+
|
37
|
+
# Gets pages count if applicable to the current document format
|
38
|
+
attr_accessor :page_count
|
39
|
+
|
40
|
+
# Document bytes size
|
41
|
+
attr_accessor :size
|
42
|
+
|
43
|
+
# Returns detected width if applicable to the current document format
|
44
|
+
attr_accessor :width
|
45
|
+
|
46
|
+
# Returns detected height if applicable to the current document format
|
47
|
+
attr_accessor :height
|
48
|
+
|
49
|
+
# Returns detected horizontal resolution if applicable to the current document format
|
50
|
+
attr_accessor :horizontal_resolution
|
51
|
+
|
52
|
+
# Returns detected vertical resolution if applicable to the current document format
|
53
|
+
attr_accessor :vertical_resolution
|
54
|
+
|
55
|
+
# Returns detected bits per pixel if applicable to the current document format
|
56
|
+
attr_accessor :bits_per_pixel
|
57
|
+
|
58
|
+
# Returns document title width if applicable to the current document format
|
59
|
+
attr_accessor :title
|
60
|
+
|
61
|
+
# Returns detected document author if applicable to the current document format
|
62
|
+
attr_accessor :author
|
63
|
+
|
64
|
+
# Returns detected document creation date if it's applicable to the current document format
|
65
|
+
attr_accessor :created_date
|
66
|
+
|
67
|
+
# Returns detected document modification date if applicable to the current document format
|
68
|
+
attr_accessor :modified_date
|
69
|
+
|
70
|
+
# Returns list of layer names if applicable to the current document format
|
71
|
+
attr_accessor :layers
|
72
|
+
|
73
|
+
# Is document password protected
|
74
|
+
attr_accessor :is_password_protected
|
75
|
+
|
76
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
77
|
+
def self.attribute_map
|
78
|
+
{
|
79
|
+
:'file_type' => :'FileType',
|
80
|
+
:'page_count' => :'PageCount',
|
81
|
+
:'size' => :'Size',
|
82
|
+
:'width' => :'Width',
|
83
|
+
:'height' => :'Height',
|
84
|
+
:'horizontal_resolution' => :'HorizontalResolution',
|
85
|
+
:'vertical_resolution' => :'VerticalResolution',
|
86
|
+
:'bits_per_pixel' => :'BitsPerPixel',
|
87
|
+
:'title' => :'Title',
|
88
|
+
:'author' => :'Author',
|
89
|
+
:'created_date' => :'CreatedDate',
|
90
|
+
:'modified_date' => :'ModifiedDate',
|
91
|
+
:'layers' => :'Layers',
|
92
|
+
:'is_password_protected' => :'IsPasswordProtected'
|
93
|
+
}
|
94
|
+
end
|
95
|
+
|
96
|
+
# Attribute type mapping.
|
97
|
+
def self.swagger_types
|
98
|
+
{
|
99
|
+
:'file_type' => :'String',
|
100
|
+
:'page_count' => :'Integer',
|
101
|
+
:'size' => :'Integer',
|
102
|
+
:'width' => :'Integer',
|
103
|
+
:'height' => :'Integer',
|
104
|
+
:'horizontal_resolution' => :'Integer',
|
105
|
+
:'vertical_resolution' => :'Integer',
|
106
|
+
:'bits_per_pixel' => :'Integer',
|
107
|
+
:'title' => :'String',
|
108
|
+
:'author' => :'String',
|
109
|
+
:'created_date' => :'DateTime',
|
110
|
+
:'modified_date' => :'DateTime',
|
111
|
+
:'layers' => :'Array<String>',
|
112
|
+
:'is_password_protected' => :'BOOLEAN'
|
113
|
+
}
|
114
|
+
end
|
115
|
+
|
116
|
+
# Initializes the object
|
117
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
118
|
+
def initialize(attributes = {})
|
119
|
+
return unless attributes.is_a?(Hash)
|
120
|
+
|
121
|
+
# convert string to symbol for hash key
|
122
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
123
|
+
|
124
|
+
if attributes.key?(:'FileType')
|
125
|
+
self.file_type = attributes[:'FileType']
|
126
|
+
end
|
127
|
+
|
128
|
+
if attributes.key?(:'PageCount')
|
129
|
+
self.page_count = attributes[:'PageCount']
|
130
|
+
end
|
131
|
+
|
132
|
+
if attributes.key?(:'Size')
|
133
|
+
self.size = attributes[:'Size']
|
134
|
+
end
|
135
|
+
|
136
|
+
if attributes.key?(:'Width')
|
137
|
+
self.width = attributes[:'Width']
|
138
|
+
end
|
139
|
+
|
140
|
+
if attributes.key?(:'Height')
|
141
|
+
self.height = attributes[:'Height']
|
142
|
+
end
|
143
|
+
|
144
|
+
if attributes.key?(:'HorizontalResolution')
|
145
|
+
self.horizontal_resolution = attributes[:'HorizontalResolution']
|
146
|
+
end
|
147
|
+
|
148
|
+
if attributes.key?(:'VerticalResolution')
|
149
|
+
self.vertical_resolution = attributes[:'VerticalResolution']
|
150
|
+
end
|
151
|
+
|
152
|
+
if attributes.key?(:'BitsPerPixel')
|
153
|
+
self.bits_per_pixel = attributes[:'BitsPerPixel']
|
154
|
+
end
|
155
|
+
|
156
|
+
if attributes.key?(:'Title')
|
157
|
+
self.title = attributes[:'Title']
|
158
|
+
end
|
159
|
+
|
160
|
+
if attributes.key?(:'Author')
|
161
|
+
self.author = attributes[:'Author']
|
162
|
+
end
|
163
|
+
|
164
|
+
if attributes.key?(:'CreatedDate')
|
165
|
+
self.created_date = attributes[:'CreatedDate']
|
166
|
+
end
|
167
|
+
|
168
|
+
if attributes.key?(:'ModifiedDate')
|
169
|
+
self.modified_date = attributes[:'ModifiedDate']
|
170
|
+
end
|
171
|
+
|
172
|
+
if attributes.key?(:'Layers')
|
173
|
+
if (value = attributes[:'Layers']).is_a?(Array)
|
174
|
+
self.layers = value
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
if attributes.key?(:'IsPasswordProtected')
|
179
|
+
self.is_password_protected = attributes[:'IsPasswordProtected']
|
180
|
+
end
|
181
|
+
|
182
|
+
end
|
183
|
+
|
184
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
185
|
+
# @return Array for valid properies with the reasons
|
186
|
+
def list_invalid_properties
|
187
|
+
invalid_properties = []
|
188
|
+
if @page_count.nil?
|
189
|
+
invalid_properties.push("invalid value for 'page_count', page_count cannot be nil.")
|
190
|
+
end
|
191
|
+
|
192
|
+
if @size.nil?
|
193
|
+
invalid_properties.push("invalid value for 'size', size cannot be nil.")
|
194
|
+
end
|
195
|
+
|
196
|
+
if @width.nil?
|
197
|
+
invalid_properties.push("invalid value for 'width', width cannot be nil.")
|
198
|
+
end
|
199
|
+
|
200
|
+
if @height.nil?
|
201
|
+
invalid_properties.push("invalid value for 'height', height cannot be nil.")
|
202
|
+
end
|
203
|
+
|
204
|
+
if @horizontal_resolution.nil?
|
205
|
+
invalid_properties.push("invalid value for 'horizontal_resolution', horizontal_resolution cannot be nil.")
|
206
|
+
end
|
207
|
+
|
208
|
+
if @vertical_resolution.nil?
|
209
|
+
invalid_properties.push("invalid value for 'vertical_resolution', vertical_resolution cannot be nil.")
|
210
|
+
end
|
211
|
+
|
212
|
+
if @bits_per_pixel.nil?
|
213
|
+
invalid_properties.push("invalid value for 'bits_per_pixel', bits_per_pixel cannot be nil.")
|
214
|
+
end
|
215
|
+
|
216
|
+
if @created_date.nil?
|
217
|
+
invalid_properties.push("invalid value for 'created_date', created_date cannot be nil.")
|
218
|
+
end
|
219
|
+
|
220
|
+
if @modified_date.nil?
|
221
|
+
invalid_properties.push("invalid value for 'modified_date', modified_date cannot be nil.")
|
222
|
+
end
|
223
|
+
|
224
|
+
if @is_password_protected.nil?
|
225
|
+
invalid_properties.push("invalid value for 'is_password_protected', is_password_protected cannot be nil.")
|
226
|
+
end
|
227
|
+
|
228
|
+
return invalid_properties
|
229
|
+
end
|
230
|
+
|
231
|
+
# Check to see if the all the properties in the model are valid
|
232
|
+
# @return true if the model is valid
|
233
|
+
def valid?
|
234
|
+
return false if @page_count.nil?
|
235
|
+
return false if @size.nil?
|
236
|
+
return false if @width.nil?
|
237
|
+
return false if @height.nil?
|
238
|
+
return false if @horizontal_resolution.nil?
|
239
|
+
return false if @vertical_resolution.nil?
|
240
|
+
return false if @bits_per_pixel.nil?
|
241
|
+
return false if @created_date.nil?
|
242
|
+
return false if @modified_date.nil?
|
243
|
+
return false if @is_password_protected.nil?
|
244
|
+
return true
|
245
|
+
end
|
246
|
+
|
247
|
+
# Checks equality by comparing each attribute.
|
248
|
+
# @param [Object] Object to be compared
|
249
|
+
def ==(other)
|
250
|
+
return true if self.equal?(other)
|
251
|
+
self.class == other.class &&
|
252
|
+
file_type == other.file_type &&
|
253
|
+
page_count == other.page_count &&
|
254
|
+
size == other.size &&
|
255
|
+
width == other.width &&
|
256
|
+
height == other.height &&
|
257
|
+
horizontal_resolution == other.horizontal_resolution &&
|
258
|
+
vertical_resolution == other.vertical_resolution &&
|
259
|
+
bits_per_pixel == other.bits_per_pixel &&
|
260
|
+
title == other.title &&
|
261
|
+
author == other.author &&
|
262
|
+
created_date == other.created_date &&
|
263
|
+
modified_date == other.modified_date &&
|
264
|
+
layers == other.layers &&
|
265
|
+
is_password_protected == other.is_password_protected
|
266
|
+
end
|
267
|
+
|
268
|
+
# @see the `==` method
|
269
|
+
# @param [Object] Object to be compared
|
270
|
+
def eql?(other)
|
271
|
+
self == other
|
272
|
+
end
|
273
|
+
|
274
|
+
# Calculates hash code according to all attributes.
|
275
|
+
# @return [Fixnum] Hash code
|
276
|
+
def hash
|
277
|
+
[file_type, page_count, size, width, height, horizontal_resolution, vertical_resolution, bits_per_pixel, title, author, created_date, modified_date, layers, is_password_protected].hash
|
278
|
+
end
|
279
|
+
|
280
|
+
# Downcases first letter.
|
281
|
+
# @return downcased string
|
282
|
+
def uncap(str)
|
283
|
+
str[0, 1].downcase + str[1..-1]
|
284
|
+
end
|
285
|
+
|
286
|
+
# Builds the object from hash
|
287
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
288
|
+
# @return [Object] Returns the model itself
|
289
|
+
def build_from_hash(attributes)
|
290
|
+
return nil unless attributes.is_a?(Hash)
|
291
|
+
self.class.swagger_types.each_pair do |key, type|
|
292
|
+
pname = uncap(self.class.attribute_map[key]).intern
|
293
|
+
value = attributes[pname]
|
294
|
+
if type =~ /\AArray<(.*)>/i
|
295
|
+
# check to ensure the input is an array given that the the attribute
|
296
|
+
# is documented as an array but the input is not
|
297
|
+
if value.is_a?(Array)
|
298
|
+
self.send("#{key}=", value.map { |v| _deserialize($1, v) })
|
299
|
+
end
|
300
|
+
elsif !value.nil?
|
301
|
+
self.send("#{key}=", _deserialize(type, value))
|
302
|
+
end
|
303
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
304
|
+
end
|
305
|
+
|
306
|
+
self
|
307
|
+
end
|
308
|
+
|
309
|
+
# Deserializes the data based on type
|
310
|
+
# @param string type Data type
|
311
|
+
# @param string value Value to be deserialized
|
312
|
+
# @return [Object] Deserialized data
|
313
|
+
def _deserialize(type, value)
|
314
|
+
case type.to_sym
|
315
|
+
when :DateTime
|
316
|
+
Date.parse value
|
317
|
+
when :Date
|
318
|
+
Date.parse value
|
319
|
+
when :String
|
320
|
+
value.to_s
|
321
|
+
when :Integer
|
322
|
+
value.to_i
|
323
|
+
when :Float
|
324
|
+
value.to_f
|
325
|
+
when :BOOLEAN
|
326
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
327
|
+
true
|
328
|
+
else
|
329
|
+
false
|
330
|
+
end
|
331
|
+
when :Object
|
332
|
+
# generic object (usually a Hash), return directly
|
333
|
+
value
|
334
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
335
|
+
inner_type = Regexp.last_match[:inner_type]
|
336
|
+
value.map { |v| _deserialize(inner_type, v) }
|
337
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
338
|
+
k_type = Regexp.last_match[:k_type]
|
339
|
+
v_type = Regexp.last_match[:v_type]
|
340
|
+
{}.tap do |hash|
|
341
|
+
value.each do |k, v|
|
342
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
343
|
+
end
|
344
|
+
end
|
345
|
+
else
|
346
|
+
# model
|
347
|
+
temp_model = GroupDocsConversionCloud.const_get(type).new
|
348
|
+
temp_model.build_from_hash(value)
|
349
|
+
end
|
350
|
+
end
|
351
|
+
|
352
|
+
# Returns the string representation of the object
|
353
|
+
# @return [String] String presentation of the object
|
354
|
+
def to_s
|
355
|
+
to_hash.to_s
|
356
|
+
end
|
357
|
+
|
358
|
+
# to_body is an alias to to_hash (backward compatibility)
|
359
|
+
# @return [Hash] Returns the object in the form of hash
|
360
|
+
def to_body
|
361
|
+
to_hash
|
362
|
+
end
|
363
|
+
|
364
|
+
# Returns the object in the form of hash
|
365
|
+
# @return [Hash] Returns the object in the form of hash
|
366
|
+
def to_hash
|
367
|
+
hash = {}
|
368
|
+
self.class.attribute_map.each_pair do |attr, param|
|
369
|
+
value = self.send(attr)
|
370
|
+
next if value.nil?
|
371
|
+
hash[param] = _to_hash(value)
|
372
|
+
end
|
373
|
+
hash
|
374
|
+
end
|
375
|
+
|
376
|
+
# Outputs non-array value in the form of hash
|
377
|
+
# For object, use to_hash. Otherwise, just return the value
|
378
|
+
# @param [Object] value Any valid value
|
379
|
+
# @return [Hash] Returns the value in the form of hash
|
380
|
+
def _to_hash(value)
|
381
|
+
if value.is_a?(Array)
|
382
|
+
value.compact.map { |v| _to_hash(v) }
|
383
|
+
elsif value.is_a?(Hash)
|
384
|
+
{}.tap do |hash|
|
385
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
386
|
+
end
|
387
|
+
elsif value.respond_to? :to_hash
|
388
|
+
value.to_hash
|
389
|
+
else
|
390
|
+
value
|
391
|
+
end
|
392
|
+
end
|
393
|
+
|
394
|
+
end
|
395
|
+
|
396
|
+
end
|