groupdocs_conversion_cloud 25.9 → 25.12

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.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/lib/groupdocs_conversion_cloud/models/{tsv_convert_options.rb → cad_convert_options.rb} +74 -32
  3. data/lib/groupdocs_conversion_cloud/models/{pps_convert_options.rb → compression_convert_options.rb} +7 -22
  4. data/lib/groupdocs_conversion_cloud/models/compression_load_options.rb +224 -0
  5. data/lib/groupdocs_conversion_cloud/models/database_load_options.rb +214 -0
  6. data/lib/groupdocs_conversion_cloud/models/{odp_convert_options.rb → diagram_convert_options.rb} +14 -24
  7. data/lib/groupdocs_conversion_cloud/models/e_book_load_options.rb +214 -0
  8. data/lib/groupdocs_conversion_cloud/models/{ppt_convert_options.rb → email_convert_options.rb} +7 -32
  9. data/lib/groupdocs_conversion_cloud/models/{otp_convert_options.rb → finance_convert_options.rb} +7 -32
  10. data/lib/groupdocs_conversion_cloud/models/{ppsm_convert_options.rb → finance_load_options.rb} +11 -78
  11. data/lib/groupdocs_conversion_cloud/models/{potm_convert_options.rb → font_convert_options.rb} +7 -32
  12. data/lib/groupdocs_conversion_cloud/models/font_load_options.rb +214 -0
  13. data/lib/groupdocs_conversion_cloud/models/{txt_convert_options.rb → gis_convert_options.rb} +3 -3
  14. data/lib/groupdocs_conversion_cloud/models/gis_load_options.rb +244 -0
  15. data/lib/groupdocs_conversion_cloud/models/image_convert_options.rb +44 -4
  16. data/lib/groupdocs_conversion_cloud/models/jpg_convert_options.rb +1 -265
  17. data/lib/groupdocs_conversion_cloud/models/mbox_load_options.rb +214 -0
  18. data/lib/groupdocs_conversion_cloud/models/{one_load_options.rb → note_load_options.rb} +2 -2
  19. data/lib/groupdocs_conversion_cloud/models/olm_load_options.rb +224 -0
  20. data/lib/groupdocs_conversion_cloud/models/pdl_convert_options.rb +35 -5
  21. data/lib/groupdocs_conversion_cloud/models/pdl_load_options.rb +214 -0
  22. data/lib/groupdocs_conversion_cloud/models/project_management_convert_options.rb +256 -0
  23. data/lib/groupdocs_conversion_cloud/models/psd_convert_options.rb +1 -244
  24. data/lib/groupdocs_conversion_cloud/models/pub_load_options.rb +214 -0
  25. data/lib/groupdocs_conversion_cloud/models/rtf_convert_options.rb +1 -237
  26. data/lib/groupdocs_conversion_cloud/models/spreadsheet_convert_options.rb +4 -19
  27. data/lib/groupdocs_conversion_cloud/models/three_d_convert_options.rb +256 -0
  28. data/lib/groupdocs_conversion_cloud/models/three_d_load_options.rb +214 -0
  29. data/lib/groupdocs_conversion_cloud/models/tiff_convert_options.rb +1 -244
  30. data/lib/groupdocs_conversion_cloud/models/vcf_load_options.rb +224 -0
  31. data/lib/groupdocs_conversion_cloud/models/webp_convert_options.rb +1 -265
  32. data/lib/groupdocs_conversion_cloud/models/word_processing_convert_options.rb +14 -4
  33. data/lib/groupdocs_conversion_cloud/version.rb +1 -1
  34. data/lib/groupdocs_conversion_cloud.rb +27 -53
  35. metadata +24 -50
  36. data/lib/groupdocs_conversion_cloud/models/bmp_convert_options.rb +0 -468
  37. data/lib/groupdocs_conversion_cloud/models/dcm_convert_options.rb +0 -468
  38. data/lib/groupdocs_conversion_cloud/models/djvu_convert_options.rb +0 -468
  39. data/lib/groupdocs_conversion_cloud/models/dng_convert_options.rb +0 -468
  40. data/lib/groupdocs_conversion_cloud/models/doc_convert_options.rb +0 -440
  41. data/lib/groupdocs_conversion_cloud/models/docm_convert_options.rb +0 -440
  42. data/lib/groupdocs_conversion_cloud/models/docx_convert_options.rb +0 -440
  43. data/lib/groupdocs_conversion_cloud/models/dot_convert_options.rb +0 -440
  44. data/lib/groupdocs_conversion_cloud/models/dotm_convert_options.rb +0 -440
  45. data/lib/groupdocs_conversion_cloud/models/dotx_convert_options.rb +0 -440
  46. data/lib/groupdocs_conversion_cloud/models/emf_convert_options.rb +0 -468
  47. data/lib/groupdocs_conversion_cloud/models/gif_convert_options.rb +0 -468
  48. data/lib/groupdocs_conversion_cloud/models/ico_convert_options.rb +0 -468
  49. data/lib/groupdocs_conversion_cloud/models/j2c_convert_options.rb +0 -483
  50. data/lib/groupdocs_conversion_cloud/models/j2k_convert_options.rb +0 -483
  51. data/lib/groupdocs_conversion_cloud/models/jp2_convert_options.rb +0 -483
  52. data/lib/groupdocs_conversion_cloud/models/jpeg_convert_options.rb +0 -483
  53. data/lib/groupdocs_conversion_cloud/models/jpf_convert_options.rb +0 -483
  54. data/lib/groupdocs_conversion_cloud/models/jpm_convert_options.rb +0 -483
  55. data/lib/groupdocs_conversion_cloud/models/jpx_convert_options.rb +0 -483
  56. data/lib/groupdocs_conversion_cloud/models/odg_convert_options.rb +0 -468
  57. data/lib/groupdocs_conversion_cloud/models/ods_convert_options.rb +0 -296
  58. data/lib/groupdocs_conversion_cloud/models/odt_convert_options.rb +0 -440
  59. data/lib/groupdocs_conversion_cloud/models/ots_convert_options.rb +0 -296
  60. data/lib/groupdocs_conversion_cloud/models/ott_convert_options.rb +0 -440
  61. data/lib/groupdocs_conversion_cloud/models/png_convert_options.rb +0 -468
  62. data/lib/groupdocs_conversion_cloud/models/potx_convert_options.rb +0 -281
  63. data/lib/groupdocs_conversion_cloud/models/ppsx_convert_options.rb +0 -281
  64. data/lib/groupdocs_conversion_cloud/models/pptm_convert_options.rb +0 -281
  65. data/lib/groupdocs_conversion_cloud/models/pptx_convert_options.rb +0 -281
  66. data/lib/groupdocs_conversion_cloud/models/tif_convert_options.rb +0 -494
  67. data/lib/groupdocs_conversion_cloud/models/wmf_convert_options.rb +0 -468
  68. data/lib/groupdocs_conversion_cloud/models/xls2003_convert_options.rb +0 -296
  69. data/lib/groupdocs_conversion_cloud/models/xls_convert_options.rb +0 -296
  70. data/lib/groupdocs_conversion_cloud/models/xlsb_convert_options.rb +0 -296
  71. data/lib/groupdocs_conversion_cloud/models/xlsm_convert_options.rb +0 -296
  72. data/lib/groupdocs_conversion_cloud/models/xlsx_convert_options.rb +0 -296
  73. data/lib/groupdocs_conversion_cloud/models/xltm_convert_options.rb +0 -296
  74. data/lib/groupdocs_conversion_cloud/models/xltx_convert_options.rb +0 -296
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75774957dc308e2667ec3c3152e4e125ce8e046deb072ec7602924162cc18c6f
4
- data.tar.gz: 76337f3a01f88d34ea34695f59c0221119cb15457d4d9397f6f2db85d291992c
3
+ metadata.gz: 9b1ed8cd55ca604107efc20ba226287a4c5fe66b839dfefd32d56ab6f714c6cf
4
+ data.tar.gz: 19e573ad7da6438550d30e0f045f66cdf229c099b9d3b9300c591157227cab4d
5
5
  SHA512:
