docusign_esign 3.4.0 → 3.5.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +73 -0
  3. data/docusign_esign-2.6.0.rc1.gem +0 -0
  4. data/lib/docusign_esign.rb +24 -0
  5. data/lib/docusign_esign/.DS_Store +0 -0
  6. data/lib/docusign_esign/api/.DS_Store +0 -0
  7. data/lib/docusign_esign/api/accounts_api.rb +362 -0
  8. data/lib/docusign_esign/api/bulk_envelopes_api.rb +126 -4
  9. data/lib/docusign_esign/api/envelopes_api.rb +320 -0
  10. data/lib/docusign_esign/client/.DS_Store +0 -0
  11. data/lib/docusign_esign/models/account_settings_information.rb +11 -1
  12. data/lib/docusign_esign/models/bulk_send_batch_status.rb +287 -0
  13. data/lib/docusign_esign/models/bulk_send_batch_summaries.rb +277 -0
  14. data/lib/docusign_esign/models/bulk_send_batch_summary.rb +255 -0
  15. data/lib/docusign_esign/models/bulk_send_error_status.rb +207 -0
  16. data/lib/docusign_esign/models/conditional_recipient_rule.rb +216 -0
  17. data/lib/docusign_esign/models/conditional_recipient_rule_condition.rb +207 -0
  18. data/lib/docusign_esign/models/conditional_recipient_rule_filter.rb +235 -0
  19. data/lib/docusign_esign/models/e_note_configuration.rb +11 -1
  20. data/lib/docusign_esign/models/envelope.rb +13 -4
  21. data/lib/docusign_esign/models/envelope_definition.rb +13 -4
  22. data/lib/docusign_esign/models/envelope_template.rb +13 -4
  23. data/lib/docusign_esign/models/new_user.rb +11 -1
  24. data/lib/docusign_esign/models/proof_service_resource_token.rb +14 -4
  25. data/lib/docusign_esign/models/recipient_additional_notification.rb +14 -4
  26. data/lib/docusign_esign/models/recipient_group.rb +207 -0
  27. data/lib/docusign_esign/models/recipient_option.rb +225 -0
  28. data/lib/docusign_esign/models/recipient_routing.rb +184 -0
  29. data/lib/docusign_esign/models/recipient_rules.rb +187 -0
  30. data/lib/docusign_esign/models/report_in_product_csv_run_request.rb +437 -0
  31. data/lib/docusign_esign/models/report_in_product_field.rb +215 -0
  32. data/lib/docusign_esign/models/report_in_product_get.rb +466 -0
  33. data/lib/docusign_esign/models/report_in_product_list.rb +187 -0
  34. data/lib/docusign_esign/models/report_in_product_list_item.rb +315 -0
  35. data/lib/docusign_esign/models/report_in_product_run_request.rb +397 -0
  36. data/lib/docusign_esign/models/report_in_product_run_response.rb +247 -0
  37. data/lib/docusign_esign/models/report_in_product_run_response_row.rb +194 -0
  38. data/lib/docusign_esign/models/report_in_product_run_response_row_fields.rb +1395 -0
  39. data/lib/docusign_esign/models/report_in_product_save_response.rb +185 -0
  40. data/lib/docusign_esign/models/report_in_product_sent_by_details.rb +199 -0
  41. data/lib/docusign_esign/models/sender_email_notifications.rb +11 -1
  42. data/lib/docusign_esign/models/tab_metadata.rb +21 -1
  43. data/lib/docusign_esign/models/workflow.rb +207 -0
  44. data/lib/docusign_esign/models/workflow_step.rb +254 -0
  45. data/lib/docusign_esign/version.rb +1 -1
  46. data/tests/Gemfile.lock +3 -3
  47. metadata +33 -7
  48. data/docusign_esign-2.4.0.gem +0 -0
  49. data/docusign_esign-2.5.0.rc1.gem +0 -0
  50. data/docusign_esign-3.4.0.rc1.gem +0 -0
