groupdocs_conversion_cloud 24.4 → 24.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -40,9 +40,6 @@ module GroupDocsConversionCloud
40
40
  # Option to display or hide \"from\" email address. Default: true
41
41
  attr_accessor :display_from_email_address
42
42
 
43
- # Option to display or hide email address. Default: true
44
- attr_accessor :display_email_address
45
-
46
43
  # Option to display or hide \"to\" email address. Default: true
47
44
  attr_accessor :display_to_email_address
48
45
 
@@ -70,7 +67,6 @@ module GroupDocsConversionCloud
70
67
  :'format' => :'Format',
71
68
  :'display_header' => :'DisplayHeader',
72
69
  :'display_from_email_address' => :'DisplayFromEmailAddress',
73
- :'display_email_address' => :'DisplayEmailAddress',
74
70
  :'display_to_email_address' => :'DisplayToEmailAddress',
75
71
  :'display_cc_email_address' => :'DisplayCcEmailAddress',
76
72
  :'display_bcc_email_address' => :'DisplayBccEmailAddress',
@@ -87,7 +83,6 @@ module GroupDocsConversionCloud
87
83
  :'format' => :'String',
88
84
  :'display_header' => :'BOOLEAN',
89
85
  :'display_from_email_address' => :'BOOLEAN',
90
- :'display_email_address' => :'BOOLEAN',
91
86
  :'display_to_email_address' => :'BOOLEAN',
92
87
  :'display_cc_email_address' => :'BOOLEAN',
93
88
  :'display_bcc_email_address' => :'BOOLEAN',
@@ -118,10 +113,6 @@ module GroupDocsConversionCloud
118
113
  self.display_from_email_address = attributes[:'DisplayFromEmailAddress']
119
114
  end
120
115
 
121
- if attributes.key?(:'DisplayEmailAddress')
122
- self.display_email_address = attributes[:'DisplayEmailAddress']
123
- end
124
-
125
116
  if attributes.key?(:'DisplayToEmailAddress')
126
117
  self.display_to_email_address = attributes[:'DisplayToEmailAddress']
127
118
  end
@@ -166,10 +157,6 @@ module GroupDocsConversionCloud
166
157
  invalid_properties.push("invalid value for 'display_from_email_address', display_from_email_address cannot be nil.")
167
158
  end
168
159
 
169
- if @display_email_address.nil?
170
- invalid_properties.push("invalid value for 'display_email_address', display_email_address cannot be nil.")
171
- end
172
-
173
160
  if @display_to_email_address.nil?
174
161
  invalid_properties.push("invalid value for 'display_to_email_address', display_to_email_address cannot be nil.")
175
162
  end
@@ -198,7 +185,6 @@ module GroupDocsConversionCloud
198
185
  def valid?
199
186
  return false if @display_header.nil?
200
187
  return false if @display_from_email_address.nil?
201
- return false if @display_email_address.nil?
202
188
  return false if @display_to_email_address.nil?
203
189
  return false if @display_cc_email_address.nil?
204
190
  return false if @display_bcc_email_address.nil?
@@ -215,7 +201,6 @@ module GroupDocsConversionCloud
215
201
  format == other.format &&
216
202
  display_header == other.display_header &&
217
203
  display_from_email_address == other.display_from_email_address &&
218
- display_email_address == other.display_email_address &&
219
204
  display_to_email_address == other.display_to_email_address &&
220
205
  display_cc_email_address == other.display_cc_email_address &&
221
206
  display_bcc_email_address == other.display_bcc_email_address &&
@@ -234,7 +219,7 @@ module GroupDocsConversionCloud
234
219
  # Calculates hash code according to all attributes.
235
220
  # @return [Fixnum] Hash code
236
221
  def hash
237
- [format, display_header, display_from_email_address, display_email_address, display_to_email_address, display_cc_email_address, display_bcc_email_address, time_zone_offset, convert_attachments, field_labels, preserve_original_date].hash
222
+ [format, display_header, display_from_email_address, display_to_email_address, display_cc_email_address, display_bcc_email_address, time_zone_offset, convert_attachments, field_labels, preserve_original_date].hash
238
223
  end
