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
@@ -525,6 +525,466 @@ module Dropbox::Sign
525
525
  return data, status_code, headers
526
526
  end
527
527
 
528
+ # Edit Signature Request
529
+ # Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend will not deduct your signature request quota.
530
+ # @param signature_request_id [String] The id of the SignatureRequest to edit.
531
+ # @param signature_request_edit_request [SignatureRequestEditRequest]
532
+ # @param [Hash] opts the optional parameters
533
+ # @return [SignatureRequestGetResponse]
534
+ def signature_request_edit(signature_request_id, signature_request_edit_request, opts = {})
535
+ data, _status_code, _headers = signature_request_edit_with_http_info(signature_request_id, signature_request_edit_request, opts)
536
+ data
537
+ end
538
+
539
+ # Edit Signature Request
540
+ # Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend will not deduct your signature request quota.
541
+ # @param signature_request_id [String] The id of the SignatureRequest to edit.
542
+ # @param signature_request_edit_request [SignatureRequestEditRequest]
543
+ # @param [Hash] opts the optional parameters
544
+ # @return [Array<(SignatureRequestGetResponse, Integer, Hash)>] SignatureRequestGetResponse data, response status code and response headers
545
+ def signature_request_edit_with_http_info(signature_request_id, signature_request_edit_request, opts = {})
546
+ if @api_client.config.debugging
547
+ @api_client.config.logger.debug 'Calling API: SignatureRequestApi.signature_request_edit ...'
548
+ end
549
+ # verify the required parameter 'signature_request_id' is set
550
+ if @api_client.config.client_side_validation && signature_request_id.nil?
551
+ fail ArgumentError, "Missing the required parameter 'signature_request_id' when calling SignatureRequestApi.signature_request_edit"
552
+ end
553
+ # verify the required parameter 'signature_request_edit_request' is set
554
+ if @api_client.config.client_side_validation && signature_request_edit_request.nil?
555
+ fail ArgumentError, "Missing the required parameter 'signature_request_edit_request' when calling SignatureRequestApi.signature_request_edit"
556
+ end
557
+ # resource path
558
+ local_var_path = '/signature_request/edit/{signature_request_id}'.sub('{' + 'signature_request_id' + '}', CGI.escape(signature_request_id.to_s))
559
+
560
+ # query parameters
561
+ query_params = opts[:query_params] || {}
562
+
563
+ # header parameters
564
+ header_params = opts[:header_params] || {}
565
+ # HTTP header 'Accept' (if needed)
566
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
567
+ # HTTP header 'Content-Type'
568
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])
569
+ if !content_type.nil?
570
+ header_params['Content-Type'] = content_type
571
+ end
572
+
573
+ post_body = {}
574
+ form_params = opts[:form_params] || {}
575
+ result = @api_client.generate_form_data(
576
+ signature_request_edit_request,
577
+ Dropbox::Sign::SignatureRequestEditRequest.openapi_types
578
+ )
579
+
580
+ # form parameters
581
+ if result[:has_file]
582
+ form_params = opts[:form_params] || result[:params]
583
+ header_params['Content-Type'] = 'multipart/form-data'
584
+ else
585
+ # http body (model)
586
+ post_body = opts[:debug_body] || result[:params]
587
+ end
588
+
589
+ # return_type
590
+ return_type = opts[:debug_return_type] || 'SignatureRequestGetResponse'
591
+
592
+ # auth_names
593
+ auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2']
594
+
595
+ new_options = opts.merge(
596
+ :operation => :"SignatureRequestApi.signature_request_edit",
597
+ :header_params => header_params,
598
+ :query_params => query_params,
599
+ :form_params => form_params,
600
+ :body => post_body,
601
+ :auth_names => auth_names,
602
+ :return_type => return_type
603
+ )
604
+
605
+ begin
606
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
607
+ rescue Dropbox::Sign::ApiError => e
608
+ if e.code === 200
609
+ body = @api_client.convert_to_type(
610
+ JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0],
611
+ "Dropbox::Sign::SignatureRequestGetResponse"
612
+ )
613
+
614
+ fail ApiError.new(:code => e.code,
615
+ :response_headers => e.response_headers,
616
+ :response_body => body),
617
+ e.message
618
+ end
619
+
620
+ range_code = "4XX".split('').first
621
+ range_code_left = "#{range_code}00".to_i
622
+ range_code_right = "#{range_code}99".to_i
623
+ if e.code >= range_code_left && e.code <= range_code_right
624
+ body = @api_client.convert_to_type(
625
+ JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0],
626
+ "Dropbox::Sign::ErrorResponse"
627
+ )
628
+
629
+ fail ApiError.new(:code => e.code,
630
+ :response_headers => e.response_headers,
631
+ :response_body => body),
632
+ e.message
633
+ end
634
+
635
+ end
636
+
637
+ if @api_client.config.debugging
638
+ @api_client.config.logger.debug "API called: SignatureRequestApi#signature_request_edit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
639
+ end
640
+ return data, status_code, headers
641
+ end
642
+
643
+ # Edit Embedded Signature Request
644
+ # Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. <u>Note</u> that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign.
645
+ # @param signature_request_id [String] The id of the SignatureRequest to edit.
646
+ # @param signature_request_edit_embedded_request [SignatureRequestEditEmbeddedRequest]
647
+ # @param [Hash] opts the optional parameters
648
+ # @return [SignatureRequestGetResponse]
649
+ def signature_request_edit_embedded(signature_request_id, signature_request_edit_embedded_request, opts = {})
650
+ data, _status_code, _headers = signature_request_edit_embedded_with_http_info(signature_request_id, signature_request_edit_embedded_request, opts)
651
+ data
652
+ end
653
+
654
+ # Edit Embedded Signature Request
655
+ # Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. &lt;u&gt;Note&lt;/u&gt; that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign.
656
+ # @param signature_request_id [String] The id of the SignatureRequest to edit.
657
+ # @param signature_request_edit_embedded_request [SignatureRequestEditEmbeddedRequest]
658
+ # @param [Hash] opts the optional parameters
659
+ # @return [Array<(SignatureRequestGetResponse, Integer, Hash)>] SignatureRequestGetResponse data, response status code and response headers
660
+ def signature_request_edit_embedded_with_http_info(signature_request_id, signature_request_edit_embedded_request, opts = {})
661
+ if @api_client.config.debugging
662
+ @api_client.config.logger.debug 'Calling API: SignatureRequestApi.signature_request_edit_embedded ...'
663
+ end
664
+ # verify the required parameter 'signature_request_id' is set
665
+ if @api_client.config.client_side_validation && signature_request_id.nil?
666
+ fail ArgumentError, "Missing the required parameter 'signature_request_id' when calling SignatureRequestApi.signature_request_edit_embedded"
667
+ end
668
+ # verify the required parameter 'signature_request_edit_embedded_request' is set
669
+ if @api_client.config.client_side_validation && signature_request_edit_embedded_request.nil?
670
+ fail ArgumentError, "Missing the required parameter 'signature_request_edit_embedded_request' when calling SignatureRequestApi.signature_request_edit_embedded"
671
+ end
672
+ # resource path
673
+ local_var_path = '/signature_request/edit_embedded/{signature_request_id}'.sub('{' + 'signature_request_id' + '}', CGI.escape(signature_request_id.to_s))
674
+
675
+ # query parameters
676
+ query_params = opts[:query_params] || {}
677
+
678
+ # header parameters
679
+ header_params = opts[:header_params] || {}
680
+ # HTTP header 'Accept' (if needed)
681
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
682
+ # HTTP header 'Content-Type'
683
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])
684
+ if !content_type.nil?
685
+ header_params['Content-Type'] = content_type
686
+ end
687
+
688
+ post_body = {}
689
+ form_params = opts[:form_params] || {}
690
+ result = @api_client.generate_form_data(
691
+ signature_request_edit_embedded_request,
692
+ Dropbox::Sign::SignatureRequestEditEmbeddedRequest.openapi_types
693
+ )
694
+
695
+ # form parameters
696
+ if result[:has_file]
697
+ form_params = opts[:form_params] || result[:params]
698
+ header_params['Content-Type'] = 'multipart/form-data'
699
+ else
700
+ # http body (model)
701
+ post_body = opts[:debug_body] || result[:params]
702
+ end
703
+
704
+ # return_type
705
+ return_type = opts[:debug_return_type] || 'SignatureRequestGetResponse'
706
+
707
+ # auth_names
708
+ auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2']
709
+
710
+ new_options = opts.merge(
711
+ :operation => :"SignatureRequestApi.signature_request_edit_embedded",
712
+ :header_params => header_params,
713
+ :query_params => query_params,
714
+ :form_params => form_params,
715
+ :body => post_body,
716
+ :auth_names => auth_names,
717
+ :return_type => return_type
718
+ )
719
+
720
+ begin
721
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
722
+ rescue Dropbox::Sign::ApiError => e
723
+ if e.code === 200
724
+ body = @api_client.convert_to_type(
725
+ JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0],
726
+ "Dropbox::Sign::SignatureRequestGetResponse"
727
+ )
728
+
729
+ fail ApiError.new(:code => e.code,
730
+ :response_headers => e.response_headers,
731
+ :response_body => body),
732
+ e.message
733
+ end
734
+
735
+ range_code = "4XX".split('').first
736
+ range_code_left = "#{range_code}00".to_i
737
+ range_code_right = "#{range_code}99".to_i
738
+ if e.code >= range_code_left && e.code <= range_code_right
739
+ body = @api_client.convert_to_type(
740
+ JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0],
741
+ "Dropbox::Sign::ErrorResponse"
742
+ )
743
+
744
+ fail ApiError.new(:code => e.code,
745
+ :response_headers => e.response_headers,
746
+ :response_body => body),
747
+ e.message
748
+ end
749
+
750
+ end
751
+
752
+ if @api_client.config.debugging
753
+ @api_client.config.logger.debug "API called: SignatureRequestApi#signature_request_edit_embedded\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
754
+ end
755
+ return data, status_code, headers
756
+ end
757
+
758
+ # Edit Embedded Signature Request with Template
759
+ # Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. <u>Note</u> that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign.
760
+ # @param signature_request_id [String] The id of the SignatureRequest to edit.
761
+ # @param signature_request_edit_embedded_with_template_request [SignatureRequestEditEmbeddedWithTemplateRequest]
762
+ # @param [Hash] opts the optional parameters
763
+ # @return [SignatureRequestGetResponse]
764
+ def signature_request_edit_embedded_with_template(signature_request_id, signature_request_edit_embedded_with_template_request, opts = {})
765
+ data, _status_code, _headers = signature_request_edit_embedded_with_template_with_http_info(signature_request_id, signature_request_edit_embedded_with_template_request, opts)
766
+ data
767
+ end
768
+
769
+ # Edit Embedded Signature Request with Template
770
+ # Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. &lt;u&gt;Note&lt;/u&gt; that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign.
771
+ # @param signature_request_id [String] The id of the SignatureRequest to edit.
772
+ # @param signature_request_edit_embedded_with_template_request [SignatureRequestEditEmbeddedWithTemplateRequest]
773
+ # @param [Hash] opts the optional parameters
774
+ # @return [Array<(SignatureRequestGetResponse, Integer, Hash)>] SignatureRequestGetResponse data, response status code and response headers
775
+ def signature_request_edit_embedded_with_template_with_http_info(signature_request_id, signature_request_edit_embedded_with_template_request, opts = {})
776
+ if @api_client.config.debugging
777
+ @api_client.config.logger.debug 'Calling API: SignatureRequestApi.signature_request_edit_embedded_with_template ...'
778
+ end
779
+ # verify the required parameter 'signature_request_id' is set
780
+ if @api_client.config.client_side_validation && signature_request_id.nil?
781
+ fail ArgumentError, "Missing the required parameter 'signature_request_id' when calling SignatureRequestApi.signature_request_edit_embedded_with_template"
782
+ end
783
+ # verify the required parameter 'signature_request_edit_embedded_with_template_request' is set
784
+ if @api_client.config.client_side_validation && signature_request_edit_embedded_with_template_request.nil?
785
+ fail ArgumentError, "Missing the required parameter 'signature_request_edit_embedded_with_template_request' when calling SignatureRequestApi.signature_request_edit_embedded_with_template"
786
+ end
787
+ # resource path
788
+ local_var_path = '/signature_request/edit_embedded_with_template/{signature_request_id}'.sub('{' + 'signature_request_id' + '}', CGI.escape(signature_request_id.to_s))
789
+
790
+ # query parameters
791
+ query_params = opts[:query_params] || {}
792
+
793
+ # header parameters
794
+ header_params = opts[:header_params] || {}
795
+ # HTTP header 'Accept' (if needed)
796
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
797
+ # HTTP header 'Content-Type'
798
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])
799
+ if !content_type.nil?
800
+ header_params['Content-Type'] = content_type
801
+ end
802
+
803
+ post_body = {}
804
+ form_params = opts[:form_params] || {}
805
+ result = @api_client.generate_form_data(
806
+ signature_request_edit_embedded_with_template_request,
807
+ Dropbox::Sign::SignatureRequestEditEmbeddedWithTemplateRequest.openapi_types
808
+ )
809
+
810
+ # form parameters
811
+ if result[:has_file]
812
+ form_params = opts[:form_params] || result[:params]
813
+ header_params['Content-Type'] = 'multipart/form-data'
814
+ else
815
+ # http body (model)
816
+ post_body = opts[:debug_body] || result[:params]
817
+ end
818
+
819
+ # return_type
820
+ return_type = opts[:debug_return_type] || 'SignatureRequestGetResponse'
821
+
822
+ # auth_names
823
+ auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2']
824
+
825
+ new_options = opts.merge(
826
+ :operation => :"SignatureRequestApi.signature_request_edit_embedded_with_template",
827
+ :header_params => header_params,
828
+ :query_params => query_params,
829
+ :form_params => form_params,
830
+ :body => post_body,
831
+ :auth_names => auth_names,
832
+ :return_type => return_type
833
+ )
834
+
835
+ begin
836
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
837
+ rescue Dropbox::Sign::ApiError => e
838
+ if e.code === 200
839
+ body = @api_client.convert_to_type(
840
+ JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0],
841
+ "Dropbox::Sign::SignatureRequestGetResponse"
842
+ )
843
+
844
+ fail ApiError.new(:code => e.code,
845
+ :response_headers => e.response_headers,
846
+ :response_body => body),
847
+ e.message
848
+ end
849
+
850
+ range_code = "4XX".split('').first
851
+ range_code_left = "#{range_code}00".to_i
852
+ range_code_right = "#{range_code}99".to_i
853
+ if e.code >= range_code_left && e.code <= range_code_right
854
+ body = @api_client.convert_to_type(
855
+ JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0],
856
+ "Dropbox::Sign::ErrorResponse"
857
+ )
858
+
859
+ fail ApiError.new(:code => e.code,
860
+ :response_headers => e.response_headers,
861
+ :response_body => body),
862
+ e.message
863
+ end
864
+
865
+ end
866
+
867
+ if @api_client.config.debugging
868
+ @api_client.config.logger.debug "API called: SignatureRequestApi#signature_request_edit_embedded_with_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
869
+ end
870
+ return data, status_code, headers
871
+ end
872
+
873
+ # Edit Signature Request With Template
874
+ # Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend will not deduct your signature request quota.
875
+ # @param signature_request_id [String] The id of the SignatureRequest to edit.
876
+ # @param signature_request_edit_with_template_request [SignatureRequestEditWithTemplateRequest]
877
+ # @param [Hash] opts the optional parameters
878
+ # @return [SignatureRequestGetResponse]
879
+ def signature_request_edit_with_template(signature_request_id, signature_request_edit_with_template_request, opts = {})
880
+ data, _status_code, _headers = signature_request_edit_with_template_with_http_info(signature_request_id, signature_request_edit_with_template_request, opts)
881
+ data
882
+ end
883
+
884
+ # Edit Signature Request With Template
885
+ # Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend will not deduct your signature request quota.
886
+ # @param signature_request_id [String] The id of the SignatureRequest to edit.
887
+ # @param signature_request_edit_with_template_request [SignatureRequestEditWithTemplateRequest]
888
+ # @param [Hash] opts the optional parameters
889
+ # @return [Array<(SignatureRequestGetResponse, Integer, Hash)>] SignatureRequestGetResponse data, response status code and response headers
890
+ def signature_request_edit_with_template_with_http_info(signature_request_id, signature_request_edit_with_template_request, opts = {})
891
+ if @api_client.config.debugging
892
+ @api_client.config.logger.debug 'Calling API: SignatureRequestApi.signature_request_edit_with_template ...'
893
+ end
894
+ # verify the required parameter 'signature_request_id' is set
895
+ if @api_client.config.client_side_validation && signature_request_id.nil?
896
+ fail ArgumentError, "Missing the required parameter 'signature_request_id' when calling SignatureRequestApi.signature_request_edit_with_template"
897
+ end
898
+ # verify the required parameter 'signature_request_edit_with_template_request' is set
899
+ if @api_client.config.client_side_validation && signature_request_edit_with_template_request.nil?
900
+ fail ArgumentError, "Missing the required parameter 'signature_request_edit_with_template_request' when calling SignatureRequestApi.signature_request_edit_with_template"
901
+ end
902
+ # resource path
903
+ local_var_path = '/signature_request/edit_with_template/{signature_request_id}'.sub('{' + 'signature_request_id' + '}', CGI.escape(signature_request_id.to_s))
904
+
905
+ # query parameters
906
+ query_params = opts[:query_params] || {}
907
+
908
+ # header parameters
909
+ header_params = opts[:header_params] || {}
910
+ # HTTP header 'Accept' (if needed)
911
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
912
+ # HTTP header 'Content-Type'
913
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])
914
+ if !content_type.nil?
915
+ header_params['Content-Type'] = content_type
916
+ end
917
+
918
+ post_body = {}
919
+ form_params = opts[:form_params] || {}
920
+ result = @api_client.generate_form_data(
921
+ signature_request_edit_with_template_request,
922
+ Dropbox::Sign::SignatureRequestEditWithTemplateRequest.openapi_types
923
+ )
924
+
925
+ # form parameters
926
+ if result[:has_file]
927
+ form_params = opts[:form_params] || result[:params]
928
+ header_params['Content-Type'] = 'multipart/form-data'
929
+ else
930
+ # http body (model)
931
+ post_body = opts[:debug_body] || result[:params]
932
+ end
933
+
934
+ # return_type
935
+ return_type = opts[:debug_return_type] || 'SignatureRequestGetResponse'
936
+
937
+ # auth_names
938
+ auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2']
939
+
940
+ new_options = opts.merge(
941
+ :operation => :"SignatureRequestApi.signature_request_edit_with_template",
942
+ :header_params => header_params,
943
+ :query_params => query_params,
944
+ :form_params => form_params,
945
+ :body => post_body,
946
+ :auth_names => auth_names,
947
+ :return_type => return_type
948
+ )
949
+
950
+ begin
951
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
952
+ rescue Dropbox::Sign::ApiError => e
953
+ if e.code === 200
954
+ body = @api_client.convert_to_type(
955
+ JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0],
956
+ "Dropbox::Sign::SignatureRequestGetResponse"
957
+ )
958
+
959
+ fail ApiError.new(:code => e.code,
960
+ :response_headers => e.response_headers,
961
+ :response_body => body),
962
+ e.message
963
+ end
964
+
965
+ range_code = "4XX".split('').first
966
+ range_code_left = "#{range_code}00".to_i
967
+ range_code_right = "#{range_code}99".to_i
968
+ if e.code >= range_code_left && e.code <= range_code_right
969
+ body = @api_client.convert_to_type(
970
+ JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0],
971
+ "Dropbox::Sign::ErrorResponse"
972
+ )
973
+
974
+ fail ApiError.new(:code => e.code,
975
+ :response_headers => e.response_headers,
976
+ :response_body => body),
977
+ e.message
978
+ end
979
+
980
+ end
981
+
982
+ if @api_client.config.debugging
983
+ @api_client.config.logger.debug "API called: SignatureRequestApi#signature_request_edit_with_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
984
+ end
985
+ return data, status_code, headers
986
+ end
987
+
528
988
  # Download Files
