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,202 @@
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 'uri'
13
+
14
+ module DocuSign_Click
15
+ class Configuration
16
+ # Defines url scheme
17
+ attr_accessor :scheme
18
+
19
+ # Defines url host
20
+ attr_accessor :host
21
+
22
+ # Defines url base path
23
+ attr_accessor :base_path
24
+
25
+ # Defines API keys used with API Key authentications.
26
+ #
27
+ # @return [Hash] key: parameter name, value: parameter value (API key)
28
+ #
29
+ # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
30
+ # config.api_key['api_key'] = 'xxx'
31
+ attr_accessor :api_key
32
+
33
+ # Defines API key prefixes used with API Key authentications.
34
+ #
35
+ # @return [Hash] key: parameter name, value: API key prefix
36
+ #
37
+ # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
38
+ # config.api_key_prefix['api_key'] = 'Token'
39
+ attr_accessor :api_key_prefix
40
+
41
+ # Defines the username used with HTTP basic authentication.
42
+ #
43
+ # @return [String]
44
+ attr_accessor :username
45
+
46
+ # Defines the password used with HTTP basic authentication.
47
+ #
48
+ # @return [String]
49
+ attr_accessor :password
50
+
51
+ # Defines the access token (Bearer) used with OAuth2.
52
+ attr_accessor :access_token
53
+
54
+ # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
55
+ # details will be logged with `logger.debug` (see the `logger` attribute).
56
+ # Default to false.
57
+ #
58
+ # @return [true, false]
59
+ attr_accessor :debugging
60
+
61
+ # Defines the logger used for debugging.
62
+ # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
63
+ #
64
+ # @return [#debug]
65
+ attr_accessor :logger
66
+
67
+ # Defines the temporary folder to store downloaded files
68
+ # (for API endpoints that have file response).
69
+ # Default to use `Tempfile`.
70
+ #
71
+ # @return [String]
72
+ attr_accessor :temp_folder_path
73
+
74
+ # The time limit for HTTP request in seconds.
75
+ # Default to 0 (never times out).
76
+ attr_accessor :timeout
77
+
78
+ ### TLS/SSL setting
79
+ # Set this to false to skip verifying SSL certificate when calling API from https server.
80
+ # Default to true.
81
+ #
82
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
83
+ #
84
+ # @return [true, false]
85
+ attr_accessor :verify_ssl
86
+
87
+ ### TLS/SSL setting
88
+ # Set this to false to skip verifying SSL host name
89
+ # Default to true.
90
+ #
91
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
92
+ #
93
+ # @return [true, false]
94
+ attr_accessor :verify_ssl_host
95
+
96
+ ### TLS/SSL setting
97
+ # Set this to customize the certificate file to verify the peer.
98
+ #
99
+ # @return [String] the path to the certificate file
100
+ #
101
+ # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
102
+ # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
103
+ attr_accessor :ssl_ca_cert
104
+
105
+ ### TLS/SSL setting
106
+ # Client certificate file (for client certificate)
107
+ attr_accessor :cert_file
108
+
109
+ ### TLS/SSL setting
110
+ # Client private key file (for client certificate)
111
+ attr_accessor :key_file
112
+
113
+ # Set this to customize parameters encoding of array parameter with multi collectionFormat.
114
+ # Default to nil.
115
+ #
116
+ # @see The params_encoding option of Ethon. Related source code:
117
+ # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
118
+ attr_accessor :params_encoding
119
+
120
+ attr_accessor :inject_format
121
+
122
+ attr_accessor :force_ending_format
123
+
124
+ def initialize
125
+ @scheme = 'https'
126
+ @host = 'www.docusign.net'
127
+ @base_path = '/clickapi'
128
+ @api_key = {}
129
+ @api_key_prefix = {}
130
+ @timeout = 0
131
+ @verify_ssl = true
132
+ @verify_ssl_host = true
133
+ @params_encoding = nil
134
+ @cert_file = nil
135
+ @key_file = nil
136
+ @debugging = false
137
+ @inject_format = false
138
+ @force_ending_format = false
139
+ @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
140
+
141
+ yield(self) if block_given?
142
+ end
143
+
144
+ # The default Configuration object.
145
+ def self.default
146
+ @@default ||= Configuration.new
147
+ end
148
+
149
+ def configure
150
+ yield(self) if block_given?
151
+ end
152
+
153
+ def scheme=(scheme)
154
+ # remove :// from scheme
155
+ @scheme = scheme.sub(/:\/\//, '')
156
+ end
157
+
158
+ def host=(host)
159
+ # remove http(s):// and anything after a slash
160
+ @host = host.sub(/https?:\/\//, '').split('/').first
161
+ end
162
+
163
+ def base_path=(base_path)
164
+ # Add leading and trailing slashes to base_path
165
+ @base_path = "/#{base_path}".gsub(/\/+/, '/')
166
+ @base_path = '' if @base_path == '/'
167
+ end
168
+
169
+ def base_url
170
+ url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
171
+ URI.encode(url)
172
+ end
173
+
174
+ # Gets API key (with prefix if set).
175
+ # @param [String] param_name the parameter name of API key auth
176
+ def api_key_with_prefix(param_name)
177
+ if @api_key_prefix[param_name]
178
+ "#{@api_key_prefix[param_name]} #{@api_key[param_name]}"
179
+ else
180
+ @api_key[param_name]
181
+ end
182
+ end
183
+
184
+ # Gets Basic Auth token string
185
+ def basic_auth_token
186
+ 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
187
+ end
188
+
189
+ # Returns Auth Settings hash for api client.
190
+ def auth_settings
191
+ {
192
+ 'docusignAccessCode' =>
193
+ {
194
+ type: 'oauth2',
195
+ in: 'header',
196
+ key: 'Authorization',
197
+ value: "Bearer #{access_token}"
198
+ },
199
+ }
200
+ end
201
+ end
202
+ end
@@ -0,0 +1,226 @@
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 ClickwrapAgreementsResponse
16
+ #
17
+ attr_accessor :begin_created_on
18
+
19
+ #
20
+ attr_accessor :minimum_pages_remaining
21
+
22
+ #
23
+ attr_accessor :page
24
+
25
+ #
26
+ attr_accessor :page_size
27
+
28
+ #
29
+ attr_accessor :user_agreements
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'begin_created_on' => :'beginCreatedOn',
35
+ :'minimum_pages_remaining' => :'minimumPagesRemaining',
36
+ :'page' => :'page',
37
+ :'page_size' => :'pageSize',
38
+ :'user_agreements' => :'userAgreements'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.swagger_types
44
+ {
45
+ :'begin_created_on' => :'Object',
46
+ :'minimum_pages_remaining' => :'Integer',
47
+ :'page' => :'Integer',
48
+ :'page_size' => :'Integer',
49
+ :'user_agreements' => :'Array<UserAgreementResponse>'
50
+ }
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ return unless attributes.is_a?(Hash)
57
+
58
+ # convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
60
+
61
+ if attributes.has_key?(:'beginCreatedOn')
62
+ self.begin_created_on = attributes[:'beginCreatedOn']
63
+ end
64
+
65
+ if attributes.has_key?(:'minimumPagesRemaining')
66
+ self.minimum_pages_remaining = attributes[:'minimumPagesRemaining']
67
+ end
68
+
69
+ if attributes.has_key?(:'page')
70
+ self.page = attributes[:'page']
71
+ end
72
+
73
+ if attributes.has_key?(:'pageSize')
74
+ self.page_size = attributes[:'pageSize']
75
+ end
76
+
77
+ if attributes.has_key?(:'userAgreements')
78
+ if (value = attributes[:'userAgreements']).is_a?(Array)
79
+ self.user_agreements = value
80
+ end
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ invalid_properties = Array.new
88
+ invalid_properties
89
+ end
90
+
91
+ # Check to see if the all the properties in the model are valid
92
+ # @return true if the model is valid
93
+ def valid?
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ begin_created_on == o.begin_created_on &&
103
+ minimum_pages_remaining == o.minimum_pages_remaining &&
104
+ page == o.page &&
105
+ page_size == o.page_size &&
106
+ user_agreements == o.user_agreements
107
+ end
108
+
109
+ # @see the `==` method
110
+ # @param [Object] Object to be compared
111
+ def eql?(o)
112
+ self == o
113
+ end
114
+
115
+ # Calculates hash code according to all attributes.
116
+ # @return [Fixnum] Hash code
117
+ def hash
118
+ [begin_created_on, minimum_pages_remaining, page, page_size, user_agreements].hash
119
+ end
120
+
121
+ # Builds the object from hash
122
+ # @param [Hash] attributes Model attributes in the form of hash
123
+ # @return [Object] Returns the model itself
124
+ def build_from_hash(attributes)
125
+ return nil unless attributes.is_a?(Hash)
126
+ self.class.swagger_types.each_pair do |key, type|
127
+ if type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
131
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
132
+ end
133
+ elsif !attributes[self.class.attribute_map[key]].nil?
134
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
135
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
136
+ end
137
+
138
+ self
139
+ end
140
+
141
+ # Deserializes the data based on type
142
+ # @param string type Data type
143
+ # @param string value Value to be deserialized
144
+ # @return [Object] Deserialized data
145
+ def _deserialize(type, value)
146
+ case type.to_sym
147
+ when :DateTime
148
+ DateTime.parse(value)
149
+ when :Date
150
+ Date.parse(value)
151
+ when :String
152
+ value.to_s
153
+ when :Integer
154
+ value.to_i
155
+ when :Float
156
+ value.to_f
157
+ when :BOOLEAN
158
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
+ true
160
+ else
161
+ false
162
+ end
163
+ when :Object
164
+ # generic object (usually a Hash), return directly
165
+ value
166
+ when /\AArray<(?<inner_type>.+)>\z/
167
+ inner_type = Regexp.last_match[:inner_type]
168
+ value.map { |v| _deserialize(inner_type, v) }
169
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
+ k_type = Regexp.last_match[:k_type]
171
+ v_type = Regexp.last_match[:v_type]
172
+ {}.tap do |hash|
173
+ value.each do |k, v|
174
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
+ end
176
+ end
177
+ else # model
178
+ temp_model = DocuSign_Click.const_get(type).new
179
+ temp_model.build_from_hash(value)
180
+ end
181
+ end
182
+
183
+ # Returns the string representation of the object
184
+ # @return [String] String presentation of the object
185
+ def to_s
186
+ to_hash.to_s
187
+ end
188
+
189
+ # to_body is an alias to to_hash (backward compatibility)
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_body
192
+ to_hash
193
+ end
194
+
195
+ # Returns the object in the form of hash
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_hash
198
+ hash = {}
199
+ self.class.attribute_map.each_pair do |attr, param|
200
+ value = self.send(attr)
201
+ next if value.nil?
202
+ hash[param] = _to_hash(value)
203
+ end
204
+ hash
205
+ end
206
+
207
+ # Outputs non-array value in the form of hash
208
+ # For object, use to_hash. Otherwise, just return the value
209
+ # @param [Object] value Any valid value
210
+ # @return [Hash] Returns the value in the form of hash
211
+ def _to_hash(value)
212
+ if value.is_a?(Array)
213
+ value.compact.map { |v| _to_hash(v) }
214
+ elsif value.is_a?(Hash)
215
+ {}.tap do |hash|
216
+ value.each { |k, v| hash[k] = _to_hash(v) }
217
+ end
218
+ elsif value.respond_to? :to_hash
219
+ value.to_hash
220
+ else
221
+ value
222
+ end
223
+ end
224
+
225
+ end
226
+ end
@@ -0,0 +1,224 @@
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 ClickwrapDeleteResponse
16
+ #
17
+ attr_accessor :clickwrap_id
18
+
19
+ #
20
+ attr_accessor :clickwrap_name
21
+
22
+ #
23
+ attr_accessor :deletion_message
24
+
25
+ #
26
+ attr_accessor :deletion_success
27
+
28
+ #
29
+ attr_accessor :status
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'clickwrap_id' => :'clickwrapId',
35
+ :'clickwrap_name' => :'clickwrapName',
36
+ :'deletion_message' => :'deletionMessage',
37
+ :'deletion_success' => :'deletionSuccess',
38
+ :'status' => :'status'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.swagger_types
44
+ {
45
+ :'clickwrap_id' => :'String',
46
+ :'clickwrap_name' => :'String',
47
+ :'deletion_message' => :'String',
48
+ :'deletion_success' => :'BOOLEAN',
49
+ :'status' => :'String'
50
+ }
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ return unless attributes.is_a?(Hash)
57
+
58
+ # convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
60
+
61
+ if attributes.has_key?(:'clickwrapId')
62
+ self.clickwrap_id = attributes[:'clickwrapId']
63
+ end
64
+
65
+ if attributes.has_key?(:'clickwrapName')
66
+ self.clickwrap_name = attributes[:'clickwrapName']
67
+ end
68
+
69
+ if attributes.has_key?(:'deletionMessage')
70
+ self.deletion_message = attributes[:'deletionMessage']
71
+ end
72
+
73
+ if attributes.has_key?(:'deletionSuccess')
74
+ self.deletion_success = attributes[:'deletionSuccess']
75
+ end
76
+
77
+ if attributes.has_key?(:'status')
78
+ self.status = attributes[:'status']
79
+ end
80
+ end
81
+
82
+ # Show invalid properties with the reasons. Usually used together with valid?
83
+ # @return Array for valid properties with the reasons
84
+ def list_invalid_properties
85
+ invalid_properties = Array.new
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ true
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] Object to be compared
97
+ def ==(o)
98
+ return true if self.equal?(o)
99
+ self.class == o.class &&
100
+ clickwrap_id == o.clickwrap_id &&
101
+ clickwrap_name == o.clickwrap_name &&
102
+ deletion_message == o.deletion_message &&
103
+ deletion_success == o.deletion_success &&
104
+ status == o.status
105
+ end
106
+
107
+ # @see the `==` method
108
+ # @param [Object] Object to be compared
109
+ def eql?(o)
110
+ self == o
111
+ end
112
+
113
+ # Calculates hash code according to all attributes.
114
+ # @return [Fixnum] Hash code
115
+ def hash
116
+ [clickwrap_id, clickwrap_name, deletion_message, deletion_success, status].hash
117
+ end
118
+
119
+ # Builds the object from hash
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ # @return [Object] Returns the model itself
122
+ def build_from_hash(attributes)
123
+ return nil unless attributes.is_a?(Hash)
124
+ self.class.swagger_types.each_pair do |key, type|
125
+ if type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
129
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
130
+ end
131
+ elsif !attributes[self.class.attribute_map[key]].nil?
132
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
133
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
134
+ end
135
+
136
+ self
137
+ end
138
+
139
+ # Deserializes the data based on type
140
+ # @param string type Data type
141
+ # @param string value Value to be deserialized
142
+ # @return [Object] Deserialized data
143
+ def _deserialize(type, value)
144
+ case type.to_sym
145
+ when :DateTime
146
+ DateTime.parse(value)
147
+ when :Date
148
+ Date.parse(value)
149
+ when :String
150
+ value.to_s
151
+ when :Integer
152
+ value.to_i
153
+ when :Float
154
+ value.to_f
155
+ when :BOOLEAN
156
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
157
+ true
158
+ else
159
+ false
160
+ end
161
+ when :Object
162
+ # generic object (usually a Hash), return directly
163
+ value
164
+ when /\AArray<(?<inner_type>.+)>\z/
165
+ inner_type = Regexp.last_match[:inner_type]
166
+ value.map { |v| _deserialize(inner_type, v) }
167
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
168
+ k_type = Regexp.last_match[:k_type]
169
+ v_type = Regexp.last_match[:v_type]
170
+ {}.tap do |hash|
171
+ value.each do |k, v|
172
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
173
+ end
174
+ end
175
+ else # model
176
+ temp_model = DocuSign_Click.const_get(type).new
177
+ temp_model.build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ next if value.nil?
200
+ hash[param] = _to_hash(value)
201
+ end
202
+ hash
203
+ end
204
+
205
+ # Outputs non-array value in the form of hash
206
+ # For object, use to_hash. Otherwise, just return the value
207
+ # @param [Object] value Any valid value
208
+ # @return [Hash] Returns the value in the form of hash
209
+ def _to_hash(value)
210
+ if value.is_a?(Array)
211
+ value.compact.map { |v| _to_hash(v) }
212
+ elsif value.is_a?(Hash)
213
+ {}.tap do |hash|
214
+ value.each { |k, v| hash[k] = _to_hash(v) }
215
+ end
216
+ elsif value.respond_to? :to_hash
217
+ value.to_hash
218
+ else
219
+ value
220
+ end
221
+ end
222
+
223
+ end
224
+ end