docusign_click 1.0.0.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +6 -0
  3. data/Gemfile +7 -0
  4. data/Gemfile.lock +69 -0
  5. data/LICENSE +21 -0
  6. data/README.md +80 -0
  7. data/Rakefile +8 -0
  8. data/docusign_click-1.0.0.pre.alpha.gem +0 -0
  9. data/docusign_click-1.0.0.rc1.gem +0 -0
  10. data/docusign_click.gemspec +45 -0
  11. data/git_push.sh +55 -0
  12. data/lib/.DS_Store +0 -0
  13. data/lib/docusign_click.rb +62 -0
  14. data/lib/docusign_click/.DS_Store +0 -0
  15. data/lib/docusign_click/api/.DS_Store +0 -0
  16. data/lib/docusign_click/api/accounts_api.rb +1377 -0
  17. data/lib/docusign_click/client/.DS_Store +0 -0
  18. data/lib/docusign_click/client/api_client.rb +590 -0
  19. data/lib/docusign_click/client/api_error.rb +37 -0
  20. data/lib/docusign_click/client/auth/oauth.rb +1061 -0
  21. data/lib/docusign_click/configuration.rb +202 -0
  22. data/lib/docusign_click/models/clickwrap_agreements_response.rb +226 -0
  23. data/lib/docusign_click/models/clickwrap_delete_response.rb +224 -0
  24. data/lib/docusign_click/models/clickwrap_request.rb +294 -0
  25. data/lib/docusign_click/models/clickwrap_scheduled_reacceptance.rb +204 -0
  26. data/lib/docusign_click/models/clickwrap_transfer_request.rb +194 -0
  27. data/lib/docusign_click/models/clickwrap_version.rb +283 -0
  28. data/lib/docusign_click/models/clickwrap_version_delete_response.rb +303 -0
  29. data/lib/docusign_click/models/clickwrap_version_response.rb +334 -0
  30. data/lib/docusign_click/models/clickwrap_version_summary_response.rb +313 -0
  31. data/lib/docusign_click/models/clickwrap_versions_delete_response.rb +206 -0
  32. data/lib/docusign_click/models/clickwrap_versions_paged_response.rb +246 -0
  33. data/lib/docusign_click/models/clickwrap_versions_response.rb +216 -0
  34. data/lib/docusign_click/models/clickwraps_delete_response.rb +186 -0
  35. data/lib/docusign_click/models/conversion_document.rb +204 -0
  36. data/lib/docusign_click/models/display_settings.rb +356 -0
  37. data/lib/docusign_click/models/document.rb +224 -0
  38. data/lib/docusign_click/models/document_conversion_request.rb +186 -0
  39. data/lib/docusign_click/models/document_conversion_response.rb +186 -0
  40. data/lib/docusign_click/models/error_details.rb +194 -0
  41. data/lib/docusign_click/models/html_result.rb +194 -0
  42. data/lib/docusign_click/models/recipient_copy_request.rb +184 -0
  43. data/lib/docusign_click/models/service_information.rb +238 -0
  44. data/lib/docusign_click/models/service_version.rb +194 -0
  45. data/lib/docusign_click/models/update_agreement_request.rb +194 -0
  46. data/lib/docusign_click/models/user_agreement_request.rb +204 -0
  47. data/lib/docusign_click/models/user_agreement_response.rb +335 -0
  48. data/lib/docusign_click/version.rb +14 -0
  49. data/tests/Gemfile +5 -0
  50. data/tests/Gemfile.lock +42 -0
  51. data/tests/docs/Test.pdf +0 -0
  52. data/tests/docs/private.pem +27 -0
  53. data/tests/spec/unit_tests_using_jwt_spec.rb +126 -0
  54. metadata +297 -0