239
224
 
240
225
  # Downcases first letter.
@@ -40,9 +40,6 @@ module GroupDocsConversionCloud
40
40
  # Option to display or hide \"from\" email address. Default: true
41
41
  attr_accessor :display_from_email_address
42
42
 
43
- # Option to display or hide email address. Default: true
44
- attr_accessor :display_email_address
45
-
46
43
  # Option to display or hide \"to\" email address. Default: true
47
44
  attr_accessor :display_to_email_address
48
45
 
@@ -70,7 +67,6 @@ module GroupDocsConversionCloud
70
67
  :'format' => :'Format',
71
68
  :'display_header' => :'DisplayHeader',
72
69
  :'display_from_email_address' => :'DisplayFromEmailAddress',
73
- :'display_email_address' => :'DisplayEmailAddress',
74
70
  :'display_to_email_address' => :'DisplayToEmailAddress',
75
71
  :'display_cc_email_address' => :'DisplayCcEmailAddress',
76
72
  :'display_bcc_email_address' => :'DisplayBccEmailAddress',
@@ -87,7 +83,6 @@ module GroupDocsConversionCloud
87
83
  :'format' => :'String',
88
84
  :'display_header' => :'BOOLEAN',
89
85
  :'display_from_email_address' => :'BOOLEAN',
90
- :'display_email_address' => :'BOOLEAN',
91
86
  :'display_to_email_address' => :'BOOLEAN',
92
87
  :'display_cc_email_address' => :'BOOLEAN',
93
88
  :'display_bcc_email_address' => :'BOOLEAN',
@@ -118,10 +113,6 @@ module GroupDocsConversionCloud
118
113
  self.display_from_email_address = attributes[:'DisplayFromEmailAddress']
119
114
  end
120
115
 
121
- if attributes.key?(:'DisplayEmailAddress')
122
- self.display_email_address = attributes[:'DisplayEmailAddress']
123
- end
124
-
125
116
  if attributes.key?(:'DisplayToEmailAddress')
126
117
  self.display_to_email_address = attributes[:'DisplayToEmailAddress']
127
118
  end
@@ -166,10 +157,6 @@ module GroupDocsConversionCloud
166
157
  invalid_properties.push("invalid value for 'display_from_email_address', display_from_email_address cannot be nil.")
167
158
  end
168
159
 
169
- if @display_email_address.nil?
170
- invalid_properties.push("invalid value for 'display_email_address', display_email_address cannot be nil.")
171
- end
172
-
173
160
  if @display_to_email_address.nil?
174
161
  invalid_properties.push("invalid value for 'display_to_email_address', display_to_email_address cannot be nil.")
175
162
  end
@@ -198,7 +185,6 @@ module GroupDocsConversionCloud
198
185
  def valid?
199
186
  return false if @display_header.nil?
200
187
  return false if @display_from_email_address.nil?
201
- return false if @display_email_address.nil?
202
188
  return false if @display_to_email_address.nil?
203
189
  return false if @display_cc_email_address.nil?
204
190
  return false if @display_bcc_email_address.nil?
@@ -215,7 +201,6 @@ module GroupDocsConversionCloud
215
201
  format == other.format &&
216
202
  display_header == other.display_header &&
217
203
  display_from_email_address == other.display_from_email_address &&
218
- display_email_address == other.display_email_address &&
219
204
  display_to_email_address == other.display_to_email_address &&
220
205
  display_cc_email_address == other.display_cc_email_address &&
221
206
  display_bcc_email_address == other.display_bcc_email_address &&
@@ -234,7 +219,7 @@ module GroupDocsConversionCloud
234
219
  # Calculates hash code according to all attributes.
235
220
  # @return [Fixnum] Hash code
236
221
  def hash