6
- metadata.gz: eefc308f561163c516a5946f9fd33e4183b6ab3e5650b4d27ec3870e0c9145a9d4363a2d8a2bfe4dce445e466fcec08602aa780f2c668908c4888d2353101b4f
7
- data.tar.gz: 891542daf965004769bfecbe389ee56643a9ebe0b78bd69da37c5d2acb3196101b479ff7a8425f34ab96b6907163be148cfa9ae59d4c47cfbe2e0e773dd6575d
6
+ metadata.gz: ef40dd950a0173af03fe06c468b0d088ee70b507dbad85e6eb615ac860e12cce20605e83bc5da541dd25b5a67baa145bd59a79086b4bd460f1ce988dd3980142
7
+ data.tar.gz: a8e52cb7f91b612f8b2f1ed05c9c9acc4b8765fb4f66df89c53ee27b5d162fe14e6e5023ded842160450f0db8f589383088a83b86300e961c5f0436e701557d7
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="tsv_convert_options.rb">
3
+ # <copyright company="Aspose Pty Ltd" file="cad_convert_options.rb">
4
4
  # Copyright (c) Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
@@ -28,8 +28,8 @@
28
28
  require 'date'
29
29
 
30
30
  module GroupDocsConversionCloud
31
- # Tsv convert options
32
- class TsvConvertOptions
31
+ # Options for to Cad conversion
32
+ class CadConvertOptions
33
33
 
