dropbox-sign 1.2.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  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 +419 -3
  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/docs/TemplateApi.md +4 -3
  23. data/docs/TemplateCreateResponse.md +1 -1
  24. data/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md +1 -0
  25. data/examples/SignatureRequestEdit.rb +58 -0
  26. data/examples/SignatureRequestEditEmbedded.rb +48 -0
  27. data/examples/SignatureRequestEditEmbeddedWithTemplate.rb +41 -0
  28. data/examples/SignatureRequestEditWithTemplate.rb +52 -0
  29. data/lib/dropbox-sign/api/api_app_api.rb +1 -1
  30. data/lib/dropbox-sign/api/signature_request_api.rb +463 -0
  31. data/lib/dropbox-sign/api/team_api.rb +1 -1
  32. data/lib/dropbox-sign/api/template_api.rb +3 -0
  33. data/lib/dropbox-sign/event_callback_helper.rb +1 -1
  34. data/lib/dropbox-sign/models/bulk_send_job_get_response_signature_requests.rb +13 -1
  35. data/lib/dropbox-sign/models/event_callback_request_event.rb +2 -7
  36. data/lib/dropbox-sign/models/signature_request_bulk_create_embedded_with_template_request.rb +1 -1
  37. data/lib/dropbox-sign/models/signature_request_bulk_send_with_template_request.rb +1 -1
  38. data/lib/dropbox-sign/models/signature_request_edit_embedded_request.rb +593 -0
  39. data/lib/dropbox-sign/models/signature_request_edit_embedded_with_template_request.rb +490 -0
  40. data/lib/dropbox-sign/models/signature_request_edit_request.rb +612 -0
  41. data/lib/dropbox-sign/models/signature_request_edit_with_template_request.rb +509 -0
  42. data/lib/dropbox-sign/models/signature_request_response.rb +28 -4
  43. data/lib/dropbox-sign/models/sub_form_fields_per_document_date_signed.rb +2 -0
  44. data/lib/dropbox-sign/models/sub_form_fields_per_document_dropdown.rb +2 -0
  45. data/lib/dropbox-sign/models/sub_form_fields_per_document_hyperlink.rb +2 -0
  46. data/lib/dropbox-sign/models/sub_form_fields_per_document_text.rb +2 -0
  47. data/lib/dropbox-sign/models/sub_form_fields_per_document_text_merge.rb +2 -0
  48. data/lib/dropbox-sign/models/sub_signature_request_signer.rb +1 -1
  49. data/lib/dropbox-sign/models/sub_signature_request_template_signer.rb +1 -1
  50. data/lib/dropbox-sign/models/template_create_response.rb +2 -2
  51. data/lib/dropbox-sign/models/unclaimed_draft_create_embedded_with_template_request.rb +17 -4
  52. data/lib/dropbox-sign/version.rb +1 -1
  53. data/lib/dropbox-sign.rb +4 -0
  54. data/openapi-config.yaml +1 -1
  55. data/openapi-sdk.yaml +2380 -1305
  56. data/spec/event_callback_helper_spec.rb +17 -3
  57. data/templates/event_callback_helper.mustache +1 -1
  58. data/test_fixtures/EventCallbackHelper_AccountCallbacks.json +82 -0
  59. data/test_fixtures/{EventCallbackHelper.json → EventCallbackHelper_AppCallbacks.json} +8 -4
  60. data/test_fixtures/SignatureRequestSendRequest.json +12 -6
  61. data/test_fixtures/SubFormFieldsPerDocument.json +8 -4
  62. data/test_fixtures/UnclaimedDraftCreateEmbeddedWithTemplateRequest.json +2 -1
  63. metadata +21 -8
