docusign_esign 2.1.0 → 2.2.0.pre.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1 -1
  3. data/docusign_esign-3.1.0.pre.rc1.gem +0 -0
  4. data/lib/docusign_esign.rb +450 -383
  5. data/{tests → lib/docusign_esign/api}/.DS_Store +0 -0
  6. data/lib/docusign_esign/api/accounts_api.rb +69 -8
  7. data/lib/docusign_esign/api/connect_api.rb +400 -0
  8. data/lib/docusign_esign/api/envelopes_api.rb +18 -6
  9. data/lib/docusign_esign/api/organizations_api.rb +232 -0
  10. data/lib/docusign_esign/api/tsps_api.rb +256 -0
  11. data/lib/docusign_esign/models/access_code_format.rb +273 -0
  12. data/lib/docusign_esign/models/account_notification.rb +206 -0
  13. data/lib/docusign_esign/models/account_ui_settings.rb +330 -0
  14. data/lib/docusign_esign/models/bcc_email_archive.rb +276 -0
  15. data/lib/docusign_esign/models/bcc_email_archive_history.rb +237 -0
  16. data/lib/docusign_esign/models/bcc_email_archive_history_list.rb +250 -0
  17. data/lib/docusign_esign/models/bcc_email_archive_list.rb +250 -0
  18. data/lib/docusign_esign/models/bulk_send_request.rb +188 -0
  19. data/lib/docusign_esign/models/bulk_send_response.rb +222 -0
  20. data/lib/docusign_esign/models/bulk_send_test_response.rb +212 -0
  21. data/lib/docusign_esign/models/bulk_sending_copy.rb +222 -0
  22. data/lib/docusign_esign/models/bulk_sending_copy_custom_field.rb +198 -0
  23. data/lib/docusign_esign/models/bulk_sending_copy_recipient.rb +382 -0
  24. data/lib/docusign_esign/models/bulk_sending_copy_tab.rb +198 -0
  25. data/lib/docusign_esign/models/bulk_sending_list.rb +210 -0
  26. data/lib/docusign_esign/models/bulk_sending_list_summaries.rb +190 -0
  27. data/lib/docusign_esign/models/bulk_sending_list_summary.rb +218 -0
  28. data/lib/docusign_esign/models/carbon_copy.rb +19 -1
  29. data/lib/docusign_esign/models/certified_delivery.rb +19 -1
  30. data/lib/docusign_esign/models/comment.rb +392 -0
  31. data/lib/docusign_esign/models/comment_history_result.rb +220 -0
  32. data/lib/docusign_esign/models/comment_publish.rb +244 -0
  33. data/lib/docusign_esign/models/comment_thread.rb +961 -0
  34. data/lib/docusign_esign/models/comments_publish.rb +190 -0
  35. data/lib/docusign_esign/models/connect_salesforce_field.rb +258 -0
  36. data/lib/docusign_esign/models/connect_salesforce_object.rb +272 -0
  37. data/lib/docusign_esign/models/connect_user_object.rb +230 -0
  38. data/lib/docusign_esign/models/direct_debit_processor_information.rb +298 -0
  39. data/lib/docusign_esign/models/display_appliance_document.rb +258 -0
  40. data/lib/docusign_esign/models/display_appliance_document_page.rb +278 -0
  41. data/lib/docusign_esign/models/display_appliance_envelope.rb +328 -0
  42. data/lib/docusign_esign/models/display_appliance_info.rb +235 -0
  43. data/lib/docusign_esign/models/display_appliance_page.rb +278 -0
  44. data/lib/docusign_esign/models/display_appliance_pdf.rb +267 -0
  45. data/lib/docusign_esign/models/display_appliance_recipient.rb +388 -0
  46. data/lib/docusign_esign/models/display_appliance_signer_attachment.rb +248 -0
  47. data/lib/docusign_esign/models/document_fields_information.rb +1 -1
  48. data/lib/docusign_esign/models/document_html_display_settings.rb +11 -1
  49. data/lib/docusign_esign/models/envelope_document.rb +11 -1
  50. data/lib/docusign_esign/models/envelope_metadata.rb +208 -0
  51. data/lib/docusign_esign/models/envelope_purge_configuration.rb +218 -0
  52. data/lib/docusign_esign/models/envelope_transfer_rule.rb +273 -0
  53. data/lib/docusign_esign/models/envelope_transfer_rule_information.rb +250 -0
  54. data/lib/docusign_esign/models/envelope_transfer_rule_request.rb +279 -0
  55. data/lib/docusign_esign/models/external_claim.rb +218 -0
  56. data/lib/docusign_esign/models/external_document_sources.rb +273 -0
  57. data/lib/docusign_esign/models/favorite_templates_content_item.rb +207 -0
  58. data/lib/docusign_esign/models/favorite_templates_info.rb +209 -0
  59. data/lib/docusign_esign/models/feature_available_metadata.rb +198 -0
  60. data/lib/docusign_esign/models/folder_shared_item.rb +289 -0
  61. data/lib/docusign_esign/models/form_data_item.rb +227 -0
  62. data/lib/docusign_esign/models/graphics_context.rb +208 -0
  63. data/lib/docusign_esign/models/id_check_configuration.rb +210 -0
  64. data/lib/docusign_esign/models/id_check_security_step.rb +188 -0
  65. data/lib/docusign_esign/models/locale_policy.rb +595 -0
  66. data/lib/docusign_esign/models/locale_policy_tab.rb +298 -0
  67. data/lib/docusign_esign/models/new_account_definition.rb +11 -1
  68. data/lib/docusign_esign/models/notification_default_settings.rb +196 -0
  69. data/lib/docusign_esign/models/notification_defaults.rb +196 -0
  70. data/lib/docusign_esign/models/offline_attributes.rb +238 -0
  71. data/lib/docusign_esign/models/page_size.rb +198 -0
  72. data/lib/docusign_esign/models/path_extended_element.rb +208 -0
  73. data/lib/docusign_esign/models/pay_pal_legacy_settings.rb +228 -0
  74. data/lib/docusign_esign/models/payment_gateway_account_setting.rb +218 -0
  75. data/lib/docusign_esign/models/payment_method_with_options.rb +200 -0
  76. data/lib/docusign_esign/models/poly_line.rb +218 -0
  77. data/lib/docusign_esign/models/poly_line_overlay.rb +885 -0
  78. data/lib/docusign_esign/models/recipient_email_notification.rb +1 -1
  79. data/lib/docusign_esign/models/recipient_preview_request.rb +278 -0
  80. data/lib/docusign_esign/models/recipient_proof_file.rb +188 -0
  81. data/lib/docusign_esign/models/signature_properties.rb +198 -0
  82. data/lib/docusign_esign/models/signer.rb +11 -2
  83. data/lib/docusign_esign/models/smart_section_display_settings.rb +11 -1
  84. data/lib/docusign_esign/models/tab_group.rb +911 -0
  85. data/lib/docusign_esign/models/usage_history.rb +1 -1
  86. data/lib/docusign_esign/models/user_information.rb +1 -1
  87. data/lib/docusign_esign/models/witness.rb +10 -1
  88. data/lib/docusign_esign/models/workspace_settings.rb +188 -0
  89. data/lib/docusign_esign/version.rb +1 -1
  90. data/tests/Gemfile.lock +1 -1
  91. data/tests/spec/unit_tests_using_jwt_spec.rb +6 -3
  92. metadata +74 -7
  93. data/Gemfile.lock +0 -73
  94. data/lib/docusign_esign/api/trust_service_providers_api.rb +0 -73