34
34
  # Start conversion from FromPage page
35
35
  attr_accessor :from_page
@@ -43,14 +43,35 @@ module GroupDocsConversionCloud
43
43
  # Watermark specific options
44
44
  attr_accessor :watermark_options
45
45
 
46
- # Set this property if you want to protect the converted document with a password
47
- attr_accessor :password
48
-
49
- # Specifies the zoom level in percentage. Default is 100.
50
- attr_accessor :zoom
46
+ # Desired page width after conversion
47
+ attr_accessor :width
48
+
49
+ # Desired page height after conversion
50
+ attr_accessor :height
51
+
52
+ # Page size
53
+ attr_accessor :page_size
54
+ class EnumAttributeValidator
55
+ attr_reader :datatype
56
+ attr_reader :allowable_values
57
+
58
+ def initialize(datatype, allowable_values)
59
+ @allowable_values = allowable_values.map do |value|
60
+ case datatype.to_s
61
+ when /Integer/i
62
+ value.to_i
63
+ when /Float/i
64
+ value.to_f
65
+ else
66
+ value
67
+ end
68
+ end
69
+ end
51
70
 
52
- # If true, the input firstly is converted to PDF and after that to desired format
53
- attr_accessor :use_pdf
71
+ def valid?(value)
72
+ !value || allowable_values.include?(value)
73
+ end
74
+ end
54
75
 
55
76
  # Attribute mapping from ruby-style variable name to JSON key.
56
77
  def self.attribute_map
@@ -59,9 +80,9 @@ module GroupDocsConversionCloud
59
80
  :'pages_count' => :'PagesCount',
60
81
  :'pages' => :'Pages',
61
82
  :'watermark_options' => :'WatermarkOptions',
62
- :'password' => :'Password',
63
- :'zoom' => :'Zoom',
64
- :'use_pdf' => :'UsePdf'
83
+ :'width' => :'Width',
84
+ :'height' => :'Height',
85
+ :'page_size' => :'PageSize'
65
86
  }
66
87
  end
67
88
 
@@ -72,9 +93,9 @@ module GroupDocsConversionCloud
72
93
  :'pages_count' => :'Integer',
73
94
  :'pages' => :'Array<Integer>',
74
95
  :'watermark_options' => :'WatermarkOptions',
75
- :'password' => :'String',
76
- :'zoom' => :'Integer',
77
- :'use_pdf' => :'BOOLEAN'
96
+ :'width' => :'Integer',
97
+ :'height' => :'Integer',
98
+ :'page_size' => :'String'
78
99
  }
79
100
  end
80
101
 
@@ -104,16 +125,16 @@ module GroupDocsConversionCloud
104
125
  self.watermark_options = attributes[:'WatermarkOptions']
105
126
  end
106
127
 