529
989
  # Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead.
530
990
  # @param signature_request_id [String] The id of the SignatureRequest to retrieve.
@@ -724,6 +1184,7 @@ module Dropbox::Sign
724
1184
  # Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead.
725
1185
  # @param signature_request_id [String] The id of the SignatureRequest to retrieve.
726
1186
  # @param [Hash] opts the optional parameters
1187
+ # @option opts [Integer] :force_download By default when opening the &#x60;file_url&#x60; a browser will download the PDF and save it locally. When set to &#x60;0&#x60; the PDF file will be displayed in the browser. (default to 1)
727
1188
  # @return [FileResponse]
728
1189
  def signature_request_files_as_file_url(signature_request_id, opts = {})
729
1190
  data, _status_code, _headers = signature_request_files_as_file_url_with_http_info(signature_request_id, opts)
@@ -734,6 +1195,7 @@ module Dropbox::Sign
734
1195
  # Obtain a copy of the current documents specified by the &#x60;signature_request_id&#x60; parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of &#x60;409&#x60; will be returned instead.
735
1196
  # @param signature_request_id [String] The id of the SignatureRequest to retrieve.
736
1197
  # @param [Hash] opts the optional parameters
1198
+ # @option opts [Integer] :force_download By default when opening the &#x60;file_url&#x60; a browser will download the PDF and save it locally. When set to &#x60;0&#x60; the PDF file will be displayed in the browser.
737
1199
  # @return [Array<(FileResponse, Integer, Hash)>] FileResponse data, response status code and response headers