@@ -0,0 +1,298 @@
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
+
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module DocuSign_eSign
15
+
16
+ class LocalePolicyTab
17
+ #
18
+ attr_accessor :address_format
19
+
20
+ #
21
+ attr_accessor :calendar_type
22
+
23
+ #
24
+ attr_accessor :culture_name
25
+
26
+ #
27
+ attr_accessor :currency_negative_format
28
+
29
+ #
30
+ attr_accessor :currency_positive_format
31
+
32
+ #
33
+ attr_accessor :custom_date_format
34
+
35
+ #
36
+ attr_accessor :custom_time_format
37
+
38
+ #
39
+ attr_accessor :date_format
40
+
41
+ #
42
+ attr_accessor :initial_format
43
+
44
+ #
45
+ attr_accessor :name_format
46
+
47
+ #
48
+ attr_accessor :time_format
49
+
50
+ #
51
+ attr_accessor :time_zone
52
+
53
+
54
+ # Attribute mapping from ruby-style variable name to JSON key.
55
+ def self.attribute_map
56
+ {
57
+ :'address_format' => :'addressFormat',
58
+ :'calendar_type' => :'calendarType',
59
+ :'culture_name' => :'cultureName',
60
+ :'currency_negative_format' => :'currencyNegativeFormat',
61
+ :'currency_positive_format' => :'currencyPositiveFormat',
62
+ :'custom_date_format' => :'customDateFormat',
63
+ :'custom_time_format' => :'customTimeFormat',
64
+ :'date_format' => :'dateFormat',
65
+ :'initial_format' => :'initialFormat',
66
+ :'name_format' => :'nameFormat',
67
+ :'time_format' => :'timeFormat',
68
+ :'time_zone' => :'timeZone'
69
+ }
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.swagger_types
74
+ {
75
+ :'address_format' => :'String',
76
+ :'calendar_type' => :'String',
77
+ :'culture_name' => :'String',
78
+ :'currency_negative_format' => :'String',
79
+ :'currency_positive_format' => :'String',
80
+ :'custom_date_format' => :'String',
81
+ :'custom_time_format' => :'String',
82
+ :'date_format' => :'String',
83
+ :'initial_format' => :'String',
84
+ :'name_format' => :'String',
85
+ :'time_format' => :'String',
86
+ :'time_zone' => :'String'
87
+ }
88
+ end
89
+
90
+ # Initializes the object
91
+ # @param [Hash] attributes Model attributes in the form of hash
92
+ def initialize(attributes = {})
93
+ return unless attributes.is_a?(Hash)
94
+
95
+ # convert string to symbol for hash key
96
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
97
+
98
+ if attributes.has_key?(:'addressFormat')
99
+ self.address_format = attributes[:'addressFormat']
100
+ end
101
+
102
+ if attributes.has_key?(:'calendarType')
103
+ self.calendar_type = attributes[:'calendarType']
104
+ end
105
+
106
+ if attributes.has_key?(:'cultureName')
107
+ self.culture_name = attributes[:'cultureName']
108
+ end
109
+
110
+ if attributes.has_key?(:'currencyNegativeFormat')
111
+ self.currency_negative_format = attributes[:'currencyNegativeFormat']
112
+ end
113
+
114
+ if attributes.has_key?(:'currencyPositiveFormat')
115
+ self.currency_positive_format = attributes[:'currencyPositiveFormat']
116
+ end
117
+
118
+ if attributes.has_key?(:'customDateFormat')
119
+ self.custom_date_format = attributes[:'customDateFormat']
120
+ end
121
+
122
+ if attributes.has_key?(:'customTimeFormat')
123
+ self.custom_time_format = attributes[:'customTimeFormat']
124
+ end
125
+
126
+ if attributes.has_key?(:'dateFormat')
127
+ self.date_format = attributes[:'dateFormat']
128
+ end
129
+
130
+ if attributes.has_key?(:'initialFormat')
131
+ self.initial_format = attributes[:'initialFormat']
132
+ end
133
+
134
+ if attributes.has_key?(:'nameFormat')
135
+ self.name_format = attributes[:'nameFormat']
136
+ end
137
+
138
+ if attributes.has_key?(:'timeFormat')
139
+ self.time_format = attributes[:'timeFormat']
140
+ end
141
+
142
+ if attributes.has_key?(:'timeZone')
143
+ self.time_zone = attributes[:'timeZone']
144
+ end
145
+
146
+ end
147
+
148
+ # Show invalid properties with the reasons. Usually used together with valid?
149
+ # @return Array for valid properies with the reasons
150
+ def list_invalid_properties
151
+ invalid_properties = Array.new
152
+ return invalid_properties
153
+ end
154
+
155
+ # Check to see if the all the properties in the model are valid
156
+ # @return true if the model is valid
157
+ def valid?
158
+ return true
159
+ end
160
+
161
+ # Checks equality by comparing each attribute.
162
+ # @param [Object] Object to be compared
163
+ def ==(o)
164
+ return true if self.equal?(o)
165
+ self.class == o.class &&
166
+ address_format == o.address_format &&
167
+ calendar_type == o.calendar_type &&
168
+ culture_name == o.culture_name &&
169
+ currency_negative_format == o.currency_negative_format &&
170
+ currency_positive_format == o.currency_positive_format &&
171
+ custom_date_format == o.custom_date_format &&
172
+ custom_time_format == o.custom_time_format &&
173
+ date_format == o.date_format &&
174
+ initial_format == o.initial_format &&
175
+ name_format == o.name_format &&
176
+ time_format == o.time_format &&
177
+ time_zone == o.time_zone
178
+ end
179
+
180
+ # @see the `==` method
181
+ # @param [Object] Object to be compared
182
+ def eql?(o)
183
+ self == o
184
+ end
185
+
186
+ # Calculates hash code according to all attributes.
187
+ # @return [Fixnum] Hash code
188
+ def hash
189
+ [address_format, calendar_type, culture_name, currency_negative_format, currency_positive_format, custom_date_format, custom_time_format, date_format, initial_format, name_format, time_format, time_zone].hash
190
+ end
191
+
192
+ # Builds the object from hash
193
+ # @param [Hash] attributes Model attributes in the form of hash
194
+ # @return [Object] Returns the model itself
195
+ def build_from_hash(attributes)
196
+ return nil unless attributes.is_a?(Hash)
197
+ self.class.swagger_types.each_pair do |key, type|
198
+ if type =~ /\AArray<(.*)>/i
199
+ # check to ensure the input is an array given that the the attribute
200
+ # is documented as an array but the input is not
201
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
202
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
203
+ end
204
+ elsif !attributes[self.class.attribute_map[key]].nil?
205
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
206
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
207
+ end
208
+
209
+ self
210
+ end
211
+
212
+ # Deserializes the data based on type
213
+ # @param string type Data type
214
+ # @param string value Value to be deserialized
215
+ # @return [Object] Deserialized data
216
+ def _deserialize(type, value)
217
+ case type.to_sym
218
+ when :DateTime
219
+ DateTime.parse(value)
220
+ when :Date
221
+ Date.parse(value)
222
+ when :String
223
+ value.to_s
224
+ when :Integer
225
+ value.to_i
226
+ when :Float
227
+ value.to_f
228
+ when :BOOLEAN
229
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
230
+ true
231
+ else
232
+ false
233
+ end
234
+ when :Object
235
+ # generic object (usually a Hash), return directly
236
+ value
237
+ when /\AArray<(?<inner_type>.+)>\z/
238
+ inner_type = Regexp.last_match[:inner_type]
239
+ value.map { |v| _deserialize(inner_type, v) }
240
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
241
+ k_type = Regexp.last_match[:k_type]
242
+ v_type = Regexp.last_match[:v_type]
243
+ {}.tap do |hash|
244
+ value.each do |k, v|
245
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
246
+ end
247
+ end
248
+ else # model
249
+ temp_model = DocuSign_eSign.const_get(type).new
250
+ temp_model.build_from_hash(value)
251
+ end
252
+ end
253
+
254
+ # Returns the string representation of the object
255
+ # @return [String] String presentation of the object
256
+ def to_s
257
+ to_hash.to_s
258
+ end
259
+
260
+ # to_body is an alias to to_hash (backward compatibility)
261
+ # @return [Hash] Returns the object in the form of hash
262
+ def to_body
263
+ to_hash
264
+ end
265
+
266
+ # Returns the object in the form of hash
267
+ # @return [Hash] Returns the object in the form of hash
268
+ def to_hash
269
+ hash = {}
270
+ self.class.attribute_map.each_pair do |attr, param|
271
+ value = self.send(attr)
272
+ next if value.nil?
273
+ hash[param] = _to_hash(value)
274
+ end
275
+ hash
276
+ end
277
+
278
+ # Outputs non-array value in the form of hash
279
+ # For object, use to_hash. Otherwise, just return the value
280
+ # @param [Object] value Any valid value
281
+ # @return [Hash] Returns the value in the form of hash
282
+ def _to_hash(value)
283
+ if value.is_a?(Array)
284
+ value.compact.map{ |v| _to_hash(v) }
285
+ elsif value.is_a?(Hash)
286
+ {}.tap do |hash|
287
+ value.each { |k, v| hash[k] = _to_hash(v) }
288
+ end
289
+ elsif value.respond_to? :to_hash
290
+ value.to_hash
291
+ else
292
+ value
293
+ end
294
+ end
295
+
296
+ end
297
+
298
+ end
@@ -30,6 +30,9 @@ module DocuSign_eSign
30
30
  # The password for the distributorCode.