107
- if attributes.key?(:'Password')
108
- self.password = attributes[:'Password']
128
+ if attributes.key?(:'Width')
129
+ self.width = attributes[:'Width']
109
130
  end
110
131
 
111
- if attributes.key?(:'Zoom')
112
- self.zoom = attributes[:'Zoom']
132
+ if attributes.key?(:'Height')
133
+ self.height = attributes[:'Height']
113
134
  end
114
135
 
115
- if attributes.key?(:'UsePdf')
116
- self.use_pdf = attributes[:'UsePdf']
136
+ if attributes.key?(:'PageSize')
137
+ self.page_size = attributes[:'PageSize']
117
138
  end
118
139
 
119
140
  end
@@ -130,12 +151,16 @@ module GroupDocsConversionCloud
130
151
  invalid_properties.push("invalid value for 'pages_count', pages_count cannot be nil.")
131
152
  end
132
153
 
133
- if @zoom.nil?
134
- invalid_properties.push("invalid value for 'zoom', zoom cannot be nil.")
154
+ if @width.nil?
155
+ invalid_properties.push("invalid value for 'width', width cannot be nil.")
135
156
  end
136
157
 
137
- if @use_pdf.nil?
138
- invalid_properties.push("invalid value for 'use_pdf', use_pdf cannot be nil.")
158
+ if @height.nil?
159
+ invalid_properties.push("invalid value for 'height', height cannot be nil.")
160
+ end
161
+
162
+ if @page_size.nil?
163
+ invalid_properties.push("invalid value for 'page_size', page_size cannot be nil.")
139
164
  end
140
165
 
141
166
  return invalid_properties
@@ -146,11 +171,28 @@ module GroupDocsConversionCloud
146
171
  def valid?
147
172
  return false if @from_page.nil?
148
173
  return false if @pages_count.nil?
149
- return false if @zoom.nil?
150
- return false if @use_pdf.nil?
174
+ return false if @width.nil?
175
+ return false if @height.nil?
176
+ return false if @page_size.nil?
177
+ page_size_validator = EnumAttributeValidator.new('String', ["Default", "A3", "Statement", "Quarto", "Paper11x17", "Paper10x14", "Letter", "Legal", "Ledger", "Folio", "Executive", "EnvelopeDL", "Custom", "B5", "B4", "A5", "A4", "Tabloid"])
178
+ return false unless page_size_validator.valid?(@page_size)
151
179
  return true
152
180
  end
153
181
 
182
+ # Custom attribute writer method checking allowed values (enum).
183
+ # @param [Object] page_size Object to be assigned
184
+ def page_size=(page_size)
185
+ validator = EnumAttributeValidator.new('String', ["Default", "A3", "Statement", "Quarto", "Paper11x17", "Paper10x14", "Letter", "Legal", "Ledger", "Folio", "Executive", "EnvelopeDL", "Custom", "B5", "B4", "A5", "A4", "Tabloid"])
186
+ if page_size.to_i == 0
187
+ unless validator.valid?(page_size)
188
+ raise ArgumentError, "invalid value for 'page_size', must be one of #{validator.allowable_values}."
189
+ end
190
+ @page_size = page_size
191
+ else
192
+ @page_size = validator.allowable_values[page_size.to_i]
193
+ end
194
+ end
195
+
154
196
  # Checks equality by comparing each attribute.
155
197
  # @param [Object] Object to be compared
156
198
  def ==(other)
@@ -160,9 +202,9 @@ module GroupDocsConversionCloud
160
202
  pages_count == other.pages_count &&
161
203
  pages == other.pages &&
162
204
  watermark_options == other.watermark_options &&
163
- password == other.password &&
164
- zoom == other.zoom &&
165
- use_pdf == other.use_pdf
205
+ width == other.width &&
206
+ height == other.height &&
207
+ page_size == other.page_size
166
208
  end
167
209
 
168
210
  # @see the `==` method
@@ -174,7 +216,7 @@ module GroupDocsConversionCloud
174
216
  # Calculates hash code according to all attributes.
175
217
  # @return [Fixnum] Hash code
176
218
  def hash