738
1200
  def signature_request_files_as_file_url_with_http_info(signature_request_id, opts = {})
739
1201
  if @api_client.config.debugging
@@ -748,6 +1210,7 @@ module Dropbox::Sign
748
1210
 
749
1211
  # query parameters
750
1212
  query_params = opts[:query_params] || {}
1213
+ query_params[:'force_download'] = opts[:'force_download'] if !opts[:'force_download'].nil?
751
1214
 
752
1215
  # header parameters
753
1216
  header_params = opts[:header_params] || {}
@@ -756,7 +756,7 @@ module Dropbox::Sign
756
756
  begin
757
757
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
758
758
  rescue Dropbox::Sign::ApiError => e
759
- if e.code === 200
759
+ if e.code === 201
760
760
  body = @api_client.convert_to_type(
761
761
  JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0],
762
762
  "Dropbox::Sign::TeamGetResponse"
@@ -621,6 +621,7 @@ module Dropbox::Sign
621
621
  # Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event.
622
622
  # @param template_id [String] The id of the template files to retrieve.
623
623
  # @param [Hash] opts the optional parameters
624
+ # @option opts [Integer] :force_download By default when opening the &#x60;file_url&#x60; a browser will download the PDF and save it locally. When set to &#x60;0&#x60; the PDF file will be displayed in the browser. (default to 1)
624
625
  # @return [FileResponse]
