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