237
- [format, display_header, display_from_email_address, display_email_address, display_to_email_address, display_cc_email_address, display_bcc_email_address, time_zone_offset, convert_attachments, field_labels, preserve_original_date].hash
222
+ [format, display_header, display_from_email_address, display_to_email_address, display_cc_email_address, display_bcc_email_address, time_zone_offset, convert_attachments, field_labels, preserve_original_date].hash
238
223
  end
239
224
 
240
225
  # Downcases first letter.
@@ -40,9 +40,6 @@ module GroupDocsConversionCloud
40
40
  # Option to display or hide \"from\" email address. Default: true
41
41
  attr_accessor :display_from_email_address
42
42
 
43
- # Option to display or hide email address. Default: true
44
- attr_accessor :display_email_address
45
-
46
43
  # Option to display or hide \"to\" email address. Default: true
47
44
  attr_accessor :display_to_email_address
48
45
 
@@ -70,7 +67,6 @@ module GroupDocsConversionCloud
70
67
  :'format' => :'Format',
71
68
  :'display_header' => :'DisplayHeader',
72
69
  :'display_from_email_address' => :'DisplayFromEmailAddress',
73
- :'display_email_address' => :'DisplayEmailAddress',
74
70
  :'display_to_email_address' => :'DisplayToEmailAddress',
75
71
  :'display_cc_email_address' => :'DisplayCcEmailAddress',
76
72
  :'display_bcc_email_address' => :'DisplayBccEmailAddress',
@@ -87,7 +83,6 @@ module GroupDocsConversionCloud
87
83
  :'format' => :'String',
88
84
  :'display_header' => :'BOOLEAN',
89
85
  :'display_from_email_address' => :'BOOLEAN',
90
- :'display_email_address' => :'BOOLEAN',
91
86
  :'display_to_email_address' => :'BOOLEAN',
92
87
  :'display_cc_email_address' => :'BOOLEAN',
93
88
  :'display_bcc_email_address' => :'BOOLEAN',
@@ -118,10 +113,6 @@ module GroupDocsConversionCloud
118
113
  self.display_from_email_address = attributes[:'DisplayFromEmailAddress']
119
114
  end
120
115
 
121
- if attributes.key?(:'DisplayEmailAddress')
122
- self.display_email_address = attributes[:'DisplayEmailAddress']
123
- end
124
-
125
116
  if attributes.key?(:'DisplayToEmailAddress')
126
117
  self.display_to_email_address = attributes[:'DisplayToEmailAddress']
127
118
  end
@@ -166,10 +157,6 @@ module GroupDocsConversionCloud
166
157
  invalid_properties.push("invalid value for 'display_from_email_address', display_from_email_address cannot be nil.")
167
158
  end
168
159
 
169
- if @display_email_address.nil?
170
- invalid_properties.push("invalid value for 'display_email_address', display_email_address cannot be nil.")
171
- end
172
-
173
160
  if @display_to_email_address.nil?
174
161
  invalid_properties.push("invalid value for 'display_to_email_address', display_to_email_address cannot be nil.")
175
162
  end
@@ -198,7 +185,6 @@ module GroupDocsConversionCloud
198
185
  def valid?
199
186
  return false if @display_header.nil?
200
187
  return false if @display_from_email_address.nil?
201
- return false if @display_email_address.nil?
202
188
  return false if @display_to_email_address.nil?
203
189
  return false if @display_cc_email_address.nil?
204
190
  return false if @display_bcc_email_address.nil?
@@ -215,7 +201,6 @@ module GroupDocsConversionCloud
215
201
  format == other.format &&
216
202
  display_header == other.display_header &&
217
203
  display_from_email_address == other.display_from_email_address &&
218
- display_email_address == other.display_email_address &&
219
204
  display_to_email_address == other.display_to_email_address &&
220
205
  display_cc_email_address == other.display_cc_email_address &&
221
206
  display_bcc_email_address == other.display_bcc_email_address &&