625
626
  def template_files_as_file_url(template_id, opts = {})
626
627
  data, _status_code, _headers = template_files_as_file_url_with_http_info(template_id, opts)
@@ -631,6 +632,7 @@ module Dropbox::Sign
631
632
  # Obtain a copy of the current documents specified by the &#x60;template_id&#x60; parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of &#x60;409&#x60; will be returned instead. In this case please wait for the &#x60;template_created&#x60; callback event.
632
633
  # @param template_id [String] The id of the template files to retrieve.
633
634
  # @param [Hash] opts the optional parameters
635
+ # @option opts [Integer] :force_download By default when opening the &#x60;file_url&#x60; a browser will download the PDF and save it locally. When set to &#x60;0&#x60; the PDF file will be displayed in the browser.
634
636
  # @return [Array<(FileResponse, Integer, Hash)>] FileResponse data, response status code and response headers
635
637
  def template_files_as_file_url_with_http_info(template_id, opts = {})
636
638
  if @api_client.config.debugging
@@ -645,6 +647,7 @@ module Dropbox::Sign
645
647
 
646
648
  # query parameters
647
649
  query_params = opts[:query_params] || {}
650
+ query_params[:'force_download'] = opts[:'force_download'] if !opts[:'force_download'].nil?
648
651
 
