dropbox-sign 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +12 -4
  4. data/VERSION +1 -1
  5. data/docs/BulkSendJobGetResponseSignatureRequests.md +1 -0
  6. data/docs/EventCallbackRequestEvent.md +1 -1
  7. data/docs/SignatureRequestApi.md +415 -0
  8. data/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md +1 -1
  9. data/docs/SignatureRequestBulkSendWithTemplateRequest.md +1 -1
  10. data/docs/SignatureRequestEditEmbeddedRequest.md +33 -0
  11. data/docs/SignatureRequestEditEmbeddedWithTemplateRequest.md +24 -0
  12. data/docs/SignatureRequestEditRequest.md +35 -0
  13. data/docs/SignatureRequestEditWithTemplateRequest.md +26 -0
  14. data/docs/SignatureRequestResponse.md +2 -0
  15. data/docs/SubFormFieldsPerDocumentDateSigned.md +1 -1
  16. data/docs/SubFormFieldsPerDocumentDropdown.md +1 -1
  17. data/docs/SubFormFieldsPerDocumentHyperlink.md +1 -1
  18. data/docs/SubFormFieldsPerDocumentText.md +1 -1
  19. data/docs/SubFormFieldsPerDocumentTextMerge.md +1 -1
  20. data/docs/SubSignatureRequestSigner.md +1 -1
  21. data/docs/SubSignatureRequestTemplateSigner.md +1 -1
  22. data/examples/SignatureRequestEdit.rb +58 -0
  23. data/examples/SignatureRequestEditEmbedded.rb +48 -0
  24. data/examples/SignatureRequestEditEmbeddedWithTemplate.rb +41 -0
  25. data/examples/SignatureRequestEditWithTemplate.rb +52 -0
  26. data/lib/dropbox-sign/api/api_app_api.rb +1 -1
  27. data/lib/dropbox-sign/api/signature_request_api.rb +460 -0
  28. data/lib/dropbox-sign/api/team_api.rb +1 -1
  29. data/lib/dropbox-sign/event_callback_helper.rb +1 -1
  30. data/lib/dropbox-sign/models/bulk_send_job_get_response_signature_requests.rb +13 -1
  31. data/lib/dropbox-sign/models/event_callback_request_event.rb +2 -7
  32. data/lib/dropbox-sign/models/signature_request_bulk_create_embedded_with_template_request.rb +1 -1
  33. data/lib/dropbox-sign/models/signature_request_bulk_send_with_template_request.rb +1 -1
  34. data/lib/dropbox-sign/models/signature_request_edit_embedded_request.rb +593 -0
  35. data/lib/dropbox-sign/models/signature_request_edit_embedded_with_template_request.rb +490 -0
  36. data/lib/dropbox-sign/models/signature_request_edit_request.rb +612 -0
  37. data/lib/dropbox-sign/models/signature_request_edit_with_template_request.rb +509 -0
  38. data/lib/dropbox-sign/models/signature_request_response.rb +28 -4
  39. data/lib/dropbox-sign/models/sub_form_fields_per_document_date_signed.rb +2 -0
  40. data/lib/dropbox-sign/models/sub_form_fields_per_document_dropdown.rb +2 -0
  41. data/lib/dropbox-sign/models/sub_form_fields_per_document_hyperlink.rb +2 -0
  42. data/lib/dropbox-sign/models/sub_form_fields_per_document_text.rb +2 -0
  43. data/lib/dropbox-sign/models/sub_form_fields_per_document_text_merge.rb +2 -0
  44. data/lib/dropbox-sign/models/sub_signature_request_signer.rb +1 -1
  45. data/lib/dropbox-sign/models/sub_signature_request_template_signer.rb +1 -1
  46. data/lib/dropbox-sign/version.rb +1 -1
  47. data/lib/dropbox-sign.rb +4 -0
  48. data/openapi-config.yaml +1 -1
  49. data/openapi-sdk.yaml +2321 -1264
  50. data/spec/event_callback_helper_spec.rb +17 -3
  51. data/templates/event_callback_helper.mustache +1 -1
  52. data/test_fixtures/EventCallbackHelper_AccountCallbacks.json +82 -0
  53. data/test_fixtures/{EventCallbackHelper.json → EventCallbackHelper_AppCallbacks.json} +8 -4
  54. data/test_fixtures/SignatureRequestSendRequest.json +12 -6
  55. data/test_fixtures/SubFormFieldsPerDocument.json +8 -4
  56. metadata +23 -10