31
31
  attr_accessor :distributor_password
32
32
 
33
+ #
34
+ attr_accessor :envelope_partition_id
35
+
33
36
  attr_accessor :initial_user
34
37
 
35
38
  attr_accessor :payment_processor_information
@@ -50,6 +53,7 @@ module DocuSign_eSign
50
53
  :'credit_card_information' => :'creditCardInformation',
51
54
  :'distributor_code' => :'distributorCode',
52
55
  :'distributor_password' => :'distributorPassword',
56
+ :'envelope_partition_id' => :'envelopePartitionId',
53
57
  :'initial_user' => :'initialUser',
54
58
  :'payment_processor_information' => :'PaymentProcessorInformation',
55
59
  :'plan_information' => :'planInformation',
@@ -67,6 +71,7 @@ module DocuSign_eSign
67
71
  :'credit_card_information' => :'CreditCardInformation',
68
72
  :'distributor_code' => :'String',
69
73
  :'distributor_password' => :'String',
74
+ :'envelope_partition_id' => :'String',
70
75
  :'initial_user' => :'UserInformation',
71
76
  :'payment_processor_information' => :'PaymentProcessorInformation',
72
77
  :'plan_information' => :'PlanInformation',
@@ -109,6 +114,10 @@ module DocuSign_eSign
109
114
  self.distributor_password = attributes[:'distributorPassword']