177
- [from_page, pages_count, pages, watermark_options, password, zoom, use_pdf].hash
219
+ [from_page, pages_count, pages, watermark_options, width, height, page_size].hash
178
220
  end
179
221
 
180
222
  # Downcases first letter.
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="pps_convert_options.rb">
3
+ # <copyright company="Aspose Pty Ltd" file="compression_convert_options.rb">
4
4
  # Copyright (c) Aspose Pty Ltd
5
5
  # </copyright>
6
6
  # <summary>
@@ -28,8 +28,8 @@
28
28
  require 'date'
29
29
 
30
30
  module GroupDocsConversionCloud
31
- # Pps convert options
32
- class PpsConvertOptions
31
+ # Options for to zip conversion
32
+ class CompressionConvertOptions
33
33
 
34
34
  # Start conversion from FromPage page
35
35
  attr_accessor :from_page
@@ -46,9 +46,6 @@ module GroupDocsConversionCloud
46
46
  # Set this property if you want to protect the converted document with a password
47
47
  attr_accessor :password
48
48
 
49
- # Specifies the zoom level in percentage. Default is 100. Default zoom is supported till Microsoft Powerpoint 2010. Starting from Microsoft Powerpoint 2013 default zoom is no longer set to document, instead it appears to use the zoom factor of the last document that was opened.
50
- attr_accessor :zoom
51
-
52
49
  # Attribute mapping from ruby-style variable name to JSON key.
53
50
  def self.attribute_map
54
51
  {
@@ -56,8 +53,7 @@ module GroupDocsConversionCloud
56
53
  :'pages_count' => :'PagesCount',
57
54
  :'pages' => :'Pages',
58
55
  :'watermark_options' => :'WatermarkOptions',
59
- :'password' => :'Password',
60
- :'zoom' => :'Zoom'
56
+ :'password' => :'Password'
61
57
  }
62
58
  end
63
59
 
@@ -68,8 +64,7 @@ module GroupDocsConversionCloud
68
64
  :'pages_count' => :'Integer',
69
65
  :'pages' => :'Array<Integer>',
70
66
  :'watermark_options' => :'WatermarkOptions',
71
- :'password' => :'String',
72
- :'zoom' => :'Integer'
67
+ :'password' => :'String'
73
68
  }
74
69
  end
75
70
 
@@ -103,10 +98,6 @@ module GroupDocsConversionCloud
103
98
  self.password = attributes[:'Password']
104
99
  end
105
100
 
106
- if attributes.key?(:'Zoom')
107
- self.zoom = attributes[:'Zoom']
108
- end
109
-
110
101
  end
111
102
 
112
103
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -121,10 +112,6 @@ module GroupDocsConversionCloud
121
112
  invalid_properties.push("invalid value for 'pages_count', pages_count cannot be nil.")
122
113
  end
123
114
 
124
- if @zoom.nil?
125
- invalid_properties.push("invalid value for 'zoom', zoom cannot be nil.")
126
- end
127
-
128
115
  return invalid_properties
129
116
  end
130
117
 
@@ -133,7 +120,6 @@ module GroupDocsConversionCloud
133
120
  def valid?
134
121
  return false if @from_page.nil?
135
122
  return false if @pages_count.nil?
136
- return false if @zoom.nil?
137
123
  return true
138
124
  end
139
125
 
@@ -146,8 +132,7 @@ module GroupDocsConversionCloud
146
132
  pages_count == other.pages_count &&
147
133
  pages == other.pages &&
148
134
  watermark_options == other.watermark_options &&
149
- password == other.password &&
150
- zoom == other.zoom
135
+ password == other.password
151
136
  end
152
137
 
153
138
  # @see the `==` method
@@ -159,7 +144,7 @@ module GroupDocsConversionCloud
159
144
  # Calculates hash code according to all attributes.
160
145
  # @return [Fixnum] Hash code
161
146
  def hash
162
- [from_page, pages_count, pages, watermark_options, password, zoom].hash
147
+ [from_page, pages_count, pages, watermark_options, password].hash
163
148
  end
164
149
 
165
150
  # Downcases first letter.