@@ -0,0 +1,593 @@
1
+ =begin
2
+ #Dropbox Sign API
3
+
4
+ #Dropbox Sign v3 API
5
+
6
+ The version of the OpenAPI document: 3.0.0
7
+ Contact: apisupport@hellosign.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Dropbox
17
+ end
18
+
19
+ module Dropbox::Sign
20
+ class SignatureRequestEditEmbeddedRequest
21
+ # Client id of the app you're using to create this embedded signature request. Used for security purposes.
22
+ # @return [String]
23
+ attr_accessor :client_id
24
+
25
+ # Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.
26
+ # @return [Array<File>]
27
+ attr_accessor :files
28
+
29
+ # Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.
30
+ # @return [Array<String>]
31
+ attr_accessor :file_urls
32
+
33
+ # Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.
34
+ # @return [Array<SubSignatureRequestSigner>]
35
+ attr_accessor :signers
36
+
37
+ # Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.
38
+ # @return [Array<SubSignatureRequestGroupedSigners>]
39
+ attr_accessor :grouped_signers
40
+
41
+ # Allows signers to decline to sign a document if `true`. Defaults to `false`.
42
+ # @return [Boolean]
43
+ attr_accessor :allow_decline
44
+
45
+ # Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **Note**: Only available for Premium plan.
46
+ # @return [Boolean]
47
+ attr_accessor :allow_reassign
48
+
49
+ # A list describing the attachments
50
+ # @return [Array<SubAttachment>]
51
+ attr_accessor :attachments
52
+
53
+ # The email addresses that should be CCed.
54
+ # @return [Array<String>]
55
+ attr_accessor :cc_email_addresses
56
+
57
+ # When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.
58
+ # @return [Array<SubCustomField>]
59
+ attr_accessor :custom_fields
60
+
61
+ # @return [SubFieldOptions]
62
+ attr_accessor :field_options
63
+
64
+ # Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.
65
+ # @return [Array<SubFormFieldGroup>]
66
+ attr_accessor :form_field_groups
67
+
68
+ # Conditional Logic rules for fields defined in `form_fields_per_document`.
69
+ # @return [Array<SubFormFieldRule>]
70
+ attr_accessor :form_field_rules
71
+
72
+ # The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE**: Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`
73
+ # @return [Array<SubFormFieldsPerDocumentBase>]
74
+ attr_accessor :form_fields_per_document
75
+
76
+ # Enables automatic Text Tag removal when set to true. **NOTE**: Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.
77
+ # @return [Boolean]
78
+ attr_accessor :hide_text_tags
79
+
80
+ # The custom message in the email that will be sent to the signers.
81
+ # @return [String]
82
+ attr_accessor :message
83
+
84
+ # Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.
85
+ # @return [Hash<String, Object>]
86
+ attr_accessor :metadata
87
+
88
+ # @return [SubSigningOptions]
89
+ attr_accessor :signing_options
90
+
91
+ # The subject in the email that will be sent to the signers.
92
+ # @return [String]
93
+ attr_accessor :subject
94
+
95
+ # Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.
96
+ # @return [Boolean]
97
+ attr_accessor :test_mode
98
+
99
+ # The title you want to assign to the SignatureRequest.
100
+ # @return [String]
101
+ attr_accessor :title
102
+
103
+ # Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.
104
+ # @return [Boolean]
105
+ attr_accessor :use_text_tags
106
+
107
+ # Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. ⚠️ **Note** ⚠️: Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.
108
+ # @return [Boolean]
109
+ attr_accessor :populate_auto_fill_fields
110
+
111
+ # When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.
112
+ # @return [Integer, nil]
113
+ attr_accessor :expires_at
114
+
115
+ # Attribute mapping from ruby-style variable name to JSON key.
116
+ def self.attribute_map
117
+ {
118
+ :'client_id' => :'client_id',
119
+ :'files' => :'files',
120
+ :'file_urls' => :'file_urls',
121
+ :'signers' => :'signers',
122
+ :'grouped_signers' => :'grouped_signers',
123
+ :'allow_decline' => :'allow_decline',
124
+ :'allow_reassign' => :'allow_reassign',
125
+ :'attachments' => :'attachments',
126
+ :'cc_email_addresses' => :'cc_email_addresses',
127
+ :'custom_fields' => :'custom_fields',
128
+ :'field_options' => :'field_options',
129
+ :'form_field_groups' => :'form_field_groups',
130
+ :'form_field_rules' => :'form_field_rules',
131
+ :'form_fields_per_document' => :'form_fields_per_document',
132
+ :'hide_text_tags' => :'hide_text_tags',
133
+ :'message' => :'message',
134
+ :'metadata' => :'metadata',
135
+ :'signing_options' => :'signing_options',
136
+ :'subject' => :'subject',
137
+ :'test_mode' => :'test_mode',
138
+ :'title' => :'title',
139
+ :'use_text_tags' => :'use_text_tags',
140
+ :'populate_auto_fill_fields' => :'populate_auto_fill_fields',
141
+ :'expires_at' => :'expires_at'
142
+ }
143
+ end
144
+
145
+ # Returns all the JSON keys this model knows about
146
+ def self.acceptable_attributes
147
+ attribute_map.values
148
+ end
149
+
150
+ # Returns attribute map of this model + parent
151
+ def self.merged_attributes
152
+ self.attribute_map
153
+ end
154
+
155
+ # Attribute type mapping.
156
+ def self.openapi_types
157
+ {
158
+ :'client_id' => :'String',
159
+ :'files' => :'Array<File>',
160
+ :'file_urls' => :'Array<String>',
161
+ :'signers' => :'Array<SubSignatureRequestSigner>',
162
+ :'grouped_signers' => :'Array<SubSignatureRequestGroupedSigners>',
163
+ :'allow_decline' => :'Boolean',
164
+ :'allow_reassign' => :'Boolean',
165
+ :'attachments' => :'Array<SubAttachment>',
166
+ :'cc_email_addresses' => :'Array<String>',
167
+ :'custom_fields' => :'Array<SubCustomField>',
168
+ :'field_options' => :'SubFieldOptions',
169
+ :'form_field_groups' => :'Array<SubFormFieldGroup>',
170
+ :'form_field_rules' => :'Array<SubFormFieldRule>',
171
+ :'form_fields_per_document' => :'Array<SubFormFieldsPerDocumentBase>',
172
+ :'hide_text_tags' => :'Boolean',
173
+ :'message' => :'String',
174
+ :'metadata' => :'Hash<String, Object>',
175
+ :'signing_options' => :'SubSigningOptions',
176
+ :'subject' => :'String',
177
+ :'test_mode' => :'Boolean',
178
+ :'title' => :'String',
179
+ :'use_text_tags' => :'Boolean',
180
+ :'populate_auto_fill_fields' => :'Boolean',
181
+ :'expires_at' => :'Integer'
182
+ }
183
+ end
184
+
185
+ # Attribute type mapping of this model + parent
186
+ def self.merged_types
187
+ self.openapi_types
188
+ end
189
+
190
+ # List of attributes with nullable: true
191
+ def self.openapi_nullable
192
+ Set.new([
193
+ :'expires_at'
194
+ ])
195
+ end
196
+
197
+ # Returns list of attributes with nullable: true of this model + parent
198
+ def self.merged_nullable
199
+ self.openapi_nullable
200
+ end
201
+
202
+ # Attempt to instantiate and hydrate a new instance of this class
203
+ # @param [Object] data Data to be converted
204
+ # @return [SignatureRequestEditEmbeddedRequest]
205
+ def self.init(data)
206
+ return ApiClient.default.convert_to_type(
207
+ data,
208
+ "SignatureRequestEditEmbeddedRequest"
209
+ ) || SignatureRequestEditEmbeddedRequest.new
210
+ end
211
+
212
+ # Initializes the object
213
+ # @param [Hash] attributes Model attributes in the form of hash
214
+ def initialize(attributes = {})
215
+ if (!attributes.is_a?(Hash))
216
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Dropbox::Sign::SignatureRequestEditEmbeddedRequest` initialize method"
217
+ end
218
+
219
+ # check to see if the attribute exists and convert string to symbol for hash key
220
+ attributes = attributes.each_with_object({}) { |(k, v), h|
221
+ if (!self.class.merged_attributes.key?(k.to_sym))
222
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::SignatureRequestEditEmbeddedRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
223
+ end
224
+ h[k.to_sym] = v
225
+ }
226
+
227
+ if attributes.key?(:'client_id')
228
+ self.client_id = attributes[:'client_id']
229
+ end
230
+
231
+ if attributes.key?(:'files')
232
+ if (value = attributes[:'files']).is_a?(Array)
233
+ self.files = value
234
+ end
235
+ end
236
+
237
+ if attributes.key?(:'file_urls')
238
+ if (value = attributes[:'file_urls']).is_a?(Array)
239
+ self.file_urls = value
240
+ end
241
+ end
242
+
243
+ if attributes.key?(:'signers')
244
+ if (value = attributes[:'signers']).is_a?(Array)
245
+ self.signers = value
246
+ end
247
+ end
248
+
249
+ if attributes.key?(:'grouped_signers')
250
+ if (value = attributes[:'grouped_signers']).is_a?(Array)
251
+ self.grouped_signers = value
252
+ end
253
+ end
254
+
255
+ if attributes.key?(:'allow_decline')
256
+ self.allow_decline = attributes[:'allow_decline']
257
+ else
258
+ self.allow_decline = false
259
+ end
260
+
261
+ if attributes.key?(:'allow_reassign')
262
+ self.allow_reassign = attributes[:'allow_reassign']
263
+ else
264
+ self.allow_reassign = false
265
+ end
266
+
267
+ if attributes.key?(:'attachments')
268
+ if (value = attributes[:'attachments']).is_a?(Array)
269
+ self.attachments = value
270
+ end
271
+ end
272
+
273
+ if attributes.key?(:'cc_email_addresses')
274
+ if (value = attributes[:'cc_email_addresses']).is_a?(Array)
275
+ self.cc_email_addresses = value
276
+ end
277
+ end
278
+
279
+ if attributes.key?(:'custom_fields')
280
+ if (value = attributes[:'custom_fields']).is_a?(Array)
281
+ self.custom_fields = value
282
+ end
283
+ end
284
+
285
+ if attributes.key?(:'field_options')
286
+ self.field_options = attributes[:'field_options']
287
+ end
288
+
289
+ if attributes.key?(:'form_field_groups')
290
+ if (value = attributes[:'form_field_groups']).is_a?(Array)
291
+ self.form_field_groups = value
292
+ end
293
+ end
294
+
295
+ if attributes.key?(:'form_field_rules')
296
+ if (value = attributes[:'form_field_rules']).is_a?(Array)
297
+ self.form_field_rules = value
298
+ end
299
+ end
300
+
301
+ if attributes.key?(:'form_fields_per_document')
302
+ if (value = attributes[:'form_fields_per_document']).is_a?(Array)
303
+ self.form_fields_per_document = value
304
+ end
305
+ end
306
+
307
+ if attributes.key?(:'hide_text_tags')
308
+ self.hide_text_tags = attributes[:'hide_text_tags']
309
+ else
310
+ self.hide_text_tags = false
311
+ end
312
+
313
+ if attributes.key?(:'message')
314
+ self.message = attributes[:'message']
315
+ end
316
+
317
+ if attributes.key?(:'metadata')
318
+ if (value = attributes[:'metadata']).is_a?(Hash)
319
+ self.metadata = value
320
+ end
321
+ end
322
+
323
+ if attributes.key?(:'signing_options')
324
+ self.signing_options = attributes[:'signing_options']
325
+ end
326
+
327
+ if attributes.key?(:'subject')
328
+ self.subject = attributes[:'subject']
329
+ end
330
+
331
+ if attributes.key?(:'test_mode')
332
+ self.test_mode = attributes[:'test_mode']
333
+ else
334
+ self.test_mode = false
335
+ end
336
+
337
+ if attributes.key?(:'title')
338
+ self.title = attributes[:'title']
339
+ end
340
+
341
+ if attributes.key?(:'use_text_tags')
342
+ self.use_text_tags = attributes[:'use_text_tags']
343
+ else
344
+ self.use_text_tags = false
345
+ end
346
+
347
+ if attributes.key?(:'populate_auto_fill_fields')
348
+ self.populate_auto_fill_fields = attributes[:'populate_auto_fill_fields']
349
+ else
350
+ self.populate_auto_fill_fields = false
351
+ end
352
+
353
+ if attributes.key?(:'expires_at')
354
+ self.expires_at = attributes[:'expires_at']
355
+ end
356
+ end
357
+
358
+ # Show invalid properties with the reasons. Usually used together with valid?
359
+ # @return Array for valid properties with the reasons
360
+ def list_invalid_properties
361
+ invalid_properties = Array.new
362
+ if @client_id.nil?
363
+ invalid_properties.push('invalid value for "client_id", client_id cannot be nil.')
364
+ end
365
+
366
+ if !@message.nil? && @message.to_s.length > 5000
367
+ invalid_properties.push('invalid value for "message", the character length must be smaller than or equal to 5000.')
368
+ end
369
+
370
+ if !@subject.nil? && @subject.to_s.length > 255
371
+ invalid_properties.push('invalid value for "subject", the character length must be smaller than or equal to 255.')
372
+ end
373
+
374
+ if !@title.nil? && @title.to_s.length > 255
375
+ invalid_properties.push('invalid value for "title", the character length must be smaller than or equal to 255.')
376
+ end
377
+
378
+ invalid_properties
379
+ end
380
+
381
+ # Check to see if the all the properties in the model are valid
382
+ # @return true if the model is valid
383
+ def valid?
384
+ return false if @client_id.nil?
385
+ return false if !@message.nil? && @message.to_s.length > 5000
386
+ return false if !@subject.nil? && @subject.to_s.length > 255
387
+ return false if !@title.nil? && @title.to_s.length > 255
388
+ true
389
+ end
390
+
391
+ # Custom attribute writer method with validation
392
+ # @param [Object] message Value to be assigned
393
+ def message=(message)
394
+ if !message.nil? && message.to_s.length > 5000
395
+ fail ArgumentError, 'invalid value for "message", the character length must be smaller than or equal to 5000.'
396
+ end
397
+
398
+ @message = message
399
+ end
400
+
401
+ # Custom attribute writer method with validation
402
+ # @param [Object] metadata Value to be assigned
403
+ def metadata=(metadata)
404
+ @metadata = metadata
405
+ end
406
+
407
+ # Custom attribute writer method with validation
408
+ # @param [Object] subject Value to be assigned
409
+ def subject=(subject)
410
+ if !subject.nil? && subject.to_s.length > 255
411
+ fail ArgumentError, 'invalid value for "subject", the character length must be smaller than or equal to 255.'
412
+ end
413
+
414
+ @subject = subject
415
+ end
416
+
417
+ # Custom attribute writer method with validation
418
+ # @param [Object] title Value to be assigned
419
+ def title=(title)
420
+ if !title.nil? && title.to_s.length > 255
421
+ fail ArgumentError, 'invalid value for "title", the character length must be smaller than or equal to 255.'
422
+ end
423
+
424
+ @title = title
425
+ end
426
+
427
+ # Checks equality by comparing each attribute.
428
+ # @param [Object] Object to be compared
429
+ def ==(o)
430
+ return true if self.equal?(o)
431
+ self.class == o.class &&
432
+ client_id == o.client_id &&
433
+ files == o.files &&
434
+ file_urls == o.file_urls &&
435
+ signers == o.signers &&
436
+ grouped_signers == o.grouped_signers &&
437
+ allow_decline == o.allow_decline &&
438
+ allow_reassign == o.allow_reassign &&
439
+ attachments == o.attachments &&
440
+ cc_email_addresses == o.cc_email_addresses &&
441
+ custom_fields == o.custom_fields &&
442
+ field_options == o.field_options &&
443
+ form_field_groups == o.form_field_groups &&
444
+ form_field_rules == o.form_field_rules &&
445
+ form_fields_per_document == o.form_fields_per_document &&
446
+ hide_text_tags == o.hide_text_tags &&
447
+ message == o.message &&
448
+ metadata == o.metadata &&
449
+ signing_options == o.signing_options &&
450
+ subject == o.subject &&
451
+ test_mode == o.test_mode &&
452
+ title == o.title &&
453
+ use_text_tags == o.use_text_tags &&
454
+ populate_auto_fill_fields == o.populate_auto_fill_fields &&
455
+ expires_at == o.expires_at
456
+ end
457
+
458
+ # @see the `==` method
459
+ # @param [Object] Object to be compared
460
+ def eql?(o)
461
+ self == o
462
+ end
463
+
464
+ # Calculates hash code according to all attributes.
465
+ # @return [Integer] Hash code
466
+ def hash
467
+ [client_id, files, file_urls, signers, grouped_signers, allow_decline, allow_reassign, attachments, cc_email_addresses, custom_fields, field_options, form_field_groups, form_field_rules, form_fields_per_document, hide_text_tags, message, metadata, signing_options, subject, test_mode, title, use_text_tags, populate_auto_fill_fields, expires_at].hash
468
+ end
469
+
470
+ # Builds the object from hash
471
+ # @param [Hash] attributes Model attributes in the form of hash
472
+ # @return [Object] Returns the model itself
473
+ def self.build_from_hash(attributes)
474
+ new.build_from_hash(attributes)
475
+ end
476
+
477
+ # Builds the object from hash
478
+ # @param [Hash] attributes Model attributes in the form of hash
479
+ # @return [Object] Returns the model itself
480
+ def build_from_hash(attributes)
481
+ return nil unless attributes.is_a?(Hash)
482
+ attribute_map = self.class.merged_attributes
483
+
484
+ self.class.merged_types.each_pair do |key, type|
485
+ if type =~ /\AArray<(.*)>/i
486
+ # check to ensure the input is an array given that the attribute
487
+ # is documented as an array but the input is not
488
+ if attributes[attribute_map[key]].is_a?(Array)
489
+ self.send("#{key}=", attributes[attribute_map[key]].map { |v| _deserialize($1, v) })
490
+ end
491
+ elsif !attributes[attribute_map[key]].nil?
492
+ self.send("#{key}=", _deserialize(type, attributes[attribute_map[key]]))
493
+ end
494
+ end
495
+
496
+ self
497
+ end
498
+
499
+ # Deserializes the data based on type
500
+ # @param string type Data type
501
+ # @param string value Value to be deserialized
502
+ # @return [Object] Deserialized data
503
+ def _deserialize(type, value)
504
+ case type.to_sym
505
+ when :Time
506
+ Time.parse(value)
507
+ when :Date
508
+ Date.parse(value)
509
+ when :String
510
+ value.to_s
511
+ when :Integer
512
+ value.to_i
513
+ when :Float
514
+ value.to_f
515
+ when :Boolean
516
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
517
+ true
518
+ else
519
+ false
520
+ end
521
+ when :File
522
+ value
523
+ when :Object
524
+ # generic object (usually a Hash), return directly
525
+ value
526
+ when /\AArray<(?<inner_type>.+)>\z/
527
+ inner_type = Regexp.last_match[:inner_type]
528
+ value.map { |v| _deserialize(inner_type, v) }
529
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
530
+ k_type = Regexp.last_match[:k_type]
531
+ v_type = Regexp.last_match[:v_type]
532
+ {}.tap do |hash|
533
+ value.each do |k, v|
534
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
535
+ end
536
+ end
537
+ else # model
538
+ # models (e.g. Pet)
539
+ klass = Dropbox::Sign.const_get(type)
540
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
541
+ end
542
+ end
543
+
544
+ # Returns the string representation of the object
545
+ # @return [String] String presentation of the object
546
+ def to_s
547
+ to_hash.to_s
548
+ end
549
+
550
+ # to_body is an alias to to_hash (backward compatibility)
551
+ # @return [Hash] Returns the object in the form of hash
552
+ def to_body
553
+ to_hash
554
+ end
555
+
556
+ # Returns the object in the form of hash
557
+ # @return [Hash] Returns the object in the form of hash
558
+ def to_hash(include_nil = true)
559
+ hash = {}
560
+ self.class.merged_attributes.each_pair do |attr, param|
561
+ value = self.send(attr)
562
+ if value.nil?
563
+ next unless include_nil
564
+ is_nullable = self.class.merged_nullable.include?(attr)
565
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
566
+ end
567
+
568
+ hash[param] = _to_hash(value, include_nil)
569
+ end
570
+ hash
571
+ end
572
+
573
+ # Outputs non-array value in the form of hash
574
+ # For object, use to_hash. Otherwise, just return the value
575
+ # @param [Object] value Any valid value
576
+ # @return [Hash] Returns the value in the form of hash
577
+ def _to_hash(value, include_nil = true)
578
+ if value.is_a?(Array)
579
+ value.compact.map { |v| _to_hash(v, include_nil) }
580
+ elsif value.is_a?(Hash)
581
+ {}.tap do |hash|
582
+ value.each { |k, v| hash[k] = _to_hash(v, include_nil) }
583
+ end
584
+ elsif value.respond_to? :to_hash
585
+ value.to_hash(include_nil)
586
+ else
587
+ value
588
+ end
589
+ end
590
+
591
+ end
592
+
593
+ end