110
115
  end
111
116
 
117
+ if attributes.has_key?(:'envelopePartitionId')
118
+ self.envelope_partition_id = attributes[:'envelopePartitionId']
119
+ end
120
+
112
121
  if attributes.has_key?(:'initialUser')
113
122
  self.initial_user = attributes[:'initialUser']
114
123
  end
@@ -155,6 +164,7 @@ module DocuSign_eSign
155
164
  credit_card_information == o.credit_card_information &&
156
165
  distributor_code == o.distributor_code &&
157
166
  distributor_password == o.distributor_password &&
167
+ envelope_partition_id == o.envelope_partition_id &&
158
168
  initial_user == o.initial_user &&
159
169
  payment_processor_information == o.payment_processor_information &&
160
170
  plan_information == o.plan_information &&
@@ -171,7 +181,7 @@ module DocuSign_eSign
171
181
  # Calculates hash code according to all attributes.
172
182
  # @return [Fixnum] Hash code
173
183
  def hash
174
- [account_name, account_settings, address_information, credit_card_information, distributor_code, distributor_password, initial_user, payment_processor_information, plan_information, referral_information, social_account_information].hash
184
+ [account_name, account_settings, address_information, credit_card_information, distributor_code, distributor_password, envelope_partition_id, initial_user, payment_processor_information, plan_information, referral_information, social_account_information].hash
175
185
  end