649
652
  # header parameters
650
653
  header_params = opts[:header_params] || {}
@@ -44,7 +44,7 @@ module Dropbox::Sign
44
44
  def self.get_callback_type(event_callback)
45
45
  metadata = event_callback.event.event_metadata || EventCallbackRequestEventMetadata.new
46
46
 
47
- if metadata.reported_for_app_id.nil? || metadata.reported_for_app_id.empty?
47
+ if metadata.nil? || metadata.reported_for_app_id.nil? || metadata.reported_for_app_id.empty?
48
48
  return EVENT_TYPE_ACCOUNT_CALLBACK
49
49
  end
50
50
 
@@ -90,6 +90,10 @@ module Dropbox::Sign
90
90
  # @return [String, nil]
91
91
  attr_accessor :signing_redirect_url
92
92
 
93
+ # The path where the completed document can be downloaded
94
+ # @return [String, nil]
95
+ attr_accessor :final_copy_uri
96
+
93
97
  # Templates IDs used in this SignatureRequest (if any).
94
98
  # @return [Array<String>, nil]
95
99
  attr_accessor :template_ids
@@ -135,6 +139,7 @@ module Dropbox::Sign
135
139
  :'details_url' => :'details_url',
136
140
  :'cc_email_addresses' => :'cc_email_addresses',