@@ -234,7 +219,7 @@ module GroupDocsConversionCloud
234
219
  # Calculates hash code according to all attributes.
235
220
  # @return [Fixnum] Hash code
236
221
  def hash
237
- [format, display_header, display_from_email_address, display_email_address, display_to_email_address, display_cc_email_address, display_bcc_email_address, time_zone_offset, convert_attachments, field_labels, preserve_original_date].hash
222
+ [format, display_header, display_from_email_address, display_to_email_address, display_cc_email_address, display_bcc_email_address, time_zone_offset, convert_attachments, field_labels, preserve_original_date].hash
238
223
  end
239
224
 
240
225
  # Downcases first letter.
@@ -40,9 +40,6 @@ module GroupDocsConversionCloud
40
40
  # Option to display or hide \"from\" email address. Default: true
41
41
  attr_accessor :display_from_email_address
42
42
 
43
- # Option to display or hide email address. Default: true
44
- attr_accessor :display_email_address
45
-
46
43
  # Option to display or hide \"to\" email address. Default: true
47
44
  attr_accessor :display_to_email_address
48
45
 
@@ -70,7 +67,6 @@ module GroupDocsConversionCloud
70
67
  :'format' => :'Format',
71
68
  :'display_header' => :'DisplayHeader',
72
69
  :'display_from_email_address' => :'DisplayFromEmailAddress',
73
- :'display_email_address' => :'DisplayEmailAddress',
74
70
  :'display_to_email_address' => :'DisplayToEmailAddress',
75
71
  :'display_cc_email_address' => :'DisplayCcEmailAddress',
76
72
  :'display_bcc_email_address' => :'DisplayBccEmailAddress',
@@ -87,7 +83,6 @@ module GroupDocsConversionCloud
87
83
  :'format' => :'String',
88
84
  :'display_header' => :'BOOLEAN',
89
85
  :'display_from_email_address' => :'BOOLEAN',
90
- :'display_email_address' => :'BOOLEAN',
91
86
  :'display_to_email_address' => :'BOOLEAN',
92
87
  :'display_cc_email_address' => :'BOOLEAN',
93
88
  :'display_bcc_email_address' => :'BOOLEAN',
@@ -118,10 +113,6 @@ module GroupDocsConversionCloud
118
113
  self.display_from_email_address = attributes[:'DisplayFromEmailAddress']
119
114
  end
120
115
 
121
- if attributes.key?(:'DisplayEmailAddress')
122
- self.display_email_address = attributes[:'DisplayEmailAddress']
123
- end
124
-
125
116
  if attributes.key?(:'DisplayToEmailAddress')
126
117
  self.display_to_email_address = attributes[:'DisplayToEmailAddress']
127
118
  end
@@ -166,10 +157,6 @@ module GroupDocsConversionCloud
166
157
  invalid_properties.push("invalid value for 'display_from_email_address', display_from_email_address cannot be nil.")
167
158
  end
168
159
 
169
- if @display_email_address.nil?
170
- invalid_properties.push("invalid value for 'display_email_address', display_email_address cannot be nil.")
171
- end
172
-
173
160
  if @display_to_email_address.nil?
174
161
  invalid_properties.push("invalid value for 'display_to_email_address', display_to_email_address cannot be nil.")
175
162
  end
@@ -198,7 +185,6 @@ module GroupDocsConversionCloud
198
185
  def valid?
199
186
  return false if @display_header.nil?
200
187
  return false if @display_from_email_address.nil?
201
- return false if @display_email_address.nil?
202
188
  return false if @display_to_email_address.nil?
203
189
  return false if @display_cc_email_address.nil?
204
190
  return false if @display_bcc_email_address.nil?
@@ -215,7 +201,6 @@ module GroupDocsConversionCloud
215
201
  format == other.format &&
216
202
  display_header == other.display_header &&
217
203
  display_from_email_address == other.display_from_email_address &&