@@ -0,0 +1,224 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="compression_load_options.rb">
4
+ # Copyright (c) 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
+ # Options for loading compression documents
32
+ class CompressionLoadOptions
33
+
34
+ # The format of input file, (\"docx\", for example). This field must be filled with correct input file format when using ConvertDirect method, which accept input file as binary stream, and, because of that, API can correctly handle LoadOptions. In regular conversion, the input file format taken from the input file name and this field ignored.
35
+ attr_accessor :format
36
+
37
+ # Set password to load protected document.
38
+ attr_accessor :password
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'format' => :'Format',
44
+ :'password' => :'Password'
45
+ }
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.swagger_types
50
+ {
51
+ :'format' => :'String',
52
+ :'password' => :'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?(:'Format')
65
+ self.format = attributes[:'Format']
66
+ end
67
+
68
+ if attributes.key?(:'Password')
69
+ self.password = attributes[:'Password']
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
+ format == other.format &&
93
+ password == other.password
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
+ [format, password].hash
106
+ end
107
+
108
+ # Downcases first letter.
109
+ # @return downcased string
110
+ def uncap(str)
111
+ str[0, 1].downcase + str[1..-1]
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def build_from_hash(attributes)
118
+ return nil unless attributes.is_a?(Hash)
119
+ self.class.swagger_types.each_pair do |key, type|
120
+ pname = uncap(self.class.attribute_map[key]).intern
121
+ value = attributes[pname]
122
+ if type =~ /\AArray<(.*)>/i
123
+ # check to ensure the input is an array given that the the attribute
124
+ # is documented as an array but the input is not
125
+ if value.is_a?(Array)
126
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
127
+ end
128
+ elsif !value.nil?
129
+ self.send("#{key}=", _deserialize(type, value))
130
+ end
131
+ # or else data not found in attributes(hash), not an issue as the data can be optional
132
+ end
133
+
134
+ self
135
+ end
136
+
137
+ # Deserializes the data based on type
138
+ # @param string type Data type
139
+ # @param string value Value to be deserialized
140
+ # @return [Object] Deserialized data
141
+ def _deserialize(type, value)
142
+ case type.to_sym
143
+ when :DateTime
144
+ Date.parse value
145
+ when :Date
146
+ Date.parse value
147
+ when :String
148
+ value.to_s
149
+ when :Integer
150
+ value.to_i
151
+ when :Float
152
+ value.to_f
153
+ when :BOOLEAN
154
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
155
+ true
156
+ else
157
+ false
158
+ end
159
+ when :Object
160
+ # generic object (usually a Hash), return directly
161
+ value
162
+ when /\AArray<(?<inner_type>.+)>\z/
163
+ inner_type = Regexp.last_match[:inner_type]
164
+ value.map { |v| _deserialize(inner_type, v) }
165
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
166
+ k_type = Regexp.last_match[:k_type]
167
+ v_type = Regexp.last_match[:v_type]
168
+ {}.tap do |hash|
169
+ value.each do |k, v|
170
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
171
+ end
172
+ end
173
+ else
174
+ # model
175
+ temp_model = GroupDocsConversionCloud.const_get(type).new
176
+ temp_model.build_from_hash(value)
177
+ end
178
+ end
179
+
180
+ # Returns the string representation of the object
181
+ # @return [String] String presentation of the object
182
+ def to_s
183
+ to_hash.to_s
184
+ end
185
+
186
+ # to_body is an alias to to_hash (backward compatibility)
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_body
189
+ to_hash
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ next if value.nil?
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ # Outputs non-array value in the form of hash
205
+ # For object, use to_hash. Otherwise, just return the value
206
+ # @param [Object] value Any valid value
207
+ # @return [Hash] Returns the value in the form of hash
208
+ def _to_hash(value)
209
+ if value.is_a?(Array)
210
+ value.compact.map { |v| _to_hash(v) }
211
+ elsif value.is_a?(Hash)
212
+ {}.tap do |hash|
213
+ value.each { |k, v| hash[k] = _to_hash(v) }
214
+ end
215
+ elsif value.respond_to? :to_hash
216
+ value.to_hash
217
+ else
218
+ value
219
+ end
220
+ end
221
+
222
+ end
223
+
224
+ end