@@ -0,0 +1,612 @@
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 SignatureRequestEditRequest
21
+ # Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.
22
+ # @return [Array<File>]
23
+ attr_accessor :files
24
+
25
+ # 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.
26
+ # @return [Array<String>]
27
+ attr_accessor :file_urls
28
+
29
+ # Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.
30
+ # @return [Array<SubSignatureRequestSigner>]
31
+ attr_accessor :signers
32
+
33
+ # Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.
34
+ # @return [Array<SubSignatureRequestGroupedSigners>]
35
+ attr_accessor :grouped_signers
36
+
37
+ # Allows signers to decline to sign a document if `true`. Defaults to `false`.
38
+ # @return [Boolean]
39
+ attr_accessor :allow_decline
40
+
41
+ # Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **Note**: Only available for Premium plan and higher.
42
+ # @return [Boolean]
43
+ attr_accessor :allow_reassign
44
+
45
+ # A list describing the attachments
46
+ # @return [Array<SubAttachment>]
47
+ attr_accessor :attachments
48
+
49
+ # The email addresses that should be CCed.
50
+ # @return [Array<String>]
51
+ attr_accessor :cc_email_addresses
52
+
53
+ # The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.
54
+ # @return [String]
55
+ attr_accessor :client_id
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
+ # Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.<br> **Note**: QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.
81
+ # @return [Boolean]
82
+ attr_accessor :is_qualified_signature
83
+
84
+ # Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **Note**: eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.
85
+ # @return [Boolean]
86
+ attr_accessor :is_eid
87
+
88
+ # The custom message in the email that will be sent to the signers.
89
+ # @return [String]
90
+ attr_accessor :message
91
+
92
+ # 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.
93
+ # @return [Hash<String, Object>]
94
+ attr_accessor :metadata
95
+
96
+ # @return [SubSigningOptions]
97
+ attr_accessor :signing_options
98
+
99
+ # The URL you want signers redirected to after they successfully sign.
100
+ # @return [String]
101
+ attr_accessor :signing_redirect_url
102
+
103
+ # The subject in the email that will be sent to the signers.
104
+ # @return [String]
105
+ attr_accessor :subject
106
+
107
+ # Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.
108
+ # @return [Boolean]
109
+ attr_accessor :test_mode
110
+
111
+ # The title you want to assign to the SignatureRequest.
112
+ # @return [String]
113
+ attr_accessor :title
114
+
115
+ # 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`.
116
+ # @return [Boolean]
117
+ attr_accessor :use_text_tags
118
+
119
+ # 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.
120
+ # @return [Integer, nil]
121
+ attr_accessor :expires_at
122
+
123
+ # Attribute mapping from ruby-style variable name to JSON key.
124
+ def self.attribute_map
125
+ {
126
+ :'files' => :'files',
127
+ :'file_urls' => :'file_urls',
128
+ :'signers' => :'signers',
129
+ :'grouped_signers' => :'grouped_signers',
130
+ :'allow_decline' => :'allow_decline',
131
+ :'allow_reassign' => :'allow_reassign',
132
+ :'attachments' => :'attachments',
133
+ :'cc_email_addresses' => :'cc_email_addresses',
134
+ :'client_id' => :'client_id',
135
+ :'custom_fields' => :'custom_fields',
136
+ :'field_options' => :'field_options',
137
+ :'form_field_groups' => :'form_field_groups',
138
+ :'form_field_rules' => :'form_field_rules',
139
+ :'form_fields_per_document' => :'form_fields_per_document',
140
+ :'hide_text_tags' => :'hide_text_tags',
141
+ :'is_qualified_signature' => :'is_qualified_signature',
142
+ :'is_eid' => :'is_eid',
143
+ :'message' => :'message',
144
+ :'metadata' => :'metadata',
145
+ :'signing_options' => :'signing_options',
146
+ :'signing_redirect_url' => :'signing_redirect_url',
147
+ :'subject' => :'subject',
148
+ :'test_mode' => :'test_mode',
149
+ :'title' => :'title',
150
+ :'use_text_tags' => :'use_text_tags',
151
+ :'expires_at' => :'expires_at'
152
+ }
153
+ end
154
+
155
+ # Returns all the JSON keys this model knows about
156
+ def self.acceptable_attributes
157
+ attribute_map.values
158
+ end
159
+
160
+ # Returns attribute map of this model + parent
161
+ def self.merged_attributes
162
+ self.attribute_map
163
+ end
164
+
165
+ # Attribute type mapping.
166
+ def self.openapi_types
167
+ {
168
+ :'files' => :'Array<File>',
169
+ :'file_urls' => :'Array<String>',
170
+ :'signers' => :'Array<SubSignatureRequestSigner>',
171
+ :'grouped_signers' => :'Array<SubSignatureRequestGroupedSigners>',
172
+ :'allow_decline' => :'Boolean',
173
+ :'allow_reassign' => :'Boolean',
174
+ :'attachments' => :'Array<SubAttachment>',
175
+ :'cc_email_addresses' => :'Array<String>',
176
+ :'client_id' => :'String',
177
+ :'custom_fields' => :'Array<SubCustomField>',
178
+ :'field_options' => :'SubFieldOptions',
179
+ :'form_field_groups' => :'Array<SubFormFieldGroup>',
180
+ :'form_field_rules' => :'Array<SubFormFieldRule>',
181
+ :'form_fields_per_document' => :'Array<SubFormFieldsPerDocumentBase>',
182
+ :'hide_text_tags' => :'Boolean',
183
+ :'is_qualified_signature' => :'Boolean',
184
+ :'is_eid' => :'Boolean',
185
+ :'message' => :'String',
186
+ :'metadata' => :'Hash<String, Object>',
187
+ :'signing_options' => :'SubSigningOptions',
188
+ :'signing_redirect_url' => :'String',
189
+ :'subject' => :'String',
190
+ :'test_mode' => :'Boolean',
191
+ :'title' => :'String',
192
+ :'use_text_tags' => :'Boolean',
193
+ :'expires_at' => :'Integer'
194
+ }
195
+ end
196
+
197
+ # Attribute type mapping of this model + parent
198
+ def self.merged_types
199
+ self.openapi_types
200
+ end
201
+
202
+ # List of attributes with nullable: true
203
+ def self.openapi_nullable
204
+ Set.new([
205
+ :'expires_at'
206
+ ])
207
+ end
208
+
209
+ # Returns list of attributes with nullable: true of this model + parent
210
+ def self.merged_nullable
211
+ self.openapi_nullable
212
+ end
213
+
214
+ # Attempt to instantiate and hydrate a new instance of this class
215
+ # @param [Object] data Data to be converted
216
+ # @return [SignatureRequestEditRequest]
217
+ def self.init(data)
218
+ return ApiClient.default.convert_to_type(
219
+ data,
220
+ "SignatureRequestEditRequest"
221
+ ) || SignatureRequestEditRequest.new
222
+ end
223
+
224
+ # Initializes the object
225
+ # @param [Hash] attributes Model attributes in the form of hash
226
+ def initialize(attributes = {})
227
+ if (!attributes.is_a?(Hash))
228
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Dropbox::Sign::SignatureRequestEditRequest` initialize method"
229
+ end
230
+
231
+ # check to see if the attribute exists and convert string to symbol for hash key
232
+ attributes = attributes.each_with_object({}) { |(k, v), h|
233
+ if (!self.class.merged_attributes.key?(k.to_sym))
234
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::SignatureRequestEditRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
235
+ end
236
+ h[k.to_sym] = v
237
+ }
238
+
239
+ if attributes.key?(:'files')
240
+ if (value = attributes[:'files']).is_a?(Array)
241
+ self.files = value
242
+ end
243
+ end
244
+
245
+ if attributes.key?(:'file_urls')
246
+ if (value = attributes[:'file_urls']).is_a?(Array)
247
+ self.file_urls = value
248
+ end
249
+ end
250
+
251
+ if attributes.key?(:'signers')
252
+ if (value = attributes[:'signers']).is_a?(Array)
253
+ self.signers = value
254
+ end
255
+ end
256
+
257
+ if attributes.key?(:'grouped_signers')
258
+ if (value = attributes[:'grouped_signers']).is_a?(Array)
259
+ self.grouped_signers = value
260
+ end
261
+ end
262
+
263
+ if attributes.key?(:'allow_decline')
264
+ self.allow_decline = attributes[:'allow_decline']
265
+ else
266
+ self.allow_decline = false
267
+ end
268
+
269
+ if attributes.key?(:'allow_reassign')
270
+ self.allow_reassign = attributes[:'allow_reassign']
271
+ else
272
+ self.allow_reassign = false
273
+ end
274
+
275
+ if attributes.key?(:'attachments')
276
+ if (value = attributes[:'attachments']).is_a?(Array)
277
+ self.attachments = value
278
+ end
279
+ end
280
+
281
+ if attributes.key?(:'cc_email_addresses')
282
+ if (value = attributes[:'cc_email_addresses']).is_a?(Array)
283
+ self.cc_email_addresses = value
284
+ end
285
+ end
286
+
287
+ if attributes.key?(:'client_id')
288
+ self.client_id = attributes[:'client_id']
289
+ end
290
+
291
+ if attributes.key?(:'custom_fields')
292
+ if (value = attributes[:'custom_fields']).is_a?(Array)
293
+ self.custom_fields = value
294
+ end
295
+ end
296
+
297
+ if attributes.key?(:'field_options')
298
+ self.field_options = attributes[:'field_options']
299
+ end
300
+
301
+ if attributes.key?(:'form_field_groups')
302
+ if (value = attributes[:'form_field_groups']).is_a?(Array)
303
+ self.form_field_groups = value
304
+ end
305
+ end
306
+
307
+ if attributes.key?(:'form_field_rules')
308
+ if (value = attributes[:'form_field_rules']).is_a?(Array)
309
+ self.form_field_rules = value
310
+ end
311
+ end
312
+
313
+ if attributes.key?(:'form_fields_per_document')
314
+ if (value = attributes[:'form_fields_per_document']).is_a?(Array)
315
+ self.form_fields_per_document = value
316
+ end
317
+ end
318
+
319
+ if attributes.key?(:'hide_text_tags')
320
+ self.hide_text_tags = attributes[:'hide_text_tags']
321
+ else
322
+ self.hide_text_tags = false
323
+ end
324
+
325
+ if attributes.key?(:'is_qualified_signature')
326
+ self.is_qualified_signature = attributes[:'is_qualified_signature']
327
+ else
328
+ self.is_qualified_signature = false
329
+ end
330
+
331
+ if attributes.key?(:'is_eid')
332
+ self.is_eid = attributes[:'is_eid']
333
+ else
334
+ self.is_eid = false
335
+ end
336
+
337
+ if attributes.key?(:'message')
338
+ self.message = attributes[:'message']
339
+ end
340
+
341
+ if attributes.key?(:'metadata')
342
+ if (value = attributes[:'metadata']).is_a?(Hash)
343
+ self.metadata = value
344
+ end
345
+ end
346
+
347
+ if attributes.key?(:'signing_options')
348
+ self.signing_options = attributes[:'signing_options']
349
+ end
350
+
351
+ if attributes.key?(:'signing_redirect_url')
352
+ self.signing_redirect_url = attributes[:'signing_redirect_url']
353
+ end
354
+
355
+ if attributes.key?(:'subject')
356
+ self.subject = attributes[:'subject']
357
+ end
358
+
359
+ if attributes.key?(:'test_mode')
360
+ self.test_mode = attributes[:'test_mode']
361
+ else
362
+ self.test_mode = false
363
+ end
364
+
365
+ if attributes.key?(:'title')
366
+ self.title = attributes[:'title']
367
+ end
368
+
369
+ if attributes.key?(:'use_text_tags')
370
+ self.use_text_tags = attributes[:'use_text_tags']
371
+ else
372
+ self.use_text_tags = false
373
+ end
374
+
375
+ if attributes.key?(:'expires_at')
376
+ self.expires_at = attributes[:'expires_at']
377
+ end
378
+ end
379
+
380
+ # Show invalid properties with the reasons. Usually used together with valid?
381
+ # @return Array for valid properties with the reasons
382
+ def list_invalid_properties
383
+ invalid_properties = Array.new
384
+ if !@message.nil? && @message.to_s.length > 5000
385
+ invalid_properties.push('invalid value for "message", the character length must be smaller than or equal to 5000.')
386
+ end
387
+
388
+ if !@subject.nil? && @subject.to_s.length > 255
389
+ invalid_properties.push('invalid value for "subject", the character length must be smaller than or equal to 255.')
390
+ end
391
+
392
+ if !@title.nil? && @title.to_s.length > 255
393
+ invalid_properties.push('invalid value for "title", the character length must be smaller than or equal to 255.')
394
+ end
395
+
396
+ invalid_properties
397
+ end
398
+
399
+ # Check to see if the all the properties in the model are valid
400
+ # @return true if the model is valid
401
+ def valid?
402
+ return false if !@message.nil? && @message.to_s.length > 5000
403
+ return false if !@subject.nil? && @subject.to_s.length > 255
404
+ return false if !@title.nil? && @title.to_s.length > 255
405
+ true
406
+ end
407
+
408
+ # Custom attribute writer method with validation
409
+ # @param [Object] message Value to be assigned
410
+ def message=(message)
411
+ if !message.nil? && message.to_s.length > 5000
412
+ fail ArgumentError, 'invalid value for "message", the character length must be smaller than or equal to 5000.'
413
+ end
414
+
415
+ @message = message
416
+ end
417
+
418
+ # Custom attribute writer method with validation
419
+ # @param [Object] metadata Value to be assigned
420
+ def metadata=(metadata)
421
+ @metadata = metadata
422
+ end
423
+
424
+ # Custom attribute writer method with validation
425
+ # @param [Object] subject Value to be assigned
426
+ def subject=(subject)
427
+ if !subject.nil? && subject.to_s.length > 255
428
+ fail ArgumentError, 'invalid value for "subject", the character length must be smaller than or equal to 255.'
429
+ end
430
+
431
+ @subject = subject
432
+ end
433
+
434
+ # Custom attribute writer method with validation
435
+ # @param [Object] title Value to be assigned
436
+ def title=(title)
437
+ if !title.nil? && title.to_s.length > 255
438
+ fail ArgumentError, 'invalid value for "title", the character length must be smaller than or equal to 255.'
439
+ end
440
+
441
+ @title = title
442
+ end
443
+
444
+ # Checks equality by comparing each attribute.
445
+ # @param [Object] Object to be compared
446
+ def ==(o)
447
+ return true if self.equal?(o)
448
+ self.class == o.class &&
449
+ files == o.files &&
450
+ file_urls == o.file_urls &&
451
+ signers == o.signers &&
452
+ grouped_signers == o.grouped_signers &&
453
+ allow_decline == o.allow_decline &&
454
+ allow_reassign == o.allow_reassign &&
455
+ attachments == o.attachments &&
456
+ cc_email_addresses == o.cc_email_addresses &&
457
+ client_id == o.client_id &&
458
+ custom_fields == o.custom_fields &&
459
+ field_options == o.field_options &&
460
+ form_field_groups == o.form_field_groups &&
461
+ form_field_rules == o.form_field_rules &&
462
+ form_fields_per_document == o.form_fields_per_document &&
463
+ hide_text_tags == o.hide_text_tags &&
464
+ is_qualified_signature == o.is_qualified_signature &&
465
+ is_eid == o.is_eid &&
466
+ message == o.message &&
467
+ metadata == o.metadata &&
468
+ signing_options == o.signing_options &&
469
+ signing_redirect_url == o.signing_redirect_url &&
470
+ subject == o.subject &&
471
+ test_mode == o.test_mode &&
472
+ title == o.title &&
473
+ use_text_tags == o.use_text_tags &&
474
+ expires_at == o.expires_at
475
+ end
476
+
477
+ # @see the `==` method
478
+ # @param [Object] Object to be compared
479
+ def eql?(o)
480
+ self == o
481
+ end
482
+
483
+ # Calculates hash code according to all attributes.
484
+ # @return [Integer] Hash code
485
+ def hash
486
+ [files, file_urls, signers, grouped_signers, allow_decline, allow_reassign, attachments, cc_email_addresses, client_id, custom_fields, field_options, form_field_groups, form_field_rules, form_fields_per_document, hide_text_tags, is_qualified_signature, is_eid, message, metadata, signing_options, signing_redirect_url, subject, test_mode, title, use_text_tags, expires_at].hash
487
+ end
488
+
489
+ # Builds the object from hash
490
+ # @param [Hash] attributes Model attributes in the form of hash
491
+ # @return [Object] Returns the model itself
492
+ def self.build_from_hash(attributes)
493
+ new.build_from_hash(attributes)
494
+ end
495
+
496
+ # Builds the object from hash
497
+ # @param [Hash] attributes Model attributes in the form of hash
498
+ # @return [Object] Returns the model itself
499
+ def build_from_hash(attributes)
500
+ return nil unless attributes.is_a?(Hash)
501
+ attribute_map = self.class.merged_attributes
502
+
503
+ self.class.merged_types.each_pair do |key, type|
504
+ if type =~ /\AArray<(.*)>/i
505
+ # check to ensure the input is an array given that the attribute
506
+ # is documented as an array but the input is not
507
+ if attributes[attribute_map[key]].is_a?(Array)
508
+ self.send("#{key}=", attributes[attribute_map[key]].map { |v| _deserialize($1, v) })
509
+ end
510
+ elsif !attributes[attribute_map[key]].nil?
511
+ self.send("#{key}=", _deserialize(type, attributes[attribute_map[key]]))
512
+ end
513
+ end
514
+
515
+ self
516
+ end
517
+
518
+ # Deserializes the data based on type
519
+ # @param string type Data type
520
+ # @param string value Value to be deserialized
521
+ # @return [Object] Deserialized data
522
+ def _deserialize(type, value)
523
+ case type.to_sym
524
+ when :Time
525
+ Time.parse(value)
526
+ when :Date
527
+ Date.parse(value)
528
+ when :String
529
+ value.to_s
530
+ when :Integer
531
+ value.to_i
532
+ when :Float
533
+ value.to_f
534
+ when :Boolean
535
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
536
+ true
537
+ else
538
+ false
539
+ end
540
+ when :File
541
+ value
542
+ when :Object
543
+ # generic object (usually a Hash), return directly
544
+ value
545
+ when /\AArray<(?<inner_type>.+)>\z/
546
+ inner_type = Regexp.last_match[:inner_type]
547
+ value.map { |v| _deserialize(inner_type, v) }
548
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
549
+ k_type = Regexp.last_match[:k_type]
550
+ v_type = Regexp.last_match[:v_type]
551
+ {}.tap do |hash|
552
+ value.each do |k, v|
553
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
554
+ end
555
+ end
556
+ else # model
557
+ # models (e.g. Pet)
558
+ klass = Dropbox::Sign.const_get(type)
559
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
560
+ end
561
+ end
562
+
563
+ # Returns the string representation of the object
564
+ # @return [String] String presentation of the object
565
+ def to_s
566
+ to_hash.to_s
567
+ end
568
+
569
+ # to_body is an alias to to_hash (backward compatibility)
570
+ # @return [Hash] Returns the object in the form of hash
571
+ def to_body
572
+ to_hash
573
+ end
574
+
575
+ # Returns the object in the form of hash
576
+ # @return [Hash] Returns the object in the form of hash
577
+ def to_hash(include_nil = true)
578
+ hash = {}
579
+ self.class.merged_attributes.each_pair do |attr, param|
580
+ value = self.send(attr)
581
+ if value.nil?
582
+ next unless include_nil
583
+ is_nullable = self.class.merged_nullable.include?(attr)
584
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
585
+ end
586
+
587
+ hash[param] = _to_hash(value, include_nil)
588
+ end
589
+ hash
590
+ end
591
+
592
+ # Outputs non-array value in the form of hash
593
+ # For object, use to_hash. Otherwise, just return the value
594
+ # @param [Object] value Any valid value
595
+ # @return [Hash] Returns the value in the form of hash
596
+ def _to_hash(value, include_nil = true)
597
+ if value.is_a?(Array)
598
+ value.compact.map { |v| _to_hash(v, include_nil) }
599
+ elsif value.is_a?(Hash)
600
+ {}.tap do |hash|
601
+ value.each { |k, v| hash[k] = _to_hash(v, include_nil) }
602
+ end
603
+ elsif value.respond_to? :to_hash
604
+ value.to_hash(include_nil)
605
+ else
606
+ value
607
+ end
608
+ end
609
+
610
+ end
611
+
612
+ end