218
- display_email_address == other.display_email_address &&
219
204
  display_to_email_address == other.display_to_email_address &&
220
205
  display_cc_email_address == other.display_cc_email_address &&
221
206
  display_bcc_email_address == other.display_bcc_email_address &&
@@ -234,7 +219,7 @@ module GroupDocsConversionCloud
234
219
  # Calculates hash code according to all attributes.
235
220
  # @return [Fixnum] Hash code
236
221
  def hash
237
- [format, display_header, display_from_email_address, display_email_address, display_to_email_address, display_cc_email_address, display_bcc_email_address, time_zone_offset, convert_attachments, field_labels, preserve_original_date].hash
222
+ [format, display_header, display_from_email_address, display_to_email_address, display_cc_email_address, display_bcc_email_address, time_zone_offset, convert_attachments, field_labels, preserve_original_date].hash
238
223
  end
239
224
 
240
225
  # Downcases first letter.
@@ -0,0 +1,354 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="operation_result.rb">
4
+ # Copyright (c) 2003-2024 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
+ # Operation status result
32
+ class OperationResult
33
+ attr_accessor :id
34
+ attr_accessor :method
35
+ attr_accessor :status
36
+ attr_accessor :created
37
+ attr_accessor :started
38
+ attr_accessor :failed
39
+ attr_accessor :canceled
40
+ attr_accessor :finished
41
+ attr_accessor :result
42
+ attr_accessor :error
43
+ class EnumAttributeValidator
44
+ attr_reader :datatype
45
+ attr_reader :allowable_values
46
+
47
+ def initialize(datatype, allowable_values)
48
+ @allowable_values = allowable_values.map do |value|
49
+ case datatype.to_s
50
+ when /Integer/i
51
+ value.to_i
52
+ when /Float/i
53
+ value.to_f
54
+ else
55
+ value
56
+ end
57
+ end
58
+ end
59
+
60
+ def valid?(value)
61
+ !value || allowable_values.include?(value)
62
+ end
63
+ end
64
+
65
+ # Attribute mapping from ruby-style variable name to JSON key.
66
+ def self.attribute_map
67
+ {
68
+ :'id' => :'Id',
69
+ :'method' => :'Method',
70
+ :'status' => :'Status',
71
+ :'created' => :'Created',
72
+ :'started' => :'Started',
73
+ :'failed' => :'Failed',
74
+ :'canceled' => :'Canceled',
75
+ :'finished' => :'Finished',
76
+ :'result' => :'Result',
77
+ :'error' => :'Error'
78
+ }
79
+ end
80
+
81
+ # Attribute type mapping.
82
+ def self.swagger_types
83
+ {
84
+ :'id' => :'String',
85
+ :'method' => :'String',
86
+ :'status' => :'String',
87
+ :'created' => :'DateTime',
88
+ :'started' => :'DateTime',
89
+ :'failed' => :'DateTime',
90
+ :'canceled' => :'DateTime',
91
+ :'finished' => :'DateTime',
92
+ :'result' => :'Array<StoredConvertedResult>',
93
+ :'error' => :'String'
94
+ }
95
+ end
96
+
97
+ # Initializes the object
98
+ # @param [Hash] attributes Model attributes in the form of hash
99
+ def initialize(attributes = {})
100
+ return unless attributes.is_a?(Hash)
101
+
102
+ # convert string to symbol for hash key
103
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
104
+
105
+ if attributes.key?(:'Id')
106
+ self.id = attributes[:'Id']
107
+ end
108
+
109
+ if attributes.key?(:'Method')
110
+ self.method = attributes[:'Method']
111
+ end
112
+
113
+ if attributes.key?(:'Status')
114
+ self.status = attributes[:'Status']
115
+ end
116
+
117
+ if attributes.key?(:'Created')
118
+ self.created = attributes[:'Created']
119
+ end
120
+
121
+ if attributes.key?(:'Started')
122
+ self.started = attributes[:'Started']
123
+ end
124
+
125
+ if attributes.key?(:'Failed')
126
+ self.failed = attributes[:'Failed']
127
+ end
128
+
129
+ if attributes.key?(:'Canceled')
130
+ self.canceled = attributes[:'Canceled']
131
+ end
132
+
133
+ if attributes.key?(:'Finished')
134
+ self.finished = attributes[:'Finished']
135
+ end
136
+
137
+ if attributes.key?(:'Result')
138
+ if (value = attributes[:'Result']).is_a?(Array)
139
+ self.result = value
140
+ end
141
+ end
142
+
143
+ if attributes.key?(:'Error')
144
+ self.error = attributes[:'Error']
145
+ end
146
+
147
+ end
148
+
149
+ # Show invalid properties with the reasons. Usually used together with valid?
150
+ # @return Array for valid properies with the reasons
151
+ def list_invalid_properties
152
+ invalid_properties = []
153
+ if @id.nil?
154
+ invalid_properties.push("invalid value for 'id', id cannot be nil.")
155
+ end
156
+
157
+ if @method.nil?
158
+ invalid_properties.push("invalid value for 'method', method cannot be nil.")
159
+ end
160
+
161
+ if @status.nil?
162
+ invalid_properties.push("invalid value for 'status', status cannot be nil.")
163
+ end
164
+
165
+ return invalid_properties
166
+ end
167
+
168
+ # Check to see if the all the properties in the model are valid
169
+ # @return true if the model is valid
170
+ def valid?
171
+ return false if @id.nil?
172
+ return false if @method.nil?
173
+ method_validator = EnumAttributeValidator.new('String', ["Convert", "ConvertAndSave"])
174
+ return false unless method_validator.valid?(@method)
175
+ return false if @status.nil?
176
+ status_validator = EnumAttributeValidator.new('String', ["Created", "Started", "Failed", "Canceled", "Finished"])
177
+ return false unless status_validator.valid?(@status)
178
+ return true
179
+ end
180
+
181
+ # Custom attribute writer method checking allowed values (enum).
182
+ # @param [Object] method Object to be assigned
183
+ def method=(method)
184
+ validator = EnumAttributeValidator.new('String', ["Convert", "ConvertAndSave"])
185
+ if method.to_i == 0
186
+ unless validator.valid?(method)
187
+ raise ArgumentError, "invalid value for 'method', must be one of #{validator.allowable_values}."
188
+ end
189
+ @method = method
190
+ else
191
+ @method = validator.allowable_values[method.to_i]
192
+ end
193
+ end
194
+
195
+ # Custom attribute writer method checking allowed values (enum).
196
+ # @param [Object] status Object to be assigned
197
+ def status=(status)
198
+ validator = EnumAttributeValidator.new('String', ["Created", "Started", "Failed", "Canceled", "Finished"])
199
+ if status.to_i == 0
200
+ unless validator.valid?(status)
201
+ raise ArgumentError, "invalid value for 'status', must be one of #{validator.allowable_values}."
202
+ end
203
+ @status = status
204
+ else
205
+ @status = validator.allowable_values[status.to_i]
206
+ end
207
+ end
208
+
209
+ # Checks equality by comparing each attribute.
210
+ # @param [Object] Object to be compared
211
+ def ==(other)
212
+ return true if self.equal?(other)
213
+ self.class == other.class &&
214
+ id == other.id &&
215
+ method == other.method &&
216
+ status == other.status &&
217
+ created == other.created &&
218
+ started == other.started &&
219
+ failed == other.failed &&
220
+ canceled == other.canceled &&
221
+ finished == other.finished &&
222
+ result == other.result &&
223
+ error == other.error
224
+ end
225
+
226
+ # @see the `==` method
227
+ # @param [Object] Object to be compared
228
+ def eql?(other)
229
+ self == other
230
+ end
231
+
232
+ # Calculates hash code according to all attributes.
233
+ # @return [Fixnum] Hash code
234
+ def hash
235
+ [id, method, status, created, started, failed, canceled, finished, result, error].hash
236
+ end
237
+
238
+ # Downcases first letter.
239
+ # @return downcased string
240
+ def uncap(str)
241
+ str[0, 1].downcase + str[1..-1]
242
+ end
243
+
244
+ # Builds the object from hash
245
+ # @param [Hash] attributes Model attributes in the form of hash
246
+ # @return [Object] Returns the model itself
247
+ def build_from_hash(attributes)
248
+ return nil unless attributes.is_a?(Hash)
249
+ self.class.swagger_types.each_pair do |key, type|
250
+ pname = uncap(self.class.attribute_map[key]).intern
251
+ value = attributes[pname]
252
+ if type =~ /\AArray<(.*)>/i
253
+ # check to ensure the input is an array given that the the attribute
254
+ # is documented as an array but the input is not
255
+ if value.is_a?(Array)
256
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
257
+ end
258
+ elsif !value.nil?
259
+ self.send("#{key}=", _deserialize(type, value))
260
+ end
261
+ # or else data not found in attributes(hash), not an issue as the data can be optional
262
+ end
263
+
264
+ self
265
+ end
266
+
267
+ # Deserializes the data based on type
268
+ # @param string type Data type
269
+ # @param string value Value to be deserialized
270
+ # @return [Object] Deserialized data
271
+ def _deserialize(type, value)
272
+ case type.to_sym
273
+ when :DateTime
274
+ Date.parse value
275
+ when :Date
276
+ Date.parse value
277
+ when :String
278
+ value.to_s
279
+ when :Integer
280
+ value.to_i
281
+ when :Float
282
+ value.to_f
283
+ when :BOOLEAN
284
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
285
+ true
286
+ else
287
+ false
288
+ end
289
+ when :Object
290
+ # generic object (usually a Hash), return directly
291
+ value
292
+ when /\AArray<(?<inner_type>.+)>\z/
293
+ inner_type = Regexp.last_match[:inner_type]
294
+ value.map { |v| _deserialize(inner_type, v) }
295
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
296
+ k_type = Regexp.last_match[:k_type]
297
+ v_type = Regexp.last_match[:v_type]
298
+ {}.tap do |hash|
299
+ value.each do |k, v|
300
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
301
+ end
302
+ end
303
+ else
304
+ # model
305
+ temp_model = GroupDocsConversionCloud.const_get(type).new
306
+ temp_model.build_from_hash(value)
307
+ end
308
+ end
309
+
310
+ # Returns the string representation of the object
311
+ # @return [String] String presentation of the object
312
+ def to_s
313
+ to_hash.to_s
314
+ end
315
+
316
+ # to_body is an alias to to_hash (backward compatibility)
317
+ # @return [Hash] Returns the object in the form of hash
318
+ def to_body
319
+ to_hash
320
+ end
321
+
322
+ # Returns the object in the form of hash
323
+ # @return [Hash] Returns the object in the form of hash
324
+ def to_hash
325
+ hash = {}
326
+ self.class.attribute_map.each_pair do |attr, param|
327
+ value = self.send(attr)
328
+ next if value.nil?
329
+ hash[param] = _to_hash(value)
330
+ end
331
+ hash
332
+ end
333
+
334
+ # Outputs non-array value in the form of hash
335
+ # For object, use to_hash. Otherwise, just return the value
336
+ # @param [Object] value Any valid value
337
+ # @return [Hash] Returns the value in the form of hash
338
+ def _to_hash(value)
339
+ if value.is_a?(Array)
340
+ value.compact.map { |v| _to_hash(v) }
341
+ elsif value.is_a?(Hash)
342
+ {}.tap do |hash|
343
+ value.each { |k, v| hash[k] = _to_hash(v) }
344
+ end
345
+ elsif value.respond_to? :to_hash
346
+ value.to_hash
347
+ else
348
+ value
349
+ end
350
+ end
351
+
352
+ end
353
+
354
+ end