137
141
  :'signing_redirect_url' => :'signing_redirect_url',
142
+ :'final_copy_uri' => :'final_copy_uri',
138
143
  :'template_ids' => :'template_ids',
139
144
  :'custom_fields' => :'custom_fields',
140
145
  :'attachments' => :'attachments',
@@ -175,6 +180,7 @@ module Dropbox::Sign
175
180
  :'details_url' => :'String',
176
181
  :'cc_email_addresses' => :'Array<String>',
177
182
  :'signing_redirect_url' => :'String',
183
+ :'final_copy_uri' => :'String',
178
184
  :'template_ids' => :'Array<String>',
179
185
  :'custom_fields' => :'Array<SignatureRequestResponseCustomFieldBase>',
180
186
  :'attachments' => :'Array<SignatureRequestResponseAttachment>',
@@ -197,6 +203,7 @@ module Dropbox::Sign
197
203
  :'message',
198
204
  :'signing_url',
199
205
  :'signing_redirect_url',
206
+ :'final_copy_uri',
200
207
  :'template_ids',
201
208
  :'custom_fields',
202
209
  :'attachments',
@@ -310,6 +317,10 @@ module Dropbox::Sign
310
317
  self.signing_redirect_url = attributes[:'signing_redirect_url']
311
318
  end
