docusign_esign 3.1.0.pre.rc1 → 3.1.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-4.1.210.gem +0 -0
- data/lib/docusign_esign.rb +448 -465
- data/lib/docusign_esign/configuration.rb +1 -1
- data/lib/docusign_esign/version.rb +2 -2
- metadata +3 -22
- data/lib/docusign_esign/api/.DS_Store +0 -0
- data/lib/docusign_esign/api/comments_api.rb +0 -89
- data/lib/docusign_esign/api/trust_service_providers_api.rb +0 -73
- data/lib/docusign_esign/models/address_information_v2.rb +0 -258
- data/lib/docusign_esign/models/custom_field_v2.rb +0 -247
- 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_template_definition.rb +0 -336
- data/lib/docusign_esign/models/envelope_template_result.rb +0 -824
- data/lib/docusign_esign/models/folder_item.rb +0 -390
- data/lib/docusign_esign/models/recipient_saml_authentication.rb +0 -190
- data/lib/docusign_esign/models/saml_assertion_attribute.rb +0 -217
- data/tests/Gemfile.lock +0 -42
- data/tests/docs/private.pem +0 -27
@@ -1,248 +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 DisplayApplianceSignerAttachment
|
17
|
-
#
|
18
|
-
attr_accessor :attachment_description
|
19
|
-
|
20
|
-
#
|
21
|
-
attr_accessor :attachment_tab_id
|
22
|
-
|
23
|
-
# Specifies the document ID number that the tab is placed on. This must refer to an existing Document's ID attribute.
|
24
|
-
attr_accessor :document_id
|
25
|
-
|
26
|
-
# The envelope ID of the envelope status that failed to post.
|
27
|
-
attr_accessor :envelope_id
|
28
|
-
|
29
|
-
#
|
30
|
-
attr_accessor :page_count
|
31
|
-
|
32
|
-
#
|
33
|
-
attr_accessor :page_id
|
34
|
-
|
35
|
-
# Unique for the recipient. It is used by the tab element to indicate which recipient is to sign the Document.
|
36
|
-
attr_accessor :recipient_id
|
37
|
-
|
38
|
-
|
39
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
40
|
-
def self.attribute_map
|
41
|
-
{
|
42
|
-
:'attachment_description' => :'attachmentDescription',
|
43
|
-
:'attachment_tab_id' => :'attachmentTabId',
|
44
|
-
:'document_id' => :'documentId',
|
45
|
-
:'envelope_id' => :'envelopeId',
|
46
|
-
:'page_count' => :'pageCount',
|
47
|
-
:'page_id' => :'pageId',
|
48
|
-
:'recipient_id' => :'recipientId'
|
49
|
-
}
|
50
|
-
end
|
51
|
-
|
52
|
-
# Attribute type mapping.
|
53
|
-
def self.swagger_types
|
54
|
-
{
|
55
|
-
:'attachment_description' => :'String',
|
56
|
-
:'attachment_tab_id' => :'String',
|
57
|
-
:'document_id' => :'String',
|
58
|
-
:'envelope_id' => :'String',
|
59
|
-
:'page_count' => :'Integer',
|
60
|
-
:'page_id' => :'String',
|
61
|
-
:'recipient_id' => :'String'
|
62
|
-
}
|
63
|
-
end
|
64
|
-
|
65
|
-
# Initializes the object
|
66
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
67
|
-
def initialize(attributes = {})
|
68
|
-
return unless attributes.is_a?(Hash)
|
69
|
-
|
70
|
-
# convert string to symbol for hash key
|
71
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
72
|
-
|
73
|
-
if attributes.has_key?(:'attachmentDescription')
|
74
|
-
self.attachment_description = attributes[:'attachmentDescription']
|
75
|
-
end
|
76
|
-
|
77
|
-
if attributes.has_key?(:'attachmentTabId')
|
78
|
-
self.attachment_tab_id = attributes[:'attachmentTabId']
|
79
|
-
end
|
80
|
-
|
81
|
-
if attributes.has_key?(:'documentId')
|
82
|
-
self.document_id = attributes[:'documentId']
|
83
|
-
end
|
84
|
-
|
85
|
-
if attributes.has_key?(:'envelopeId')
|
86
|
-
self.envelope_id = attributes[:'envelopeId']
|
87
|
-
end
|
88
|
-
|
89
|
-
if attributes.has_key?(:'pageCount')
|
90
|
-
self.page_count = attributes[:'pageCount']
|
91
|
-
end
|
92
|
-
|
93
|
-
if attributes.has_key?(:'pageId')
|
94
|
-
self.page_id = attributes[:'pageId']
|
95
|
-
end
|
96
|
-
|
97
|
-
if attributes.has_key?(:'recipientId')
|
98
|
-
self.recipient_id = attributes[:'recipientId']
|
99
|
-
end
|
100
|
-
|
101
|
-
end
|
102
|
-
|
103
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
104
|
-
# @return Array for valid properies with the reasons
|
105
|
-
def list_invalid_properties
|
106
|
-
invalid_properties = Array.new
|
107
|
-
return 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
|
-
return 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
|
-
attachment_description == o.attachment_description &&
|
122
|
-
attachment_tab_id == o.attachment_tab_id &&
|
123
|
-
document_id == o.document_id &&
|
124
|
-
envelope_id == o.envelope_id &&
|
125
|
-
page_count == o.page_count &&
|
126
|
-
page_id == o.page_id &&
|
127
|
-
recipient_id == o.recipient_id
|
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
|
-
[attachment_description, attachment_tab_id, document_id, envelope_id, page_count, page_id, recipient_id].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 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
|
-
|
248
|
-
end
|
@@ -1,336 +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
|
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
|
-
# A complex element containing the following information: templateId: Unique identifier of the template. If this is not provided, DocuSign will generate a value. name: Name of the template. Maximum length: 100 characters. shared: When set to **true**, the template is shared with the Everyone group in the account. If false, the template is only shared with the Administrator group. password: Password, if the template is locked. description: Description of the template. Maximum Length: 500 characters. pageCount: Number of document pages in the template. folderName: The name of the folder the template is located in. folderId: The ID for the folder. owner: The userName, email, userId, userType, and userStatus for the template owner.
|
16
|
-
class EnvelopeTemplateDefinition
|
17
|
-
#
|
18
|
-
attr_accessor :created
|
19
|
-
|
20
|
-
#
|
21
|
-
attr_accessor :description
|
22
|
-
|
23
|
-
# The ID for the folder.
|
24
|
-
attr_accessor :folder_id
|
25
|
-
|
26
|
-
# The name of the folder in which the template is located.
|
27
|
-
attr_accessor :folder_name
|
28
|
-
|
29
|
-
# The URI of the folder.
|
30
|
-
attr_accessor :folder_uri
|
31
|
-
|
32
|
-
#
|
33
|
-
attr_accessor :last_modified
|
34
|
-
|
35
|
-
attr_accessor :last_modified_by
|
36
|
-
|
37
|
-
#
|
38
|
-
attr_accessor :name
|
39
|
-
|
40
|
-
#
|
41
|
-
attr_accessor :new_password
|
42
|
-
|
43
|
-
attr_accessor :owner
|
44
|
-
|
45
|
-
# An integer value specifying the number of document pages in the template. Omit this property if not submitting a page count.
|
46
|
-
attr_accessor :page_count
|
47
|
-
|
48
|
-
#
|
49
|
-
attr_accessor :parent_folder_uri
|
50
|
-
|
51
|
-
#
|
52
|
-
attr_accessor :password
|
53
|
-
|
54
|
-
# When set to **true**, this custom tab is shared.
|
55
|
-
attr_accessor :shared
|
56
|
-
|
57
|
-
# The unique identifier of the template. If this is not provided, DocuSign will generate a value.
|
58
|
-
attr_accessor :template_id
|
59
|
-
|
60
|
-
#
|
61
|
-
attr_accessor :uri
|
62
|
-
|
63
|
-
|
64
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
65
|
-
def self.attribute_map
|
66
|
-
{
|
67
|
-
:'created' => :'created',
|
68
|
-
:'description' => :'description',
|
69
|
-
:'folder_id' => :'folderId',
|
70
|
-
:'folder_name' => :'folderName',
|
71
|
-
:'folder_uri' => :'folderUri',
|
72
|
-
:'last_modified' => :'lastModified',
|
73
|
-
:'last_modified_by' => :'lastModifiedBy',
|
74
|
-
:'name' => :'name',
|
75
|
-
:'new_password' => :'newPassword',
|
76
|
-
:'owner' => :'owner',
|
77
|
-
:'page_count' => :'pageCount',
|
78
|
-
:'parent_folder_uri' => :'parentFolderUri',
|
79
|
-
:'password' => :'password',
|
80
|
-
:'shared' => :'shared',
|
81
|
-
:'template_id' => :'templateId',
|
82
|
-
:'uri' => :'uri'
|
83
|
-
}
|
84
|
-
end
|
85
|
-
|
86
|
-
# Attribute type mapping.
|
87
|
-
def self.swagger_types
|
88
|
-
{
|
89
|
-
:'created' => :'String',
|
90
|
-
:'description' => :'String',
|
91
|
-
:'folder_id' => :'String',
|
92
|
-
:'folder_name' => :'String',
|
93
|
-
:'folder_uri' => :'String',
|
94
|
-
:'last_modified' => :'String',
|
95
|
-
:'last_modified_by' => :'UserInfo',
|
96
|
-
:'name' => :'String',
|
97
|
-
:'new_password' => :'String',
|
98
|
-
:'owner' => :'UserInfo',
|
99
|
-
:'page_count' => :'Integer',
|
100
|
-
:'parent_folder_uri' => :'String',
|
101
|
-
:'password' => :'String',
|
102
|
-
:'shared' => :'String',
|
103
|
-
:'template_id' => :'String',
|
104
|
-
:'uri' => :'String'
|
105
|
-
}
|
106
|
-
end
|
107
|
-
|
108
|
-
# Initializes the object
|
109
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
110
|
-
def initialize(attributes = {})
|
111
|
-
return unless attributes.is_a?(Hash)
|
112
|
-
|
113
|
-
# convert string to symbol for hash key
|
114
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
115
|
-
|
116
|
-
if attributes.has_key?(:'created')
|
117
|
-
self.created = attributes[:'created']
|
118
|
-
end
|
119
|
-
|
120
|
-
if attributes.has_key?(:'description')
|
121
|
-
self.description = attributes[:'description']
|
122
|
-
end
|
123
|
-
|
124
|
-
if attributes.has_key?(:'folderId')
|
125
|
-
self.folder_id = attributes[:'folderId']
|
126
|
-
end
|
127
|
-
|
128
|
-
if attributes.has_key?(:'folderName')
|
129
|
-
self.folder_name = attributes[:'folderName']
|
130
|
-
end
|
131
|
-
|
132
|
-
if attributes.has_key?(:'folderUri')
|
133
|
-
self.folder_uri = attributes[:'folderUri']
|
134
|
-
end
|
135
|
-
|
136
|
-
if attributes.has_key?(:'lastModified')
|
137
|
-
self.last_modified = attributes[:'lastModified']
|
138
|
-
end
|
139
|
-
|
140
|
-
if attributes.has_key?(:'lastModifiedBy')
|
141
|
-
self.last_modified_by = attributes[:'lastModifiedBy']
|
142
|
-
end
|
143
|
-
|
144
|
-
if attributes.has_key?(:'name')
|
145
|
-
self.name = attributes[:'name']
|
146
|
-
end
|
147
|
-
|
148
|
-
if attributes.has_key?(:'newPassword')
|
149
|
-
self.new_password = attributes[:'newPassword']
|
150
|
-
end
|
151
|
-
|
152
|
-
if attributes.has_key?(:'owner')
|
153
|
-
self.owner = attributes[:'owner']
|
154
|
-
end
|
155
|
-
|
156
|
-
if attributes.has_key?(:'pageCount')
|
157
|
-
self.page_count = attributes[:'pageCount']
|
158
|
-
end
|
159
|
-
|
160
|
-
if attributes.has_key?(:'parentFolderUri')
|
161
|
-
self.parent_folder_uri = attributes[:'parentFolderUri']
|
162
|
-
end
|
163
|
-
|
164
|
-
if attributes.has_key?(:'password')
|
165
|
-
self.password = attributes[:'password']
|
166
|
-
end
|
167
|
-
|
168
|
-
if attributes.has_key?(:'shared')
|
169
|
-
self.shared = attributes[:'shared']
|
170
|
-
end
|
171
|
-
|
172
|
-
if attributes.has_key?(:'templateId')
|
173
|
-
self.template_id = attributes[:'templateId']
|
174
|
-
end
|
175
|
-
|
176
|
-
if attributes.has_key?(:'uri')
|
177
|
-
self.uri = attributes[:'uri']
|
178
|
-
end
|
179
|
-
|
180
|
-
end
|
181
|
-
|
182
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
183
|
-
# @return Array for valid properies with the reasons
|
184
|
-
def list_invalid_properties
|
185
|
-
invalid_properties = Array.new
|
186
|
-
return invalid_properties
|
187
|
-
end
|
188
|
-
|
189
|
-
# Check to see if the all the properties in the model are valid
|
190
|
-
# @return true if the model is valid
|
191
|
-
def valid?
|
192
|
-
return true
|
193
|
-
end
|
194
|
-
|
195
|
-
# Checks equality by comparing each attribute.
|
196
|
-
# @param [Object] Object to be compared
|
197
|
-
def ==(o)
|
198
|
-
return true if self.equal?(o)
|
199
|
-
self.class == o.class &&
|
200
|
-
created == o.created &&
|
201
|
-
description == o.description &&
|
202
|
-
folder_id == o.folder_id &&
|
203
|
-
folder_name == o.folder_name &&
|
204
|
-
folder_uri == o.folder_uri &&
|
205
|
-
last_modified == o.last_modified &&
|
206
|
-
last_modified_by == o.last_modified_by &&
|
207
|
-
name == o.name &&
|
208
|
-
new_password == o.new_password &&
|
209
|
-
owner == o.owner &&
|
210
|
-
page_count == o.page_count &&
|
211
|
-
parent_folder_uri == o.parent_folder_uri &&
|
212
|
-
password == o.password &&
|
213
|
-
shared == o.shared &&
|
214
|
-
template_id == o.template_id &&
|
215
|
-
uri == o.uri
|
216
|
-
end
|
217
|
-
|
218
|
-
# @see the `==` method
|
219
|
-
# @param [Object] Object to be compared
|
220
|
-
def eql?(o)
|
221
|
-
self == o
|
222
|
-
end
|
223
|
-
|
224
|
-
# Calculates hash code according to all attributes.
|
225
|
-
# @return [Fixnum] Hash code
|
226
|
-
def hash
|
227
|
-
[created, description, folder_id, folder_name, folder_uri, last_modified, last_modified_by, name, new_password, owner, page_count, parent_folder_uri, password, shared, template_id, uri].hash
|
228
|
-
end
|
229
|
-
|
230
|
-
# Builds the object from hash
|
231
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
232
|
-
# @return [Object] Returns the model itself
|
233
|
-
def build_from_hash(attributes)
|
234
|
-
return nil unless attributes.is_a?(Hash)
|
235
|
-
self.class.swagger_types.each_pair do |key, type|
|
236
|
-
if type =~ /\AArray<(.*)>/i
|
237
|
-
# check to ensure the input is an array given that the the attribute
|
238
|
-
# is documented as an array but the input is not
|
239
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
240
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
241
|
-
end
|
242
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
243
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
244
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
245
|
-
end
|
246
|
-
|
247
|
-
self
|
248
|
-
end
|
249
|
-
|
250
|
-
# Deserializes the data based on type
|
251
|
-
# @param string type Data type
|
252
|
-
# @param string value Value to be deserialized
|
253
|
-
# @return [Object] Deserialized data
|
254
|
-
def _deserialize(type, value)
|
255
|
-
case type.to_sym
|
256
|
-
when :DateTime
|
257
|
-
DateTime.parse(value)
|
258
|
-
when :Date
|
259
|
-
Date.parse(value)
|
260
|
-
when :String
|
261
|
-
value.to_s
|
262
|
-
when :Integer
|
263
|
-
value.to_i
|
264
|
-
when :Float
|
265
|
-
value.to_f
|
266
|
-
when :BOOLEAN
|
267
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
268
|
-
true
|
269
|
-
else
|
270
|
-
false
|
271
|
-
end
|
272
|
-
when :Object
|
273
|
-
# generic object (usually a Hash), return directly
|
274
|
-
value
|
275
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
276
|
-
inner_type = Regexp.last_match[:inner_type]
|
277
|
-
value.map { |v| _deserialize(inner_type, v) }
|
278
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
279
|
-
k_type = Regexp.last_match[:k_type]
|
280
|
-
v_type = Regexp.last_match[:v_type]
|
281
|
-
{}.tap do |hash|
|
282
|
-
value.each do |k, v|
|
283
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
284
|
-
end
|
285
|
-
end
|
286
|
-
else # model
|
287
|
-
temp_model = DocuSign_eSign.const_get(type).new
|
288
|
-
temp_model.build_from_hash(value)
|
289
|
-
end
|
290
|
-
end
|
291
|
-
|
292
|
-
# Returns the string representation of the object
|
293
|
-
# @return [String] String presentation of the object
|
294
|
-
def to_s
|
295
|
-
to_hash.to_s
|
296
|
-
end
|
297
|
-
|
298
|
-
# to_body is an alias to to_hash (backward compatibility)
|
299
|
-
# @return [Hash] Returns the object in the form of hash
|
300
|
-
def to_body
|
301
|
-
to_hash
|
302
|
-
end
|
303
|
-
|
304
|
-
# Returns the object in the form of hash
|
305
|
-
# @return [Hash] Returns the object in the form of hash
|
306
|
-
def to_hash
|
307
|
-
hash = {}
|
308
|
-
self.class.attribute_map.each_pair do |attr, param|
|
309
|
-
value = self.send(attr)
|
310
|
-
next if value.nil?
|
311
|
-
hash[param] = _to_hash(value)
|
312
|
-
end
|
313
|
-
hash
|
314
|
-
end
|
315
|
-
|
316
|
-
# Outputs non-array value in the form of hash
|
317
|
-
# For object, use to_hash. Otherwise, just return the value
|
318
|
-
# @param [Object] value Any valid value
|
319
|
-
# @return [Hash] Returns the value in the form of hash
|
320
|
-
def _to_hash(value)
|
321
|
-
if value.is_a?(Array)
|
322
|
-
value.compact.map{ |v| _to_hash(v) }
|
323
|
-
elsif value.is_a?(Hash)
|
324
|
-
{}.tap do |hash|
|
325
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
326
|
-
end
|
327
|
-
elsif value.respond_to? :to_hash
|
328
|
-
value.to_hash
|
329
|
-
else
|
330
|
-
value
|
331
|
-
end
|
332
|
-
end
|
333
|
-
|
334
|
-
end
|
335
|
-
|
336
|
-
end
|