176
186
 
177
187
  # Builds the object from hash
@@ -0,0 +1,196 @@
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
+
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module DocuSign_eSign
15
+
16
+ class NotificationDefaultSettings
17
+ attr_accessor :sender_email_notifications
18
+
19
+ attr_accessor :signer_email_notifications
20
+
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'sender_email_notifications' => :'senderEmailNotifications',
26
+ :'signer_email_notifications' => :'signerEmailNotifications'
27
+ }
28
+ end
29
+
30
+ # Attribute type mapping.
31
+ def self.swagger_types
32
+ {
33
+ :'sender_email_notifications' => :'SenderEmailNotifications',
34
+ :'signer_email_notifications' => :'SignerEmailNotifications'
35
+ }
36
+ end
37
+
38
+ # Initializes the object
39
+ # @param [Hash] attributes Model attributes in the form of hash
40
+ def initialize(attributes = {})
41
+ return unless attributes.is_a?(Hash)
42
+
43
+ # convert string to symbol for hash key
44
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
45
+
46
+ if attributes.has_key?(:'senderEmailNotifications')
47
+ self.sender_email_notifications = attributes[:'senderEmailNotifications']
48
+ end
49
+
50
+ if attributes.has_key?(:'signerEmailNotifications')
51
+ self.signer_email_notifications = attributes[:'signerEmailNotifications']
52
+ end
53
+
54
+ end
55
+
56
+ # Show invalid properties with the reasons. Usually used together with valid?
57
+ # @return Array for valid properies with the reasons
58
+ def list_invalid_properties
59
+ invalid_properties = Array.new
60
+ return invalid_properties
61
+ end
62
+
63
+ # Check to see if the all the properties in the model are valid
64
+ # @return true if the model is valid
65
+ def valid?
66
+ return true
67
+ end
68
+
69
+ # Checks equality by comparing each attribute.
70
+ # @param [Object] Object to be compared
71
+ def ==(o)
72
+ return true if self.equal?(o)
73
+ self.class == o.class &&
74
+ sender_email_notifications == o.sender_email_notifications &&
75
+ signer_email_notifications == o.signer_email_notifications
76
+ end
77
+
78
+ # @see the `==` method
79
+ # @param [Object] Object to be compared
80
+ def eql?(o)
81
+ self == o
82
+ end
83
+
84
+ # Calculates hash code according to all attributes.
85
+ # @return [Fixnum] Hash code
86
+ def hash
87
+ [sender_email_notifications, signer_email_notifications].hash
88
+ end
89
+
90
+ # Builds the object from hash
91
+ # @param [Hash] attributes Model attributes in the form of hash
92
+ # @return [Object] Returns the model itself
93
+ def build_from_hash(attributes)
94
+ return nil unless attributes.is_a?(Hash)
95
+ self.class.swagger_types.each_pair do |key, type|
96
+ if type =~ /\AArray<(.*)>/i
97
+ # check to ensure the input is an array given that the the attribute
98
+ # is documented as an array but the input is not
99
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
100
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
101
+ end
102
+ elsif !attributes[self.class.attribute_map[key]].nil?
103
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
104
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
105
+ end
106
+
107
+ self
108
+ end
109
+
110
+ # Deserializes the data based on type
111
+ # @param string type Data type
112
+ # @param string value Value to be deserialized
113
+ # @return [Object] Deserialized data
114
+ def _deserialize(type, value)
115
+ case type.to_sym
116
+ when :DateTime
117
+ DateTime.parse(value)
118
+ when :Date
119
+ Date.parse(value)
120
+ when :String
121
+ value.to_s
122
+ when :Integer
123
+ value.to_i
124
+ when :Float
125
+ value.to_f
126
+ when :BOOLEAN
127
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
128
+ true
129
+ else
130
+ false
131
+ end
132
+ when :Object
133
+ # generic object (usually a Hash), return directly
134
+ value
135
+ when /\AArray<(?<inner_type>.+)>\z/
136
+ inner_type = Regexp.last_match[:inner_type]
137
+ value.map { |v| _deserialize(inner_type, v) }
138
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
139
+ k_type = Regexp.last_match[:k_type]
140
+ v_type = Regexp.last_match[:v_type]
141
+ {}.tap do |hash|
142
+ value.each do |k, v|
143
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
144
+ end
145
+ end
146
+ else # model
147
+ temp_model = DocuSign_eSign.const_get(type).new
148
+ temp_model.build_from_hash(value)
149
+ end
150
+ end
151
+
152
+ # Returns the string representation of the object
153
+ # @return [String] String presentation of the object
154
+ def to_s
155
+ to_hash.to_s
156
+ end
157
+
158
+ # to_body is an alias to to_hash (backward compatibility)
159
+ # @return [Hash] Returns the object in the form of hash
160
+ def to_body
161
+ to_hash
162
+ end
163
+
164
+ # Returns the object in the form of hash
165
+ # @return [Hash] Returns the object in the form of hash
166
+ def to_hash
167
+ hash = {}
168
+ self.class.attribute_map.each_pair do |attr, param|
169
+ value = self.send(attr)
170
+ next if value.nil?
171
+ hash[param] = _to_hash(value)
172
+ end
173
+ hash
174
+ end
175
+
176
+ # Outputs non-array value in the form of hash
177
+ # For object, use to_hash. Otherwise, just return the value
178
+ # @param [Object] value Any valid value
179
+ # @return [Hash] Returns the value in the form of hash
180
+ def _to_hash(value)
181
+ if value.is_a?(Array)
182
+ value.compact.map{ |v| _to_hash(v) }
183
+ elsif value.is_a?(Hash)
184
+ {}.tap do |hash|
185
+ value.each { |k, v| hash[k] = _to_hash(v) }
186
+ end
187
+ elsif value.respond_to? :to_hash
188
+ value.to_hash
189
+ else
190
+ value
191
+ end
192
+ end
193
+
194
+ end
195
+
196
+ end