312
319
 
320
+ if attributes.key?(:'final_copy_uri')
321
+ self.final_copy_uri = attributes[:'final_copy_uri']
322
+ end
323
+
313
324
  if attributes.key?(:'template_ids')
314
325
  if (value = attributes[:'template_ids']).is_a?(Array)
315
326
  self.template_ids = value
@@ -381,6 +392,7 @@ module Dropbox::Sign
381
392
  details_url == o.details_url &&
382
393
  cc_email_addresses == o.cc_email_addresses &&
383
394
  signing_redirect_url == o.signing_redirect_url &&
395
+ final_copy_uri == o.final_copy_uri &&
384
396
  template_ids == o.template_ids &&
385
397
  custom_fields == o.custom_fields &&
386
398
  attachments == o.attachments &&
@@ -398,7 +410,7 @@ module Dropbox::Sign
398
410
  # Calculates hash code according to all attributes.
399
411
  # @return [Integer] Hash code
400
412
  def hash
401
- [test_mode, signature_request_id, requester_email_address, title, original_title, subject, message, metadata, created_at, expires_at, is_complete, is_declined, has_error, files_url, signing_url, details_url, cc_email_addresses, signing_redirect_url, template_ids, custom_fields, attachments, response_data, signatures, bulk_send_job_id].hash
413
+ [test_mode, signature_request_id, requester_email_address, title, original_title, subject, message, metadata, created_at, expires_at, is_complete, is_declined, has_error, files_url, signing_url, details_url, cc_email_addresses, signing_redirect_url, final_copy_uri, template_ids, custom_fields, attachments, response_data, signatures, bulk_send_job_id].hash
402
414
  end
403
415
 
