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