@@ -0,0 +1,397 @@
1
+ =begin
2
+ #DocuSign REST API
3
+
4
+ #The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
5
+
6
+ OpenAPI spec version: v2.1
7
+ Contact: devcenter@docusign.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.13-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module DocuSign_eSign
16
+ class ReportInProductRunRequest
17
+ #
18
+ attr_accessor :custom_field_filter
19
+
20
+ #
21
+ attr_accessor :date_range_custom_from_date
22
+
23
+ #
24
+ attr_accessor :date_range_custom_to_date
25
+
26
+ #
27
+ attr_accessor :date_range_filter
28
+
29
+ #
30
+ attr_accessor :envelope_date_type_filter
31
+
32
+ #
33
+ attr_accessor :envelope_recipient_name_contains_filter
34
+
35
+ #
36
+ attr_accessor :envelope_status_filter
37
+
38
+ #
39
+ attr_accessor :envelope_subject_contains_filter
40
+
41
+ #
42
+ attr_accessor :fields
43
+
44
+ #
45
+ attr_accessor :for_download
46
+
47
+ #
48
+ attr_accessor :is_dashboard
49
+
50
+ #
51
+ attr_accessor :period_length_filter
52
+
53
+ #
54
+ attr_accessor :report_customized_id
55
+
56
+ #
57
+ attr_accessor :report_description
58
+
59
+ #
60
+ attr_accessor :report_id
61
+
62
+ #
63
+ attr_accessor :report_invocation_type
64
+
65
+ #
66
+ attr_accessor :report_name
67
+
68
+ #
69
+ attr_accessor :sent_by_filter
70
+
71
+ #
72
+ attr_accessor :sent_by_ids
73
+
74
+ #
75
+ attr_accessor :sort_direction
76
+
77
+ #
78
+ attr_accessor :sort_field
79
+
80
+ # Starting position of the current result set.
81
+ attr_accessor :start_position
82
+
83
+ # Attribute mapping from ruby-style variable name to JSON key.
84
+ def self.attribute_map
85
+ {
86
+ :'custom_field_filter' => :'customFieldFilter',
87
+ :'date_range_custom_from_date' => :'dateRangeCustomFromDate',
88
+ :'date_range_custom_to_date' => :'dateRangeCustomToDate',
89
+ :'date_range_filter' => :'dateRangeFilter',
90
+ :'envelope_date_type_filter' => :'envelopeDateTypeFilter',
91
+ :'envelope_recipient_name_contains_filter' => :'envelopeRecipientNameContainsFilter',
92
+ :'envelope_status_filter' => :'envelopeStatusFilter',
93
+ :'envelope_subject_contains_filter' => :'envelopeSubjectContainsFilter',
94
+ :'fields' => :'fields',
95
+ :'for_download' => :'forDownload',
96
+ :'is_dashboard' => :'isDashboard',
97
+ :'period_length_filter' => :'periodLengthFilter',
98
+ :'report_customized_id' => :'reportCustomizedId',
99
+ :'report_description' => :'reportDescription',
100
+ :'report_id' => :'reportId',
101
+ :'report_invocation_type' => :'reportInvocationType',
102
+ :'report_name' => :'reportName',
103
+ :'sent_by_filter' => :'sentByFilter',
104
+ :'sent_by_ids' => :'sentByIds',
105
+ :'sort_direction' => :'sortDirection',
106
+ :'sort_field' => :'sortField',
107
+ :'start_position' => :'startPosition'
108
+ }
109
+ end
110
+
111
+ # Attribute type mapping.
112
+ def self.swagger_types
113
+ {
114
+ :'custom_field_filter' => :'String',
115
+ :'date_range_custom_from_date' => :'String',
116
+ :'date_range_custom_to_date' => :'String',
117
+ :'date_range_filter' => :'String',
118
+ :'envelope_date_type_filter' => :'String',
119
+ :'envelope_recipient_name_contains_filter' => :'String',
120
+ :'envelope_status_filter' => :'String',
121
+ :'envelope_subject_contains_filter' => :'String',
122
+ :'fields' => :'Array<ReportInProductField>',
123
+ :'for_download' => :'String',
124
+ :'is_dashboard' => :'String',
125
+ :'period_length_filter' => :'String',
126
+ :'report_customized_id' => :'String',
127
+ :'report_description' => :'String',
128
+ :'report_id' => :'String',
129
+ :'report_invocation_type' => :'String',
130
+ :'report_name' => :'String',
131
+ :'sent_by_filter' => :'String',
132
+ :'sent_by_ids' => :'String',
133
+ :'sort_direction' => :'String',
134
+ :'sort_field' => :'String',
135
+ :'start_position' => :'String'
136
+ }
137
+ end
138
+
139
+ # Initializes the object
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ def initialize(attributes = {})
142
+ return unless attributes.is_a?(Hash)
143
+
144
+ # convert string to symbol for hash key
145
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
146
+
147
+ if attributes.has_key?(:'customFieldFilter')
148
+ self.custom_field_filter = attributes[:'customFieldFilter']
149
+ end
150
+
151
+ if attributes.has_key?(:'dateRangeCustomFromDate')
152
+ self.date_range_custom_from_date = attributes[:'dateRangeCustomFromDate']
153
+ end
154
+
155
+ if attributes.has_key?(:'dateRangeCustomToDate')
156
+ self.date_range_custom_to_date = attributes[:'dateRangeCustomToDate']
157
+ end
158
+
159
+ if attributes.has_key?(:'dateRangeFilter')
160
+ self.date_range_filter = attributes[:'dateRangeFilter']
161
+ end
162
+
163
+ if attributes.has_key?(:'envelopeDateTypeFilter')
164
+ self.envelope_date_type_filter = attributes[:'envelopeDateTypeFilter']
165
+ end
166
+
167
+ if attributes.has_key?(:'envelopeRecipientNameContainsFilter')
168
+ self.envelope_recipient_name_contains_filter = attributes[:'envelopeRecipientNameContainsFilter']
169
+ end
170
+
171
+ if attributes.has_key?(:'envelopeStatusFilter')
172
+ self.envelope_status_filter = attributes[:'envelopeStatusFilter']
173
+ end
174
+
175
+ if attributes.has_key?(:'envelopeSubjectContainsFilter')
176
+ self.envelope_subject_contains_filter = attributes[:'envelopeSubjectContainsFilter']
177
+ end
178
+
179
+ if attributes.has_key?(:'fields')
180
+ if (value = attributes[:'fields']).is_a?(Array)
181
+ self.fields = value
182
+ end
183
+ end
184
+
185
+ if attributes.has_key?(:'forDownload')
186
+ self.for_download = attributes[:'forDownload']
187
+ end
188
+
189
+ if attributes.has_key?(:'isDashboard')
190
+ self.is_dashboard = attributes[:'isDashboard']
191
+ end
192
+
193
+ if attributes.has_key?(:'periodLengthFilter')
194
+ self.period_length_filter = attributes[:'periodLengthFilter']
195
+ end
196
+
197
+ if attributes.has_key?(:'reportCustomizedId')
198
+ self.report_customized_id = attributes[:'reportCustomizedId']
199
+ end
200
+
201
+ if attributes.has_key?(:'reportDescription')
202
+ self.report_description = attributes[:'reportDescription']
203
+ end
204
+
205
+ if attributes.has_key?(:'reportId')
206
+ self.report_id = attributes[:'reportId']
207
+ end
208
+
209
+ if attributes.has_key?(:'reportInvocationType')
210
+ self.report_invocation_type = attributes[:'reportInvocationType']
211
+ end
212
+
213
+ if attributes.has_key?(:'reportName')
214
+ self.report_name = attributes[:'reportName']
215
+ end
216
+
217
+ if attributes.has_key?(:'sentByFilter')
218
+ self.sent_by_filter = attributes[:'sentByFilter']
219
+ end
220
+
221
+ if attributes.has_key?(:'sentByIds')
222
+ self.sent_by_ids = attributes[:'sentByIds']
223
+ end
224
+
225
+ if attributes.has_key?(:'sortDirection')
226
+ self.sort_direction = attributes[:'sortDirection']
227
+ end
228
+
229
+ if attributes.has_key?(:'sortField')
230
+ self.sort_field = attributes[:'sortField']
231
+ end
232
+
233
+ if attributes.has_key?(:'startPosition')
234
+ self.start_position = attributes[:'startPosition']
235
+ end
236
+ end
237
+
238
+ # Show invalid properties with the reasons. Usually used together with valid?
239
+ # @return Array for valid properties with the reasons
240
+ def list_invalid_properties
241
+ invalid_properties = Array.new
242
+ invalid_properties
243
+ end
244
+
245
+ # Check to see if the all the properties in the model are valid
246
+ # @return true if the model is valid
247
+ def valid?
248
+ true
249
+ end
250
+
251
+ # Checks equality by comparing each attribute.
252
+ # @param [Object] Object to be compared
253
+ def ==(o)
254
+ return true if self.equal?(o)
255
+ self.class == o.class &&
256
+ custom_field_filter == o.custom_field_filter &&
257
+ date_range_custom_from_date == o.date_range_custom_from_date &&
258
+ date_range_custom_to_date == o.date_range_custom_to_date &&
259
+ date_range_filter == o.date_range_filter &&
260
+ envelope_date_type_filter == o.envelope_date_type_filter &&
261
+ envelope_recipient_name_contains_filter == o.envelope_recipient_name_contains_filter &&
262
+ envelope_status_filter == o.envelope_status_filter &&
263
+ envelope_subject_contains_filter == o.envelope_subject_contains_filter &&
264
+ fields == o.fields &&
265
+ for_download == o.for_download &&
266
+ is_dashboard == o.is_dashboard &&
267
+ period_length_filter == o.period_length_filter &&
268
+ report_customized_id == o.report_customized_id &&
269
+ report_description == o.report_description &&
270
+ report_id == o.report_id &&
271
+ report_invocation_type == o.report_invocation_type &&
272
+ report_name == o.report_name &&
273
+ sent_by_filter == o.sent_by_filter &&
274
+ sent_by_ids == o.sent_by_ids &&
275
+ sort_direction == o.sort_direction &&
276
+ sort_field == o.sort_field &&
277
+ start_position == o.start_position
278
+ end
279
+
280
+ # @see the `==` method
281
+ # @param [Object] Object to be compared
282
+ def eql?(o)
283
+ self == o
284
+ end
285
+
286
+ # Calculates hash code according to all attributes.
287
+ # @return [Fixnum] Hash code
288
+ def hash
289
+ [custom_field_filter, date_range_custom_from_date, date_range_custom_to_date, date_range_filter, envelope_date_type_filter, envelope_recipient_name_contains_filter, envelope_status_filter, envelope_subject_contains_filter, fields, for_download, is_dashboard, period_length_filter, report_customized_id, report_description, report_id, report_invocation_type, report_name, sent_by_filter, sent_by_ids, sort_direction, sort_field, start_position].hash
290
+ end
291
+
292
+ # Builds the object from hash
293
+ # @param [Hash] attributes Model attributes in the form of hash
294
+ # @return [Object] Returns the model itself
295
+ def build_from_hash(attributes)
296
+ return nil unless attributes.is_a?(Hash)
297
+ self.class.swagger_types.each_pair do |key, type|
298
+ if type =~ /\AArray<(.*)>/i
299
+ # check to ensure the input is an array given that the attribute
300
+ # is documented as an array but the input is not
301
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
302
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
303
+ end
304
+ elsif !attributes[self.class.attribute_map[key]].nil?
305
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
306
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
307
+ end
308
+
309
+ self
310
+ end
311
+
312
+ # Deserializes the data based on type
313
+ # @param string type Data type
314
+ # @param string value Value to be deserialized
315
+ # @return [Object] Deserialized data
316
+ def _deserialize(type, value)
317
+ case type.to_sym
318
+ when :DateTime
319
+ DateTime.parse(value)
320
+ when :Date
321
+ Date.parse(value)
322
+ when :String
323
+ value.to_s
324
+ when :Integer
325
+ value.to_i
326
+ when :Float
327
+ value.to_f
328
+ when :BOOLEAN
329
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
330
+ true
331
+ else
332
+ false
333
+ end
334
+ when :Object
335
+ # generic object (usually a Hash), return directly
336
+ value
337
+ when /\AArray<(?<inner_type>.+)>\z/
338
+ inner_type = Regexp.last_match[:inner_type]
339
+ value.map { |v| _deserialize(inner_type, v) }
340
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
341
+ k_type = Regexp.last_match[:k_type]
342
+ v_type = Regexp.last_match[:v_type]
343
+ {}.tap do |hash|
344
+ value.each do |k, v|
345
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
346
+ end
347
+ end
348
+ else # model
349
+ temp_model = DocuSign_eSign.const_get(type).new
350
+ temp_model.build_from_hash(value)
351
+ end
352
+ end
353
+
354
+ # Returns the string representation of the object
355
+ # @return [String] String presentation of the object
356
+ def to_s
357
+ to_hash.to_s
358
+ end
359
+
360
+ # to_body is an alias to to_hash (backward compatibility)
361
+ # @return [Hash] Returns the object in the form of hash
362
+ def to_body
363
+ to_hash
364
+ end
365
+
366
+ # Returns the object in the form of hash
367
+ # @return [Hash] Returns the object in the form of hash
368
+ def to_hash
369
+ hash = {}
370
+ self.class.attribute_map.each_pair do |attr, param|
371
+ value = self.send(attr)
372
+ next if value.nil?
373
+ hash[param] = _to_hash(value)
374
+ end
375
+ hash
376
+ end
377
+
378
+ # Outputs non-array value in the form of hash
379
+ # For object, use to_hash. Otherwise, just return the value
380
+ # @param [Object] value Any valid value
381
+ # @return [Hash] Returns the value in the form of hash
382
+ def _to_hash(value)
383
+ if value.is_a?(Array)
384
+ value.compact.map { |v| _to_hash(v) }
385
+ elsif value.is_a?(Hash)
386
+ {}.tap do |hash|
387
+ value.each { |k, v| hash[k] = _to_hash(v) }
388
+ end
389
+ elsif value.respond_to? :to_hash
390
+ value.to_hash
391
+ else
392
+ value
393
+ end
394
+ end
395
+
396
+ end
397
+ end
@@ -0,0 +1,247 @@
1
+ =begin
2
+ #DocuSign REST API
3
+
4
+ #The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
5
+
6
+ OpenAPI spec version: v2.1
7
+ Contact: devcenter@docusign.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.13-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module DocuSign_eSign
16
+ class ReportInProductRunResponse
17
+ # The last position in the result set.
18
+ attr_accessor :end_position
19
+
20
+ #
21
+ attr_accessor :exceeded_max_results
22
+
23
+ #
24
+ attr_accessor :last_warehouse_refresh_date_time
25
+
26
+ # The number of results returned in this response.
27
+ attr_accessor :result_set_size
28
+
29
+ #
30
+ attr_accessor :rows
31
+
32
+ # Starting position of the current result set.
33
+ attr_accessor :start_position
34
+
35
+ # The total number of items available in the result set. This will always be greater than or equal to the value of the property returning the results in the in the response.
36
+ attr_accessor :total_set_size
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'end_position' => :'endPosition',
42
+ :'exceeded_max_results' => :'exceededMaxResults',
43
+ :'last_warehouse_refresh_date_time' => :'lastWarehouseRefreshDateTime',
44
+ :'result_set_size' => :'resultSetSize',
45
+ :'rows' => :'rows',
46
+ :'start_position' => :'startPosition',
47
+ :'total_set_size' => :'totalSetSize'
48
+ }
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.swagger_types
53
+ {
54
+ :'end_position' => :'String',
55
+ :'exceeded_max_results' => :'String',
56
+ :'last_warehouse_refresh_date_time' => :'String',
57
+ :'result_set_size' => :'String',
58
+ :'rows' => :'Array<ReportInProductRunResponseRow>',
59
+ :'start_position' => :'String',
60
+ :'total_set_size' => :'String'
61
+ }
62
+ end
63
+
64
+ # Initializes the object
65
+ # @param [Hash] attributes Model attributes in the form of hash
66
+ def initialize(attributes = {})
67
+ return unless attributes.is_a?(Hash)
68
+
69
+ # convert string to symbol for hash key
70
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
71
+
72
+ if attributes.has_key?(:'endPosition')
73
+ self.end_position = attributes[:'endPosition']
74
+ end
75
+
76
+ if attributes.has_key?(:'exceededMaxResults')
77
+ self.exceeded_max_results = attributes[:'exceededMaxResults']
78
+ end
79
+
80
+ if attributes.has_key?(:'lastWarehouseRefreshDateTime')
81
+ self.last_warehouse_refresh_date_time = attributes[:'lastWarehouseRefreshDateTime']
82
+ end
83
+
84
+ if attributes.has_key?(:'resultSetSize')
85
+ self.result_set_size = attributes[:'resultSetSize']
86
+ end
87
+
88
+ if attributes.has_key?(:'rows')
89
+ if (value = attributes[:'rows']).is_a?(Array)
90
+ self.rows = value
91
+ end
92
+ end
93
+
94
+ if attributes.has_key?(:'startPosition')
95
+ self.start_position = attributes[:'startPosition']
96
+ end
97
+
98
+ if attributes.has_key?(:'totalSetSize')
99
+ self.total_set_size = attributes[:'totalSetSize']
100
+ end
101
+ end
102
+
103
+ # Show invalid properties with the reasons. Usually used together with valid?
104
+ # @return Array for valid properties with the reasons
105
+ def list_invalid_properties
106
+ invalid_properties = Array.new
107
+ invalid_properties
108
+ end
109
+
110
+ # Check to see if the all the properties in the model are valid
111
+ # @return true if the model is valid
112
+ def valid?
113
+ true
114
+ end
115
+
116
+ # Checks equality by comparing each attribute.
117
+ # @param [Object] Object to be compared
118
+ def ==(o)
119
+ return true if self.equal?(o)
120
+ self.class == o.class &&
121
+ end_position == o.end_position &&
122
+ exceeded_max_results == o.exceeded_max_results &&
123
+ last_warehouse_refresh_date_time == o.last_warehouse_refresh_date_time &&
124
+ result_set_size == o.result_set_size &&
125
+ rows == o.rows &&
126
+ start_position == o.start_position &&
127
+ total_set_size == o.total_set_size
128
+ end
129
+
130
+ # @see the `==` method
131
+ # @param [Object] Object to be compared
132
+ def eql?(o)
133
+ self == o
134
+ end
135
+
136
+ # Calculates hash code according to all attributes.
137
+ # @return [Fixnum] Hash code
138
+ def hash
139
+ [end_position, exceeded_max_results, last_warehouse_refresh_date_time, result_set_size, rows, start_position, total_set_size].hash
140
+ end
141
+
142
+ # Builds the object from hash
143
+ # @param [Hash] attributes Model attributes in the form of hash
144
+ # @return [Object] Returns the model itself
145
+ def build_from_hash(attributes)
146
+ return nil unless attributes.is_a?(Hash)
147
+ self.class.swagger_types.each_pair do |key, type|
148
+ if type =~ /\AArray<(.*)>/i
149
+ # check to ensure the input is an array given that the attribute
150
+ # is documented as an array but the input is not
151
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
152
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
153
+ end
154
+ elsif !attributes[self.class.attribute_map[key]].nil?
155
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
156
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
157
+ end
158
+
159
+ self
160
+ end
161
+
162
+ # Deserializes the data based on type
163
+ # @param string type Data type
164
+ # @param string value Value to be deserialized
165
+ # @return [Object] Deserialized data
166
+ def _deserialize(type, value)
167
+ case type.to_sym
168
+ when :DateTime
169
+ DateTime.parse(value)
170
+ when :Date
171
+ Date.parse(value)
172
+ when :String
173
+ value.to_s
174
+ when :Integer
175
+ value.to_i
176
+ when :Float
177
+ value.to_f
178
+ when :BOOLEAN
179
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
180
+ true
181
+ else
182
+ false
183
+ end
184
+ when :Object
185
+ # generic object (usually a Hash), return directly
186
+ value
187
+ when /\AArray<(?<inner_type>.+)>\z/
188
+ inner_type = Regexp.last_match[:inner_type]
189
+ value.map { |v| _deserialize(inner_type, v) }
190
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
191
+ k_type = Regexp.last_match[:k_type]
192
+ v_type = Regexp.last_match[:v_type]
193
+ {}.tap do |hash|
194
+ value.each do |k, v|
195
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
196
+ end
197
+ end
198
+ else # model
199
+ temp_model = DocuSign_eSign.const_get(type).new
200
+ temp_model.build_from_hash(value)
201
+ end
202
+ end
203
+
204
+ # Returns the string representation of the object
205
+ # @return [String] String presentation of the object
206
+ def to_s
207
+ to_hash.to_s
208
+ end
209
+
210
+ # to_body is an alias to to_hash (backward compatibility)
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_body
213
+ to_hash
214
+ end
215
+
216
+ # Returns the object in the form of hash
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_hash
219
+ hash = {}
220
+ self.class.attribute_map.each_pair do |attr, param|
221
+ value = self.send(attr)
222
+ next if value.nil?
223
+ hash[param] = _to_hash(value)
224
+ end
225
+ hash
226
+ end
227
+
228
+ # Outputs non-array value in the form of hash
229
+ # For object, use to_hash. Otherwise, just return the value
230
+ # @param [Object] value Any valid value
231
+ # @return [Hash] Returns the value in the form of hash
232
+ def _to_hash(value)
233
+ if value.is_a?(Array)
234
+ value.compact.map { |v| _to_hash(v) }
235
+ elsif value.is_a?(Hash)
236
+ {}.tap do |hash|
237
+ value.each { |k, v| hash[k] = _to_hash(v) }
238
+ end
239
+ elsif value.respond_to? :to_hash
240
+ value.to_hash
241
+ else
242
+ value
243
+ end
244
+ end
245
+
246
+ end
247
+ end