404
416
  # Builds the object from hash
@@ -160,10 +160,6 @@ module Dropbox::Sign
160
160
  invalid_properties.push('invalid value for "event_hash", event_hash cannot be nil.')
161
161
  end
162
162
 
163
- if @event_metadata.nil?
164
- invalid_properties.push('invalid value for "event_metadata", event_metadata cannot be nil.')
165
- end
166
-
167
163
  invalid_properties
168
164
  end
169
165
 
@@ -172,17 +168,16 @@ module Dropbox::Sign
172
168
  def valid?
173
169
  return false if @event_time.nil?
174
170
  return false if @event_type.nil?
175
- event_type_validator = EnumAttributeValidator.new('String', ["account_confirmed", "unknown_error", "file_error", "sign_url_invalid", "signature_request_viewed", "signature_request_signed", "signature_request_sent", "signature_request_all_signed", "signature_request_email_bounce", "signature_request_remind", "signature_request_incomplete_qes", "signature_request_destroyed", "signature_request_canceled", "signature_request_downloadable", "signature_request_declined", "signature_request_reassigned", "signature_request_invalid", "signature_request_prepared", "signature_request_expired", "template_created", "template_error", "callback_test"])
171
+ event_type_validator = EnumAttributeValidator.new('String', ["account_confirmed", "unknown_error", "file_error", "sign_url_invalid", "signature_request_viewed", "signature_request_signed", "signature_request_sent", "signature_request_all_signed", "signature_request_email_bounce", "signature_request_remind", "signature_request_incomplete_qes", "signature_request_destroyed", "signature_request_canceled", "signature_request_downloadable", "signature_request_declined", "signature_request_reassigned", "signature_request_invalid", "signature_request_prepared", "signature_request_expired", "template_created", "template_error", "callback_test", "signature_request_signer_removed"])
176
172
  return false unless event_type_validator.valid?(@event_type)
177
173
  return false if @event_hash.nil?
178
- return false if @event_metadata.nil?
179
174
  true
180
175
  end
181
176
 
182
177
  # Custom attribute writer method checking allowed values (enum).
183
178
  # @param [Object] event_type Object to be assigned
184
179
  def event_type=(event_type)
185
- validator = EnumAttributeValidator.new('String', ["account_confirmed", "unknown_error", "file_error", "sign_url_invalid", "signature_request_viewed", "signature_request_signed", "signature_request_sent", "signature_request_all_signed", "signature_request_email_bounce", "signature_request_remind", "signature_request_incomplete_qes", "signature_request_destroyed", "signature_request_canceled", "signature_request_downloadable", "signature_request_declined", "signature_request_reassigned", "signature_request_invalid", "signature_request_prepared", "signature_request_expired", "template_created", "template_error", "callback_test"])
180
+ validator = EnumAttributeValidator.new('String', ["account_confirmed", "unknown_error", "file_error", "sign_url_invalid", "signature_request_viewed", "signature_request_signed", "signature_request_sent", "signature_request_all_signed", "signature_request_email_bounce", "signature_request_remind", "signature_request_incomplete_qes", "signature_request_destroyed", "signature_request_canceled", "signature_request_downloadable", "signature_request_declined", "signature_request_reassigned", "signature_request_invalid", "signature_request_prepared", "signature_request_expired", "template_created", "template_error", "callback_test", "signature_request_signer_removed"])
186
181
  unless validator.valid?(event_type)
187
182
  fail ArgumentError, "invalid value for \"event_type\", must be one of #{validator.allowable_values}."
188
183
  end
@@ -26,7 +26,7 @@ module Dropbox::Sign
26
26
  # @return [String]
27
27
  attr_accessor :client_id
28
28
 
29
- # `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) **Note**: Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ```
29
+ # `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **Note**: Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ```
30
30
  # @return [File]
31
31
  attr_accessor :signer_file
32
32
 
@@ -22,7 +22,7 @@ module Dropbox::Sign
22
22
  # @return [Array<String>]
23
23
  attr_accessor :template_ids
24
24
 
25
- # `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) **Note**: Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ```
25
+ # `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **Note**: Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ```
26
26
  # @return [File]
27
27
  attr_accessor :signer_file
28
28