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,294 @@
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 ClickwrapRequest
16
+ #
17
+ attr_accessor :clickwrap_name
18
+
19
+ attr_accessor :display_settings
20
+
21
+ #
22
+ attr_accessor :documents
23
+
24
+ #
25
+ attr_accessor :fields_to_null
26
+
27
+ #
28
+ attr_accessor :is_majorversion
29
+
30
+ #
31
+ attr_accessor :name
32
+
33
+ #
34
+ attr_accessor :require_reacceptance
35
+
36
+ #
37
+ attr_accessor :scheduled_date
38
+
39
+ attr_accessor :scheduled_reacceptance
40
+
41
+ #
42
+ attr_accessor :status
43
+
44
+ #
45
+ attr_accessor :transfer_from_user_id
46
+
47
+ #
48
+ attr_accessor :transfer_to_user_id
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'clickwrap_name' => :'clickwrapName',
54
+ :'display_settings' => :'displaySettings',
55
+ :'documents' => :'documents',
56
+ :'fields_to_null' => :'fieldsToNull',
57
+ :'is_majorversion' => :'isMajorversion',
58
+ :'name' => :'name',
59
+ :'require_reacceptance' => :'requireReacceptance',
60
+ :'scheduled_date' => :'scheduledDate',
61
+ :'scheduled_reacceptance' => :'scheduledReacceptance',
62
+ :'status' => :'status',
63
+ :'transfer_from_user_id' => :'transferFromUserId',
64
+ :'transfer_to_user_id' => :'transferToUserId'
65
+ }
66
+ end
67
+
68
+ # Attribute type mapping.
69
+ def self.swagger_types
70
+ {
71
+ :'clickwrap_name' => :'String',
72
+ :'display_settings' => :'DisplaySettings',
73
+ :'documents' => :'Array<Document>',
74
+ :'fields_to_null' => :'String',
75
+ :'is_majorversion' => :'BOOLEAN',
76
+ :'name' => :'String',
77
+ :'require_reacceptance' => :'BOOLEAN',
78
+ :'scheduled_date' => :'Object',
79
+ :'scheduled_reacceptance' => :'ClickwrapScheduledReacceptance',
80
+ :'status' => :'Object',
81
+ :'transfer_from_user_id' => :'String',
82
+ :'transfer_to_user_id' => :'String'
83
+ }
84
+ end
85
+
86
+ # Initializes the object
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ def initialize(attributes = {})
89
+ return unless attributes.is_a?(Hash)
90
+
91
+ # convert string to symbol for hash key
92
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
93
+
94
+ if attributes.has_key?(:'clickwrapName')
95
+ self.clickwrap_name = attributes[:'clickwrapName']
96
+ end
97
+
98
+ if attributes.has_key?(:'displaySettings')
99
+ self.display_settings = attributes[:'displaySettings']
100
+ end
101
+
102
+ if attributes.has_key?(:'documents')
103
+ if (value = attributes[:'documents']).is_a?(Array)
104
+ self.documents = value
105
+ end
106
+ end
107
+
108
+ if attributes.has_key?(:'fieldsToNull')
109
+ self.fields_to_null = attributes[:'fieldsToNull']
110
+ end
111
+
112
+ if attributes.has_key?(:'isMajorversion')
113
+ self.is_majorversion = attributes[:'isMajorversion']
114
+ end
115
+
116
+ if attributes.has_key?(:'name')
117
+ self.name = attributes[:'name']
118
+ end
119
+
120
+ if attributes.has_key?(:'requireReacceptance')
121
+ self.require_reacceptance = attributes[:'requireReacceptance']
122
+ end
123
+
124
+ if attributes.has_key?(:'scheduledDate')
125
+ self.scheduled_date = attributes[:'scheduledDate']
126
+ end
127
+
128
+ if attributes.has_key?(:'scheduledReacceptance')
129
+ self.scheduled_reacceptance = attributes[:'scheduledReacceptance']
130
+ end
131
+
132
+ if attributes.has_key?(:'status')
133
+ self.status = attributes[:'status']
134
+ end
135
+
136
+ if attributes.has_key?(:'transferFromUserId')
137
+ self.transfer_from_user_id = attributes[:'transferFromUserId']
138
+ end
139
+
140
+ if attributes.has_key?(:'transferToUserId')
141
+ self.transfer_to_user_id = attributes[:'transferToUserId']
142
+ end
143
+ end
144
+
145
+ # Show invalid properties with the reasons. Usually used together with valid?
146
+ # @return Array for valid properties with the reasons
147
+ def list_invalid_properties
148
+ invalid_properties = Array.new
149
+ invalid_properties
150
+ end
151
+
152
+ # Check to see if the all the properties in the model are valid
153
+ # @return true if the model is valid
154
+ def valid?
155
+ true
156
+ end
157
+
158
+ # Checks equality by comparing each attribute.
159
+ # @param [Object] Object to be compared
160
+ def ==(o)
161
+ return true if self.equal?(o)
162
+ self.class == o.class &&
163
+ clickwrap_name == o.clickwrap_name &&
164
+ display_settings == o.display_settings &&
165
+ documents == o.documents &&
166
+ fields_to_null == o.fields_to_null &&
167
+ is_majorversion == o.is_majorversion &&
168
+ name == o.name &&
169
+ require_reacceptance == o.require_reacceptance &&
170
+ scheduled_date == o.scheduled_date &&
171
+ scheduled_reacceptance == o.scheduled_reacceptance &&
172
+ status == o.status &&
173
+ transfer_from_user_id == o.transfer_from_user_id &&
174
+ transfer_to_user_id == o.transfer_to_user_id
175
+ end
176
+
177
+ # @see the `==` method
178
+ # @param [Object] Object to be compared
179
+ def eql?(o)
180
+ self == o
181
+ end
182
+
183
+ # Calculates hash code according to all attributes.
184
+ # @return [Fixnum] Hash code
185
+ def hash
186
+ [clickwrap_name, display_settings, documents, fields_to_null, is_majorversion, name, require_reacceptance, scheduled_date, scheduled_reacceptance, status, transfer_from_user_id, transfer_to_user_id].hash
187
+ end
188
+
189
+ # Builds the object from hash
190
+ # @param [Hash] attributes Model attributes in the form of hash
191
+ # @return [Object] Returns the model itself
192
+ def build_from_hash(attributes)
193
+ return nil unless attributes.is_a?(Hash)
194
+ self.class.swagger_types.each_pair do |key, type|
195
+ if type =~ /\AArray<(.*)>/i
196
+ # check to ensure the input is an array given that the attribute
197
+ # is documented as an array but the input is not
198
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
199
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
200
+ end
201
+ elsif !attributes[self.class.attribute_map[key]].nil?
202
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
203
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
204
+ end
205
+
206
+ self
207
+ end
208
+
209
+ # Deserializes the data based on type
210
+ # @param string type Data type
211
+ # @param string value Value to be deserialized
212
+ # @return [Object] Deserialized data
213
+ def _deserialize(type, value)
214
+ case type.to_sym
215
+ when :DateTime
216
+ DateTime.parse(value)
217
+ when :Date
218
+ Date.parse(value)
219
+ when :String
220
+ value.to_s
221
+ when :Integer
222
+ value.to_i
223
+ when :Float
224
+ value.to_f
225
+ when :BOOLEAN
226
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
227
+ true
228
+ else
229
+ false
230
+ end
231
+ when :Object
232
+ # generic object (usually a Hash), return directly
233
+ value
234
+ when /\AArray<(?<inner_type>.+)>\z/
235
+ inner_type = Regexp.last_match[:inner_type]
236
+ value.map { |v| _deserialize(inner_type, v) }
237
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
238
+ k_type = Regexp.last_match[:k_type]
239
+ v_type = Regexp.last_match[:v_type]
240
+ {}.tap do |hash|
241
+ value.each do |k, v|
242
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
243
+ end
244
+ end
245
+ else # model
246
+ temp_model = DocuSign_Click.const_get(type).new
247
+ temp_model.build_from_hash(value)
248
+ end
249
+ end
250
+
251
+ # Returns the string representation of the object
252
+ # @return [String] String presentation of the object
253
+ def to_s
254
+ to_hash.to_s
255
+ end
256
+
257
+ # to_body is an alias to to_hash (backward compatibility)
258
+ # @return [Hash] Returns the object in the form of hash
259
+ def to_body
260
+ to_hash
261
+ end
262
+
263
+ # Returns the object in the form of hash
264
+ # @return [Hash] Returns the object in the form of hash
265
+ def to_hash
266
+ hash = {}
267
+ self.class.attribute_map.each_pair do |attr, param|
268
+ value = self.send(attr)
269
+ next if value.nil?
270
+ hash[param] = _to_hash(value)
271
+ end
272
+ hash
273
+ end
274
+
275
+ # Outputs non-array value in the form of hash
276
+ # For object, use to_hash. Otherwise, just return the value
277
+ # @param [Object] value Any valid value
278
+ # @return [Hash] Returns the value in the form of hash
279
+ def _to_hash(value)
280
+ if value.is_a?(Array)
281
+ value.compact.map { |v| _to_hash(v) }
282
+ elsif value.is_a?(Hash)
283
+ {}.tap do |hash|
284
+ value.each { |k, v| hash[k] = _to_hash(v) }
285
+ end
286
+ elsif value.respond_to? :to_hash
287
+ value.to_hash
288
+ else
289
+ value
290
+ end
291
+ end
292
+
293
+ end
294
+ end
@@ -0,0 +1,204 @@
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 ClickwrapScheduledReacceptance
16
+ #
17
+ attr_accessor :recurrence_interval
18
+
19
+ #
20
+ attr_accessor :recurrence_interval_type
21
+
22
+ #
23
+ attr_accessor :start_date_time
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'recurrence_interval' => :'recurrenceInterval',
29
+ :'recurrence_interval_type' => :'recurrenceIntervalType',
30
+ :'start_date_time' => :'startDateTime'
31
+ }
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.swagger_types
36
+ {
37
+ :'recurrence_interval' => :'Integer',
38
+ :'recurrence_interval_type' => :'String',
39
+ :'start_date_time' => :'Object'
40
+ }
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ return unless attributes.is_a?(Hash)
47
+
48
+ # convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
50
+
51
+ if attributes.has_key?(:'recurrenceInterval')
52
+ self.recurrence_interval = attributes[:'recurrenceInterval']
53
+ end
54
+
55
+ if attributes.has_key?(:'recurrenceIntervalType')
56
+ self.recurrence_interval_type = attributes[:'recurrenceIntervalType']
57
+ end
58
+
59
+ if attributes.has_key?(:'startDateTime')
60
+ self.start_date_time = attributes[:'startDateTime']
61
+ end
62
+ end
63
+
64
+ # Show invalid properties with the reasons. Usually used together with valid?
65
+ # @return Array for valid properties with the reasons
66
+ def list_invalid_properties
67
+ invalid_properties = Array.new
68
+ invalid_properties
69
+ end
70
+
71
+ # Check to see if the all the properties in the model are valid
72
+ # @return true if the model is valid
73
+ def valid?
74
+ true
75
+ end
76
+
77
+ # Checks equality by comparing each attribute.
78
+ # @param [Object] Object to be compared
79
+ def ==(o)
80
+ return true if self.equal?(o)
81
+ self.class == o.class &&
82
+ recurrence_interval == o.recurrence_interval &&
83
+ recurrence_interval_type == o.recurrence_interval_type &&
84
+ start_date_time == o.start_date_time
85
+ end
86
+
87
+ # @see the `==` method
88
+ # @param [Object] Object to be compared
89
+ def eql?(o)
90
+ self == o
91
+ end
92
+
93
+ # Calculates hash code according to all attributes.
94
+ # @return [Fixnum] Hash code
95
+ def hash
96
+ [recurrence_interval, recurrence_interval_type, start_date_time].hash
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def build_from_hash(attributes)
103
+ return nil unless attributes.is_a?(Hash)
104
+ self.class.swagger_types.each_pair do |key, type|
105
+ if type =~ /\AArray<(.*)>/i
106
+ # check to ensure the input is an array given that the attribute
107
+ # is documented as an array but the input is not
108
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
109
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
110
+ end
111
+ elsif !attributes[self.class.attribute_map[key]].nil?
112
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
113
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
114
+ end
115
+
116
+ self
117
+ end
118
+
119
+ # Deserializes the data based on type
120
+ # @param string type Data type
121
+ # @param string value Value to be deserialized
122
+ # @return [Object] Deserialized data
123
+ def _deserialize(type, value)
124
+ case type.to_sym
125
+ when :DateTime
126
+ DateTime.parse(value)
127
+ when :Date
128
+ Date.parse(value)
129
+ when :String
130
+ value.to_s
131
+ when :Integer
132
+ value.to_i
133
+ when :Float
134
+ value.to_f
135
+ when :BOOLEAN
136
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
137
+ true
138
+ else
139
+ false
140
+ end
141
+ when :Object
142
+ # generic object (usually a Hash), return directly
143
+ value
144
+ when /\AArray<(?<inner_type>.+)>\z/
145
+ inner_type = Regexp.last_match[:inner_type]
146
+ value.map { |v| _deserialize(inner_type, v) }
147
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
148
+ k_type = Regexp.last_match[:k_type]
149
+ v_type = Regexp.last_match[:v_type]
150
+ {}.tap do |hash|
151
+ value.each do |k, v|
152
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
153
+ end
154
+ end
155
+ else # model
156
+ temp_model = DocuSign_Click.const_get(type).new
157
+ temp_model.build_from_hash(value)
158
+ end
159
+ end
160
+
161
+ # Returns the string representation of the object
162
+ # @return [String] String presentation of the object
163
+ def to_s
164
+ to_hash.to_s
165
+ end
166
+
167
+ # to_body is an alias to to_hash (backward compatibility)
168
+ # @return [Hash] Returns the object in the form of hash
169
+ def to_body
170
+ to_hash
171
+ end
172
+
173
+ # Returns the object in the form of hash
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_hash
176
+ hash = {}
177
+ self.class.attribute_map.each_pair do |attr, param|
178
+ value = self.send(attr)
179
+ next if value.nil?
180
+ hash[param] = _to_hash(value)
181
+ end
182
+ hash
183
+ end
184
+
185
+ # Outputs non-array value in the form of hash
186
+ # For object, use to_hash. Otherwise, just return the value
187
+ # @param [Object] value Any valid value
188
+ # @return [Hash] Returns the value in the form of hash
189
+ def _to_hash(value)
190
+ if value.is_a?(Array)
191
+ value.compact.map { |v| _to_hash(v) }
192
+ elsif value.is_a?(Hash)
193
+ {}.tap do |hash|
194
+ value.each { |k, v| hash[k] = _to_hash(v) }
195
+ end
196
+ elsif value.respond_to? :to_hash
197
+ value.to_hash
198
+ else
199
+ value
200
+ end
201
+ end
202
+
203
+ end
204
+ end