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,210 @@
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 BulkSendingList
17
+ #
18
+ attr_accessor :bulk_copies
19
+
20
+ #
21
+ attr_accessor :list_id
22
+
23
+ #
24
+ attr_accessor :name
25
+
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'bulk_copies' => :'bulkCopies',
31
+ :'list_id' => :'listId',
32
+ :'name' => :'name'
33
+ }
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.swagger_types
38
+ {
39
+ :'bulk_copies' => :'Array<BulkSendingCopy>',
40
+ :'list_id' => :'String',
41
+ :'name' => :'String'
42
+ }
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ return unless attributes.is_a?(Hash)
49
+
50
+ # convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
52
+
53
+ if attributes.has_key?(:'bulkCopies')
54
+ if (value = attributes[:'bulkCopies']).is_a?(Array)
55
+ self.bulk_copies = value
56
+ end
57
+ end
58
+
59
+ if attributes.has_key?(:'listId')
60
+ self.list_id = attributes[:'listId']
61
+ end
62
+
63
+ if attributes.has_key?(:'name')
64
+ self.name = attributes[:'name']
65
+ end
66
+
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properies with the reasons
71
+ def list_invalid_properties
72
+ invalid_properties = Array.new
73
+ return invalid_properties
74
+ end
75
+
76
+ # Check to see if the all the properties in the model are valid
77
+ # @return true if the model is valid
78
+ def valid?
79
+ return true
80
+ end
81
+
82
+ # Checks equality by comparing each attribute.
83
+ # @param [Object] Object to be compared
84
+ def ==(o)
85
+ return true if self.equal?(o)
86
+ self.class == o.class &&
87
+ bulk_copies == o.bulk_copies &&
88
+ list_id == o.list_id &&
89
+ name == o.name
90
+ end
91
+
92
+ # @see the `==` method
93
+ # @param [Object] Object to be compared
94
+ def eql?(o)
95
+ self == o
96
+ end
97
+
98
+ # Calculates hash code according to all attributes.
99
+ # @return [Fixnum] Hash code
100
+ def hash
101
+ [bulk_copies, list_id, name].hash
102
+ end
103
+
104
+ # Builds the object from hash
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ # @return [Object] Returns the model itself
107
+ def build_from_hash(attributes)
108
+ return nil unless attributes.is_a?(Hash)
109
+ self.class.swagger_types.each_pair do |key, type|
110
+ if type =~ /\AArray<(.*)>/i
111
+ # check to ensure the input is an array given that the the attribute
112
+ # is documented as an array but the input is not
113
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
114
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
115
+ end
116
+ elsif !attributes[self.class.attribute_map[key]].nil?
117
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
118
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
119
+ end
120
+
121
+ self
122
+ end
123
+
124
+ # Deserializes the data based on type
125
+ # @param string type Data type
126
+ # @param string value Value to be deserialized
127
+ # @return [Object] Deserialized data
128
+ def _deserialize(type, value)
129
+ case type.to_sym
130
+ when :DateTime
131
+ DateTime.parse(value)
132
+ when :Date
133
+ Date.parse(value)
134
+ when :String
135
+ value.to_s
136
+ when :Integer
137
+ value.to_i
138
+ when :Float
139
+ value.to_f
140
+ when :BOOLEAN
141
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
142
+ true
143
+ else
144
+ false
145
+ end
146
+ when :Object
147
+ # generic object (usually a Hash), return directly
148
+ value
149
+ when /\AArray<(?<inner_type>.+)>\z/
150
+ inner_type = Regexp.last_match[:inner_type]
151
+ value.map { |v| _deserialize(inner_type, v) }
152
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
153
+ k_type = Regexp.last_match[:k_type]
154
+ v_type = Regexp.last_match[:v_type]
155
+ {}.tap do |hash|
156
+ value.each do |k, v|
157
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
158
+ end
159
+ end
160
+ else # model
161
+ temp_model = DocuSign_eSign.const_get(type).new
162
+ temp_model.build_from_hash(value)
163
+ end
164
+ end
165
+
166
+ # Returns the string representation of the object
167
+ # @return [String] String presentation of the object
168
+ def to_s
169
+ to_hash.to_s
170
+ end
171
+
172
+ # to_body is an alias to to_hash (backward compatibility)
173
+ # @return [Hash] Returns the object in the form of hash
174
+ def to_body
175
+ to_hash
176
+ end
177
+
178
+ # Returns the object in the form of hash
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_hash
181
+ hash = {}
182
+ self.class.attribute_map.each_pair do |attr, param|
183
+ value = self.send(attr)
184
+ next if value.nil?
185
+ hash[param] = _to_hash(value)
186
+ end
187
+ hash
188
+ end
189
+
190
+ # Outputs non-array value in the form of hash
191
+ # For object, use to_hash. Otherwise, just return the value
192
+ # @param [Object] value Any valid value
193
+ # @return [Hash] Returns the value in the form of hash
194
+ def _to_hash(value)
195
+ if value.is_a?(Array)
196
+ value.compact.map{ |v| _to_hash(v) }
197
+ elsif value.is_a?(Hash)
198
+ {}.tap do |hash|
199
+ value.each { |k, v| hash[k] = _to_hash(v) }
200
+ end
201
+ elsif value.respond_to? :to_hash
202
+ value.to_hash
203
+ else
204
+ value
205
+ end
206
+ end
207
+
208
+ end
209
+
210
+ end
@@ -0,0 +1,190 @@
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 BulkSendingListSummaries
17
+ #
18
+ attr_accessor :bulk_list_summaries
19
+
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'bulk_list_summaries' => :'bulkListSummaries'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.swagger_types
30
+ {
31
+ :'bulk_list_summaries' => :'Array<BulkSendingListSummary>'
32
+ }
33
+ end
34
+
35
+ # Initializes the object
36
+ # @param [Hash] attributes Model attributes in the form of hash
37
+ def initialize(attributes = {})
38
+ return unless attributes.is_a?(Hash)
39
+
40
+ # convert string to symbol for hash key
41
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
42
+
43
+ if attributes.has_key?(:'bulkListSummaries')
44
+ if (value = attributes[:'bulkListSummaries']).is_a?(Array)
45
+ self.bulk_list_summaries = value
46
+ end
47
+ end
48
+
49
+ end
50
+
51
+ # Show invalid properties with the reasons. Usually used together with valid?
52
+ # @return Array for valid properies with the reasons
53
+ def list_invalid_properties
54
+ invalid_properties = Array.new
55
+ return invalid_properties
56
+ end
57
+
58
+ # Check to see if the all the properties in the model are valid
59
+ # @return true if the model is valid
60
+ def valid?
61
+ return true
62
+ end
63
+
64
+ # Checks equality by comparing each attribute.
65
+ # @param [Object] Object to be compared
66
+ def ==(o)
67
+ return true if self.equal?(o)
68
+ self.class == o.class &&
69
+ bulk_list_summaries == o.bulk_list_summaries
70
+ end
71
+
72
+ # @see the `==` method
73
+ # @param [Object] Object to be compared
74
+ def eql?(o)
75
+ self == o
76
+ end
77
+
78
+ # Calculates hash code according to all attributes.
79
+ # @return [Fixnum] Hash code
80
+ def hash
81
+ [bulk_list_summaries].hash
82
+ end
83
+
84
+ # Builds the object from hash
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ # @return [Object] Returns the model itself
87
+ def build_from_hash(attributes)
88
+ return nil unless attributes.is_a?(Hash)
89
+ self.class.swagger_types.each_pair do |key, type|
90
+ if type =~ /\AArray<(.*)>/i
91
+ # check to ensure the input is an array given that the the attribute
92
+ # is documented as an array but the input is not
93
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
94
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
95
+ end
96
+ elsif !attributes[self.class.attribute_map[key]].nil?
97
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
98
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
99
+ end
100
+
101
+ self
102
+ end
103
+
104
+ # Deserializes the data based on type
105
+ # @param string type Data type
106
+ # @param string value Value to be deserialized
107
+ # @return [Object] Deserialized data
108
+ def _deserialize(type, value)
109
+ case type.to_sym
110
+ when :DateTime
111
+ DateTime.parse(value)
112
+ when :Date
113
+ Date.parse(value)
114
+ when :String
115
+ value.to_s
116
+ when :Integer
117
+ value.to_i
118
+ when :Float
119
+ value.to_f
120
+ when :BOOLEAN
121
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
122
+ true
123
+ else
124
+ false
125
+ end
126
+ when :Object
127
+ # generic object (usually a Hash), return directly
128
+ value
129
+ when /\AArray<(?<inner_type>.+)>\z/
130
+ inner_type = Regexp.last_match[:inner_type]
131
+ value.map { |v| _deserialize(inner_type, v) }
132
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
133
+ k_type = Regexp.last_match[:k_type]
134
+ v_type = Regexp.last_match[:v_type]
135
+ {}.tap do |hash|
136
+ value.each do |k, v|
137
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
138
+ end
139
+ end
140
+ else # model
141
+ temp_model = DocuSign_eSign.const_get(type).new
142
+ temp_model.build_from_hash(value)
143
+ end
144
+ end
145
+
146
+ # Returns the string representation of the object
147
+ # @return [String] String presentation of the object
148
+ def to_s
149
+ to_hash.to_s
150
+ end
151
+
152
+ # to_body is an alias to to_hash (backward compatibility)
153
+ # @return [Hash] Returns the object in the form of hash
154
+ def to_body
155
+ to_hash
156
+ end
157
+
158
+ # Returns the object in the form of hash
159
+ # @return [Hash] Returns the object in the form of hash
160
+ def to_hash
161
+ hash = {}
162
+ self.class.attribute_map.each_pair do |attr, param|
163
+ value = self.send(attr)
164
+ next if value.nil?
165
+ hash[param] = _to_hash(value)
166
+ end
167
+ hash
168
+ end
169
+
170
+ # Outputs non-array value in the form of hash
171
+ # For object, use to_hash. Otherwise, just return the value
172
+ # @param [Object] value Any valid value
173
+ # @return [Hash] Returns the value in the form of hash
174
+ def _to_hash(value)
175
+ if value.is_a?(Array)
176
+ value.compact.map{ |v| _to_hash(v) }
177
+ elsif value.is_a?(Hash)
178
+ {}.tap do |hash|
179
+ value.each { |k, v| hash[k] = _to_hash(v) }
180
+ end
181
+ elsif value.respond_to? :to_hash
182
+ value.to_hash
183
+ else
184
+ value
185
+ end
186
+ end
187
+
188
+ end
189
+
190
+ 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 BulkSendingListSummary
17
+ #
18
+ attr_accessor :bulk_send_list_id
19
+
20
+ #
21
+ attr_accessor :created_by_user
22
+
23
+ #
24
+ attr_accessor :created_date
25
+
26
+ #
27
+ attr_accessor :name
28
+
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'bulk_send_list_id' => :'bulkSendListId',
34
+ :'created_by_user' => :'createdByUser',
35
+ :'created_date' => :'createdDate',
36
+ :'name' => :'name'
37
+ }
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.swagger_types
42
+ {
43
+ :'bulk_send_list_id' => :'String',
44
+ :'created_by_user' => :'String',
45
+ :'created_date' => :'String',
46
+ :'name' => :'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?(:'bulkSendListId')
59
+ self.bulk_send_list_id = attributes[:'bulkSendListId']
60
+ end
61
+
62
+ if attributes.has_key?(:'createdByUser')
63
+ self.created_by_user = attributes[:'createdByUser']
64
+ end
65
+
66
+ if attributes.has_key?(:'createdDate')
67
+ self.created_date = attributes[:'createdDate']
68
+ end
69
+
70
+ if attributes.has_key?(:'name')
71
+ self.name = attributes[:'name']
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
+ bulk_send_list_id == o.bulk_send_list_id &&
95
+ created_by_user == o.created_by_user &&
96
+ created_date == o.created_date &&
97
+ name == o.name
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
+ [bulk_send_list_id, created_by_user, created_date, name].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