@@ -0,0 +1,303 @@
1
+ =begin
2
+ #DocuSign Click API
3
+
4
+ #DocuSign Click lets you capture consent to standard agreement terms with a single click: terms and conditions, terms of service, terms of use, privacy policies, and more. The Click API lets you include this customizable clickwrap solution in your DocuSign integrations.
5
+
6
+ OpenAPI spec version: v1
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_Click
15
+ class ClickwrapVersionDeleteResponse
16
+ #
17
+ attr_accessor :clickwrap_version_id
18
+
19
+ #
20
+ attr_accessor :created_time
21
+
22
+ #
23
+ attr_accessor :deletion_message
24
+
25
+ #
26
+ attr_accessor :deletion_success
27
+
28
+ #
29
+ attr_accessor :last_modified
30
+
31
+ #
32
+ attr_accessor :last_modified_by
33
+
34
+ #
35
+ attr_accessor :owner_user_id
36
+
37
+ #
38
+ attr_accessor :require_reacceptance
39
+
40
+ #
41
+ attr_accessor :scheduled_date
42
+
43
+ attr_accessor :scheduled_reacceptance
44
+
45
+ #
46
+ attr_accessor :status
47
+
48
+ #
49
+ attr_accessor :version_id
50
+
51
+ #
52
+ attr_accessor :version_number
53
+
54
+ # Attribute mapping from ruby-style variable name to JSON key.
55
+ def self.attribute_map
56
+ {
57
+ :'clickwrap_version_id' => :'clickwrapVersionId',
58
+ :'created_time' => :'createdTime',
59
+ :'deletion_message' => :'deletionMessage',
60
+ :'deletion_success' => :'deletionSuccess',
61
+ :'last_modified' => :'lastModified',
62
+ :'last_modified_by' => :'lastModifiedBy',
63
+ :'owner_user_id' => :'ownerUserId',
64
+ :'require_reacceptance' => :'requireReacceptance',
65
+ :'scheduled_date' => :'scheduledDate',
66
+ :'scheduled_reacceptance' => :'scheduledReacceptance',
67
+ :'status' => :'status',
68
+ :'version_id' => :'versionId',
69
+ :'version_number' => :'versionNumber'
70
+ }
71
+ end
72
+
73
+ # Attribute type mapping.
74
+ def self.swagger_types
75
+ {
76
+ :'clickwrap_version_id' => :'String',
77
+ :'created_time' => :'Object',
78
+ :'deletion_message' => :'String',
79
+ :'deletion_success' => :'BOOLEAN',
80
+ :'last_modified' => :'Object',
81
+ :'last_modified_by' => :'String',
82
+ :'owner_user_id' => :'String',
83
+ :'require_reacceptance' => :'BOOLEAN',
84
+ :'scheduled_date' => :'Object',
85
+ :'scheduled_reacceptance' => :'ClickwrapScheduledReacceptance',
86
+ :'status' => :'String',
87
+ :'version_id' => :'String',
88
+ :'version_number' => :'String'
89
+ }
90
+ end
91
+
92
+ # Initializes the object
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ def initialize(attributes = {})
95
+ return unless attributes.is_a?(Hash)
96
+
97
+ # convert string to symbol for hash key
98
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
99
+
100
+ if attributes.has_key?(:'clickwrapVersionId')
101
+ self.clickwrap_version_id = attributes[:'clickwrapVersionId']
102
+ end
103
+
104
+ if attributes.has_key?(:'createdTime')
105
+ self.created_time = attributes[:'createdTime']
106
+ end
107
+
108
+ if attributes.has_key?(:'deletionMessage')
109
+ self.deletion_message = attributes[:'deletionMessage']
110
+ end
111
+
112
+ if attributes.has_key?(:'deletionSuccess')
113
+ self.deletion_success = attributes[:'deletionSuccess']
114
+ end
115
+
116
+ if attributes.has_key?(:'lastModified')
117
+ self.last_modified = attributes[:'lastModified']
118
+ end
119
+
120
+ if attributes.has_key?(:'lastModifiedBy')
121
+ self.last_modified_by = attributes[:'lastModifiedBy']
122
+ end
123
+
124
+ if attributes.has_key?(:'ownerUserId')
125
+ self.owner_user_id = attributes[:'ownerUserId']
126
+ end
127
+
128
+ if attributes.has_key?(:'requireReacceptance')
129
+ self.require_reacceptance = attributes[:'requireReacceptance']
130
+ end
131
+
132
+ if attributes.has_key?(:'scheduledDate')
133
+ self.scheduled_date = attributes[:'scheduledDate']
134
+ end
135
+
136
+ if attributes.has_key?(:'scheduledReacceptance')
137
+ self.scheduled_reacceptance = attributes[:'scheduledReacceptance']
138
+ end
139
+
140
+ if attributes.has_key?(:'status')
141
+ self.status = attributes[:'status']
142
+ end
143
+
144
+ if attributes.has_key?(:'versionId')
145
+ self.version_id = attributes[:'versionId']
146
+ end
147
+
148
+ if attributes.has_key?(:'versionNumber')
149
+ self.version_number = attributes[:'versionNumber']
150
+ end
151
+ end
152
+
153
+ # Show invalid properties with the reasons. Usually used together with valid?
154
+ # @return Array for valid properties with the reasons
155
+ def list_invalid_properties
156
+ invalid_properties = Array.new
157
+ invalid_properties
158
+ end
159
+
160
+ # Check to see if the all the properties in the model are valid
161
+ # @return true if the model is valid
162
+ def valid?
163
+ true
164
+ end
165
+
166
+ # Checks equality by comparing each attribute.
167
+ # @param [Object] Object to be compared
168
+ def ==(o)
169
+ return true if self.equal?(o)
170
+ self.class == o.class &&
171
+ clickwrap_version_id == o.clickwrap_version_id &&
172
+ created_time == o.created_time &&
173
+ deletion_message == o.deletion_message &&
174
+ deletion_success == o.deletion_success &&
175
+ last_modified == o.last_modified &&
176
+ last_modified_by == o.last_modified_by &&
177
+ owner_user_id == o.owner_user_id &&
178
+ require_reacceptance == o.require_reacceptance &&
179
+ scheduled_date == o.scheduled_date &&
180
+ scheduled_reacceptance == o.scheduled_reacceptance &&
181
+ status == o.status &&
182
+ version_id == o.version_id &&
183
+ version_number == o.version_number
184
+ end
185
+
186
+ # @see the `==` method
187
+ # @param [Object] Object to be compared
188
+ def eql?(o)
189
+ self == o
190
+ end
191
+
192
+ # Calculates hash code according to all attributes.
193
+ # @return [Fixnum] Hash code
194
+ def hash
195
+ [clickwrap_version_id, created_time, deletion_message, deletion_success, last_modified, last_modified_by, owner_user_id, require_reacceptance, scheduled_date, scheduled_reacceptance, status, version_id, version_number].hash
196
+ end
197
+
198
+ # Builds the object from hash
199
+ # @param [Hash] attributes Model attributes in the form of hash
200
+ # @return [Object] Returns the model itself
201
+ def build_from_hash(attributes)
202
+ return nil unless attributes.is_a?(Hash)
203
+ self.class.swagger_types.each_pair do |key, type|
204
+ if type =~ /\AArray<(.*)>/i
205
+ # check to ensure the input is an array given that the attribute
206
+ # is documented as an array but the input is not
207
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
208
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
209
+ end
210
+ elsif !attributes[self.class.attribute_map[key]].nil?
211
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
212
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
213
+ end
214
+
215
+ self
216
+ end
217
+
218
+ # Deserializes the data based on type
219
+ # @param string type Data type
220
+ # @param string value Value to be deserialized
221
+ # @return [Object] Deserialized data
222
+ def _deserialize(type, value)
223
+ case type.to_sym
224
+ when :DateTime
225
+ DateTime.parse(value)
226
+ when :Date
227
+ Date.parse(value)
228
+ when :String
229
+ value.to_s
230
+ when :Integer
231
+ value.to_i
232
+ when :Float
233
+ value.to_f
234
+ when :BOOLEAN
235
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
236
+ true
237
+ else
238
+ false
239
+ end
240
+ when :Object
241
+ # generic object (usually a Hash), return directly
242
+ value
243
+ when /\AArray<(?<inner_type>.+)>\z/
244
+ inner_type = Regexp.last_match[:inner_type]
245
+ value.map { |v| _deserialize(inner_type, v) }
246
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
247
+ k_type = Regexp.last_match[:k_type]
248
+ v_type = Regexp.last_match[:v_type]
249
+ {}.tap do |hash|
250
+ value.each do |k, v|
251
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
252
+ end
253
+ end
254
+ else # model
255
+ temp_model = DocuSign_Click.const_get(type).new
256
+ temp_model.build_from_hash(value)
257
+ end
258
+ end
259
+
260
+ # Returns the string representation of the object
261
+ # @return [String] String presentation of the object
262
+ def to_s
263
+ to_hash.to_s
264
+ end
265
+
266
+ # to_body is an alias to to_hash (backward compatibility)
267
+ # @return [Hash] Returns the object in the form of hash
268
+ def to_body
269
+ to_hash
270
+ end
271
+
272
+ # Returns the object in the form of hash
273
+ # @return [Hash] Returns the object in the form of hash
274
+ def to_hash
275
+ hash = {}
276
+ self.class.attribute_map.each_pair do |attr, param|
277
+ value = self.send(attr)
278
+ next if value.nil?
279
+ hash[param] = _to_hash(value)
280
+ end
281
+ hash
282
+ end
283
+
284
+ # Outputs non-array value in the form of hash
285
+ # For object, use to_hash. Otherwise, just return the value
286
+ # @param [Object] value Any valid value
287
+ # @return [Hash] Returns the value in the form of hash
288
+ def _to_hash(value)
289
+ if value.is_a?(Array)
290
+ value.compact.map { |v| _to_hash(v) }
291
+ elsif value.is_a?(Hash)
292
+ {}.tap do |hash|
293
+ value.each { |k, v| hash[k] = _to_hash(v) }
294
+ end
295
+ elsif value.respond_to? :to_hash
296
+ value.to_hash
297
+ else
298
+ value
299
+ end
300
+ end
301
+
302
+ end
303
+ end
@@ -0,0 +1,334 @@
1
+ =begin
2
+ #DocuSign Click API
3
+
4
+ #DocuSign Click lets you capture consent to standard agreement terms with a single click: terms and conditions, terms of service, terms of use, privacy policies, and more. The Click API lets you include this customizable clickwrap solution in your DocuSign integrations.
5
+
6
+ OpenAPI spec version: v1
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_Click
15
+ class ClickwrapVersionResponse
16
+ #
17
+ attr_accessor :account_id
18
+
19
+ #
20
+ attr_accessor :clickwrap_id
21
+
22
+ #
23
+ attr_accessor :clickwrap_name
24
+
25
+ #
26
+ attr_accessor :clickwrap_version_id
27
+
28
+ #
29
+ attr_accessor :created_time
30
+
31
+ attr_accessor :display_settings
32
+
33
+ #
34
+ attr_accessor :documents
35
+
36
+ #
37
+ attr_accessor :last_modified
38
+
39
+ #
40
+ attr_accessor :last_modified_by
41
+
42
+ #
43
+ attr_accessor :owner_user_id
44
+
45
+ #
46
+ attr_accessor :require_reacceptance
47
+
48
+ #
49
+ attr_accessor :scheduled_date
50
+
51
+ attr_accessor :scheduled_reacceptance
52
+
53
+ #
54
+ attr_accessor :status
55
+
56
+ #
57
+ attr_accessor :version_id
58
+
59
+ #
60
+ attr_accessor :version_number
61
+
62
+ # Attribute mapping from ruby-style variable name to JSON key.
63
+ def self.attribute_map
64
+ {
65
+ :'account_id' => :'accountId',
66
+ :'clickwrap_id' => :'clickwrapId',
67
+ :'clickwrap_name' => :'clickwrapName',
68
+ :'clickwrap_version_id' => :'clickwrapVersionId',
69
+ :'created_time' => :'createdTime',
70
+ :'display_settings' => :'displaySettings',
71
+ :'documents' => :'documents',
72
+ :'last_modified' => :'lastModified',
73
+ :'last_modified_by' => :'lastModifiedBy',
74
+ :'owner_user_id' => :'ownerUserId',
75
+ :'require_reacceptance' => :'requireReacceptance',
76
+ :'scheduled_date' => :'scheduledDate',
77
+ :'scheduled_reacceptance' => :'scheduledReacceptance',
78
+ :'status' => :'status',
79
+ :'version_id' => :'versionId',
80
+ :'version_number' => :'versionNumber'
81
+ }
82
+ end
83
+
84
+ # Attribute type mapping.
85
+ def self.swagger_types
86
+ {
87
+ :'account_id' => :'String',
88
+ :'clickwrap_id' => :'String',
89
+ :'clickwrap_name' => :'String',
90
+ :'clickwrap_version_id' => :'String',
91
+ :'created_time' => :'Object',
92
+ :'display_settings' => :'DisplaySettings',
93
+ :'documents' => :'Array<Document>',
94
+ :'last_modified' => :'Object',
95
+ :'last_modified_by' => :'String',
96
+ :'owner_user_id' => :'String',
97
+ :'require_reacceptance' => :'BOOLEAN',
98
+ :'scheduled_date' => :'Object',
99
+ :'scheduled_reacceptance' => :'ClickwrapScheduledReacceptance',
100
+ :'status' => :'String',
101
+ :'version_id' => :'String',
102
+ :'version_number' => :'String'
103
+ }
104
+ end
105
+
106
+ # Initializes the object
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ def initialize(attributes = {})
109
+ return unless attributes.is_a?(Hash)
110
+
111
+ # convert string to symbol for hash key
112
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
113
+
114
+ if attributes.has_key?(:'accountId')
115
+ self.account_id = attributes[:'accountId']
116
+ end
117
+
118
+ if attributes.has_key?(:'clickwrapId')
119
+ self.clickwrap_id = attributes[:'clickwrapId']
120
+ end
121
+
122
+ if attributes.has_key?(:'clickwrapName')
123
+ self.clickwrap_name = attributes[:'clickwrapName']
124
+ end
125
+
126
+ if attributes.has_key?(:'clickwrapVersionId')
127
+ self.clickwrap_version_id = attributes[:'clickwrapVersionId']
128
+ end
129
+
130
+ if attributes.has_key?(:'createdTime')
131
+ self.created_time = attributes[:'createdTime']
132
+ end
133
+
134
+ if attributes.has_key?(:'displaySettings')
135
+ self.display_settings = attributes[:'displaySettings']
136
+ end
137
+
138
+ if attributes.has_key?(:'documents')
139
+ if (value = attributes[:'documents']).is_a?(Array)
140
+ self.documents = value
141
+ end
142
+ end
143
+
144
+ if attributes.has_key?(:'lastModified')
145
+ self.last_modified = attributes[:'lastModified']
146
+ end
147
+
148
+ if attributes.has_key?(:'lastModifiedBy')
149
+ self.last_modified_by = attributes[:'lastModifiedBy']
150
+ end
151
+
152
+ if attributes.has_key?(:'ownerUserId')
153
+ self.owner_user_id = attributes[:'ownerUserId']
154
+ end
155
+
156
+ if attributes.has_key?(:'requireReacceptance')
157
+ self.require_reacceptance = attributes[:'requireReacceptance']
158
+ end
159
+
160
+ if attributes.has_key?(:'scheduledDate')
161
+ self.scheduled_date = attributes[:'scheduledDate']
162
+ end
163
+
164
+ if attributes.has_key?(:'scheduledReacceptance')
165
+ self.scheduled_reacceptance = attributes[:'scheduledReacceptance']
166
+ end
167
+
168
+ if attributes.has_key?(:'status')
169
+ self.status = attributes[:'status']
170
+ end
171
+
172
+ if attributes.has_key?(:'versionId')
173
+ self.version_id = attributes[:'versionId']
174
+ end
175
+
176
+ if attributes.has_key?(:'versionNumber')
177
+ self.version_number = attributes[:'versionNumber']
178
+ end
179
+ end
180
+
181
+ # Show invalid properties with the reasons. Usually used together with valid?
182
+ # @return Array for valid properties with the reasons
183
+ def list_invalid_properties
184
+ invalid_properties = Array.new
185
+ invalid_properties
186
+ end
187
+
188
+ # Check to see if the all the properties in the model are valid
189
+ # @return true if the model is valid
190
+ def valid?
191
+ true
192
+ end
193
+
194
+ # Checks equality by comparing each attribute.
195
+ # @param [Object] Object to be compared
196
+ def ==(o)
197
+ return true if self.equal?(o)
198
+ self.class == o.class &&
199
+ account_id == o.account_id &&
200
+ clickwrap_id == o.clickwrap_id &&
201
+ clickwrap_name == o.clickwrap_name &&
202
+ clickwrap_version_id == o.clickwrap_version_id &&
203
+ created_time == o.created_time &&
204
+ display_settings == o.display_settings &&
205
+ documents == o.documents &&
206
+ last_modified == o.last_modified &&
207
+ last_modified_by == o.last_modified_by &&
208
+ owner_user_id == o.owner_user_id &&
209
+ require_reacceptance == o.require_reacceptance &&
210
+ scheduled_date == o.scheduled_date &&
211
+ scheduled_reacceptance == o.scheduled_reacceptance &&
212
+ status == o.status &&
213
+ version_id == o.version_id &&
214
+ version_number == o.version_number
215
+ end
216
+
217
+ # @see the `==` method
218
+ # @param [Object] Object to be compared
219
+ def eql?(o)
220
+ self == o
221
+ end
222
+
223
+ # Calculates hash code according to all attributes.
224
+ # @return [Fixnum] Hash code
225
+ def hash
226
+ [account_id, clickwrap_id, clickwrap_name, clickwrap_version_id, created_time, display_settings, documents, last_modified, last_modified_by, owner_user_id, require_reacceptance, scheduled_date, scheduled_reacceptance, status, version_id, version_number].hash
227
+ end
228
+
229
+ # Builds the object from hash
230
+ # @param [Hash] attributes Model attributes in the form of hash
231
+ # @return [Object] Returns the model itself
232
+ def build_from_hash(attributes)
233
+ return nil unless attributes.is_a?(Hash)
234
+ self.class.swagger_types.each_pair do |key, type|
235
+ if type =~ /\AArray<(.*)>/i
236
+ # check to ensure the input is an array given that the attribute
237
+ # is documented as an array but the input is not
238
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
239
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
240
+ end
241
+ elsif !attributes[self.class.attribute_map[key]].nil?
242
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
243
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
244
+ end
245
+
246
+ self
247
+ end
248
+
249
+ # Deserializes the data based on type
250
+ # @param string type Data type
251
+ # @param string value Value to be deserialized
252
+ # @return [Object] Deserialized data
253
+ def _deserialize(type, value)
254
+ case type.to_sym
255
+ when :DateTime
256
+ DateTime.parse(value)
257
+ when :Date
258
+ Date.parse(value)
259
+ when :String
260
+ value.to_s
261
+ when :Integer
262
+ value.to_i
263
+ when :Float
264
+ value.to_f
265
+ when :BOOLEAN
266
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
267
+ true
268
+ else
269
+ false
270
+ end
271
+ when :Object
272
+ # generic object (usually a Hash), return directly
273
+ value
274
+ when /\AArray<(?<inner_type>.+)>\z/
275
+ inner_type = Regexp.last_match[:inner_type]
276
+ value.map { |v| _deserialize(inner_type, v) }
277
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
278
+ k_type = Regexp.last_match[:k_type]
279
+ v_type = Regexp.last_match[:v_type]
280
+ {}.tap do |hash|
281
+ value.each do |k, v|
282
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
283
+ end
284
+ end
285
+ else # model
286
+ temp_model = DocuSign_Click.const_get(type).new
287
+ temp_model.build_from_hash(value)
288
+ end
289
+ end
290
+
291
+ # Returns the string representation of the object
292
+ # @return [String] String presentation of the object
293
+ def to_s
294
+ to_hash.to_s
295
+ end
296
+
297
+ # to_body is an alias to to_hash (backward compatibility)
298
+ # @return [Hash] Returns the object in the form of hash
299
+ def to_body
300
+ to_hash
301
+ end
302
+
303
+ # Returns the object in the form of hash
304
+ # @return [Hash] Returns the object in the form of hash
305
+ def to_hash
306
+ hash = {}
307
+ self.class.attribute_map.each_pair do |attr, param|
308
+ value = self.send(attr)
309
+ next if value.nil?
310
+ hash[param] = _to_hash(value)
311
+ end
312
+ hash
313
+ end
314
+
315
+ # Outputs non-array value in the form of hash
316
+ # For object, use to_hash. Otherwise, just return the value
317
+ # @param [Object] value Any valid value
318
+ # @return [Hash] Returns the value in the form of hash
319
+ def _to_hash(value)
320
+ if value.is_a?(Array)
321
+ value.compact.map { |v| _to_hash(v) }
322
+ elsif value.is_a?(Hash)
323
+ {}.tap do |hash|
324
+ value.each { |k, v| hash[k] = _to_hash(v) }
325
+ end
326
+ elsif value.respond_to? :to_hash
327
+ value.to_hash
328
+ else
329
+ value
330
+ end
331
+ end
332
+
333
+ end
334
+ end