From dfae1a32983ef2f1c38f81ccdb66f2ad6783012b Mon Sep 17 00:00:00 2001 From: Chris Jackson Date: Fri, 27 Sep 2019 16:56:42 -0500 Subject: [PATCH] Update client to reflect latest additions to SignRequest API, latest updates provided by Swagger Codegen --- .gitignore | 2 +- .rubocop.yml | 154 +++++ .swagger-codegen/VERSION | 2 +- README.md | 26 +- Rakefile | 1 - docs/ApiTokensApi.md | 164 ------ docs/Document.md | 6 + docs/DocumentAttachment.md | 2 +- docs/DocumentAttachmentsApi.md | 8 +- docs/DocumentSearch.md | 10 +- docs/DocumentSigningLog.md | 9 + docs/DocumentSignrequest.md | 28 + docs/DocumentTeam.md | 10 + docs/DocumentsApi.md | 22 +- docs/DocumentsSearchApi.md | 16 +- docs/Event.md | 1 + docs/EventsApi.md | 26 +- docs/FileFromSf.md | 1 + docs/InlineResponse201.md | 2 +- docs/InlineSignRequest.md | 3 + docs/SignRequest.md | 5 +- docs/SignRequestQuickCreate.md | 6 +- docs/Signer.md | 3 + docs/SignrequestsApi.md | 10 +- docs/Team.md | 2 + docs/TeamMember.md | 1 + docs/TeamMembersApi.md | 14 +- docs/TeamsApi.md | 60 +- docs/Template.md | 1 + docs/TemplatesApi.md | 2 +- docs/WebhookSubscription.md | 1 + docs/WebhooksApi.md | 8 +- lib/signrequest_client.rb | 5 +- lib/signrequest_client/api/api_tokens_api.rb | 175 +----- .../api/document_attachments_api.rb | 25 +- lib/signrequest_client/api/documents_api.rb | 32 +- .../api/documents_search_api.rb | 11 +- lib/signrequest_client/api/events_api.rb | 18 +- .../api/signrequest_quick_create_api.rb | 11 +- .../api/signrequests_api.rb | 39 +- .../api/team_members_api.rb | 18 +- lib/signrequest_client/api/teams_api.rb | 90 ++- lib/signrequest_client/api/templates_api.rb | 18 +- lib/signrequest_client/api/webhooks_api.rb | 46 +- lib/signrequest_client/api_client.rb | 18 +- lib/signrequest_client/api_error.rb | 2 +- lib/signrequest_client/configuration.rb | 4 +- lib/signrequest_client/models/auth_token.rb | 39 +- lib/signrequest_client/models/document.rb | 158 +++-- .../models/document_attachment.rb | 42 +- .../models/document_search.rb | 233 ++++---- .../models/document_signer_template_conf.rb | 35 +- .../models/document_signing_log.rb | 209 +++++++ .../models/document_signrequest.rb | 538 ++++++++++++++++++ .../models/document_team.rb | 240 ++++++++ lib/signrequest_client/models/event.rb | 44 +- lib/signrequest_client/models/file_from_sf.rb | 61 +- ...inline_document_signer_integration_data.rb | 22 +- .../models/inline_integration_data.rb | 22 +- .../models/inline_prefill_tags.rb | 21 +- .../models/inline_response_200.rb | 21 +- .../models/inline_response_200_1.rb | 21 +- .../models/inline_response_200_2.rb | 21 +- .../models/inline_response_200_3.rb | 21 +- .../models/inline_response_200_4.rb | 21 +- .../models/inline_response_200_5.rb | 21 +- .../models/inline_response_200_6.rb | 21 +- .../models/inline_response_200_7.rb | 21 +- .../models/inline_response_200_8.rb | 21 +- .../models/inline_response_200_9.rb | 21 +- .../models/inline_response_201.rb | 58 +- .../models/inline_response_201_1.rb | 26 +- .../models/inline_sign_request.rb | 104 ++-- lib/signrequest_client/models/inline_team.rb | 31 +- .../models/inline_team_member.rb | 22 +- .../models/invite_member.rb | 25 +- lib/signrequest_client/models/placeholder.rb | 36 +- .../models/required_attachment.rb | 34 +- lib/signrequest_client/models/sign_request.rb | 115 ++-- .../models/sign_request_quick_create.rb | 185 ++++-- lib/signrequest_client/models/signer.rb | 163 ++++-- .../models/signer_attachment.rb | 27 +- .../models/signer_inputs.rb | 34 +- lib/signrequest_client/models/signing_log.rb | 22 +- lib/signrequest_client/models/team.rb | 89 +-- lib/signrequest_client/models/team_member.rb | 33 +- lib/signrequest_client/models/template.rb | 43 +- lib/signrequest_client/models/user.rb | 44 +- .../models/webhook_subscription.rb | 63 +- lib/signrequest_client/version.rb | 4 +- signrequest_client.gemspec | 8 +- spec/models/document_signing_log_spec.rb | 47 ++ spec/models/document_signrequest_spec.rb | 165 ++++++ spec/models/document_team_spec.rb | 53 ++ 94 files changed, 2899 insertions(+), 1524 deletions(-) create mode 100644 .rubocop.yml create mode 100644 docs/DocumentSigningLog.md create mode 100644 docs/DocumentSignrequest.md create mode 100644 docs/DocumentTeam.md create mode 100644 lib/signrequest_client/models/document_signing_log.rb create mode 100644 lib/signrequest_client/models/document_signrequest.rb create mode 100644 lib/signrequest_client/models/document_team.rb create mode 100644 spec/models/document_signing_log_spec.rb create mode 100644 spec/models/document_signrequest_spec.rb create mode 100644 spec/models/document_team_spec.rb diff --git a/.gitignore b/.gitignore index 4b91271..c021594 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ # Generated by: https://github.com/swagger-api/swagger-codegen.git -# +# *.gem *.rbc diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..19a777e --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,154 @@ +# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) +# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) +AllCops: + TargetRubyVersion: 2.2 + # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop + # to ignore them, so only the ones explicitly set in this file are enabled. + DisabledByDefault: true + Exclude: + - '**/templates/**/*' + - '**/vendor/**/*' + - 'actionpack/lib/action_dispatch/journey/parser.rb' + +# Prefer &&/|| over and/or. +Style/AndOr: + Enabled: true + +# Do not use braces for hash literals when they are the last argument of a +# method call. +Style/BracesAroundHashParameters: + Enabled: true + EnforcedStyle: context_dependent + +# Align `when` with `case`. +Layout/CaseIndentation: + Enabled: true + +# Align comments with method definitions. +Layout/CommentIndentation: + Enabled: true + +Layout/ElseAlignment: + Enabled: true + +Layout/EmptyLineAfterMagicComment: + Enabled: true + +# In a regular class definition, no empty lines around the body. +Layout/EmptyLinesAroundClassBody: + Enabled: true + +# In a regular method definition, no empty lines around the body. +Layout/EmptyLinesAroundMethodBody: + Enabled: true + +# In a regular module definition, no empty lines around the body. +Layout/EmptyLinesAroundModuleBody: + Enabled: true + +Layout/FirstParameterIndentation: + Enabled: true + +# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. +Style/HashSyntax: + Enabled: false + +# Method definitions after `private` or `protected` isolated calls need one +# extra level of indentation. +Layout/IndentationConsistency: + Enabled: true + EnforcedStyle: rails + +# Two spaces, no tabs (for indentation). +Layout/IndentationWidth: + Enabled: true + +Layout/LeadingCommentSpace: + Enabled: true + +Layout/SpaceAfterColon: + Enabled: true + +Layout/SpaceAfterComma: + Enabled: true + +Layout/SpaceAroundEqualsInParameterDefault: + Enabled: true + +Layout/SpaceAroundKeyword: + Enabled: true + +Layout/SpaceAroundOperators: + Enabled: true + +Layout/SpaceBeforeComma: + Enabled: true + +Layout/SpaceBeforeFirstArg: + Enabled: true + +Style/DefWithParentheses: + Enabled: true + +# Defining a method with parameters needs parentheses. +Style/MethodDefParentheses: + Enabled: true + +Style/FrozenStringLiteralComment: + Enabled: false + EnforcedStyle: always + +# Use `foo {}` not `foo{}`. +Layout/SpaceBeforeBlockBraces: + Enabled: true + +# Use `foo { bar }` not `foo {bar}`. +Layout/SpaceInsideBlockBraces: + Enabled: true + +# Use `{ a: 1 }` not `{a:1}`. +Layout/SpaceInsideHashLiteralBraces: + Enabled: true + +Layout/SpaceInsideParens: + Enabled: true + +# Check quotes usage according to lint rule below. +#Style/StringLiterals: +# Enabled: true +# EnforcedStyle: single_quotes + +# Detect hard tabs, no hard tabs. +Layout/Tab: + Enabled: true + +# Blank lines should not have any spaces. +Layout/TrailingBlankLines: + Enabled: true + +# No trailing whitespace. +Layout/TrailingWhitespace: + Enabled: false + +# Use quotes for string literals when they are enough. +Style/UnneededPercentQ: + Enabled: true + +# Align `end` with the matching keyword or starting expression except for +# assignments, where it should be aligned with the LHS. +Lint/EndAlignment: + Enabled: true + EnforcedStyleAlignWith: variable + AutoCorrect: true + +# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. +Lint/RequireParentheses: + Enabled: true + +Style/RedundantReturn: + Enabled: true + AllowMultipleReturnValues: true + +Style/Semicolon: + Enabled: true + AllowAsExpressionSeparator: true diff --git a/.swagger-codegen/VERSION b/.swagger-codegen/VERSION index a625450..752a79e 100644 --- a/.swagger-codegen/VERSION +++ b/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1 \ No newline at end of file +2.4.8 \ No newline at end of file diff --git a/README.md b/README.md index 9da12d8..cc46cc5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# SignRequest API Client +# SignRequest Ruby Client SignRequestClient - the offical Ruby client for [SignRequest.com](https://signrequest.com/) @@ -8,13 +8,14 @@ SignRequestClient - the offical Ruby client for [SignRequest.com](https://signre Add this to the Gemfile: - gem 'signrequest_client', '~> 1.0.0' + gem 'signrequest_client', '~> 1.1.0' And then run: bundle install - + ## API Documentation + Full API documentation, including code samples, can be found here: https://signrequest.com/api/v1/docs/ @@ -43,14 +44,11 @@ end ## Documentation for API Endpoints -All URIs are relative to _https://signrequest.com/api/v1_ +All URIs are relative to *https://signrequest.com/api/v1* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*SignRequestClient::ApiTokensApi* | [**api_tokens_create**](docs/ApiTokensApi.md#api_tokens_create) | **POST** /api-tokens/ | Create an API token -*SignRequestClient::ApiTokensApi* | [**api_tokens_delete**](docs/ApiTokensApi.md#api_tokens_delete) | **DELETE** /api-tokens/{key}/ | Delete an API token *SignRequestClient::ApiTokensApi* | [**api_tokens_list**](docs/ApiTokensApi.md#api_tokens_list) | **GET** /api-tokens/ | Retrieve a list of API tokens -*SignRequestClient::ApiTokensApi* | [**api_tokens_read**](docs/ApiTokensApi.md#api_tokens_read) | **GET** /api-tokens/{key}/ | Retrieve an API token *SignRequestClient::DocumentAttachmentsApi* | [**document_attachments_create**](docs/DocumentAttachmentsApi.md#document_attachments_create) | **POST** /document-attachments/ | Create a Document Attachment *SignRequestClient::DocumentAttachmentsApi* | [**document_attachments_list**](docs/DocumentAttachmentsApi.md#document_attachments_list) | **GET** /document-attachments/ | Retrieve a list of Document Attachments *SignRequestClient::DocumentAttachmentsApi* | [**document_attachments_read**](docs/DocumentAttachmentsApi.md#document_attachments_read) | **GET** /document-attachments/{uuid}/ | Retrieve a Document Attachment @@ -70,6 +68,7 @@ Class | Method | HTTP request | Description *SignRequestClient::TeamMembersApi* | [**team_members_list**](docs/TeamMembersApi.md#team_members_list) | **GET** /team-members/ | Retrieve a list of Team Members *SignRequestClient::TeamMembersApi* | [**team_members_read**](docs/TeamMembersApi.md#team_members_read) | **GET** /team-members/{uuid}/ | Retrieve a Team Member *SignRequestClient::TeamsApi* | [**teams_create**](docs/TeamsApi.md#teams_create) | **POST** /teams/ | Create a Team +*SignRequestClient::TeamsApi* | [**teams_delete**](docs/TeamsApi.md#teams_delete) | **DELETE** /teams/{subdomain}/ | Delete a Team *SignRequestClient::TeamsApi* | [**teams_invite_member**](docs/TeamsApi.md#teams_invite_member) | **POST** /teams/{subdomain}/invite_member/ | Invite a Team Member *SignRequestClient::TeamsApi* | [**teams_list**](docs/TeamsApi.md#teams_list) | **GET** /teams/ | Retrieve a list of Teams *SignRequestClient::TeamsApi* | [**teams_partial_update**](docs/TeamsApi.md#teams_partial_update) | **PATCH** /teams/{subdomain}/ | Update a Team @@ -91,6 +90,9 @@ Class | Method | HTTP request | Description - [SignRequestClient::DocumentAttachment](docs/DocumentAttachment.md) - [SignRequestClient::DocumentSearch](docs/DocumentSearch.md) - [SignRequestClient::DocumentSignerTemplateConf](docs/DocumentSignerTemplateConf.md) + - [SignRequestClient::DocumentSigningLog](docs/DocumentSigningLog.md) + - [SignRequestClient::DocumentSignrequest](docs/DocumentSignrequest.md) + - [SignRequestClient::DocumentTeam](docs/DocumentTeam.md) - [SignRequestClient::Event](docs/Event.md) - [SignRequestClient::FileFromSf](docs/FileFromSf.md) - [SignRequestClient::InlineDocumentSignerIntegrationData](docs/InlineDocumentSignerIntegrationData.md) @@ -126,3 +128,13 @@ Class | Method | HTTP request | Description - [SignRequestClient::User](docs/User.md) - [SignRequestClient::WebhookSubscription](docs/WebhookSubscription.md) + +## Documentation for Authorization + + +### Token + +- **Type**: API key +- **API key parameter name**: Authorization +- **Location**: HTTP header + diff --git a/Rakefile b/Rakefile index 9a48c31..d52c3e3 100644 --- a/Rakefile +++ b/Rakefile @@ -1,5 +1,4 @@ begin - require 'bundler/gem_tasks' require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) diff --git a/docs/ApiTokensApi.md b/docs/ApiTokensApi.md index 2ef4f5a..6c001c0 100644 --- a/docs/ApiTokensApi.md +++ b/docs/ApiTokensApi.md @@ -4,117 +4,7 @@ All URIs are relative to *https://signrequest.com/api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**api_tokens_create**](ApiTokensApi.md#api_tokens_create) | **POST** /api-tokens/ | Create an API token -[**api_tokens_delete**](ApiTokensApi.md#api_tokens_delete) | **DELETE** /api-tokens/{key}/ | Delete an API token [**api_tokens_list**](ApiTokensApi.md#api_tokens_list) | **GET** /api-tokens/ | Retrieve a list of API tokens -[**api_tokens_read**](ApiTokensApi.md#api_tokens_read) | **GET** /api-tokens/{key}/ | Retrieve an API token - - -# **api_tokens_create** -> AuthToken api_tokens_create(data) - -Create an API token - -You can create an API token in the [team api settings page](/#/teams). It is also possible to get or create a token using the REST api with your login credentials. - -### Example -```ruby -# load the gem -require 'signrequest_client' -# setup authorization -SignRequestClient.configure do |config| - # Configure API key authorization: Token - config.api_key['Authorization'] = 'YOUR API KEY' - # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['Authorization'] = 'Bearer' -end - -api_instance = SignRequestClient::ApiTokensApi.new - -data = SignRequestClient::AuthToken.new # AuthToken | - - -begin - #Create an API token - result = api_instance.api_tokens_create(data) - p result -rescue SignRequestClient::ApiError => e - puts "Exception when calling ApiTokensApi->api_tokens_create: #{e}" -end -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **data** | [**AuthToken**](AuthToken.md)| | - -### Return type - -[**AuthToken**](AuthToken.md) - -### Authorization - -[Token](../README.md#Token) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - - -# **api_tokens_delete** -> api_tokens_delete(key) - -Delete an API token - - - -### Example -```ruby -# load the gem -require 'signrequest_client' -# setup authorization -SignRequestClient.configure do |config| - # Configure API key authorization: Token - config.api_key['Authorization'] = 'YOUR API KEY' - # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['Authorization'] = 'Bearer' -end - -api_instance = SignRequestClient::ApiTokensApi.new - -key = "key_example" # String | A unique value identifying this api token. - - -begin - #Delete an API token - api_instance.api_tokens_delete(key) -rescue SignRequestClient::ApiError => e - puts "Exception when calling ApiTokensApi->api_tokens_delete: #{e}" -end -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **key** | **String**| A unique value identifying this api token. | - -### Return type - -nil (empty response body) - -### Authorization - -[Token](../README.md#Token) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - # **api_tokens_list** @@ -174,57 +64,3 @@ Name | Type | Description | Notes -# **api_tokens_read** -> AuthToken api_tokens_read(key) - -Retrieve an API token - - - -### Example -```ruby -# load the gem -require 'signrequest_client' -# setup authorization -SignRequestClient.configure do |config| - # Configure API key authorization: Token - config.api_key['Authorization'] = 'YOUR API KEY' - # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['Authorization'] = 'Bearer' -end - -api_instance = SignRequestClient::ApiTokensApi.new - -key = "key_example" # String | A unique value identifying this api token. - - -begin - #Retrieve an API token - result = api_instance.api_tokens_read(key) - p result -rescue SignRequestClient::ApiError => e - puts "Exception when calling ApiTokensApi->api_tokens_read: #{e}" -end -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **key** | **String**| A unique value identifying this api token. | - -### Return type - -[**AuthToken**](AuthToken.md) - -### Authorization - -[Token](../README.md#Token) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - - diff --git a/docs/Document.md b/docs/Document.md index 00e9c31..c7b35fd 100644 --- a/docs/Document.md +++ b/docs/Document.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **url** | **String** | | [optional] +**team** | [**DocumentTeam**](DocumentTeam.md) | | [optional] **uuid** | **String** | | [optional] **user** | [**User**](User.md) | | [optional] **file_as_pdf** | **String** | Temporary URL to original file as PDF, expires in five minutes | [optional] @@ -20,11 +21,16 @@ Name | Type | Description | Notes **integrations** | [**Array<InlineIntegrationData>**](InlineIntegrationData.md) | | [optional] **file_from_sf** | [**FileFromSf**](FileFromSf.md) | | [optional] **auto_delete_days** | **Integer** | Number of days after which a finished document (signed/cancelled/declined) will be automatically deleted | [optional] +**auto_expire_days** | **Integer** | Number of days after which a non finished document will be automatically expired | [optional] **pdf** | **String** | Temporary URL to signed document as PDF, expires in five minutes | [optional] **status** | **String** | `co`: converting, `ne`: new, `se`: sent, `vi`: viewed, `si`: signed, `do`: downloaded, `sd`: signed and downloaded, `ca`: cancelled, `de`: declined, `ec`: error converting, `es`: error sending, `xp`: expired | [optional] +**signrequest** | [**DocumentSignrequest**](DocumentSignrequest.md) | | [optional] **api_used** | **BOOLEAN** | Indicates whether document was created using the API | [optional] +**signing_log** | [**DocumentSigningLog**](DocumentSigningLog.md) | | [optional] **security_hash** | **String** | SHA256 hash of PDF contents | [optional] **attachments** | [**Array<DocumentAttachment>**](DocumentAttachment.md) | | [optional] **auto_delete_after** | **DateTime** | Date and time calculated using `auto_delete_days` after which a finished document (signed/cancelled/declined) will be automatically deleted | [optional] +**sandbox** | **BOOLEAN** | Indicates whether document was created as part of a sandbox team | [optional] +**auto_expire_after** | **DateTime** | Date and time calculated using `auto_expire_days` after which a non finished document will be automatically expired | [optional] diff --git a/docs/DocumentAttachment.md b/docs/DocumentAttachment.md index fc441b7..f9cbc88 100644 --- a/docs/DocumentAttachment.md +++ b/docs/DocumentAttachment.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **url** | **String** | | [optional] **uuid** | **String** | | [optional] -**name** | **String** | Defaults to filename | [optional] +**name** | **String** | Defaults to filename, including extension | [optional] **file** | **String** | Temporary URL to document attachment, expires in five minutes | [optional] **file_from_content** | **String** | Base64 encoded document content | [optional] **file_from_content_name** | **String** | Filename, including extension. Required when using `file_from_content`. | [optional] diff --git a/docs/DocumentAttachmentsApi.md b/docs/DocumentAttachmentsApi.md index 315cc4e..899d0a4 100644 --- a/docs/DocumentAttachmentsApi.md +++ b/docs/DocumentAttachmentsApi.md @@ -85,9 +85,9 @@ end api_instance = SignRequestClient::DocumentAttachmentsApi.new opts = { - document__uuid: "document__uuid_example", # String | - document__external_id: "document__external_id_example", # String | - created: "created_example", # String | + document__uuid: 'document__uuid_example', # String | + document__external_id: 'document__external_id_example', # String | + created: 'created_example', # String | page: 56, # Integer | A page number within the paginated result set. limit: 56 # Integer | Number of results to return per page. } @@ -147,7 +147,7 @@ end api_instance = SignRequestClient::DocumentAttachmentsApi.new -uuid = "uuid_example" # String | +uuid = 'uuid_example' # String | begin diff --git a/docs/DocumentSearch.md b/docs/DocumentSearch.md index bab8d57..83f3404 100644 --- a/docs/DocumentSearch.md +++ b/docs/DocumentSearch.md @@ -3,14 +3,14 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**status** | **String** | `co`: converting, `ne`: new, `se`: sent, `vi`: viewed, `si`: signed, `do`: downloaded, `sd`: signed and downloaded, `ca`: cancelled, `de`: declined, `ec`: error converting, `es`: error sending, `xp`: expired | [optional] -**name** | **String** | Defaults to filename | [optional] -**who** | **String** | | -**nr_extra_docs** | **Integer** | | -**from_email** | **String** | | **uuid** | **String** | | [optional] **created** | **DateTime** | | [optional] +**status** | **String** | `co`: converting, `ne`: new, `se`: sent, `vi`: viewed, `si`: signed, `do`: downloaded, `sd`: signed and downloaded, `ca`: cancelled, `de`: declined, `ec`: error converting, `es`: error sending, `xp`: expired | [optional] +**who** | **String** | | +**name** | **String** | Defaults to filename | [optional] **autocomplete** | **String** | | +**from_email** | **String** | | +**nr_extra_docs** | **Integer** | | **signer_emails** | **Array<String>** | | [optional] **status_display** | **String** | | [optional] **created_timestamp** | **Integer** | | [optional] diff --git a/docs/DocumentSigningLog.md b/docs/DocumentSigningLog.md new file mode 100644 index 0000000..5287f9f --- /dev/null +++ b/docs/DocumentSigningLog.md @@ -0,0 +1,9 @@ +# SignRequestClient::DocumentSigningLog + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pdf** | **String** | Temporary URL to signing log, expires in five minutes | [optional] +**security_hash** | **String** | SHA256 hash of PDF contents | [optional] + + diff --git a/docs/DocumentSignrequest.md b/docs/DocumentSignrequest.md new file mode 100644 index 0000000..ea4c12c --- /dev/null +++ b/docs/DocumentSignrequest.md @@ -0,0 +1,28 @@ +# SignRequestClient::DocumentSignrequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**from_email** | **String** | Email of user sending the SignRequest (must be a validated email) | [optional] +**from_email_name** | **String** | Name to be used in the `From` email header, e.g. `{from_email_name} <no-reply@signrequest.com>` | [optional] +**is_being_prepared** | **BOOLEAN** | Have the sender of a SignRequest prepare the document before sending the request out, see: [prepare using the web interface](#section/Preparing-a-document/Prepare-using-the-web-interface) | [optional] +**prepare_url** | **String** | | [optional] +**redirect_url** | **String** | URL at which SignRequest will redirect to when a document is signed | [optional] +**redirect_url_declined** | **String** | URL at which SignRequest will redirect to when a document is declined | [optional] +**required_attachments** | [**Array<RequiredAttachment>**](RequiredAttachment.md) | | [optional] +**disable_attachments** | **BOOLEAN** | Disable uploading/adding of attachments | [optional] +**disable_text_signatures** | **BOOLEAN** | Disable usage of signatures generated by typing (text) | [optional] +**disable_text** | **BOOLEAN** | Disable adding of text | [optional] +**disable_date** | **BOOLEAN** | Disable adding of dates | [optional] +**disable_emails** | **BOOLEAN** | Disable all SignRequest status emails as well as the email that contains the signed documents | [optional] +**disable_upload_signatures** | **BOOLEAN** | Disable usage of uploaded signatures (images) | [optional] +**disable_blockchain_proof** | **BOOLEAN** | Disables storing timestamp proof hashes in blockchain integrations. | [optional] +**text_message_verification_locked** | **BOOLEAN** | When true a text message verification is needed before the signer can see the document | [optional] +**subject** | **String** | Subject of SignRequest email | [optional] +**message** | **String** | Message to include in SignRequest email, may contain the following html tags: `a`, `abbr`, `acronym`, `b`, `blockquote`, `code`, `em`, `i`, `ul`, `li`, `ol`, and `strong` | [optional] +**who** | **String** | `m`: only me, `mo`: me and others, `o`: only others | [optional] +**send_reminders** | **BOOLEAN** | Automatically remind signers to sign a document | [optional] +**signers** | [**Array<Signer>**](Signer.md) | | [optional] +**uuid** | **String** | | [optional] + + diff --git a/docs/DocumentTeam.md b/docs/DocumentTeam.md new file mode 100644 index 0000000..1a09ab5 --- /dev/null +++ b/docs/DocumentTeam.md @@ -0,0 +1,10 @@ +# SignRequestClient::DocumentTeam + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] +**subdomain** | **String** | | [optional] +**url** | **String** | | [optional] + + diff --git a/docs/DocumentsApi.md b/docs/DocumentsApi.md index 1415461..762b785 100644 --- a/docs/DocumentsApi.md +++ b/docs/DocumentsApi.md @@ -85,7 +85,7 @@ end api_instance = SignRequestClient::DocumentsApi.new -uuid = "uuid_example" # String | +uuid = 'uuid_example' # String | begin @@ -139,15 +139,15 @@ end api_instance = SignRequestClient::DocumentsApi.new opts = { - external_id: "external_id_example", # String | - signrequest__who: "signrequest__who_example", # String | - signrequest__from_email: "signrequest__from_email_example", # String | - status: "status_example", # String | - user__email: "user__email_example", # String | - user__first_name: "user__first_name_example", # String | - user__last_name: "user__last_name_example", # String | - created: "created_example", # String | - modified: "modified_example", # String | + external_id: 'external_id_example', # String | + signrequest__who: 'signrequest__who_example', # String | + signrequest__from_email: 'signrequest__from_email_example', # String | + status: 'status_example', # String | + user__email: 'user__email_example', # String | + user__first_name: 'user__first_name_example', # String | + user__last_name: 'user__last_name_example', # String | + created: 'created_example', # String | + modified: 'modified_example', # String | page: 56, # Integer | A page number within the paginated result set. limit: 56 # Integer | Number of results to return per page. } @@ -213,7 +213,7 @@ end api_instance = SignRequestClient::DocumentsApi.new -uuid = "uuid_example" # String | +uuid = 'uuid_example' # String | begin diff --git a/docs/DocumentsSearchApi.md b/docs/DocumentsSearchApi.md index 0d6e45c..6c9e8d4 100644 --- a/docs/DocumentsSearchApi.md +++ b/docs/DocumentsSearchApi.md @@ -31,14 +31,14 @@ api_instance = SignRequestClient::DocumentsSearchApi.new opts = { page: 56, # Integer | A page number within the paginated result set. limit: 56, # Integer | Number of results to return per page. - q: "q_example", # String | Normal search query - autocomplete: "autocomplete_example", # String | Partial search query - name: "name_example", # String | Document name - subdomain: "subdomain_example", # String | - signer_emails: "signer_emails_example", # String | Email needed to sign/approve - status: "status_example", # String | `co`: converting, `ne`: new, `se`: sent, `vi`: viewed, `si`: signed, `do`: downloaded, `sd`: signed and downloaded, `ca`: cancelled, `de`: declined, `ec`: error converting, `es`: error sending, `xp`: expired - who: "who_example", # String | `m`: only me, `mo`: me and others, `o`: only others - format: "format_example", # String | Export format, can be `json` (default), `csv`, or `xls` + q: 'q_example', # String | Normal search query + autocomplete: 'autocomplete_example', # String | Partial search query + name: 'name_example', # String | Document name + subdomain: 'subdomain_example', # String | + signer_emails: 'signer_emails_example', # String | Email needed to sign/approve + status: 'status_example', # String | `co`: converting, `ne`: new, `se`: sent, `vi`: viewed, `si`: signed, `do`: downloaded, `sd`: signed and downloaded, `ca`: cancelled, `de`: declined, `ec`: error converting, `es`: error sending, `xp`: expired + who: 'who_example', # String | `m`: only me, `mo`: me and others, `o`: only others + format: 'format_example', # String | Export format, can be `json` (default), `csv`, or `xls` signer_data: 8.14 # Float | Set to `1` to export with each signer on a separate row } diff --git a/docs/Event.md b/docs/Event.md index 6feb067..dca7206 100644 --- a/docs/Event.md +++ b/docs/Event.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **delivered_on** | **DateTime** | | [optional] **callback_status_code** | **Integer** | | [optional] **timestamp** | **DateTime** | | [optional] +**team** | [**DocumentTeam**](DocumentTeam.md) | | [optional] **document** | [**Document**](Document.md) | | [optional] **signer** | [**Signer**](Signer.md) | | [optional] diff --git a/docs/EventsApi.md b/docs/EventsApi.md index d131d1d..bd4f222 100644 --- a/docs/EventsApi.md +++ b/docs/EventsApi.md @@ -30,19 +30,19 @@ end api_instance = SignRequestClient::EventsApi.new opts = { - document__uuid: "document__uuid_example", # String | - document__external_id: "document__external_id_example", # String | - document__signrequest__who: "document__signrequest__who_example", # String | - document__signrequest__from_email: "document__signrequest__from_email_example", # String | - document__status: "document__status_example", # String | - document__user__email: "document__user__email_example", # String | - document__user__first_name: "document__user__first_name_example", # String | - document__user__last_name: "document__user__last_name_example", # String | - delivered: "delivered_example", # String | - delivered_on: "delivered_on_example", # String | - timestamp: "timestamp_example", # String | - status: "status_example", # String | - event_type: "event_type_example", # String | + document__uuid: 'document__uuid_example', # String | + document__external_id: 'document__external_id_example', # String | + document__signrequest__who: 'document__signrequest__who_example', # String | + document__signrequest__from_email: 'document__signrequest__from_email_example', # String | + document__status: 'document__status_example', # String | + document__user__email: 'document__user__email_example', # String | + document__user__first_name: 'document__user__first_name_example', # String | + document__user__last_name: 'document__user__last_name_example', # String | + delivered: 'delivered_example', # String | + delivered_on: 'delivered_on_example', # String | + timestamp: 'timestamp_example', # String | + status: 'status_example', # String | + event_type: 'event_type_example', # String | page: 56, # Integer | A page number within the paginated result set. limit: 56 # Integer | Number of results to return per page. } diff --git a/docs/FileFromSf.md b/docs/FileFromSf.md index 8ccf408..7c1370c 100644 --- a/docs/FileFromSf.md +++ b/docs/FileFromSf.md @@ -5,5 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **object_type** | **String** | | **object_id** | **String** | | +**uid** | **String** | | [optional] diff --git a/docs/InlineResponse201.md b/docs/InlineResponse201.md index 691c740..2895649 100644 --- a/docs/InlineResponse201.md +++ b/docs/InlineResponse201.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**cancelled** | **BOOLEAN** | | **detail** | **String** | | +**cancelled** | **BOOLEAN** | | diff --git a/docs/InlineSignRequest.md b/docs/InlineSignRequest.md index 8afeda3..490d7d0 100644 --- a/docs/InlineSignRequest.md +++ b/docs/InlineSignRequest.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **is_being_prepared** | **BOOLEAN** | Have the sender of a SignRequest prepare the document before sending the request out, see: [prepare using the web interface](#section/Preparing-a-document/Prepare-using-the-web-interface) | [optional] **prepare_url** | **String** | | [optional] **redirect_url** | **String** | URL at which SignRequest will redirect to when a document is signed | [optional] +**redirect_url_declined** | **String** | URL at which SignRequest will redirect to when a document is declined | [optional] **required_attachments** | [**Array<RequiredAttachment>**](RequiredAttachment.md) | | [optional] **disable_attachments** | **BOOLEAN** | Disable uploading/adding of attachments | [optional] **disable_text_signatures** | **BOOLEAN** | Disable usage of signatures generated by typing (text) | [optional] @@ -15,6 +16,8 @@ Name | Type | Description | Notes **disable_date** | **BOOLEAN** | Disable adding of dates | [optional] **disable_emails** | **BOOLEAN** | Disable all SignRequest status emails as well as the email that contains the signed documents | [optional] **disable_upload_signatures** | **BOOLEAN** | Disable usage of uploaded signatures (images) | [optional] +**disable_blockchain_proof** | **BOOLEAN** | Disables storing timestamp proof hashes in blockchain integrations. | [optional] +**text_message_verification_locked** | **BOOLEAN** | When true a text message verification is needed before the signer can see the document | [optional] **subject** | **String** | Subject of SignRequest email | [optional] **message** | **String** | Message to include in SignRequest email, may contain the following html tags: `a`, `abbr`, `acronym`, `b`, `blockquote`, `code`, `em`, `i`, `ul`, `li`, `ol`, and `strong` | [optional] **who** | **String** | `m`: only me, `mo`: me and others, `o`: only others | [optional] diff --git a/docs/SignRequest.md b/docs/SignRequest.md index 201bcad..580a60a 100644 --- a/docs/SignRequest.md +++ b/docs/SignRequest.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **is_being_prepared** | **BOOLEAN** | Have the sender of a SignRequest prepare the document before sending the request out, see: [prepare using the web interface](#section/Preparing-a-document/Prepare-using-the-web-interface) | [optional] **prepare_url** | **String** | | [optional] **redirect_url** | **String** | URL at which SignRequest will redirect to when a document is signed | [optional] +**redirect_url_declined** | **String** | URL at which SignRequest will redirect to when a document is declined | [optional] **required_attachments** | [**Array<RequiredAttachment>**](RequiredAttachment.md) | Attachments that signers are required to upload | [optional] **disable_attachments** | **BOOLEAN** | Disable uploading/adding of attachments | [optional] **disable_text_signatures** | **BOOLEAN** | Disable usage of signatures generated by typing (text) | [optional] @@ -15,9 +16,11 @@ Name | Type | Description | Notes **disable_date** | **BOOLEAN** | Disable adding of dates | [optional] **disable_emails** | **BOOLEAN** | Disable all SignRequest status emails as well as the email that contains the signed documents | [optional] **disable_upload_signatures** | **BOOLEAN** | Disable usage of uploaded signatures (images) | [optional] +**disable_blockchain_proof** | **BOOLEAN** | Disables storing timestamp proof hashes in blockchain integrations. | [optional] +**text_message_verification_locked** | **BOOLEAN** | When true a text message verification is needed before the signer can see the document | [optional] **subject** | **String** | Subject of SignRequest email | [optional] **message** | **String** | Message to include in SignRequest email, may contain the following html tags: `a`, `abbr`, `acronym`, `b`, `blockquote`, `code`, `em`, `i`, `ul`, `li`, `ol`, and `strong` | [optional] -**who** | **String** | `m`: only me, `mo`: me and others, `o`: only others | [optional] [default to "o"] +**who** | **String** | `m`: only me, `mo`: me and others, `o`: only others | [optional] [default to 'o'] **send_reminders** | **BOOLEAN** | Automatically remind signers to sign a document | [optional] **signers** | [**Array<Signer>**](Signer.md) | | **uuid** | **String** | | [optional] diff --git a/docs/SignRequestQuickCreate.md b/docs/SignRequestQuickCreate.md index 44737ed..0047054 100644 --- a/docs/SignRequestQuickCreate.md +++ b/docs/SignRequestQuickCreate.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **is_being_prepared** | **BOOLEAN** | Have the sender of a SignRequest prepare the document before sending the request out, see: [prepare using the web interface](#section/Preparing-a-document/Prepare-using-the-web-interface) | [optional] **prepare_url** | **String** | | [optional] **redirect_url** | **String** | URL at which SignRequest will redirect to when a document is signed | [optional] +**redirect_url_declined** | **String** | URL at which SignRequest will redirect to when a document is declined | [optional] **required_attachments** | [**Array<RequiredAttachment>**](RequiredAttachment.md) | Attachments that signers are required to upload | [optional] **disable_attachments** | **BOOLEAN** | Disable uploading/adding of attachments | [optional] **disable_text_signatures** | **BOOLEAN** | Disable usage of signatures generated by typing (text) | [optional] @@ -15,9 +16,11 @@ Name | Type | Description | Notes **disable_date** | **BOOLEAN** | Disable adding of dates | [optional] **disable_emails** | **BOOLEAN** | Disable all SignRequest status emails as well as the email that contains the signed documents | [optional] **disable_upload_signatures** | **BOOLEAN** | Disable usage of uploaded signatures (images) | [optional] +**disable_blockchain_proof** | **BOOLEAN** | Disables storing timestamp proof hashes in blockchain integrations. | [optional] +**text_message_verification_locked** | **BOOLEAN** | When true a text message verification is needed before the signer can see the document | [optional] **subject** | **String** | Subject of SignRequest email | [optional] **message** | **String** | Message to include in SignRequest email, may contain the following html tags: `a`, `abbr`, `acronym`, `b`, `blockquote`, `code`, `em`, `i`, `ul`, `li`, `ol`, and `strong` | [optional] -**who** | **String** | `m`: only me, `mo`: me and others, `o`: only others | [optional] [default to "o"] +**who** | **String** | `m`: only me, `mo`: me and others, `o`: only others | [optional] [default to 'o'] **send_reminders** | **BOOLEAN** | Automatically remind signers to sign a document | [optional] **signers** | [**Array<Signer>**](Signer.md) | | **uuid** | **String** | | [optional] @@ -38,5 +41,6 @@ Name | Type | Description | Notes **integrations** | [**Array<InlineIntegrationData>**](InlineIntegrationData.md) | | [optional] **file_from_sf** | [**FileFromSf**](FileFromSf.md) | | [optional] **auto_delete_days** | **Integer** | Number of days after which a finished document (signed/cancelled/declined) will be automatically deleted | [optional] +**auto_expire_days** | **Integer** | Number of days after which a non finished document will be automatically expired | [optional] diff --git a/docs/Signer.md b/docs/Signer.md index 3d360e5..f374055 100644 --- a/docs/Signer.md +++ b/docs/Signer.md @@ -31,10 +31,13 @@ Name | Type | Description | Notes **message** | **String** | | [optional] **embed_url_user_id** | **String** | | [optional] **inputs** | [**Array<SignerInputs>**](SignerInputs.md) | | [optional] +**use_stamp_for_approve_only** | **BOOLEAN** | Place an approval stamp on a document when a signer approves a document | [optional] **embed_url** | **String** | | [optional] **attachments** | [**Array<SignerAttachment>**](SignerAttachment.md) | | [optional] **redirect_url** | **String** | | [optional] +**redirect_url_declined** | **String** | | [optional] **after_document** | **String** | | [optional] **integrations** | [**Array<InlineDocumentSignerIntegrationData>**](InlineDocumentSignerIntegrationData.md) | | [optional] +**password** | **String** | Require the signer to enter this password before signing a document. This field is write only. | [optional] diff --git a/docs/SignrequestsApi.md b/docs/SignrequestsApi.md index a40af1b..ed1e127 100644 --- a/docs/SignrequestsApi.md +++ b/docs/SignrequestsApi.md @@ -32,7 +32,7 @@ end api_instance = SignRequestClient::SignrequestsApi.new -uuid = "uuid_example" # String | +uuid = 'uuid_example' # String | begin @@ -141,8 +141,8 @@ end api_instance = SignRequestClient::SignrequestsApi.new opts = { - who: "who_example", # String | - from_email: "from_email_example", # String | + who: 'who_example', # String | + from_email: 'from_email_example', # String | page: 56, # Integer | A page number within the paginated result set. limit: 56 # Integer | Number of results to return per page. } @@ -201,7 +201,7 @@ end api_instance = SignRequestClient::SignrequestsApi.new -uuid = "uuid_example" # String | +uuid = 'uuid_example' # String | begin @@ -255,7 +255,7 @@ end api_instance = SignRequestClient::SignrequestsApi.new -uuid = "uuid_example" # String | +uuid = 'uuid_example' # String | begin diff --git a/docs/Team.md b/docs/Team.md index 3257087..1b92f8f 100644 --- a/docs/Team.md +++ b/docs/Team.md @@ -11,5 +11,7 @@ Name | Type | Description | Notes **primary_color** | **String** | | [optional] **events_callback_url** | **String** | | [optional] **members** | [**Array<InlineTeamMember>**](InlineTeamMember.md) | | [optional] +**delete_after** | **DateTime** | When filled this team will be deleted after this date | [optional] +**sandbox** | **BOOLEAN** | Indicates whether team is in Sandbox mode | [optional] diff --git a/docs/TeamMember.md b/docs/TeamMember.md index 86aa81d..e767b8a 100644 --- a/docs/TeamMember.md +++ b/docs/TeamMember.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes **uuid** | **String** | | [optional] **url** | **String** | | [optional] **user** | [**User**](User.md) | | [optional] +**team** | [**DocumentTeam**](DocumentTeam.md) | | [optional] **is_admin** | **BOOLEAN** | | [optional] **is_active** | **BOOLEAN** | | [optional] **is_owner** | **BOOLEAN** | | [optional] diff --git a/docs/TeamMembersApi.md b/docs/TeamMembersApi.md index e09d078..ac62404 100644 --- a/docs/TeamMembersApi.md +++ b/docs/TeamMembersApi.md @@ -30,12 +30,12 @@ end api_instance = SignRequestClient::TeamMembersApi.new opts = { - is_active: "is_active_example", # String | - is_owner: "is_owner_example", # String | - is_admin: "is_admin_example", # String | - user__email: "user__email_example", # String | - user__first_name: "user__first_name_example", # String | - user__last_name: "user__last_name_example", # String | + is_active: 'is_active_example', # String | + is_owner: 'is_owner_example', # String | + is_admin: 'is_admin_example', # String | + user__email: 'user__email_example', # String | + user__first_name: 'user__first_name_example', # String | + user__last_name: 'user__last_name_example', # String | page: 56, # Integer | A page number within the paginated result set. limit: 56 # Integer | Number of results to return per page. } @@ -98,7 +98,7 @@ end api_instance = SignRequestClient::TeamMembersApi.new -uuid = "uuid_example" # String | +uuid = 'uuid_example' # String | begin diff --git a/docs/TeamsApi.md b/docs/TeamsApi.md index 87a346d..9ae7cd2 100644 --- a/docs/TeamsApi.md +++ b/docs/TeamsApi.md @@ -5,6 +5,7 @@ All URIs are relative to *https://signrequest.com/api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- [**teams_create**](TeamsApi.md#teams_create) | **POST** /teams/ | Create a Team +[**teams_delete**](TeamsApi.md#teams_delete) | **DELETE** /teams/{subdomain}/ | Delete a Team [**teams_invite_member**](TeamsApi.md#teams_invite_member) | **POST** /teams/{subdomain}/invite_member/ | Invite a Team Member [**teams_list**](TeamsApi.md#teams_list) | **GET** /teams/ | Retrieve a list of Teams [**teams_partial_update**](TeamsApi.md#teams_partial_update) | **PATCH** /teams/{subdomain}/ | Update a Team @@ -65,6 +66,59 @@ Name | Type | Description | Notes +# **teams_delete** +> teams_delete(subdomain, ) + +Delete a Team + +Required fields are **name** and **subdomain** where the subdomain is globally unique. Use **POST** to create a Team. To update a field on a Team use **PATCH**. To use the API on behalf of a particular team change the endpoint to: *https://**{{ subdomain }}**.signrequest.com/api/v1/...* To invite new team members you can use **POST** {\"email\":\"**email-of-member-to-invite@example.com**\",\"is_admin\":false,\"is_owner\":false} to: *https://signrequest.com/api/v1/teams/**{{ subdomain }}**/invite_member/* + +### Example +```ruby +# load the gem +require 'signrequest_client' +# setup authorization +SignRequestClient.configure do |config| + # Configure API key authorization: Token + config.api_key['Authorization'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['Authorization'] = 'Bearer' +end + +api_instance = SignRequestClient::TeamsApi.new + +subdomain = 'subdomain_example' # String | + + +begin + #Delete a Team + api_instance.teams_delete(subdomain, ) +rescue SignRequestClient::ApiError => e + puts "Exception when calling TeamsApi->teams_delete: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **subdomain** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + # **teams_invite_member** > InviteMember teams_invite_member(subdomain, data) @@ -86,7 +140,7 @@ end api_instance = SignRequestClient::TeamsApi.new -subdomain = "subdomain_example" # String | +subdomain = 'subdomain_example' # String | data = SignRequestClient::InviteMember.new # InviteMember | @@ -200,7 +254,7 @@ end api_instance = SignRequestClient::TeamsApi.new -subdomain = "subdomain_example" # String | +subdomain = 'subdomain_example' # String | data = SignRequestClient::Team.new # Team | @@ -257,7 +311,7 @@ end api_instance = SignRequestClient::TeamsApi.new -subdomain = "subdomain_example" # String | +subdomain = 'subdomain_example' # String | begin diff --git a/docs/Template.md b/docs/Template.md index 9a1f010..7555943 100644 --- a/docs/Template.md +++ b/docs/Template.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **name** | **String** | Defaults to filename | [optional] **uuid** | **String** | | [optional] **user** | [**User**](User.md) | | [optional] +**team** | [**DocumentTeam**](DocumentTeam.md) | | [optional] **who** | **String** | `m`: only me, `mo`: me and others, `o`: only others | [optional] **signers** | [**Array<DocumentSignerTemplateConf>**](DocumentSignerTemplateConf.md) | | [optional] diff --git a/docs/TemplatesApi.md b/docs/TemplatesApi.md index 52e5431..6b98476 100644 --- a/docs/TemplatesApi.md +++ b/docs/TemplatesApi.md @@ -86,7 +86,7 @@ end api_instance = SignRequestClient::TemplatesApi.new -uuid = "uuid_example" # String | +uuid = 'uuid_example' # String | begin diff --git a/docs/WebhookSubscription.md b/docs/WebhookSubscription.md index 4e5c0bc..920cb65 100644 --- a/docs/WebhookSubscription.md +++ b/docs/WebhookSubscription.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **event_type** | **String** | | **callback_url** | **String** | | **integration** | **String** | | [optional] +**team** | [**DocumentTeam**](DocumentTeam.md) | | [optional] **created** | **DateTime** | | [optional] diff --git a/docs/WebhooksApi.md b/docs/WebhooksApi.md index 3d06b66..ddbcc33 100644 --- a/docs/WebhooksApi.md +++ b/docs/WebhooksApi.md @@ -87,7 +87,7 @@ end api_instance = SignRequestClient::WebhooksApi.new -uuid = "uuid_example" # String | +uuid = 'uuid_example' # String | begin @@ -197,7 +197,7 @@ end api_instance = SignRequestClient::WebhooksApi.new -uuid = "uuid_example" # String | +uuid = 'uuid_example' # String | data = SignRequestClient::WebhookSubscription.new # WebhookSubscription | @@ -254,7 +254,7 @@ end api_instance = SignRequestClient::WebhooksApi.new -uuid = "uuid_example" # String | +uuid = 'uuid_example' # String | begin @@ -308,7 +308,7 @@ end api_instance = SignRequestClient::WebhooksApi.new -uuid = "uuid_example" # String | +uuid = 'uuid_example' # String | data = SignRequestClient::WebhookSubscription.new # WebhookSubscription | diff --git a/lib/signrequest_client.rb b/lib/signrequest_client.rb index ba36ac6..07ec9e6 100644 --- a/lib/signrequest_client.rb +++ b/lib/signrequest_client.rb @@ -6,7 +6,7 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end @@ -22,6 +22,9 @@ require 'signrequest_client/models/document_attachment' require 'signrequest_client/models/document_search' require 'signrequest_client/models/document_signer_template_conf' +require 'signrequest_client/models/document_signing_log' +require 'signrequest_client/models/document_signrequest' +require 'signrequest_client/models/document_team' require 'signrequest_client/models/event' require 'signrequest_client/models/file_from_sf' require 'signrequest_client/models/inline_document_signer_integration_data' diff --git a/lib/signrequest_client/api/api_tokens_api.rb b/lib/signrequest_client/api/api_tokens_api.rb index ad0bfce..2fa7bbe 100644 --- a/lib/signrequest_client/api/api_tokens_api.rb +++ b/lib/signrequest_client/api/api_tokens_api.rb @@ -6,11 +6,11 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end -require "uri" +require 'uri' module SignRequestClient class ApiTokensApi @@ -19,116 +19,6 @@ class ApiTokensApi def initialize(api_client = ApiClient.default) @api_client = api_client end - - # Create an API token - # You can create an API token in the [team api settings page](/#/teams). It is also possible to get or create a token using the REST api with your login credentials. - # @param data - # @param [Hash] opts the optional parameters - # @return [AuthToken] - def api_tokens_create(data, opts = {}) - data, _status_code, _headers = api_tokens_create_with_http_info(data, opts) - return data - end - - # Create an API token - # You can create an API token in the [team api settings page](/#/teams). It is also possible to get or create a token using the REST api with your login credentials. - # @param data - # @param [Hash] opts the optional parameters - # @return [Array<(AuthToken, Fixnum, Hash)>] AuthToken data, response status code and response headers - def api_tokens_create_with_http_info(data, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: ApiTokensApi.api_tokens_create ..." - end - # verify the required parameter 'data' is set - if @api_client.config.client_side_validation && data.nil? - fail ArgumentError, "Missing the required parameter 'data' when calling ApiTokensApi.api_tokens_create" - end - # resource path - local_var_path = "/api-tokens/" - - # query parameters - query_params = {} - - # header parameters - header_params = {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = {} - - # http body (model) - post_body = @api_client.object_to_http_body(data) - auth_names = ['Token'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => 'AuthToken') - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ApiTokensApi#api_tokens_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Delete an API token - # - # @param key A unique value identifying this api token. - # @param [Hash] opts the optional parameters - # @return [nil] - def api_tokens_delete(key, opts = {}) - api_tokens_delete_with_http_info(key, opts) - return nil - end - - # Delete an API token - # - # @param key A unique value identifying this api token. - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def api_tokens_delete_with_http_info(key, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: ApiTokensApi.api_tokens_delete ..." - end - # verify the required parameter 'key' is set - if @api_client.config.client_side_validation && key.nil? - fail ArgumentError, "Missing the required parameter 'key' when calling ApiTokensApi.api_tokens_delete" - end - # resource path - local_var_path = "/api-tokens/{key}/".sub('{' + 'key' + '}', key.to_s) - - # query parameters - query_params = {} - - # header parameters - header_params = {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = {} - - # http body (model) - post_body = nil - auth_names = ['Token'] - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ApiTokensApi#api_tokens_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Retrieve a list of API tokens # # @param [Hash] opts the optional parameters @@ -137,7 +27,7 @@ def api_tokens_delete_with_http_info(key, opts = {}) # @return [InlineResponse200] def api_tokens_list(opts = {}) data, _status_code, _headers = api_tokens_list_with_http_info(opts) - return data + data end # Retrieve a list of API tokens @@ -148,10 +38,10 @@ def api_tokens_list(opts = {}) # @return [Array<(InlineResponse200, Fixnum, Hash)>] InlineResponse200 data, response status code and response headers def api_tokens_list_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: ApiTokensApi.api_tokens_list ..." + @api_client.config.logger.debug 'Calling API: ApiTokensApi.api_tokens_list ...' end # resource path - local_var_path = "/api-tokens/" + local_var_path = '/api-tokens/' # query parameters query_params = {} @@ -183,60 +73,5 @@ def api_tokens_list_with_http_info(opts = {}) end return data, status_code, headers end - - # Retrieve an API token - # - # @param key A unique value identifying this api token. - # @param [Hash] opts the optional parameters - # @return [AuthToken] - def api_tokens_read(key, opts = {}) - data, _status_code, _headers = api_tokens_read_with_http_info(key, opts) - return data - end - - # Retrieve an API token - # - # @param key A unique value identifying this api token. - # @param [Hash] opts the optional parameters - # @return [Array<(AuthToken, Fixnum, Hash)>] AuthToken data, response status code and response headers - def api_tokens_read_with_http_info(key, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: ApiTokensApi.api_tokens_read ..." - end - # verify the required parameter 'key' is set - if @api_client.config.client_side_validation && key.nil? - fail ArgumentError, "Missing the required parameter 'key' when calling ApiTokensApi.api_tokens_read" - end - # resource path - local_var_path = "/api-tokens/{key}/".sub('{' + 'key' + '}', key.to_s) - - # query parameters - query_params = {} - - # header parameters - header_params = {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = {} - - # http body (model) - post_body = nil - auth_names = ['Token'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => 'AuthToken') - if @api_client.config.debugging - @api_client.config.logger.debug "API called: ApiTokensApi#api_tokens_read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end end end diff --git a/lib/signrequest_client/api/document_attachments_api.rb b/lib/signrequest_client/api/document_attachments_api.rb index d543e10..dd8a53d 100644 --- a/lib/signrequest_client/api/document_attachments_api.rb +++ b/lib/signrequest_client/api/document_attachments_api.rb @@ -6,11 +6,11 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end -require "uri" +require 'uri' module SignRequestClient class DocumentAttachmentsApi @@ -19,7 +19,6 @@ class DocumentAttachmentsApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Create a Document Attachment # # @param data @@ -27,7 +26,7 @@ def initialize(api_client = ApiClient.default) # @return [DocumentAttachment] def document_attachments_create(data, opts = {}) data, _status_code, _headers = document_attachments_create_with_http_info(data, opts) - return data + data end # Create a Document Attachment @@ -37,14 +36,14 @@ def document_attachments_create(data, opts = {}) # @return [Array<(DocumentAttachment, Fixnum, Hash)>] DocumentAttachment data, response status code and response headers def document_attachments_create_with_http_info(data, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: DocumentAttachmentsApi.document_attachments_create ..." + @api_client.config.logger.debug 'Calling API: DocumentAttachmentsApi.document_attachments_create ...' end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling DocumentAttachmentsApi.document_attachments_create" end # resource path - local_var_path = "/document-attachments/" + local_var_path = '/document-attachments/' # query parameters query_params = {} @@ -74,7 +73,6 @@ def document_attachments_create_with_http_info(data, opts = {}) end return data, status_code, headers end - # Retrieve a list of Document Attachments # # @param [Hash] opts the optional parameters @@ -86,7 +84,7 @@ def document_attachments_create_with_http_info(data, opts = {}) # @return [InlineResponse2001] def document_attachments_list(opts = {}) data, _status_code, _headers = document_attachments_list_with_http_info(opts) - return data + data end # Retrieve a list of Document Attachments @@ -100,10 +98,10 @@ def document_attachments_list(opts = {}) # @return [Array<(InlineResponse2001, Fixnum, Hash)>] InlineResponse2001 data, response status code and response headers def document_attachments_list_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: DocumentAttachmentsApi.document_attachments_list ..." + @api_client.config.logger.debug 'Calling API: DocumentAttachmentsApi.document_attachments_list ...' end # resource path - local_var_path = "/document-attachments/" + local_var_path = '/document-attachments/' # query parameters query_params = {} @@ -138,7 +136,6 @@ def document_attachments_list_with_http_info(opts = {}) end return data, status_code, headers end - # Retrieve a Document Attachment # # @param uuid @@ -146,7 +143,7 @@ def document_attachments_list_with_http_info(opts = {}) # @return [DocumentAttachment] def document_attachments_read(uuid, opts = {}) data, _status_code, _headers = document_attachments_read_with_http_info(uuid, opts) - return data + data end # Retrieve a Document Attachment @@ -156,14 +153,14 @@ def document_attachments_read(uuid, opts = {}) # @return [Array<(DocumentAttachment, Fixnum, Hash)>] DocumentAttachment data, response status code and response headers def document_attachments_read_with_http_info(uuid, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: DocumentAttachmentsApi.document_attachments_read ..." + @api_client.config.logger.debug 'Calling API: DocumentAttachmentsApi.document_attachments_read ...' end # verify the required parameter 'uuid' is set if @api_client.config.client_side_validation && uuid.nil? fail ArgumentError, "Missing the required parameter 'uuid' when calling DocumentAttachmentsApi.document_attachments_read" end # resource path - local_var_path = "/document-attachments/{uuid}/".sub('{' + 'uuid' + '}', uuid.to_s) + local_var_path = '/document-attachments/{uuid}/'.sub('{' + 'uuid' + '}', uuid.to_s) # query parameters query_params = {} diff --git a/lib/signrequest_client/api/documents_api.rb b/lib/signrequest_client/api/documents_api.rb index cc66d45..21577a3 100644 --- a/lib/signrequest_client/api/documents_api.rb +++ b/lib/signrequest_client/api/documents_api.rb @@ -6,11 +6,11 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end -require "uri" +require 'uri' module SignRequestClient class DocumentsApi @@ -19,7 +19,6 @@ class DocumentsApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Create a Document # # @param data @@ -27,7 +26,7 @@ def initialize(api_client = ApiClient.default) # @return [Document] def documents_create(data, opts = {}) data, _status_code, _headers = documents_create_with_http_info(data, opts) - return data + data end # Create a Document @@ -37,14 +36,14 @@ def documents_create(data, opts = {}) # @return [Array<(Document, Fixnum, Hash)>] Document data, response status code and response headers def documents_create_with_http_info(data, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: DocumentsApi.documents_create ..." + @api_client.config.logger.debug 'Calling API: DocumentsApi.documents_create ...' end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling DocumentsApi.documents_create" end # resource path - local_var_path = "/documents/" + local_var_path = '/documents/' # query parameters query_params = {} @@ -74,7 +73,6 @@ def documents_create_with_http_info(data, opts = {}) end return data, status_code, headers end - # Delete a Document # # @param uuid @@ -82,7 +80,7 @@ def documents_create_with_http_info(data, opts = {}) # @return [nil] def documents_delete(uuid, opts = {}) documents_delete_with_http_info(uuid, opts) - return nil + nil end # Delete a Document @@ -92,14 +90,14 @@ def documents_delete(uuid, opts = {}) # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def documents_delete_with_http_info(uuid, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: DocumentsApi.documents_delete ..." + @api_client.config.logger.debug 'Calling API: DocumentsApi.documents_delete ...' end # verify the required parameter 'uuid' is set if @api_client.config.client_side_validation && uuid.nil? fail ArgumentError, "Missing the required parameter 'uuid' when calling DocumentsApi.documents_delete" end # resource path - local_var_path = "/documents/{uuid}/".sub('{' + 'uuid' + '}', uuid.to_s) + local_var_path = '/documents/{uuid}/'.sub('{' + 'uuid' + '}', uuid.to_s) # query parameters query_params = {} @@ -128,7 +126,6 @@ def documents_delete_with_http_info(uuid, opts = {}) end return data, status_code, headers end - # Retrieve a list of Documents # # @param [Hash] opts the optional parameters @@ -146,7 +143,7 @@ def documents_delete_with_http_info(uuid, opts = {}) # @return [InlineResponse2003] def documents_list(opts = {}) data, _status_code, _headers = documents_list_with_http_info(opts) - return data + data end # Retrieve a list of Documents @@ -166,10 +163,10 @@ def documents_list(opts = {}) # @return [Array<(InlineResponse2003, Fixnum, Hash)>] InlineResponse2003 data, response status code and response headers def documents_list_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: DocumentsApi.documents_list ..." + @api_client.config.logger.debug 'Calling API: DocumentsApi.documents_list ...' end # resource path - local_var_path = "/documents/" + local_var_path = '/documents/' # query parameters query_params = {} @@ -210,7 +207,6 @@ def documents_list_with_http_info(opts = {}) end return data, status_code, headers end - # Retrieve a Document # # @param uuid @@ -218,7 +214,7 @@ def documents_list_with_http_info(opts = {}) # @return [Document] def documents_read(uuid, opts = {}) data, _status_code, _headers = documents_read_with_http_info(uuid, opts) - return data + data end # Retrieve a Document @@ -228,14 +224,14 @@ def documents_read(uuid, opts = {}) # @return [Array<(Document, Fixnum, Hash)>] Document data, response status code and response headers def documents_read_with_http_info(uuid, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: DocumentsApi.documents_read ..." + @api_client.config.logger.debug 'Calling API: DocumentsApi.documents_read ...' end # verify the required parameter 'uuid' is set if @api_client.config.client_side_validation && uuid.nil? fail ArgumentError, "Missing the required parameter 'uuid' when calling DocumentsApi.documents_read" end # resource path - local_var_path = "/documents/{uuid}/".sub('{' + 'uuid' + '}', uuid.to_s) + local_var_path = '/documents/{uuid}/'.sub('{' + 'uuid' + '}', uuid.to_s) # query parameters query_params = {} diff --git a/lib/signrequest_client/api/documents_search_api.rb b/lib/signrequest_client/api/documents_search_api.rb index 2313eee..5764d9d 100644 --- a/lib/signrequest_client/api/documents_search_api.rb +++ b/lib/signrequest_client/api/documents_search_api.rb @@ -6,11 +6,11 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end -require "uri" +require 'uri' module SignRequestClient class DocumentsSearchApi @@ -19,7 +19,6 @@ class DocumentsSearchApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Search documents # Search interface for fast (autocomplete) searching of documents. This can be useful to have your users search for a document in your interface. Document names are tokenized on whitespace, hyphens and underscores to also match partial document names. *Normal search:* - ?**q**={{query}} *Autocomplete search:* - ?**autocomplete**={{partial query}} *Search in document name:* - ?**name**={{query}} *Available (extra) filters:* - ?**subdomain**={{ team_subdomain }} or use this endpoint with team_subdomain.signrequest.com (when not provided only personal documents are shown) - ?**signer_emails**={{ signer@email.com }} (will filter documents that an email needed to sign/approve) - ?**status**={{ si }} - ?**who**={{ mo }} To include multiple values for a filter field separate the values with a pipe (|). For example to only search for completed documents use **status=se|vi** (sent and viewed). *Pagination:* - ?**page**={{ page_number: default 1 }} - ?**limit**={{ limit results: default 10, max 100 }} *Format:* By default json is returned, to export data as csv or xls use the format parameter. - ?**format**=csv - ?**format**=xls For csv and xls the data can also be exported with each signer on a separate row. In this mode also the signer inputs that have an *external_id* specified on a tag will be exported. All external_id's found will be exported as columns. To use this mode add the **signer_data** parameter. - ?**format**=csv&**signer_data**=1 - ?**format**=xls&**signer_data**=1 Note that all documents are only ordered by **created** (newest first) when **q**, **autocomplete** or **name** are not used, else they are ordered by the strenght of the match. # @param [Hash] opts the optional parameters @@ -37,7 +36,7 @@ def initialize(api_client = ApiClient.default) # @return [InlineResponse2002] def documents_search_list(opts = {}) data, _status_code, _headers = documents_search_list_with_http_info(opts) - return data + data end # Search documents @@ -57,10 +56,10 @@ def documents_search_list(opts = {}) # @return [Array<(InlineResponse2002, Fixnum, Hash)>] InlineResponse2002 data, response status code and response headers def documents_search_list_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: DocumentsSearchApi.documents_search_list ..." + @api_client.config.logger.debug 'Calling API: DocumentsSearchApi.documents_search_list ...' end # resource path - local_var_path = "/documents-search/" + local_var_path = '/documents-search/' # query parameters query_params = {} diff --git a/lib/signrequest_client/api/events_api.rb b/lib/signrequest_client/api/events_api.rb index 8e540f9..dfd7d29 100644 --- a/lib/signrequest_client/api/events_api.rb +++ b/lib/signrequest_client/api/events_api.rb @@ -6,11 +6,11 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end -require "uri" +require 'uri' module SignRequestClient class EventsApi @@ -19,7 +19,6 @@ class EventsApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Retrieve a list of Events # # @param [Hash] opts the optional parameters @@ -41,7 +40,7 @@ def initialize(api_client = ApiClient.default) # @return [InlineResponse2004] def events_list(opts = {}) data, _status_code, _headers = events_list_with_http_info(opts) - return data + data end # Retrieve a list of Events @@ -65,10 +64,10 @@ def events_list(opts = {}) # @return [Array<(InlineResponse2004, Fixnum, Hash)>] InlineResponse2004 data, response status code and response headers def events_list_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: EventsApi.events_list ..." + @api_client.config.logger.debug 'Calling API: EventsApi.events_list ...' end # resource path - local_var_path = "/events/" + local_var_path = '/events/' # query parameters query_params = {} @@ -113,7 +112,6 @@ def events_list_with_http_info(opts = {}) end return data, status_code, headers end - # Retrieve an Event # # @param id A unique integer value identifying this event. @@ -121,7 +119,7 @@ def events_list_with_http_info(opts = {}) # @return [Event] def events_read(id, opts = {}) data, _status_code, _headers = events_read_with_http_info(id, opts) - return data + data end # Retrieve an Event @@ -131,14 +129,14 @@ def events_read(id, opts = {}) # @return [Array<(Event, Fixnum, Hash)>] Event data, response status code and response headers def events_read_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: EventsApi.events_read ..." + @api_client.config.logger.debug 'Calling API: EventsApi.events_read ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling EventsApi.events_read" end # resource path - local_var_path = "/events/{id}/".sub('{' + 'id' + '}', id.to_s) + local_var_path = '/events/{id}/'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} diff --git a/lib/signrequest_client/api/signrequest_quick_create_api.rb b/lib/signrequest_client/api/signrequest_quick_create_api.rb index 40f2c23..2052614 100644 --- a/lib/signrequest_client/api/signrequest_quick_create_api.rb +++ b/lib/signrequest_client/api/signrequest_quick_create_api.rb @@ -6,11 +6,11 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end -require "uri" +require 'uri' module SignRequestClient class SignrequestQuickCreateApi @@ -19,7 +19,6 @@ class SignrequestQuickCreateApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Quick create a SignRequest # # @param data @@ -27,7 +26,7 @@ def initialize(api_client = ApiClient.default) # @return [SignRequestQuickCreate] def signrequest_quick_create_create(data, opts = {}) data, _status_code, _headers = signrequest_quick_create_create_with_http_info(data, opts) - return data + data end # Quick create a SignRequest @@ -37,14 +36,14 @@ def signrequest_quick_create_create(data, opts = {}) # @return [Array<(SignRequestQuickCreate, Fixnum, Hash)>] SignRequestQuickCreate data, response status code and response headers def signrequest_quick_create_create_with_http_info(data, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: SignrequestQuickCreateApi.signrequest_quick_create_create ..." + @api_client.config.logger.debug 'Calling API: SignrequestQuickCreateApi.signrequest_quick_create_create ...' end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling SignrequestQuickCreateApi.signrequest_quick_create_create" end # resource path - local_var_path = "/signrequest-quick-create/" + local_var_path = '/signrequest-quick-create/' # query parameters query_params = {} diff --git a/lib/signrequest_client/api/signrequests_api.rb b/lib/signrequest_client/api/signrequests_api.rb index 887ad7f..8b6d5ca 100644 --- a/lib/signrequest_client/api/signrequests_api.rb +++ b/lib/signrequest_client/api/signrequests_api.rb @@ -6,11 +6,11 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end -require "uri" +require 'uri' module SignRequestClient class SignrequestsApi @@ -19,7 +19,6 @@ class SignrequestsApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Cancel a SignRequest # # @param uuid @@ -27,7 +26,7 @@ def initialize(api_client = ApiClient.default) # @return [InlineResponse201] def signrequests_cancel_signrequest(uuid, opts = {}) data, _status_code, _headers = signrequests_cancel_signrequest_with_http_info(uuid, opts) - return data + data end # Cancel a SignRequest @@ -37,14 +36,14 @@ def signrequests_cancel_signrequest(uuid, opts = {}) # @return [Array<(InlineResponse201, Fixnum, Hash)>] InlineResponse201 data, response status code and response headers def signrequests_cancel_signrequest_with_http_info(uuid, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: SignrequestsApi.signrequests_cancel_signrequest ..." + @api_client.config.logger.debug 'Calling API: SignrequestsApi.signrequests_cancel_signrequest ...' end # verify the required parameter 'uuid' is set if @api_client.config.client_side_validation && uuid.nil? fail ArgumentError, "Missing the required parameter 'uuid' when calling SignrequestsApi.signrequests_cancel_signrequest" end # resource path - local_var_path = "/signrequests/{uuid}/cancel_signrequest/".sub('{' + 'uuid' + '}', uuid.to_s) + local_var_path = '/signrequests/{uuid}/cancel_signrequest/'.sub('{' + 'uuid' + '}', uuid.to_s) # query parameters query_params = {} @@ -74,7 +73,6 @@ def signrequests_cancel_signrequest_with_http_info(uuid, opts = {}) end return data, status_code, headers end - # Create a SignRequest # # @param data @@ -82,7 +80,7 @@ def signrequests_cancel_signrequest_with_http_info(uuid, opts = {}) # @return [SignRequest] def signrequests_create(data, opts = {}) data, _status_code, _headers = signrequests_create_with_http_info(data, opts) - return data + data end # Create a SignRequest @@ -92,14 +90,14 @@ def signrequests_create(data, opts = {}) # @return [Array<(SignRequest, Fixnum, Hash)>] SignRequest data, response status code and response headers def signrequests_create_with_http_info(data, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: SignrequestsApi.signrequests_create ..." + @api_client.config.logger.debug 'Calling API: SignrequestsApi.signrequests_create ...' end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling SignrequestsApi.signrequests_create" end # resource path - local_var_path = "/signrequests/" + local_var_path = '/signrequests/' # query parameters query_params = {} @@ -129,7 +127,6 @@ def signrequests_create_with_http_info(data, opts = {}) end return data, status_code, headers end - # Retrieve a list of SignRequests # # @param [Hash] opts the optional parameters @@ -140,7 +137,7 @@ def signrequests_create_with_http_info(data, opts = {}) # @return [InlineResponse2005] def signrequests_list(opts = {}) data, _status_code, _headers = signrequests_list_with_http_info(opts) - return data + data end # Retrieve a list of SignRequests @@ -153,10 +150,10 @@ def signrequests_list(opts = {}) # @return [Array<(InlineResponse2005, Fixnum, Hash)>] InlineResponse2005 data, response status code and response headers def signrequests_list_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: SignrequestsApi.signrequests_list ..." + @api_client.config.logger.debug 'Calling API: SignrequestsApi.signrequests_list ...' end # resource path - local_var_path = "/signrequests/" + local_var_path = '/signrequests/' # query parameters query_params = {} @@ -190,7 +187,6 @@ def signrequests_list_with_http_info(opts = {}) end return data, status_code, headers end - # Retrieve a SignRequest # # @param uuid @@ -198,7 +194,7 @@ def signrequests_list_with_http_info(opts = {}) # @return [SignRequest] def signrequests_read(uuid, opts = {}) data, _status_code, _headers = signrequests_read_with_http_info(uuid, opts) - return data + data end # Retrieve a SignRequest @@ -208,14 +204,14 @@ def signrequests_read(uuid, opts = {}) # @return [Array<(SignRequest, Fixnum, Hash)>] SignRequest data, response status code and response headers def signrequests_read_with_http_info(uuid, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: SignrequestsApi.signrequests_read ..." + @api_client.config.logger.debug 'Calling API: SignrequestsApi.signrequests_read ...' end # verify the required parameter 'uuid' is set if @api_client.config.client_side_validation && uuid.nil? fail ArgumentError, "Missing the required parameter 'uuid' when calling SignrequestsApi.signrequests_read" end # resource path - local_var_path = "/signrequests/{uuid}/".sub('{' + 'uuid' + '}', uuid.to_s) + local_var_path = '/signrequests/{uuid}/'.sub('{' + 'uuid' + '}', uuid.to_s) # query parameters query_params = {} @@ -245,7 +241,6 @@ def signrequests_read_with_http_info(uuid, opts = {}) end return data, status_code, headers end - # Resend a SignRequest # # @param uuid @@ -253,7 +248,7 @@ def signrequests_read_with_http_info(uuid, opts = {}) # @return [InlineResponse2011] def signrequests_resend_signrequest_email(uuid, opts = {}) data, _status_code, _headers = signrequests_resend_signrequest_email_with_http_info(uuid, opts) - return data + data end # Resend a SignRequest @@ -263,14 +258,14 @@ def signrequests_resend_signrequest_email(uuid, opts = {}) # @return [Array<(InlineResponse2011, Fixnum, Hash)>] InlineResponse2011 data, response status code and response headers def signrequests_resend_signrequest_email_with_http_info(uuid, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: SignrequestsApi.signrequests_resend_signrequest_email ..." + @api_client.config.logger.debug 'Calling API: SignrequestsApi.signrequests_resend_signrequest_email ...' end # verify the required parameter 'uuid' is set if @api_client.config.client_side_validation && uuid.nil? fail ArgumentError, "Missing the required parameter 'uuid' when calling SignrequestsApi.signrequests_resend_signrequest_email" end # resource path - local_var_path = "/signrequests/{uuid}/resend_signrequest_email/".sub('{' + 'uuid' + '}', uuid.to_s) + local_var_path = '/signrequests/{uuid}/resend_signrequest_email/'.sub('{' + 'uuid' + '}', uuid.to_s) # query parameters query_params = {} diff --git a/lib/signrequest_client/api/team_members_api.rb b/lib/signrequest_client/api/team_members_api.rb index e138977..d755a10 100644 --- a/lib/signrequest_client/api/team_members_api.rb +++ b/lib/signrequest_client/api/team_members_api.rb @@ -6,11 +6,11 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end -require "uri" +require 'uri' module SignRequestClient class TeamMembersApi @@ -19,7 +19,6 @@ class TeamMembersApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Retrieve a list of Team Members # # @param [Hash] opts the optional parameters @@ -34,7 +33,7 @@ def initialize(api_client = ApiClient.default) # @return [InlineResponse2006] def team_members_list(opts = {}) data, _status_code, _headers = team_members_list_with_http_info(opts) - return data + data end # Retrieve a list of Team Members @@ -51,10 +50,10 @@ def team_members_list(opts = {}) # @return [Array<(InlineResponse2006, Fixnum, Hash)>] InlineResponse2006 data, response status code and response headers def team_members_list_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: TeamMembersApi.team_members_list ..." + @api_client.config.logger.debug 'Calling API: TeamMembersApi.team_members_list ...' end # resource path - local_var_path = "/team-members/" + local_var_path = '/team-members/' # query parameters query_params = {} @@ -92,7 +91,6 @@ def team_members_list_with_http_info(opts = {}) end return data, status_code, headers end - # Retrieve a Team Member # # @param uuid @@ -100,7 +98,7 @@ def team_members_list_with_http_info(opts = {}) # @return [TeamMember] def team_members_read(uuid, opts = {}) data, _status_code, _headers = team_members_read_with_http_info(uuid, opts) - return data + data end # Retrieve a Team Member @@ -110,14 +108,14 @@ def team_members_read(uuid, opts = {}) # @return [Array<(TeamMember, Fixnum, Hash)>] TeamMember data, response status code and response headers def team_members_read_with_http_info(uuid, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: TeamMembersApi.team_members_read ..." + @api_client.config.logger.debug 'Calling API: TeamMembersApi.team_members_read ...' end # verify the required parameter 'uuid' is set if @api_client.config.client_side_validation && uuid.nil? fail ArgumentError, "Missing the required parameter 'uuid' when calling TeamMembersApi.team_members_read" end # resource path - local_var_path = "/team-members/{uuid}/".sub('{' + 'uuid' + '}', uuid.to_s) + local_var_path = '/team-members/{uuid}/'.sub('{' + 'uuid' + '}', uuid.to_s) # query parameters query_params = {} diff --git a/lib/signrequest_client/api/teams_api.rb b/lib/signrequest_client/api/teams_api.rb index 496fe8a..b44cfd7 100644 --- a/lib/signrequest_client/api/teams_api.rb +++ b/lib/signrequest_client/api/teams_api.rb @@ -6,11 +6,11 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end -require "uri" +require 'uri' module SignRequestClient class TeamsApi @@ -19,7 +19,6 @@ class TeamsApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Create a Team # Required fields are **name** and **subdomain** where the subdomain is globally unique. Use **POST** to create a Team. To update a field on a Team use **PATCH**. To use the API on behalf of a particular team change the endpoint to: *https://**{{ subdomain }}**.signrequest.com/api/v1/...* To invite new team members you can use **POST** {\"email\":\"**email-of-member-to-invite@example.com**\",\"is_admin\":false,\"is_owner\":false} to: *https://signrequest.com/api/v1/teams/**{{ subdomain }}**/invite_member/* # @param data @@ -27,7 +26,7 @@ def initialize(api_client = ApiClient.default) # @return [Team] def teams_create(data, opts = {}) data, _status_code, _headers = teams_create_with_http_info(data, opts) - return data + data end # Create a Team @@ -37,14 +36,14 @@ def teams_create(data, opts = {}) # @return [Array<(Team, Fixnum, Hash)>] Team data, response status code and response headers def teams_create_with_http_info(data, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: TeamsApi.teams_create ..." + @api_client.config.logger.debug 'Calling API: TeamsApi.teams_create ...' end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling TeamsApi.teams_create" end # resource path - local_var_path = "/teams/" + local_var_path = '/teams/' # query parameters query_params = {} @@ -74,7 +73,59 @@ def teams_create_with_http_info(data, opts = {}) end return data, status_code, headers end + # Delete a Team + # Required fields are **name** and **subdomain** where the subdomain is globally unique. Use **POST** to create a Team. To update a field on a Team use **PATCH**. To use the API on behalf of a particular team change the endpoint to: *https://**{{ subdomain }}**.signrequest.com/api/v1/...* To invite new team members you can use **POST** {\"email\":\"**email-of-member-to-invite@example.com**\",\"is_admin\":false,\"is_owner\":false} to: *https://signrequest.com/api/v1/teams/**{{ subdomain }}**/invite_member/* + # @param subdomain + # @param [Hash] opts the optional parameters + # @return [nil] + def teams_delete(subdomain, opts = {}) + teams_delete_with_http_info(subdomain, opts) + nil + end + + # Delete a Team + # Required fields are **name** and **subdomain** where the subdomain is globally unique. Use **POST** to create a Team. To update a field on a Team use **PATCH**. To use the API on behalf of a particular team change the endpoint to: *https://**{{ subdomain }}**.signrequest.com/api/v1/...* To invite new team members you can use **POST** {\"email\":\"**email-of-member-to-invite@example.com**\",\"is_admin\":false,\"is_owner\":false} to: *https://signrequest.com/api/v1/teams/**{{ subdomain }}**/invite_member/* + # @param subdomain + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def teams_delete_with_http_info(subdomain, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TeamsApi.teams_delete ...' + end + # verify the required parameter 'subdomain' is set + if @api_client.config.client_side_validation && subdomain.nil? + fail ArgumentError, "Missing the required parameter 'subdomain' when calling TeamsApi.teams_delete" + end + # resource path + local_var_path = '/teams/{subdomain}/'.sub('{' + 'subdomain' + '}', subdomain.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['Token'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TeamsApi#teams_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end # Invite a Team Member # Required fields are **name** and **subdomain** where the subdomain is globally unique. Use **POST** to create a Team. To update a field on a Team use **PATCH**. To use the API on behalf of a particular team change the endpoint to: *https://**{{ subdomain }}**.signrequest.com/api/v1/...* To invite new team members you can use **POST** {\"email\":\"**email-of-member-to-invite@example.com**\",\"is_admin\":false,\"is_owner\":false} to: *https://signrequest.com/api/v1/teams/**{{ subdomain }}**/invite_member/* # @param subdomain @@ -83,7 +134,7 @@ def teams_create_with_http_info(data, opts = {}) # @return [InviteMember] def teams_invite_member(subdomain, data, opts = {}) data, _status_code, _headers = teams_invite_member_with_http_info(subdomain, data, opts) - return data + data end # Invite a Team Member @@ -94,7 +145,7 @@ def teams_invite_member(subdomain, data, opts = {}) # @return [Array<(InviteMember, Fixnum, Hash)>] InviteMember data, response status code and response headers def teams_invite_member_with_http_info(subdomain, data, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: TeamsApi.teams_invite_member ..." + @api_client.config.logger.debug 'Calling API: TeamsApi.teams_invite_member ...' end # verify the required parameter 'subdomain' is set if @api_client.config.client_side_validation && subdomain.nil? @@ -105,7 +156,7 @@ def teams_invite_member_with_http_info(subdomain, data, opts = {}) fail ArgumentError, "Missing the required parameter 'data' when calling TeamsApi.teams_invite_member" end # resource path - local_var_path = "/teams/{subdomain}/invite_member/".sub('{' + 'subdomain' + '}', subdomain.to_s) + local_var_path = '/teams/{subdomain}/invite_member/'.sub('{' + 'subdomain' + '}', subdomain.to_s) # query parameters query_params = {} @@ -135,7 +186,6 @@ def teams_invite_member_with_http_info(subdomain, data, opts = {}) end return data, status_code, headers end - # Retrieve a list of Teams # Required fields are **name** and **subdomain** where the subdomain is globally unique. Use **POST** to create a Team. To update a field on a Team use **PATCH**. To use the API on behalf of a particular team change the endpoint to: *https://**{{ subdomain }}**.signrequest.com/api/v1/...* To invite new team members you can use **POST** {\"email\":\"**email-of-member-to-invite@example.com**\",\"is_admin\":false,\"is_owner\":false} to: *https://signrequest.com/api/v1/teams/**{{ subdomain }}**/invite_member/* # @param [Hash] opts the optional parameters @@ -144,7 +194,7 @@ def teams_invite_member_with_http_info(subdomain, data, opts = {}) # @return [InlineResponse2007] def teams_list(opts = {}) data, _status_code, _headers = teams_list_with_http_info(opts) - return data + data end # Retrieve a list of Teams @@ -155,10 +205,10 @@ def teams_list(opts = {}) # @return [Array<(InlineResponse2007, Fixnum, Hash)>] InlineResponse2007 data, response status code and response headers def teams_list_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: TeamsApi.teams_list ..." + @api_client.config.logger.debug 'Calling API: TeamsApi.teams_list ...' end # resource path - local_var_path = "/teams/" + local_var_path = '/teams/' # query parameters query_params = {} @@ -190,7 +240,6 @@ def teams_list_with_http_info(opts = {}) end return data, status_code, headers end - # Update a Team # Required fields are **name** and **subdomain** where the subdomain is globally unique. Use **POST** to create a Team. To update a field on a Team use **PATCH**. To use the API on behalf of a particular team change the endpoint to: *https://**{{ subdomain }}**.signrequest.com/api/v1/...* To invite new team members you can use **POST** {\"email\":\"**email-of-member-to-invite@example.com**\",\"is_admin\":false,\"is_owner\":false} to: *https://signrequest.com/api/v1/teams/**{{ subdomain }}**/invite_member/* # @param subdomain @@ -199,7 +248,7 @@ def teams_list_with_http_info(opts = {}) # @return [Team] def teams_partial_update(subdomain, data, opts = {}) data, _status_code, _headers = teams_partial_update_with_http_info(subdomain, data, opts) - return data + data end # Update a Team @@ -210,7 +259,7 @@ def teams_partial_update(subdomain, data, opts = {}) # @return [Array<(Team, Fixnum, Hash)>] Team data, response status code and response headers def teams_partial_update_with_http_info(subdomain, data, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: TeamsApi.teams_partial_update ..." + @api_client.config.logger.debug 'Calling API: TeamsApi.teams_partial_update ...' end # verify the required parameter 'subdomain' is set if @api_client.config.client_side_validation && subdomain.nil? @@ -221,7 +270,7 @@ def teams_partial_update_with_http_info(subdomain, data, opts = {}) fail ArgumentError, "Missing the required parameter 'data' when calling TeamsApi.teams_partial_update" end # resource path - local_var_path = "/teams/{subdomain}/".sub('{' + 'subdomain' + '}', subdomain.to_s) + local_var_path = '/teams/{subdomain}/'.sub('{' + 'subdomain' + '}', subdomain.to_s) # query parameters query_params = {} @@ -251,7 +300,6 @@ def teams_partial_update_with_http_info(subdomain, data, opts = {}) end return data, status_code, headers end - # Retrieve a Team # Required fields are **name** and **subdomain** where the subdomain is globally unique. Use **POST** to create a Team. To update a field on a Team use **PATCH**. To use the API on behalf of a particular team change the endpoint to: *https://**{{ subdomain }}**.signrequest.com/api/v1/...* To invite new team members you can use **POST** {\"email\":\"**email-of-member-to-invite@example.com**\",\"is_admin\":false,\"is_owner\":false} to: *https://signrequest.com/api/v1/teams/**{{ subdomain }}**/invite_member/* # @param subdomain @@ -259,7 +307,7 @@ def teams_partial_update_with_http_info(subdomain, data, opts = {}) # @return [Team] def teams_read(subdomain, opts = {}) data, _status_code, _headers = teams_read_with_http_info(subdomain, opts) - return data + data end # Retrieve a Team @@ -269,14 +317,14 @@ def teams_read(subdomain, opts = {}) # @return [Array<(Team, Fixnum, Hash)>] Team data, response status code and response headers def teams_read_with_http_info(subdomain, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: TeamsApi.teams_read ..." + @api_client.config.logger.debug 'Calling API: TeamsApi.teams_read ...' end # verify the required parameter 'subdomain' is set if @api_client.config.client_side_validation && subdomain.nil? fail ArgumentError, "Missing the required parameter 'subdomain' when calling TeamsApi.teams_read" end # resource path - local_var_path = "/teams/{subdomain}/".sub('{' + 'subdomain' + '}', subdomain.to_s) + local_var_path = '/teams/{subdomain}/'.sub('{' + 'subdomain' + '}', subdomain.to_s) # query parameters query_params = {} diff --git a/lib/signrequest_client/api/templates_api.rb b/lib/signrequest_client/api/templates_api.rb index 906b90e..2bc4e9c 100644 --- a/lib/signrequest_client/api/templates_api.rb +++ b/lib/signrequest_client/api/templates_api.rb @@ -6,11 +6,11 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end -require "uri" +require 'uri' module SignRequestClient class TemplatesApi @@ -19,7 +19,6 @@ class TemplatesApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Retrieve a list of Templates # # @param [Hash] opts the optional parameters @@ -28,7 +27,7 @@ def initialize(api_client = ApiClient.default) # @return [InlineResponse2008] def templates_list(opts = {}) data, _status_code, _headers = templates_list_with_http_info(opts) - return data + data end # Retrieve a list of Templates @@ -39,10 +38,10 @@ def templates_list(opts = {}) # @return [Array<(InlineResponse2008, Fixnum, Hash)>] InlineResponse2008 data, response status code and response headers def templates_list_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: TemplatesApi.templates_list ..." + @api_client.config.logger.debug 'Calling API: TemplatesApi.templates_list ...' end # resource path - local_var_path = "/templates/" + local_var_path = '/templates/' # query parameters query_params = {} @@ -74,7 +73,6 @@ def templates_list_with_http_info(opts = {}) end return data, status_code, headers end - # Retrieve a Template # # @param uuid @@ -82,7 +80,7 @@ def templates_list_with_http_info(opts = {}) # @return [Template] def templates_read(uuid, opts = {}) data, _status_code, _headers = templates_read_with_http_info(uuid, opts) - return data + data end # Retrieve a Template @@ -92,14 +90,14 @@ def templates_read(uuid, opts = {}) # @return [Array<(Template, Fixnum, Hash)>] Template data, response status code and response headers def templates_read_with_http_info(uuid, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: TemplatesApi.templates_read ..." + @api_client.config.logger.debug 'Calling API: TemplatesApi.templates_read ...' end # verify the required parameter 'uuid' is set if @api_client.config.client_side_validation && uuid.nil? fail ArgumentError, "Missing the required parameter 'uuid' when calling TemplatesApi.templates_read" end # resource path - local_var_path = "/templates/{uuid}/".sub('{' + 'uuid' + '}', uuid.to_s) + local_var_path = '/templates/{uuid}/'.sub('{' + 'uuid' + '}', uuid.to_s) # query parameters query_params = {} diff --git a/lib/signrequest_client/api/webhooks_api.rb b/lib/signrequest_client/api/webhooks_api.rb index a2290d6..f76a327 100644 --- a/lib/signrequest_client/api/webhooks_api.rb +++ b/lib/signrequest_client/api/webhooks_api.rb @@ -6,11 +6,11 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end -require "uri" +require 'uri' module SignRequestClient class WebhooksApi @@ -19,7 +19,6 @@ class WebhooksApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Create a Webhook # # @param data @@ -27,7 +26,7 @@ def initialize(api_client = ApiClient.default) # @return [WebhookSubscription] def webhooks_create(data, opts = {}) data, _status_code, _headers = webhooks_create_with_http_info(data, opts) - return data + data end # Create a Webhook @@ -37,14 +36,14 @@ def webhooks_create(data, opts = {}) # @return [Array<(WebhookSubscription, Fixnum, Hash)>] WebhookSubscription data, response status code and response headers def webhooks_create_with_http_info(data, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: WebhooksApi.webhooks_create ..." + @api_client.config.logger.debug 'Calling API: WebhooksApi.webhooks_create ...' end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling WebhooksApi.webhooks_create" end # resource path - local_var_path = "/webhooks/" + local_var_path = '/webhooks/' # query parameters query_params = {} @@ -74,7 +73,6 @@ def webhooks_create_with_http_info(data, opts = {}) end return data, status_code, headers end - # Delete a Webhook # # @param uuid @@ -82,7 +80,7 @@ def webhooks_create_with_http_info(data, opts = {}) # @return [nil] def webhooks_delete(uuid, opts = {}) webhooks_delete_with_http_info(uuid, opts) - return nil + nil end # Delete a Webhook @@ -92,14 +90,14 @@ def webhooks_delete(uuid, opts = {}) # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def webhooks_delete_with_http_info(uuid, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: WebhooksApi.webhooks_delete ..." + @api_client.config.logger.debug 'Calling API: WebhooksApi.webhooks_delete ...' end # verify the required parameter 'uuid' is set if @api_client.config.client_side_validation && uuid.nil? fail ArgumentError, "Missing the required parameter 'uuid' when calling WebhooksApi.webhooks_delete" end # resource path - local_var_path = "/webhooks/{uuid}/".sub('{' + 'uuid' + '}', uuid.to_s) + local_var_path = '/webhooks/{uuid}/'.sub('{' + 'uuid' + '}', uuid.to_s) # query parameters query_params = {} @@ -128,7 +126,6 @@ def webhooks_delete_with_http_info(uuid, opts = {}) end return data, status_code, headers end - # Retrieve a list of Webhooks # # @param [Hash] opts the optional parameters @@ -137,7 +134,7 @@ def webhooks_delete_with_http_info(uuid, opts = {}) # @return [InlineResponse2009] def webhooks_list(opts = {}) data, _status_code, _headers = webhooks_list_with_http_info(opts) - return data + data end # Retrieve a list of Webhooks @@ -148,10 +145,10 @@ def webhooks_list(opts = {}) # @return [Array<(InlineResponse2009, Fixnum, Hash)>] InlineResponse2009 data, response status code and response headers def webhooks_list_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: WebhooksApi.webhooks_list ..." + @api_client.config.logger.debug 'Calling API: WebhooksApi.webhooks_list ...' end # resource path - local_var_path = "/webhooks/" + local_var_path = '/webhooks/' # query parameters query_params = {} @@ -183,7 +180,6 @@ def webhooks_list_with_http_info(opts = {}) end return data, status_code, headers end - # Partially update a Webhook # # @param uuid @@ -192,7 +188,7 @@ def webhooks_list_with_http_info(opts = {}) # @return [WebhookSubscription] def webhooks_partial_update(uuid, data, opts = {}) data, _status_code, _headers = webhooks_partial_update_with_http_info(uuid, data, opts) - return data + data end # Partially update a Webhook @@ -203,7 +199,7 @@ def webhooks_partial_update(uuid, data, opts = {}) # @return [Array<(WebhookSubscription, Fixnum, Hash)>] WebhookSubscription data, response status code and response headers def webhooks_partial_update_with_http_info(uuid, data, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: WebhooksApi.webhooks_partial_update ..." + @api_client.config.logger.debug 'Calling API: WebhooksApi.webhooks_partial_update ...' end # verify the required parameter 'uuid' is set if @api_client.config.client_side_validation && uuid.nil? @@ -214,7 +210,7 @@ def webhooks_partial_update_with_http_info(uuid, data, opts = {}) fail ArgumentError, "Missing the required parameter 'data' when calling WebhooksApi.webhooks_partial_update" end # resource path - local_var_path = "/webhooks/{uuid}/".sub('{' + 'uuid' + '}', uuid.to_s) + local_var_path = '/webhooks/{uuid}/'.sub('{' + 'uuid' + '}', uuid.to_s) # query parameters query_params = {} @@ -244,7 +240,6 @@ def webhooks_partial_update_with_http_info(uuid, data, opts = {}) end return data, status_code, headers end - # Retrieve a Webhook # # @param uuid @@ -252,7 +247,7 @@ def webhooks_partial_update_with_http_info(uuid, data, opts = {}) # @return [WebhookSubscription] def webhooks_read(uuid, opts = {}) data, _status_code, _headers = webhooks_read_with_http_info(uuid, opts) - return data + data end # Retrieve a Webhook @@ -262,14 +257,14 @@ def webhooks_read(uuid, opts = {}) # @return [Array<(WebhookSubscription, Fixnum, Hash)>] WebhookSubscription data, response status code and response headers def webhooks_read_with_http_info(uuid, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: WebhooksApi.webhooks_read ..." + @api_client.config.logger.debug 'Calling API: WebhooksApi.webhooks_read ...' end # verify the required parameter 'uuid' is set if @api_client.config.client_side_validation && uuid.nil? fail ArgumentError, "Missing the required parameter 'uuid' when calling WebhooksApi.webhooks_read" end # resource path - local_var_path = "/webhooks/{uuid}/".sub('{' + 'uuid' + '}', uuid.to_s) + local_var_path = '/webhooks/{uuid}/'.sub('{' + 'uuid' + '}', uuid.to_s) # query parameters query_params = {} @@ -299,7 +294,6 @@ def webhooks_read_with_http_info(uuid, opts = {}) end return data, status_code, headers end - # Update a Webhook # # @param uuid @@ -308,7 +302,7 @@ def webhooks_read_with_http_info(uuid, opts = {}) # @return [WebhookSubscription] def webhooks_update(uuid, data, opts = {}) data, _status_code, _headers = webhooks_update_with_http_info(uuid, data, opts) - return data + data end # Update a Webhook @@ -319,7 +313,7 @@ def webhooks_update(uuid, data, opts = {}) # @return [Array<(WebhookSubscription, Fixnum, Hash)>] WebhookSubscription data, response status code and response headers def webhooks_update_with_http_info(uuid, data, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: WebhooksApi.webhooks_update ..." + @api_client.config.logger.debug 'Calling API: WebhooksApi.webhooks_update ...' end # verify the required parameter 'uuid' is set if @api_client.config.client_side_validation && uuid.nil? @@ -330,7 +324,7 @@ def webhooks_update_with_http_info(uuid, data, opts = {}) fail ArgumentError, "Missing the required parameter 'data' when calling WebhooksApi.webhooks_update" end # resource path - local_var_path = "/webhooks/{uuid}/".sub('{' + 'uuid' + '}', uuid.to_s) + local_var_path = '/webhooks/{uuid}/'.sub('{' + 'uuid' + '}', uuid.to_s) # query parameters query_params = {} diff --git a/lib/signrequest_client/api_client.rb b/lib/signrequest_client/api_client.rb index 07fac31..dda60da 100644 --- a/lib/signrequest_client/api_client.rb +++ b/lib/signrequest_client/api_client.rb @@ -6,7 +6,7 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end @@ -33,7 +33,7 @@ def initialize(config = Configuration.default) @config = config @user_agent = "Swagger-Codegen/#{VERSION}/ruby" @default_headers = { - 'Content-Type' => "application/json", + 'Content-Type' => 'application/json', 'User-Agent' => @user_agent } end @@ -137,7 +137,7 @@ def build_request(http_method, path, opts = {}) # @param [String] mime MIME # @return [Boolean] True if the MIME is application/json def json_mime?(mime) - (mime == "*/*") || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? + (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? end # Deserialize the response to the given return type. @@ -201,12 +201,12 @@ def convert_to_type(data, return_type) when /\AArray<(.+)>\z/ # e.g. Array sub_type = $1 - data.map {|item| convert_to_type(item, sub_type) } + data.map { |item| convert_to_type(item, sub_type) } when /\AHash\\z/ # e.g. Hash sub_type = $1 {}.tap do |hash| - data.each {|k, v| hash[k] = convert_to_type(v, sub_type) } + data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } end else # models, e.g. Pet @@ -228,7 +228,7 @@ def download_file(request) encoding = nil request.on_headers do |response| content_disposition = response.headers['Content-Disposition'] - if content_disposition and content_disposition =~ /filename=/i + if content_disposition && content_disposition =~ /filename=/i filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] prefix = sanitize_filename(filename) else @@ -327,7 +327,7 @@ def select_header_accept(accepts) return nil if accepts.nil? || accepts.empty? # use JSON when present, otherwise use all of the provided json_accept = accepts.find { |s| json_mime?(s) } - return json_accept || accepts.join(',') + json_accept || accepts.join(',') end # Return Content-Type header based on an array of content types provided. @@ -338,7 +338,7 @@ def select_header_content_type(content_types) return 'application/json' if content_types.nil? || content_types.empty? # use JSON when present, otherwise use the first one json_content_type = content_types.find { |s| json_mime?(s) } - return json_content_type || content_types.first + json_content_type || content_types.first end # Convert object (array, hash, object, etc) to JSON string. @@ -348,7 +348,7 @@ def object_to_http_body(model) return model if model.nil? || model.is_a?(String) local_body = nil if model.is_a?(Array) - local_body = model.map{|m| object_to_hash(m) } + local_body = model.map { |m| object_to_hash(m) } else local_body = object_to_hash(model) end diff --git a/lib/signrequest_client/api_error.rb b/lib/signrequest_client/api_error.rb index a583f7f..20e2298 100644 --- a/lib/signrequest_client/api_error.rb +++ b/lib/signrequest_client/api_error.rb @@ -6,7 +6,7 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end diff --git a/lib/signrequest_client/configuration.rb b/lib/signrequest_client/configuration.rb index 9d294cd..7fd0896 100644 --- a/lib/signrequest_client/configuration.rb +++ b/lib/signrequest_client/configuration.rb @@ -6,7 +6,7 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end @@ -170,7 +170,7 @@ def host=(host) def base_path=(base_path) # Add leading and trailing slashes to base_path @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = "" if @base_path == "/" + @base_path = '' if @base_path == '/' end def base_url diff --git a/lib/signrequest_client/models/auth_token.rb b/lib/signrequest_client/models/auth_token.rb index 9d4eab3..39545e8 100644 --- a/lib/signrequest_client/models/auth_token.rb +++ b/lib/signrequest_client/models/auth_token.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class AuthToken attr_accessor :email @@ -27,7 +26,6 @@ class AuthToken attr_accessor :url - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -58,7 +56,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'email') self.email = attributes[:'email'] @@ -83,7 +81,6 @@ def initialize(attributes = {}) if attributes.has_key?(:'url') self.url = attributes[:'url'] end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -91,26 +88,26 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if @subdomain.nil? - invalid_properties.push("invalid value for 'subdomain', subdomain cannot be nil.") + invalid_properties.push('invalid value for "subdomain", subdomain cannot be nil.') end if @subdomain.to_s.length < 1 - invalid_properties.push("invalid value for 'subdomain', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "subdomain", the character length must be great than or equal to 1.') end if @subdomain !~ Regexp.new(/^[-a-zA-Z0-9_]+$/) - invalid_properties.push("invalid value for 'subdomain', must conform to the pattern /^[-a-zA-Z0-9_]+$/.") + invalid_properties.push('invalid value for "subdomain", must conform to the pattern /^[-a-zA-Z0-9_]+$/.') end if !@name.nil? && @name.to_s.length < 1 - invalid_properties.push("invalid value for 'name', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.') end if !@key.nil? && @key.to_s.length < 1 - invalid_properties.push("invalid value for 'key', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "key", the character length must be great than or equal to 1.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid @@ -121,22 +118,22 @@ def valid? return false if @subdomain !~ Regexp.new(/^[-a-zA-Z0-9_]+$/) return false if !@name.nil? && @name.to_s.length < 1 return false if !@key.nil? && @key.to_s.length < 1 - return true + true end # Custom attribute writer method with validation # @param [Object] subdomain Value to be assigned def subdomain=(subdomain) if subdomain.nil? - fail ArgumentError, "subdomain cannot be nil" + fail ArgumentError, 'subdomain cannot be nil' end if subdomain.to_s.length < 1 - fail ArgumentError, "invalid value for 'subdomain', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "subdomain", the character length must be great than or equal to 1.' end if subdomain !~ Regexp.new(/^[-a-zA-Z0-9_]+$/) - fail ArgumentError, "invalid value for 'subdomain', must conform to the pattern /^[-a-zA-Z0-9_]+$/." + fail ArgumentError, 'invalid value for "subdomain", must conform to the pattern /^[-a-zA-Z0-9_]+$/.' end @subdomain = subdomain @@ -145,9 +142,8 @@ def subdomain=(subdomain) # Custom attribute writer method with validation # @param [Object] name Value to be assigned def name=(name) - if !name.nil? && name.to_s.length < 1 - fail ArgumentError, "invalid value for 'name', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' end @name = name @@ -156,9 +152,8 @@ def name=(name) # Custom attribute writer method with validation # @param [Object] key Value to be assigned def key=(key) - if !key.nil? && key.to_s.length < 1 - fail ArgumentError, "invalid value for 'key', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "key", the character length must be great than or equal to 1.' end @key = key @@ -199,7 +194,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -281,7 +276,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -292,7 +287,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/document.rb b/lib/signrequest_client/models/document.rb index 9697726..b1b0a3f 100644 --- a/lib/signrequest_client/models/document.rb +++ b/lib/signrequest_client/models/document.rb @@ -6,17 +6,18 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class Document attr_accessor :url + attr_accessor :team + attr_accessor :uuid attr_accessor :user @@ -60,15 +61,22 @@ class Document # Number of days after which a finished document (signed/cancelled/declined) will be automatically deleted attr_accessor :auto_delete_days + # Number of days after which a non finished document will be automatically expired + attr_accessor :auto_expire_days + # Temporary URL to signed document as PDF, expires in five minutes attr_accessor :pdf # `co`: converting, `ne`: new, `se`: sent, `vi`: viewed, `si`: signed, `do`: downloaded, `sd`: signed and downloaded, `ca`: cancelled, `de`: declined, `ec`: error converting, `es`: error sending, `xp`: expired attr_accessor :status + attr_accessor :signrequest + # Indicates whether document was created using the API attr_accessor :api_used + attr_accessor :signing_log + # SHA256 hash of PDF contents attr_accessor :security_hash @@ -77,6 +85,12 @@ class Document # Date and time calculated using `auto_delete_days` after which a finished document (signed/cancelled/declined) will be automatically deleted attr_accessor :auto_delete_after + # Indicates whether document was created as part of a sandbox team + attr_accessor :sandbox + + # Date and time calculated using `auto_expire_days` after which a non finished document will be automatically expired + attr_accessor :auto_expire_after + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -103,6 +117,7 @@ def valid?(value) def self.attribute_map { :'url' => :'url', + :'team' => :'team', :'uuid' => :'uuid', :'user' => :'user', :'file_as_pdf' => :'file_as_pdf', @@ -119,12 +134,17 @@ def self.attribute_map :'integrations' => :'integrations', :'file_from_sf' => :'file_from_sf', :'auto_delete_days' => :'auto_delete_days', + :'auto_expire_days' => :'auto_expire_days', :'pdf' => :'pdf', :'status' => :'status', + :'signrequest' => :'signrequest', :'api_used' => :'api_used', + :'signing_log' => :'signing_log', :'security_hash' => :'security_hash', :'attachments' => :'attachments', - :'auto_delete_after' => :'auto_delete_after' + :'auto_delete_after' => :'auto_delete_after', + :'sandbox' => :'sandbox', + :'auto_expire_after' => :'auto_expire_after' } end @@ -132,6 +152,7 @@ def self.attribute_map def self.swagger_types { :'url' => :'String', + :'team' => :'DocumentTeam', :'uuid' => :'String', :'user' => :'User', :'file_as_pdf' => :'String', @@ -148,12 +169,17 @@ def self.swagger_types :'integrations' => :'Array', :'file_from_sf' => :'FileFromSf', :'auto_delete_days' => :'Integer', + :'auto_expire_days' => :'Integer', :'pdf' => :'String', :'status' => :'String', + :'signrequest' => :'DocumentSignrequest', :'api_used' => :'BOOLEAN', + :'signing_log' => :'DocumentSigningLog', :'security_hash' => :'String', :'attachments' => :'Array', - :'auto_delete_after' => :'DateTime' + :'auto_delete_after' => :'DateTime', + :'sandbox' => :'BOOLEAN', + :'auto_expire_after' => :'DateTime' } end @@ -163,12 +189,16 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'url') self.url = attributes[:'url'] end + if attributes.has_key?(:'team') + self.team = attributes[:'team'] + end + if attributes.has_key?(:'uuid') self.uuid = attributes[:'uuid'] end @@ -237,6 +267,10 @@ def initialize(attributes = {}) self.auto_delete_days = attributes[:'auto_delete_days'] end + if attributes.has_key?(:'auto_expire_days') + self.auto_expire_days = attributes[:'auto_expire_days'] + end + if attributes.has_key?(:'pdf') self.pdf = attributes[:'pdf'] end @@ -245,10 +279,18 @@ def initialize(attributes = {}) self.status = attributes[:'status'] end + if attributes.has_key?(:'signrequest') + self.signrequest = attributes[:'signrequest'] + end + if attributes.has_key?(:'api_used') self.api_used = attributes[:'api_used'] end + if attributes.has_key?(:'signing_log') + self.signing_log = attributes[:'signing_log'] + end + if attributes.has_key?(:'security_hash') self.security_hash = attributes[:'security_hash'] end @@ -263,6 +305,13 @@ def initialize(attributes = {}) self.auto_delete_after = attributes[:'auto_delete_after'] end + if attributes.has_key?(:'sandbox') + self.sandbox = attributes[:'sandbox'] + end + + if attributes.has_key?(:'auto_expire_after') + self.auto_expire_after = attributes[:'auto_expire_after'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -270,46 +319,54 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if !@uuid.nil? && @uuid.to_s.length < 1 - invalid_properties.push("invalid value for 'uuid', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "uuid", the character length must be great than or equal to 1.') end if !@file_as_pdf.nil? && @file_as_pdf.to_s.length < 1 - invalid_properties.push("invalid value for 'file_as_pdf', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "file_as_pdf", the character length must be great than or equal to 1.') end if !@name.nil? && @name.to_s.length > 255 - invalid_properties.push("invalid value for 'name', the character length must be smaller than or equal to 255.") + invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.') end if !@external_id.nil? && @external_id.to_s.length > 255 - invalid_properties.push("invalid value for 'external_id', the character length must be smaller than or equal to 255.") + invalid_properties.push('invalid value for "external_id", the character length must be smaller than or equal to 255.') end if !@frontend_id.nil? && @frontend_id.to_s.length > 255 - invalid_properties.push("invalid value for 'frontend_id', the character length must be smaller than or equal to 255.") + invalid_properties.push('invalid value for "frontend_id", the character length must be smaller than or equal to 255.') end if !@file_from_url.nil? && @file_from_url.to_s.length > 2100 - invalid_properties.push("invalid value for 'file_from_url', the character length must be smaller than or equal to 2100.") + invalid_properties.push('invalid value for "file_from_url", the character length must be smaller than or equal to 2100.') end if !@events_callback_url.nil? && @events_callback_url.to_s.length > 2100 - invalid_properties.push("invalid value for 'events_callback_url', the character length must be smaller than or equal to 2100.") + invalid_properties.push('invalid value for "events_callback_url", the character length must be smaller than or equal to 2100.') end if !@auto_delete_days.nil? && @auto_delete_days > 730 - invalid_properties.push("invalid value for 'auto_delete_days', must be smaller than or equal to 730.") + invalid_properties.push('invalid value for "auto_delete_days", must be smaller than or equal to 730.') end if !@auto_delete_days.nil? && @auto_delete_days < 1 - invalid_properties.push("invalid value for 'auto_delete_days', must be greater than or equal to 1.") + invalid_properties.push('invalid value for "auto_delete_days", must be greater than or equal to 1.') + end + + if !@auto_expire_days.nil? && @auto_expire_days > 730 + invalid_properties.push('invalid value for "auto_expire_days", must be smaller than or equal to 730.') + end + + if !@auto_expire_days.nil? && @auto_expire_days < 1 + invalid_properties.push('invalid value for "auto_expire_days", must be greater than or equal to 1.') end if !@security_hash.nil? && @security_hash.to_s.length < 1 - invalid_properties.push("invalid value for 'security_hash', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "security_hash", the character length must be great than or equal to 1.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid @@ -324,18 +381,19 @@ def valid? return false if !@events_callback_url.nil? && @events_callback_url.to_s.length > 2100 return false if !@auto_delete_days.nil? && @auto_delete_days > 730 return false if !@auto_delete_days.nil? && @auto_delete_days < 1 - status_validator = EnumAttributeValidator.new('String', ["co", "ne", "se", "vi", "si", "do", "sd", "ca", "de", "ec", "es", "xp"]) + return false if !@auto_expire_days.nil? && @auto_expire_days > 730 + return false if !@auto_expire_days.nil? && @auto_expire_days < 1 + status_validator = EnumAttributeValidator.new('String', ['co', 'ne', 'se', 'vi', 'si', 'do', 'sd', 'ca', 'de', 'ec', 'es', 'xp']) return false unless status_validator.valid?(@status) return false if !@security_hash.nil? && @security_hash.to_s.length < 1 - return true + true end # Custom attribute writer method with validation # @param [Object] uuid Value to be assigned def uuid=(uuid) - if !uuid.nil? && uuid.to_s.length < 1 - fail ArgumentError, "invalid value for 'uuid', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "uuid", the character length must be great than or equal to 1.' end @uuid = uuid @@ -344,9 +402,8 @@ def uuid=(uuid) # Custom attribute writer method with validation # @param [Object] file_as_pdf Value to be assigned def file_as_pdf=(file_as_pdf) - if !file_as_pdf.nil? && file_as_pdf.to_s.length < 1 - fail ArgumentError, "invalid value for 'file_as_pdf', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "file_as_pdf", the character length must be great than or equal to 1.' end @file_as_pdf = file_as_pdf @@ -355,9 +412,8 @@ def file_as_pdf=(file_as_pdf) # Custom attribute writer method with validation # @param [Object] name Value to be assigned def name=(name) - if !name.nil? && name.to_s.length > 255 - fail ArgumentError, "invalid value for 'name', the character length must be smaller than or equal to 255." + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.' end @name = name @@ -366,9 +422,8 @@ def name=(name) # Custom attribute writer method with validation # @param [Object] external_id Value to be assigned def external_id=(external_id) - if !external_id.nil? && external_id.to_s.length > 255 - fail ArgumentError, "invalid value for 'external_id', the character length must be smaller than or equal to 255." + fail ArgumentError, 'invalid value for "external_id", the character length must be smaller than or equal to 255.' end @external_id = external_id @@ -377,9 +432,8 @@ def external_id=(external_id) # Custom attribute writer method with validation # @param [Object] frontend_id Value to be assigned def frontend_id=(frontend_id) - if !frontend_id.nil? && frontend_id.to_s.length > 255 - fail ArgumentError, "invalid value for 'frontend_id', the character length must be smaller than or equal to 255." + fail ArgumentError, 'invalid value for "frontend_id", the character length must be smaller than or equal to 255.' end @frontend_id = frontend_id @@ -388,9 +442,8 @@ def frontend_id=(frontend_id) # Custom attribute writer method with validation # @param [Object] file_from_url Value to be assigned def file_from_url=(file_from_url) - if !file_from_url.nil? && file_from_url.to_s.length > 2100 - fail ArgumentError, "invalid value for 'file_from_url', the character length must be smaller than or equal to 2100." + fail ArgumentError, 'invalid value for "file_from_url", the character length must be smaller than or equal to 2100.' end @file_from_url = file_from_url @@ -399,9 +452,8 @@ def file_from_url=(file_from_url) # Custom attribute writer method with validation # @param [Object] events_callback_url Value to be assigned def events_callback_url=(events_callback_url) - if !events_callback_url.nil? && events_callback_url.to_s.length > 2100 - fail ArgumentError, "invalid value for 'events_callback_url', the character length must be smaller than or equal to 2100." + fail ArgumentError, 'invalid value for "events_callback_url", the character length must be smaller than or equal to 2100.' end @events_callback_url = events_callback_url @@ -410,24 +462,37 @@ def events_callback_url=(events_callback_url) # Custom attribute writer method with validation # @param [Object] auto_delete_days Value to be assigned def auto_delete_days=(auto_delete_days) - if !auto_delete_days.nil? && auto_delete_days > 730 - fail ArgumentError, "invalid value for 'auto_delete_days', must be smaller than or equal to 730." + fail ArgumentError, 'invalid value for "auto_delete_days", must be smaller than or equal to 730.' end if !auto_delete_days.nil? && auto_delete_days < 1 - fail ArgumentError, "invalid value for 'auto_delete_days', must be greater than or equal to 1." + fail ArgumentError, 'invalid value for "auto_delete_days", must be greater than or equal to 1.' end @auto_delete_days = auto_delete_days end + # Custom attribute writer method with validation + # @param [Object] auto_expire_days Value to be assigned + def auto_expire_days=(auto_expire_days) + if !auto_expire_days.nil? && auto_expire_days > 730 + fail ArgumentError, 'invalid value for "auto_expire_days", must be smaller than or equal to 730.' + end + + if !auto_expire_days.nil? && auto_expire_days < 1 + fail ArgumentError, 'invalid value for "auto_expire_days", must be greater than or equal to 1.' + end + + @auto_expire_days = auto_expire_days + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] status Object to be assigned def status=(status) - validator = EnumAttributeValidator.new('String', ["co", "ne", "se", "vi", "si", "do", "sd", "ca", "de", "ec", "es", "xp"]) + validator = EnumAttributeValidator.new('String', ['co', 'ne', 'se', 'vi', 'si', 'do', 'sd', 'ca', 'de', 'ec', 'es', 'xp']) unless validator.valid?(status) - fail ArgumentError, "invalid value for 'status', must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.' end @status = status end @@ -435,9 +500,8 @@ def status=(status) # Custom attribute writer method with validation # @param [Object] security_hash Value to be assigned def security_hash=(security_hash) - if !security_hash.nil? && security_hash.to_s.length < 1 - fail ArgumentError, "invalid value for 'security_hash', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "security_hash", the character length must be great than or equal to 1.' end @security_hash = security_hash @@ -449,6 +513,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && url == o.url && + team == o.team && uuid == o.uuid && user == o.user && file_as_pdf == o.file_as_pdf && @@ -465,12 +530,17 @@ def ==(o) integrations == o.integrations && file_from_sf == o.file_from_sf && auto_delete_days == o.auto_delete_days && + auto_expire_days == o.auto_expire_days && pdf == o.pdf && status == o.status && + signrequest == o.signrequest && api_used == o.api_used && + signing_log == o.signing_log && security_hash == o.security_hash && attachments == o.attachments && - auto_delete_after == o.auto_delete_after + auto_delete_after == o.auto_delete_after && + sandbox == o.sandbox && + auto_expire_after == o.auto_expire_after end # @see the `==` method @@ -482,7 +552,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [url, uuid, user, file_as_pdf, name, external_id, frontend_id, file, file_from_url, events_callback_url, file_from_content, file_from_content_name, template, prefill_tags, integrations, file_from_sf, auto_delete_days, pdf, status, api_used, security_hash, attachments, auto_delete_after].hash + [url, team, uuid, user, file_as_pdf, name, external_id, frontend_id, file, file_from_url, events_callback_url, file_from_content, file_from_content_name, template, prefill_tags, integrations, file_from_sf, auto_delete_days, auto_expire_days, pdf, status, signrequest, api_used, signing_log, security_hash, attachments, auto_delete_after, sandbox, auto_expire_after].hash end # Builds the object from hash @@ -495,7 +565,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -577,7 +647,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -588,7 +658,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/document_attachment.rb b/lib/signrequest_client/models/document_attachment.rb index 785dbd2..bab8f0f 100644 --- a/lib/signrequest_client/models/document_attachment.rb +++ b/lib/signrequest_client/models/document_attachment.rb @@ -6,20 +6,19 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class DocumentAttachment attr_accessor :url attr_accessor :uuid - # Defaults to filename + # Defaults to filename, including extension attr_accessor :name # Temporary URL to document attachment, expires in five minutes @@ -36,7 +35,6 @@ class DocumentAttachment attr_accessor :document - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -71,7 +69,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'url') self.url = attributes[:'url'] @@ -104,7 +102,6 @@ def initialize(attributes = {}) if attributes.has_key?(:'document') self.document = attributes[:'document'] end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -112,40 +109,39 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if !@uuid.nil? && @uuid.to_s.length < 1 - invalid_properties.push("invalid value for 'uuid', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "uuid", the character length must be great than or equal to 1.') end - if !@name.nil? && @name.to_s.length < 1 - invalid_properties.push("invalid value for 'name', the character length must be great than or equal to 1.") + if !@name.nil? && @name.to_s.length > 255 + invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.') end if !@file_from_url.nil? && @file_from_url.to_s.length > 2100 - invalid_properties.push("invalid value for 'file_from_url', the character length must be smaller than or equal to 2100.") + invalid_properties.push('invalid value for "file_from_url", the character length must be smaller than or equal to 2100.') end if @document.nil? - invalid_properties.push("invalid value for 'document', document cannot be nil.") + invalid_properties.push('invalid value for "document", document cannot be nil.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? return false if !@uuid.nil? && @uuid.to_s.length < 1 - return false if !@name.nil? && @name.to_s.length < 1 + return false if !@name.nil? && @name.to_s.length > 255 return false if !@file_from_url.nil? && @file_from_url.to_s.length > 2100 return false if @document.nil? - return true + true end # Custom attribute writer method with validation # @param [Object] uuid Value to be assigned def uuid=(uuid) - if !uuid.nil? && uuid.to_s.length < 1 - fail ArgumentError, "invalid value for 'uuid', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "uuid", the character length must be great than or equal to 1.' end @uuid = uuid @@ -154,9 +150,8 @@ def uuid=(uuid) # Custom attribute writer method with validation # @param [Object] name Value to be assigned def name=(name) - - if !name.nil? && name.to_s.length < 1 - fail ArgumentError, "invalid value for 'name', the character length must be great than or equal to 1." + if !name.nil? && name.to_s.length > 255 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.' end @name = name @@ -165,9 +160,8 @@ def name=(name) # Custom attribute writer method with validation # @param [Object] file_from_url Value to be assigned def file_from_url=(file_from_url) - if !file_from_url.nil? && file_from_url.to_s.length > 2100 - fail ArgumentError, "invalid value for 'file_from_url', the character length must be smaller than or equal to 2100." + fail ArgumentError, 'invalid value for "file_from_url", the character length must be smaller than or equal to 2100.' end @file_from_url = file_from_url @@ -210,7 +204,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -292,7 +286,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -303,7 +297,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/document_search.rb b/lib/signrequest_client/models/document_search.rb index a42fd85..287b811 100644 --- a/lib/signrequest_client/models/document_search.rb +++ b/lib/signrequest_client/models/document_search.rb @@ -6,32 +6,31 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class DocumentSearch + attr_accessor :uuid + + attr_accessor :created + # `co`: converting, `ne`: new, `se`: sent, `vi`: viewed, `si`: signed, `do`: downloaded, `sd`: signed and downloaded, `ca`: cancelled, `de`: declined, `ec`: error converting, `es`: error sending, `xp`: expired attr_accessor :status + attr_accessor :who + # Defaults to filename attr_accessor :name - attr_accessor :who - - attr_accessor :nr_extra_docs + attr_accessor :autocomplete attr_accessor :from_email - attr_accessor :uuid - - attr_accessor :created - - attr_accessor :autocomplete + attr_accessor :nr_extra_docs attr_accessor :signer_emails @@ -47,18 +46,17 @@ class DocumentSearch attr_accessor :subdomain - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'status' => :'status', - :'name' => :'name', - :'who' => :'who', - :'nr_extra_docs' => :'nr_extra_docs', - :'from_email' => :'from_email', :'uuid' => :'uuid', :'created' => :'created', + :'status' => :'status', + :'who' => :'who', + :'name' => :'name', :'autocomplete' => :'autocomplete', + :'from_email' => :'from_email', + :'nr_extra_docs' => :'nr_extra_docs', :'signer_emails' => :'signer_emails', :'status_display' => :'status_display', :'created_timestamp' => :'created_timestamp', @@ -72,14 +70,14 @@ def self.attribute_map # Attribute type mapping. def self.swagger_types { - :'status' => :'String', - :'name' => :'String', - :'who' => :'String', - :'nr_extra_docs' => :'Integer', - :'from_email' => :'String', :'uuid' => :'String', :'created' => :'DateTime', + :'status' => :'String', + :'who' => :'String', + :'name' => :'String', :'autocomplete' => :'String', + :'from_email' => :'String', + :'nr_extra_docs' => :'Integer', :'signer_emails' => :'Array', :'status_display' => :'String', :'created_timestamp' => :'Integer', @@ -96,38 +94,38 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.has_key?(:'status') - self.status = attributes[:'status'] + if attributes.has_key?(:'uuid') + self.uuid = attributes[:'uuid'] end - if attributes.has_key?(:'name') - self.name = attributes[:'name'] + if attributes.has_key?(:'created') + self.created = attributes[:'created'] end - if attributes.has_key?(:'who') - self.who = attributes[:'who'] + if attributes.has_key?(:'status') + self.status = attributes[:'status'] end - if attributes.has_key?(:'nr_extra_docs') - self.nr_extra_docs = attributes[:'nr_extra_docs'] + if attributes.has_key?(:'who') + self.who = attributes[:'who'] end - if attributes.has_key?(:'from_email') - self.from_email = attributes[:'from_email'] + if attributes.has_key?(:'name') + self.name = attributes[:'name'] end - if attributes.has_key?(:'uuid') - self.uuid = attributes[:'uuid'] + if attributes.has_key?(:'autocomplete') + self.autocomplete = attributes[:'autocomplete'] end - if attributes.has_key?(:'created') - self.created = attributes[:'created'] + if attributes.has_key?(:'from_email') + self.from_email = attributes[:'from_email'] end - if attributes.has_key?(:'autocomplete') - self.autocomplete = attributes[:'autocomplete'] + if attributes.has_key?(:'nr_extra_docs') + self.nr_extra_docs = attributes[:'nr_extra_docs'] end if attributes.has_key?(:'signer_emails') @@ -159,177 +157,172 @@ def initialize(attributes = {}) if attributes.has_key?(:'subdomain') self.subdomain = attributes[:'subdomain'] end - end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new - if !@status.nil? && @status.to_s.length > 2 - invalid_properties.push("invalid value for 'status', the character length must be smaller than or equal to 2.") + if !@uuid.nil? && @uuid.to_s.length < 1 + invalid_properties.push('invalid value for "uuid", the character length must be great than or equal to 1.') end - if !@status.nil? && @status.to_s.length < 1 - invalid_properties.push("invalid value for 'status', the character length must be great than or equal to 1.") + if !@status.nil? && @status.to_s.length > 2 + invalid_properties.push('invalid value for "status", the character length must be smaller than or equal to 2.') end - if !@name.nil? && @name.to_s.length < 1 - invalid_properties.push("invalid value for 'name', the character length must be great than or equal to 1.") + if !@status.nil? && @status.to_s.length < 1 + invalid_properties.push('invalid value for "status", the character length must be great than or equal to 1.') end if @who.nil? - invalid_properties.push("invalid value for 'who', who cannot be nil.") + invalid_properties.push('invalid value for "who", who cannot be nil.') end if @who.to_s.length < 1 - invalid_properties.push("invalid value for 'who', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "who", the character length must be great than or equal to 1.') end - if @nr_extra_docs.nil? - invalid_properties.push("invalid value for 'nr_extra_docs', nr_extra_docs cannot be nil.") + if !@name.nil? && @name.to_s.length < 1 + invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.') end - if @from_email.nil? - invalid_properties.push("invalid value for 'from_email', from_email cannot be nil.") + if @autocomplete.nil? + invalid_properties.push('invalid value for "autocomplete", autocomplete cannot be nil.') end - if @from_email.to_s.length < 1 - invalid_properties.push("invalid value for 'from_email', the character length must be great than or equal to 1.") + if @autocomplete.to_s.length < 1 + invalid_properties.push('invalid value for "autocomplete", the character length must be great than or equal to 1.') end - if !@uuid.nil? && @uuid.to_s.length < 1 - invalid_properties.push("invalid value for 'uuid', the character length must be great than or equal to 1.") + if @from_email.nil? + invalid_properties.push('invalid value for "from_email", from_email cannot be nil.') end - if @autocomplete.nil? - invalid_properties.push("invalid value for 'autocomplete', autocomplete cannot be nil.") + if @from_email.to_s.length < 1 + invalid_properties.push('invalid value for "from_email", the character length must be great than or equal to 1.') end - if @autocomplete.to_s.length < 1 - invalid_properties.push("invalid value for 'autocomplete', the character length must be great than or equal to 1.") + if @nr_extra_docs.nil? + invalid_properties.push('invalid value for "nr_extra_docs", nr_extra_docs cannot be nil.') end if !@status_display.nil? && @status_display.to_s.length < 1 - invalid_properties.push("invalid value for 'status_display', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "status_display", the character length must be great than or equal to 1.') end if !@parent_doc.nil? && @parent_doc.to_s.length < 1 - invalid_properties.push("invalid value for 'parent_doc', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "parent_doc", the character length must be great than or equal to 1.') end if !@subdomain.nil? && @subdomain.to_s.length < 1 - invalid_properties.push("invalid value for 'subdomain', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "subdomain", the character length must be great than or equal to 1.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + return false if !@uuid.nil? && @uuid.to_s.length < 1 return false if !@status.nil? && @status.to_s.length > 2 return false if !@status.nil? && @status.to_s.length < 1 - return false if !@name.nil? && @name.to_s.length < 1 return false if @who.nil? return false if @who.to_s.length < 1 - return false if @nr_extra_docs.nil? - return false if @from_email.nil? - return false if @from_email.to_s.length < 1 - return false if !@uuid.nil? && @uuid.to_s.length < 1 + return false if !@name.nil? && @name.to_s.length < 1 return false if @autocomplete.nil? return false if @autocomplete.to_s.length < 1 + return false if @from_email.nil? + return false if @from_email.to_s.length < 1 + return false if @nr_extra_docs.nil? return false if !@status_display.nil? && @status_display.to_s.length < 1 return false if !@parent_doc.nil? && @parent_doc.to_s.length < 1 return false if !@subdomain.nil? && @subdomain.to_s.length < 1 - return true + true + end + + # Custom attribute writer method with validation + # @param [Object] uuid Value to be assigned + def uuid=(uuid) + if !uuid.nil? && uuid.to_s.length < 1 + fail ArgumentError, 'invalid value for "uuid", the character length must be great than or equal to 1.' + end + + @uuid = uuid end # Custom attribute writer method with validation # @param [Object] status Value to be assigned def status=(status) - if !status.nil? && status.to_s.length > 2 - fail ArgumentError, "invalid value for 'status', the character length must be smaller than or equal to 2." + fail ArgumentError, 'invalid value for "status", the character length must be smaller than or equal to 2.' end if !status.nil? && status.to_s.length < 1 - fail ArgumentError, "invalid value for 'status', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "status", the character length must be great than or equal to 1.' end @status = status end - # Custom attribute writer method with validation - # @param [Object] name Value to be assigned - def name=(name) - - if !name.nil? && name.to_s.length < 1 - fail ArgumentError, "invalid value for 'name', the character length must be great than or equal to 1." - end - - @name = name - end - # Custom attribute writer method with validation # @param [Object] who Value to be assigned def who=(who) if who.nil? - fail ArgumentError, "who cannot be nil" + fail ArgumentError, 'who cannot be nil' end if who.to_s.length < 1 - fail ArgumentError, "invalid value for 'who', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "who", the character length must be great than or equal to 1.' end @who = who end # Custom attribute writer method with validation - # @param [Object] from_email Value to be assigned - def from_email=(from_email) - if from_email.nil? - fail ArgumentError, "from_email cannot be nil" - end - - if from_email.to_s.length < 1 - fail ArgumentError, "invalid value for 'from_email', the character length must be great than or equal to 1." + # @param [Object] name Value to be assigned + def name=(name) + if !name.nil? && name.to_s.length < 1 + fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' end - @from_email = from_email + @name = name end # Custom attribute writer method with validation - # @param [Object] uuid Value to be assigned - def uuid=(uuid) + # @param [Object] autocomplete Value to be assigned + def autocomplete=(autocomplete) + if autocomplete.nil? + fail ArgumentError, 'autocomplete cannot be nil' + end - if !uuid.nil? && uuid.to_s.length < 1 - fail ArgumentError, "invalid value for 'uuid', the character length must be great than or equal to 1." + if autocomplete.to_s.length < 1 + fail ArgumentError, 'invalid value for "autocomplete", the character length must be great than or equal to 1.' end - @uuid = uuid + @autocomplete = autocomplete end # Custom attribute writer method with validation - # @param [Object] autocomplete Value to be assigned - def autocomplete=(autocomplete) - if autocomplete.nil? - fail ArgumentError, "autocomplete cannot be nil" + # @param [Object] from_email Value to be assigned + def from_email=(from_email) + if from_email.nil? + fail ArgumentError, 'from_email cannot be nil' end - if autocomplete.to_s.length < 1 - fail ArgumentError, "invalid value for 'autocomplete', the character length must be great than or equal to 1." + if from_email.to_s.length < 1 + fail ArgumentError, 'invalid value for "from_email", the character length must be great than or equal to 1.' end - @autocomplete = autocomplete + @from_email = from_email end # Custom attribute writer method with validation # @param [Object] status_display Value to be assigned def status_display=(status_display) - if !status_display.nil? && status_display.to_s.length < 1 - fail ArgumentError, "invalid value for 'status_display', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "status_display", the character length must be great than or equal to 1.' end @status_display = status_display @@ -338,9 +331,8 @@ def status_display=(status_display) # Custom attribute writer method with validation # @param [Object] parent_doc Value to be assigned def parent_doc=(parent_doc) - if !parent_doc.nil? && parent_doc.to_s.length < 1 - fail ArgumentError, "invalid value for 'parent_doc', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "parent_doc", the character length must be great than or equal to 1.' end @parent_doc = parent_doc @@ -349,9 +341,8 @@ def parent_doc=(parent_doc) # Custom attribute writer method with validation # @param [Object] subdomain Value to be assigned def subdomain=(subdomain) - if !subdomain.nil? && subdomain.to_s.length < 1 - fail ArgumentError, "invalid value for 'subdomain', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "subdomain", the character length must be great than or equal to 1.' end @subdomain = subdomain @@ -362,14 +353,14 @@ def subdomain=(subdomain) def ==(o) return true if self.equal?(o) self.class == o.class && - status == o.status && - name == o.name && - who == o.who && - nr_extra_docs == o.nr_extra_docs && - from_email == o.from_email && uuid == o.uuid && created == o.created && + status == o.status && + who == o.who && + name == o.name && autocomplete == o.autocomplete && + from_email == o.from_email && + nr_extra_docs == o.nr_extra_docs && signer_emails == o.signer_emails && status_display == o.status_display && created_timestamp == o.created_timestamp && @@ -388,7 +379,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [status, name, who, nr_extra_docs, from_email, uuid, created, autocomplete, signer_emails, status_display, created_timestamp, finished_on_timestamp, parent_doc, finished_on, subdomain].hash + [uuid, created, status, who, name, autocomplete, from_email, nr_extra_docs, signer_emails, status_display, created_timestamp, finished_on_timestamp, parent_doc, finished_on, subdomain].hash end # Builds the object from hash @@ -401,7 +392,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -483,7 +474,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -494,7 +485,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/document_signer_template_conf.rb b/lib/signrequest_client/models/document_signer_template_conf.rb index bf84db3..ff783dc 100644 --- a/lib/signrequest_client/models/document_signer_template_conf.rb +++ b/lib/signrequest_client/models/document_signer_template_conf.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class DocumentSignerTemplateConf attr_accessor :signer_index @@ -29,7 +28,6 @@ class DocumentSignerTemplateConf attr_accessor :placeholders - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -62,7 +60,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'signer_index') self.signer_index = attributes[:'signer_index'] @@ -93,7 +91,6 @@ def initialize(attributes = {}) self.placeholders = value end end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -101,22 +98,22 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if !@signer_index.nil? && @signer_index > 2147483647 - invalid_properties.push("invalid value for 'signer_index', must be smaller than or equal to 2147483647.") + invalid_properties.push('invalid value for "signer_index", must be smaller than or equal to 2147483647.') end if !@signer_index.nil? && @signer_index < -2147483648 - invalid_properties.push("invalid value for 'signer_index', must be greater than or equal to -2147483648.") + invalid_properties.push('invalid value for "signer_index", must be greater than or equal to -2147483648.') end if !@order.nil? && @order > 2147483647 - invalid_properties.push("invalid value for 'order', must be smaller than or equal to 2147483647.") + invalid_properties.push('invalid value for "order", must be smaller than or equal to 2147483647.') end if !@order.nil? && @order < 0 - invalid_properties.push("invalid value for 'order', must be greater than or equal to 0.") + invalid_properties.push('invalid value for "order", must be greater than or equal to 0.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid @@ -126,19 +123,18 @@ def valid? return false if !@signer_index.nil? && @signer_index < -2147483648 return false if !@order.nil? && @order > 2147483647 return false if !@order.nil? && @order < 0 - return true + true end # Custom attribute writer method with validation # @param [Object] signer_index Value to be assigned def signer_index=(signer_index) - if !signer_index.nil? && signer_index > 2147483647 - fail ArgumentError, "invalid value for 'signer_index', must be smaller than or equal to 2147483647." + fail ArgumentError, 'invalid value for "signer_index", must be smaller than or equal to 2147483647.' end if !signer_index.nil? && signer_index < -2147483648 - fail ArgumentError, "invalid value for 'signer_index', must be greater than or equal to -2147483648." + fail ArgumentError, 'invalid value for "signer_index", must be greater than or equal to -2147483648.' end @signer_index = signer_index @@ -147,13 +143,12 @@ def signer_index=(signer_index) # Custom attribute writer method with validation # @param [Object] order Value to be assigned def order=(order) - if !order.nil? && order > 2147483647 - fail ArgumentError, "invalid value for 'order', must be smaller than or equal to 2147483647." + fail ArgumentError, 'invalid value for "order", must be smaller than or equal to 2147483647.' end if !order.nil? && order < 0 - fail ArgumentError, "invalid value for 'order', must be greater than or equal to 0." + fail ArgumentError, 'invalid value for "order", must be greater than or equal to 0.' end @order = order @@ -195,7 +190,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -277,7 +272,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -288,7 +283,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/document_signing_log.rb b/lib/signrequest_client/models/document_signing_log.rb new file mode 100644 index 0000000..93e9f64 --- /dev/null +++ b/lib/signrequest_client/models/document_signing_log.rb @@ -0,0 +1,209 @@ +=begin +#SignRequest API + +#API for SignRequest.com + +OpenAPI spec version: v1 +Contact: tech-support@signrequest.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.8 + +=end + +require 'date' + +module SignRequestClient + class DocumentSigningLog + # Temporary URL to signing log, expires in five minutes + attr_accessor :pdf + + # SHA256 hash of PDF contents + attr_accessor :security_hash + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pdf' => :'pdf', + :'security_hash' => :'security_hash' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'pdf' => :'String', + :'security_hash' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'pdf') + self.pdf = attributes[:'pdf'] + end + + if attributes.has_key?(:'security_hash') + self.security_hash = attributes[:'security_hash'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@security_hash.nil? && @security_hash.to_s.length < 1 + invalid_properties.push('invalid value for "security_hash", the character length must be great than or equal to 1.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@security_hash.nil? && @security_hash.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param [Object] security_hash Value to be assigned + def security_hash=(security_hash) + if !security_hash.nil? && security_hash.to_s.length < 1 + fail ArgumentError, 'invalid value for "security_hash", the character length must be great than or equal to 1.' + end + + @security_hash = security_hash + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pdf == o.pdf && + security_hash == o.security_hash + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [pdf, security_hash].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SignRequestClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/signrequest_client/models/document_signrequest.rb b/lib/signrequest_client/models/document_signrequest.rb new file mode 100644 index 0000000..76ecec9 --- /dev/null +++ b/lib/signrequest_client/models/document_signrequest.rb @@ -0,0 +1,538 @@ +=begin +#SignRequest API + +#API for SignRequest.com + +OpenAPI spec version: v1 +Contact: tech-support@signrequest.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.8 + +=end + +require 'date' + +module SignRequestClient + class DocumentSignrequest + # Email of user sending the SignRequest (must be a validated email) + attr_accessor :from_email + + # Name to be used in the `From` email header, e.g. `{from_email_name} ` + attr_accessor :from_email_name + + # Have the sender of a SignRequest prepare the document before sending the request out, see: [prepare using the web interface](#section/Preparing-a-document/Prepare-using-the-web-interface) + attr_accessor :is_being_prepared + + attr_accessor :prepare_url + + # URL at which SignRequest will redirect to when a document is signed + attr_accessor :redirect_url + + # URL at which SignRequest will redirect to when a document is declined + attr_accessor :redirect_url_declined + + attr_accessor :required_attachments + + # Disable uploading/adding of attachments + attr_accessor :disable_attachments + + # Disable usage of signatures generated by typing (text) + attr_accessor :disable_text_signatures + + # Disable adding of text + attr_accessor :disable_text + + # Disable adding of dates + attr_accessor :disable_date + + # Disable all SignRequest status emails as well as the email that contains the signed documents + attr_accessor :disable_emails + + # Disable usage of uploaded signatures (images) + attr_accessor :disable_upload_signatures + + # Disables storing timestamp proof hashes in blockchain integrations. + attr_accessor :disable_blockchain_proof + + # When true a text message verification is needed before the signer can see the document + attr_accessor :text_message_verification_locked + + # Subject of SignRequest email + attr_accessor :subject + + # Message to include in SignRequest email, may contain the following html tags: `a`, `abbr`, `acronym`, `b`, `blockquote`, `code`, `em`, `i`, `ul`, `li`, `ol`, and `strong` + attr_accessor :message + + # `m`: only me, `mo`: me and others, `o`: only others + attr_accessor :who + + # Automatically remind signers to sign a document + attr_accessor :send_reminders + + attr_accessor :signers + + attr_accessor :uuid + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'from_email' => :'from_email', + :'from_email_name' => :'from_email_name', + :'is_being_prepared' => :'is_being_prepared', + :'prepare_url' => :'prepare_url', + :'redirect_url' => :'redirect_url', + :'redirect_url_declined' => :'redirect_url_declined', + :'required_attachments' => :'required_attachments', + :'disable_attachments' => :'disable_attachments', + :'disable_text_signatures' => :'disable_text_signatures', + :'disable_text' => :'disable_text', + :'disable_date' => :'disable_date', + :'disable_emails' => :'disable_emails', + :'disable_upload_signatures' => :'disable_upload_signatures', + :'disable_blockchain_proof' => :'disable_blockchain_proof', + :'text_message_verification_locked' => :'text_message_verification_locked', + :'subject' => :'subject', + :'message' => :'message', + :'who' => :'who', + :'send_reminders' => :'send_reminders', + :'signers' => :'signers', + :'uuid' => :'uuid' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'from_email' => :'String', + :'from_email_name' => :'String', + :'is_being_prepared' => :'BOOLEAN', + :'prepare_url' => :'String', + :'redirect_url' => :'String', + :'redirect_url_declined' => :'String', + :'required_attachments' => :'Array', + :'disable_attachments' => :'BOOLEAN', + :'disable_text_signatures' => :'BOOLEAN', + :'disable_text' => :'BOOLEAN', + :'disable_date' => :'BOOLEAN', + :'disable_emails' => :'BOOLEAN', + :'disable_upload_signatures' => :'BOOLEAN', + :'disable_blockchain_proof' => :'BOOLEAN', + :'text_message_verification_locked' => :'BOOLEAN', + :'subject' => :'String', + :'message' => :'String', + :'who' => :'String', + :'send_reminders' => :'BOOLEAN', + :'signers' => :'Array', + :'uuid' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'from_email') + self.from_email = attributes[:'from_email'] + end + + if attributes.has_key?(:'from_email_name') + self.from_email_name = attributes[:'from_email_name'] + end + + if attributes.has_key?(:'is_being_prepared') + self.is_being_prepared = attributes[:'is_being_prepared'] + end + + if attributes.has_key?(:'prepare_url') + self.prepare_url = attributes[:'prepare_url'] + end + + if attributes.has_key?(:'redirect_url') + self.redirect_url = attributes[:'redirect_url'] + end + + if attributes.has_key?(:'redirect_url_declined') + self.redirect_url_declined = attributes[:'redirect_url_declined'] + end + + if attributes.has_key?(:'required_attachments') + if (value = attributes[:'required_attachments']).is_a?(Array) + self.required_attachments = value + end + end + + if attributes.has_key?(:'disable_attachments') + self.disable_attachments = attributes[:'disable_attachments'] + end + + if attributes.has_key?(:'disable_text_signatures') + self.disable_text_signatures = attributes[:'disable_text_signatures'] + end + + if attributes.has_key?(:'disable_text') + self.disable_text = attributes[:'disable_text'] + end + + if attributes.has_key?(:'disable_date') + self.disable_date = attributes[:'disable_date'] + end + + if attributes.has_key?(:'disable_emails') + self.disable_emails = attributes[:'disable_emails'] + end + + if attributes.has_key?(:'disable_upload_signatures') + self.disable_upload_signatures = attributes[:'disable_upload_signatures'] + end + + if attributes.has_key?(:'disable_blockchain_proof') + self.disable_blockchain_proof = attributes[:'disable_blockchain_proof'] + end + + if attributes.has_key?(:'text_message_verification_locked') + self.text_message_verification_locked = attributes[:'text_message_verification_locked'] + end + + if attributes.has_key?(:'subject') + self.subject = attributes[:'subject'] + end + + if attributes.has_key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.has_key?(:'who') + self.who = attributes[:'who'] + end + + if attributes.has_key?(:'send_reminders') + self.send_reminders = attributes[:'send_reminders'] + end + + if attributes.has_key?(:'signers') + if (value = attributes[:'signers']).is_a?(Array) + self.signers = value + end + end + + if attributes.has_key?(:'uuid') + self.uuid = attributes[:'uuid'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@from_email.nil? && @from_email.to_s.length < 1 + invalid_properties.push('invalid value for "from_email", the character length must be great than or equal to 1.') + end + + if !@from_email_name.nil? && @from_email_name.to_s.length < 1 + invalid_properties.push('invalid value for "from_email_name", the character length must be great than or equal to 1.') + end + + if !@prepare_url.nil? && @prepare_url.to_s.length < 1 + invalid_properties.push('invalid value for "prepare_url", the character length must be great than or equal to 1.') + end + + if !@redirect_url.nil? && @redirect_url.to_s.length < 1 + invalid_properties.push('invalid value for "redirect_url", the character length must be great than or equal to 1.') + end + + if !@redirect_url_declined.nil? && @redirect_url_declined.to_s.length < 1 + invalid_properties.push('invalid value for "redirect_url_declined", the character length must be great than or equal to 1.') + end + + if !@subject.nil? && @subject.to_s.length < 1 + invalid_properties.push('invalid value for "subject", the character length must be great than or equal to 1.') + end + + if !@message.nil? && @message.to_s.length < 1 + invalid_properties.push('invalid value for "message", the character length must be great than or equal to 1.') + end + + if !@uuid.nil? && @uuid.to_s.length < 1 + invalid_properties.push('invalid value for "uuid", the character length must be great than or equal to 1.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@from_email.nil? && @from_email.to_s.length < 1 + return false if !@from_email_name.nil? && @from_email_name.to_s.length < 1 + return false if !@prepare_url.nil? && @prepare_url.to_s.length < 1 + return false if !@redirect_url.nil? && @redirect_url.to_s.length < 1 + return false if !@redirect_url_declined.nil? && @redirect_url_declined.to_s.length < 1 + return false if !@subject.nil? && @subject.to_s.length < 1 + return false if !@message.nil? && @message.to_s.length < 1 + who_validator = EnumAttributeValidator.new('String', ['m', 'mo', 'o']) + return false unless who_validator.valid?(@who) + return false if !@uuid.nil? && @uuid.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param [Object] from_email Value to be assigned + def from_email=(from_email) + if !from_email.nil? && from_email.to_s.length < 1 + fail ArgumentError, 'invalid value for "from_email", the character length must be great than or equal to 1.' + end + + @from_email = from_email + end + + # Custom attribute writer method with validation + # @param [Object] from_email_name Value to be assigned + def from_email_name=(from_email_name) + if !from_email_name.nil? && from_email_name.to_s.length < 1 + fail ArgumentError, 'invalid value for "from_email_name", the character length must be great than or equal to 1.' + end + + @from_email_name = from_email_name + end + + # Custom attribute writer method with validation + # @param [Object] prepare_url Value to be assigned + def prepare_url=(prepare_url) + if !prepare_url.nil? && prepare_url.to_s.length < 1 + fail ArgumentError, 'invalid value for "prepare_url", the character length must be great than or equal to 1.' + end + + @prepare_url = prepare_url + end + + # Custom attribute writer method with validation + # @param [Object] redirect_url Value to be assigned + def redirect_url=(redirect_url) + if !redirect_url.nil? && redirect_url.to_s.length < 1 + fail ArgumentError, 'invalid value for "redirect_url", the character length must be great than or equal to 1.' + end + + @redirect_url = redirect_url + end + + # Custom attribute writer method with validation + # @param [Object] redirect_url_declined Value to be assigned + def redirect_url_declined=(redirect_url_declined) + if !redirect_url_declined.nil? && redirect_url_declined.to_s.length < 1 + fail ArgumentError, 'invalid value for "redirect_url_declined", the character length must be great than or equal to 1.' + end + + @redirect_url_declined = redirect_url_declined + end + + # Custom attribute writer method with validation + # @param [Object] subject Value to be assigned + def subject=(subject) + if !subject.nil? && subject.to_s.length < 1 + fail ArgumentError, 'invalid value for "subject", the character length must be great than or equal to 1.' + end + + @subject = subject + end + + # Custom attribute writer method with validation + # @param [Object] message Value to be assigned + def message=(message) + if !message.nil? && message.to_s.length < 1 + fail ArgumentError, 'invalid value for "message", the character length must be great than or equal to 1.' + end + + @message = message + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] who Object to be assigned + def who=(who) + validator = EnumAttributeValidator.new('String', ['m', 'mo', 'o']) + unless validator.valid?(who) + fail ArgumentError, 'invalid value for "who", must be one of #{validator.allowable_values}.' + end + @who = who + end + + # Custom attribute writer method with validation + # @param [Object] uuid Value to be assigned + def uuid=(uuid) + if !uuid.nil? && uuid.to_s.length < 1 + fail ArgumentError, 'invalid value for "uuid", the character length must be great than or equal to 1.' + end + + @uuid = uuid + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + from_email == o.from_email && + from_email_name == o.from_email_name && + is_being_prepared == o.is_being_prepared && + prepare_url == o.prepare_url && + redirect_url == o.redirect_url && + redirect_url_declined == o.redirect_url_declined && + required_attachments == o.required_attachments && + disable_attachments == o.disable_attachments && + disable_text_signatures == o.disable_text_signatures && + disable_text == o.disable_text && + disable_date == o.disable_date && + disable_emails == o.disable_emails && + disable_upload_signatures == o.disable_upload_signatures && + disable_blockchain_proof == o.disable_blockchain_proof && + text_message_verification_locked == o.text_message_verification_locked && + subject == o.subject && + message == o.message && + who == o.who && + send_reminders == o.send_reminders && + signers == o.signers && + uuid == o.uuid + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [from_email, from_email_name, is_being_prepared, prepare_url, redirect_url, redirect_url_declined, required_attachments, disable_attachments, disable_text_signatures, disable_text, disable_date, disable_emails, disable_upload_signatures, disable_blockchain_proof, text_message_verification_locked, subject, message, who, send_reminders, signers, uuid].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SignRequestClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/signrequest_client/models/document_team.rb b/lib/signrequest_client/models/document_team.rb new file mode 100644 index 0000000..ad67749 --- /dev/null +++ b/lib/signrequest_client/models/document_team.rb @@ -0,0 +1,240 @@ +=begin +#SignRequest API + +#API for SignRequest.com + +OpenAPI spec version: v1 +Contact: tech-support@signrequest.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.8 + +=end + +require 'date' + +module SignRequestClient + class DocumentTeam + attr_accessor :name + + attr_accessor :subdomain + + attr_accessor :url + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'subdomain' => :'subdomain', + :'url' => :'url' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'name' => :'String', + :'subdomain' => :'String', + :'url' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.has_key?(:'subdomain') + self.subdomain = attributes[:'subdomain'] + end + + if attributes.has_key?(:'url') + self.url = attributes[:'url'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@name.nil? && @name.to_s.length < 1 + invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.') + end + + if !@subdomain.nil? && @subdomain.to_s.length < 1 + invalid_properties.push('invalid value for "subdomain", the character length must be great than or equal to 1.') + end + + if !@subdomain.nil? && @subdomain !~ Regexp.new(/^[-a-zA-Z0-9_]+$/) + invalid_properties.push('invalid value for "subdomain", must conform to the pattern /^[-a-zA-Z0-9_]+$/.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@name.nil? && @name.to_s.length < 1 + return false if !@subdomain.nil? && @subdomain.to_s.length < 1 + return false if !@subdomain.nil? && @subdomain !~ Regexp.new(/^[-a-zA-Z0-9_]+$/) + true + end + + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if !name.nil? && name.to_s.length < 1 + fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' + end + + @name = name + end + + # Custom attribute writer method with validation + # @param [Object] subdomain Value to be assigned + def subdomain=(subdomain) + if !subdomain.nil? && subdomain.to_s.length < 1 + fail ArgumentError, 'invalid value for "subdomain", the character length must be great than or equal to 1.' + end + + if !subdomain.nil? && subdomain !~ Regexp.new(/^[-a-zA-Z0-9_]+$/) + fail ArgumentError, 'invalid value for "subdomain", must conform to the pattern /^[-a-zA-Z0-9_]+$/.' + end + + @subdomain = subdomain + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + subdomain == o.subdomain && + url == o.url + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [name, subdomain, url].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SignRequestClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/signrequest_client/models/event.rb b/lib/signrequest_client/models/event.rb index 27c9582..3804013 100644 --- a/lib/signrequest_client/models/event.rb +++ b/lib/signrequest_client/models/event.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class Event attr_accessor :uuid @@ -29,6 +28,8 @@ class Event attr_accessor :timestamp + attr_accessor :team + attr_accessor :document attr_accessor :signer @@ -65,6 +66,7 @@ def self.attribute_map :'delivered_on' => :'delivered_on', :'callback_status_code' => :'callback_status_code', :'timestamp' => :'timestamp', + :'team' => :'team', :'document' => :'document', :'signer' => :'signer' } @@ -80,6 +82,7 @@ def self.swagger_types :'delivered_on' => :'DateTime', :'callback_status_code' => :'Integer', :'timestamp' => :'DateTime', + :'team' => :'DocumentTeam', :'document' => :'Document', :'signer' => :'Signer' } @@ -91,7 +94,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'uuid') self.uuid = attributes[:'uuid'] @@ -121,6 +124,10 @@ def initialize(attributes = {}) self.timestamp = attributes[:'timestamp'] end + if attributes.has_key?(:'team') + self.team = attributes[:'team'] + end + if attributes.has_key?(:'document') self.document = attributes[:'document'] end @@ -128,7 +135,6 @@ def initialize(attributes = {}) if attributes.has_key?(:'signer') self.signer = attributes[:'signer'] end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -136,29 +142,28 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if !@uuid.nil? && @uuid.to_s.length < 1 - invalid_properties.push("invalid value for 'uuid', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "uuid", the character length must be great than or equal to 1.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? return false if !@uuid.nil? && @uuid.to_s.length < 1 - status_validator = EnumAttributeValidator.new('String', ["ok", "error"]) + status_validator = EnumAttributeValidator.new('String', ['ok', 'error']) return false unless status_validator.valid?(@status) - event_type_validator = EnumAttributeValidator.new('String', ["convert_error", "converted", "sending_error", "sent", "declined", "cancelled", "expired", "signed", "viewed", "downloaded", "signer_signed", "signer_email_bounced", "signer_viewed_email", "signer_viewed", "signer_forwarded", "signer_downloaded", "signrequest_received"]) + event_type_validator = EnumAttributeValidator.new('String', ['convert_error', 'converted', 'sending_error', 'sent', 'declined', 'cancelled', 'expired', 'signed', 'viewed', 'downloaded', 'signer_signed', 'signer_email_bounced', 'signer_viewed_email', 'signer_viewed', 'signer_forwarded', 'signer_downloaded', 'signrequest_received']) return false unless event_type_validator.valid?(@event_type) - return true + true end # Custom attribute writer method with validation # @param [Object] uuid Value to be assigned def uuid=(uuid) - if !uuid.nil? && uuid.to_s.length < 1 - fail ArgumentError, "invalid value for 'uuid', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "uuid", the character length must be great than or equal to 1.' end @uuid = uuid @@ -167,9 +172,9 @@ def uuid=(uuid) # Custom attribute writer method checking allowed values (enum). # @param [Object] status Object to be assigned def status=(status) - validator = EnumAttributeValidator.new('String', ["ok", "error"]) + validator = EnumAttributeValidator.new('String', ['ok', 'error']) unless validator.valid?(status) - fail ArgumentError, "invalid value for 'status', must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.' end @status = status end @@ -177,9 +182,9 @@ def status=(status) # Custom attribute writer method checking allowed values (enum). # @param [Object] event_type Object to be assigned def event_type=(event_type) - validator = EnumAttributeValidator.new('String', ["convert_error", "converted", "sending_error", "sent", "declined", "cancelled", "expired", "signed", "viewed", "downloaded", "signer_signed", "signer_email_bounced", "signer_viewed_email", "signer_viewed", "signer_forwarded", "signer_downloaded", "signrequest_received"]) + validator = EnumAttributeValidator.new('String', ['convert_error', 'converted', 'sending_error', 'sent', 'declined', 'cancelled', 'expired', 'signed', 'viewed', 'downloaded', 'signer_signed', 'signer_email_bounced', 'signer_viewed_email', 'signer_viewed', 'signer_forwarded', 'signer_downloaded', 'signrequest_received']) unless validator.valid?(event_type) - fail ArgumentError, "invalid value for 'event_type', must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "event_type", must be one of #{validator.allowable_values}.' end @event_type = event_type end @@ -196,6 +201,7 @@ def ==(o) delivered_on == o.delivered_on && callback_status_code == o.callback_status_code && timestamp == o.timestamp && + team == o.team && document == o.document && signer == o.signer end @@ -209,7 +215,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [uuid, status, event_type, delivered, delivered_on, callback_status_code, timestamp, document, signer].hash + [uuid, status, event_type, delivered, delivered_on, callback_status_code, timestamp, team, document, signer].hash end # Builds the object from hash @@ -222,7 +228,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -304,7 +310,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -315,7 +321,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/file_from_sf.rb b/lib/signrequest_client/models/file_from_sf.rb index eb1c1a3..4f922f5 100644 --- a/lib/signrequest_client/models/file_from_sf.rb +++ b/lib/signrequest_client/models/file_from_sf.rb @@ -6,25 +6,26 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class FileFromSf attr_accessor :object_type attr_accessor :object_id + attr_accessor :uid # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'object_type' => :'object_type', - :'object_id' => :'object_id' + :'object_id' => :'object_id', + :'uid' => :'uid' } end @@ -32,7 +33,8 @@ def self.attribute_map def self.swagger_types { :'object_type' => :'String', - :'object_id' => :'String' + :'object_id' => :'String', + :'uid' => :'String' } end @@ -42,7 +44,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'object_type') self.object_type = attributes[:'object_type'] @@ -52,6 +54,9 @@ def initialize(attributes = {}) self.object_id = attributes[:'object_id'] end + if attributes.has_key?(:'uid') + self.uid = attributes[:'uid'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -59,22 +64,26 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if @object_type.nil? - invalid_properties.push("invalid value for 'object_type', object_type cannot be nil.") + invalid_properties.push('invalid value for "object_type", object_type cannot be nil.') end if @object_type.to_s.length < 1 - invalid_properties.push("invalid value for 'object_type', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "object_type", the character length must be great than or equal to 1.') end if @object_id.nil? - invalid_properties.push("invalid value for 'object_id', object_id cannot be nil.") + invalid_properties.push('invalid value for "object_id", object_id cannot be nil.') end if @object_id.to_s.length < 1 - invalid_properties.push("invalid value for 'object_id', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "object_id", the character length must be great than or equal to 1.') + end + + if !@uid.nil? && @uid.to_s.length < 1 + invalid_properties.push('invalid value for "uid", the character length must be great than or equal to 1.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid @@ -84,18 +93,19 @@ def valid? return false if @object_type.to_s.length < 1 return false if @object_id.nil? return false if @object_id.to_s.length < 1 - return true + return false if !@uid.nil? && @uid.to_s.length < 1 + true end # Custom attribute writer method with validation # @param [Object] object_type Value to be assigned def object_type=(object_type) if object_type.nil? - fail ArgumentError, "object_type cannot be nil" + fail ArgumentError, 'object_type cannot be nil' end if object_type.to_s.length < 1 - fail ArgumentError, "invalid value for 'object_type', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "object_type", the character length must be great than or equal to 1.' end @object_type = object_type @@ -105,23 +115,34 @@ def object_type=(object_type) # @param [Object] object_id Value to be assigned def object_id=(object_id) if object_id.nil? - fail ArgumentError, "object_id cannot be nil" + fail ArgumentError, 'object_id cannot be nil' end if object_id.to_s.length < 1 - fail ArgumentError, "invalid value for 'object_id', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "object_id", the character length must be great than or equal to 1.' end @object_id = object_id end + # Custom attribute writer method with validation + # @param [Object] uid Value to be assigned + def uid=(uid) + if !uid.nil? && uid.to_s.length < 1 + fail ArgumentError, 'invalid value for "uid", the character length must be great than or equal to 1.' + end + + @uid = uid + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && object_type == o.object_type && - object_id == o.object_id + object_id == o.object_id && + uid == o.uid end # @see the `==` method @@ -133,7 +154,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [object_type, object_id].hash + [object_type, object_id, uid].hash end # Builds the object from hash @@ -146,7 +167,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -228,7 +249,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -239,7 +260,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/inline_document_signer_integration_data.rb b/lib/signrequest_client/models/inline_document_signer_integration_data.rb index d9e68fd..0593db9 100644 --- a/lib/signrequest_client/models/inline_document_signer_integration_data.rb +++ b/lib/signrequest_client/models/inline_document_signer_integration_data.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class InlineDocumentSignerIntegrationData attr_accessor :integration @@ -63,7 +62,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'integration') self.integration = attributes[:'integration'] @@ -72,30 +71,29 @@ def initialize(attributes = {}) if attributes.has_key?(:'integration_data') self.integration_data = attributes[:'integration_data'] end - end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - integration_validator = EnumAttributeValidator.new('String', ["mfiles", "salesforce", "formdesk", "zapier", "txhash"]) + integration_validator = EnumAttributeValidator.new('String', ['mfiles', 'salesforce', 'formdesk', 'zapier', 'txhash']) return false unless integration_validator.valid?(@integration) - return true + true end # Custom attribute writer method checking allowed values (enum). # @param [Object] integration Object to be assigned def integration=(integration) - validator = EnumAttributeValidator.new('String', ["mfiles", "salesforce", "formdesk", "zapier", "txhash"]) + validator = EnumAttributeValidator.new('String', ['mfiles', 'salesforce', 'formdesk', 'zapier', 'txhash']) unless validator.valid?(integration) - fail ArgumentError, "invalid value for 'integration', must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "integration", must be one of #{validator.allowable_values}.' end @integration = integration end @@ -131,7 +129,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -213,7 +211,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -224,7 +222,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/inline_integration_data.rb b/lib/signrequest_client/models/inline_integration_data.rb index 491c954..1ecd3f3 100644 --- a/lib/signrequest_client/models/inline_integration_data.rb +++ b/lib/signrequest_client/models/inline_integration_data.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class InlineIntegrationData attr_accessor :integration @@ -63,7 +62,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'integration') self.integration = attributes[:'integration'] @@ -72,30 +71,29 @@ def initialize(attributes = {}) if attributes.has_key?(:'integration_data') self.integration_data = attributes[:'integration_data'] end - end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - integration_validator = EnumAttributeValidator.new('String', ["mfiles", "salesforce", "formdesk", "zapier", "txhash"]) + integration_validator = EnumAttributeValidator.new('String', ['mfiles', 'salesforce', 'formdesk', 'zapier', 'txhash']) return false unless integration_validator.valid?(@integration) - return true + true end # Custom attribute writer method checking allowed values (enum). # @param [Object] integration Object to be assigned def integration=(integration) - validator = EnumAttributeValidator.new('String', ["mfiles", "salesforce", "formdesk", "zapier", "txhash"]) + validator = EnumAttributeValidator.new('String', ['mfiles', 'salesforce', 'formdesk', 'zapier', 'txhash']) unless validator.valid?(integration) - fail ArgumentError, "invalid value for 'integration', must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "integration", must be one of #{validator.allowable_values}.' end @integration = integration end @@ -131,7 +129,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -213,7 +211,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -224,7 +222,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/inline_prefill_tags.rb b/lib/signrequest_client/models/inline_prefill_tags.rb index 2d6ceaf..446b937 100644 --- a/lib/signrequest_client/models/inline_prefill_tags.rb +++ b/lib/signrequest_client/models/inline_prefill_tags.rb @@ -6,7 +6,7 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end @@ -23,7 +23,6 @@ class InlinePrefillTags attr_accessor :date_value - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -50,7 +49,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'external_id') self.external_id = attributes[:'external_id'] @@ -67,7 +66,6 @@ def initialize(attributes = {}) if attributes.has_key?(:'date_value') self.date_value = attributes[:'date_value'] end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -75,25 +73,24 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if !@external_id.nil? && @external_id.to_s.length > 255 - invalid_properties.push("invalid value for 'external_id', the character length must be smaller than or equal to 255.") + invalid_properties.push('invalid value for "external_id", the character length must be smaller than or equal to 255.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? return false if !@external_id.nil? && @external_id.to_s.length > 255 - return true + true end # Custom attribute writer method with validation # @param [Object] external_id Value to be assigned def external_id=(external_id) - if !external_id.nil? && external_id.to_s.length > 255 - fail ArgumentError, "invalid value for 'external_id', the character length must be smaller than or equal to 255." + fail ArgumentError, 'invalid value for "external_id", the character length must be smaller than or equal to 255.' end @external_id = external_id @@ -132,7 +129,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -214,7 +211,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -225,7 +222,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/inline_response_200.rb b/lib/signrequest_client/models/inline_response_200.rb index 20ed5ac..e637915 100644 --- a/lib/signrequest_client/models/inline_response_200.rb +++ b/lib/signrequest_client/models/inline_response_200.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class InlineResponse200 attr_accessor :count @@ -23,7 +22,6 @@ class InlineResponse200 attr_accessor :results - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -50,7 +48,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'count') self.count = attributes[:'count'] @@ -69,7 +67,6 @@ def initialize(attributes = {}) self.results = value end end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -77,14 +74,14 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if @count.nil? - invalid_properties.push("invalid value for 'count', count cannot be nil.") + invalid_properties.push('invalid value for "count", count cannot be nil.') end if @results.nil? - invalid_properties.push("invalid value for 'results', results cannot be nil.") + invalid_properties.push('invalid value for "results", results cannot be nil.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid @@ -92,7 +89,7 @@ def list_invalid_properties def valid? return false if @count.nil? return false if @results.nil? - return true + true end # Checks equality by comparing each attribute. @@ -128,7 +125,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -210,7 +207,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -221,7 +218,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/inline_response_200_1.rb b/lib/signrequest_client/models/inline_response_200_1.rb index 2a8c57f..229a9a5 100644 --- a/lib/signrequest_client/models/inline_response_200_1.rb +++ b/lib/signrequest_client/models/inline_response_200_1.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class InlineResponse2001 attr_accessor :count @@ -23,7 +22,6 @@ class InlineResponse2001 attr_accessor :results - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -50,7 +48,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'count') self.count = attributes[:'count'] @@ -69,7 +67,6 @@ def initialize(attributes = {}) self.results = value end end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -77,14 +74,14 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if @count.nil? - invalid_properties.push("invalid value for 'count', count cannot be nil.") + invalid_properties.push('invalid value for "count", count cannot be nil.') end if @results.nil? - invalid_properties.push("invalid value for 'results', results cannot be nil.") + invalid_properties.push('invalid value for "results", results cannot be nil.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid @@ -92,7 +89,7 @@ def list_invalid_properties def valid? return false if @count.nil? return false if @results.nil? - return true + true end # Checks equality by comparing each attribute. @@ -128,7 +125,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -210,7 +207,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -221,7 +218,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/inline_response_200_2.rb b/lib/signrequest_client/models/inline_response_200_2.rb index 3682678..6f49e40 100644 --- a/lib/signrequest_client/models/inline_response_200_2.rb +++ b/lib/signrequest_client/models/inline_response_200_2.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class InlineResponse2002 attr_accessor :count @@ -23,7 +22,6 @@ class InlineResponse2002 attr_accessor :results - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -50,7 +48,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'count') self.count = attributes[:'count'] @@ -69,7 +67,6 @@ def initialize(attributes = {}) self.results = value end end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -77,14 +74,14 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if @count.nil? - invalid_properties.push("invalid value for 'count', count cannot be nil.") + invalid_properties.push('invalid value for "count", count cannot be nil.') end if @results.nil? - invalid_properties.push("invalid value for 'results', results cannot be nil.") + invalid_properties.push('invalid value for "results", results cannot be nil.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid @@ -92,7 +89,7 @@ def list_invalid_properties def valid? return false if @count.nil? return false if @results.nil? - return true + true end # Checks equality by comparing each attribute. @@ -128,7 +125,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -210,7 +207,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -221,7 +218,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/inline_response_200_3.rb b/lib/signrequest_client/models/inline_response_200_3.rb index 1f46d69..01e7d7c 100644 --- a/lib/signrequest_client/models/inline_response_200_3.rb +++ b/lib/signrequest_client/models/inline_response_200_3.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class InlineResponse2003 attr_accessor :count @@ -23,7 +22,6 @@ class InlineResponse2003 attr_accessor :results - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -50,7 +48,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'count') self.count = attributes[:'count'] @@ -69,7 +67,6 @@ def initialize(attributes = {}) self.results = value end end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -77,14 +74,14 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if @count.nil? - invalid_properties.push("invalid value for 'count', count cannot be nil.") + invalid_properties.push('invalid value for "count", count cannot be nil.') end if @results.nil? - invalid_properties.push("invalid value for 'results', results cannot be nil.") + invalid_properties.push('invalid value for "results", results cannot be nil.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid @@ -92,7 +89,7 @@ def list_invalid_properties def valid? return false if @count.nil? return false if @results.nil? - return true + true end # Checks equality by comparing each attribute. @@ -128,7 +125,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -210,7 +207,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -221,7 +218,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/inline_response_200_4.rb b/lib/signrequest_client/models/inline_response_200_4.rb index d77575f..fc54dcf 100644 --- a/lib/signrequest_client/models/inline_response_200_4.rb +++ b/lib/signrequest_client/models/inline_response_200_4.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class InlineResponse2004 attr_accessor :count @@ -23,7 +22,6 @@ class InlineResponse2004 attr_accessor :results - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -50,7 +48,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'count') self.count = attributes[:'count'] @@ -69,7 +67,6 @@ def initialize(attributes = {}) self.results = value end end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -77,14 +74,14 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if @count.nil? - invalid_properties.push("invalid value for 'count', count cannot be nil.") + invalid_properties.push('invalid value for "count", count cannot be nil.') end if @results.nil? - invalid_properties.push("invalid value for 'results', results cannot be nil.") + invalid_properties.push('invalid value for "results", results cannot be nil.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid @@ -92,7 +89,7 @@ def list_invalid_properties def valid? return false if @count.nil? return false if @results.nil? - return true + true end # Checks equality by comparing each attribute. @@ -128,7 +125,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -210,7 +207,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -221,7 +218,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/inline_response_200_5.rb b/lib/signrequest_client/models/inline_response_200_5.rb index 51e2e94..d4a7b1b 100644 --- a/lib/signrequest_client/models/inline_response_200_5.rb +++ b/lib/signrequest_client/models/inline_response_200_5.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class InlineResponse2005 attr_accessor :count @@ -23,7 +22,6 @@ class InlineResponse2005 attr_accessor :results - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -50,7 +48,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'count') self.count = attributes[:'count'] @@ -69,7 +67,6 @@ def initialize(attributes = {}) self.results = value end end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -77,14 +74,14 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if @count.nil? - invalid_properties.push("invalid value for 'count', count cannot be nil.") + invalid_properties.push('invalid value for "count", count cannot be nil.') end if @results.nil? - invalid_properties.push("invalid value for 'results', results cannot be nil.") + invalid_properties.push('invalid value for "results", results cannot be nil.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid @@ -92,7 +89,7 @@ def list_invalid_properties def valid? return false if @count.nil? return false if @results.nil? - return true + true end # Checks equality by comparing each attribute. @@ -128,7 +125,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -210,7 +207,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -221,7 +218,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/inline_response_200_6.rb b/lib/signrequest_client/models/inline_response_200_6.rb index 72053d0..380add2 100644 --- a/lib/signrequest_client/models/inline_response_200_6.rb +++ b/lib/signrequest_client/models/inline_response_200_6.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class InlineResponse2006 attr_accessor :count @@ -23,7 +22,6 @@ class InlineResponse2006 attr_accessor :results - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -50,7 +48,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'count') self.count = attributes[:'count'] @@ -69,7 +67,6 @@ def initialize(attributes = {}) self.results = value end end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -77,14 +74,14 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if @count.nil? - invalid_properties.push("invalid value for 'count', count cannot be nil.") + invalid_properties.push('invalid value for "count", count cannot be nil.') end if @results.nil? - invalid_properties.push("invalid value for 'results', results cannot be nil.") + invalid_properties.push('invalid value for "results", results cannot be nil.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid @@ -92,7 +89,7 @@ def list_invalid_properties def valid? return false if @count.nil? return false if @results.nil? - return true + true end # Checks equality by comparing each attribute. @@ -128,7 +125,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -210,7 +207,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -221,7 +218,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/inline_response_200_7.rb b/lib/signrequest_client/models/inline_response_200_7.rb index 4a51e14..5c71fb0 100644 --- a/lib/signrequest_client/models/inline_response_200_7.rb +++ b/lib/signrequest_client/models/inline_response_200_7.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class InlineResponse2007 attr_accessor :count @@ -23,7 +22,6 @@ class InlineResponse2007 attr_accessor :results - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -50,7 +48,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'count') self.count = attributes[:'count'] @@ -69,7 +67,6 @@ def initialize(attributes = {}) self.results = value end end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -77,14 +74,14 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if @count.nil? - invalid_properties.push("invalid value for 'count', count cannot be nil.") + invalid_properties.push('invalid value for "count", count cannot be nil.') end if @results.nil? - invalid_properties.push("invalid value for 'results', results cannot be nil.") + invalid_properties.push('invalid value for "results", results cannot be nil.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid @@ -92,7 +89,7 @@ def list_invalid_properties def valid? return false if @count.nil? return false if @results.nil? - return true + true end # Checks equality by comparing each attribute. @@ -128,7 +125,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -210,7 +207,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -221,7 +218,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/inline_response_200_8.rb b/lib/signrequest_client/models/inline_response_200_8.rb index 39c1db2..922601c 100644 --- a/lib/signrequest_client/models/inline_response_200_8.rb +++ b/lib/signrequest_client/models/inline_response_200_8.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class InlineResponse2008 attr_accessor :count @@ -23,7 +22,6 @@ class InlineResponse2008 attr_accessor :results - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -50,7 +48,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'count') self.count = attributes[:'count'] @@ -69,7 +67,6 @@ def initialize(attributes = {}) self.results = value end end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -77,14 +74,14 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if @count.nil? - invalid_properties.push("invalid value for 'count', count cannot be nil.") + invalid_properties.push('invalid value for "count", count cannot be nil.') end if @results.nil? - invalid_properties.push("invalid value for 'results', results cannot be nil.") + invalid_properties.push('invalid value for "results", results cannot be nil.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid @@ -92,7 +89,7 @@ def list_invalid_properties def valid? return false if @count.nil? return false if @results.nil? - return true + true end # Checks equality by comparing each attribute. @@ -128,7 +125,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -210,7 +207,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -221,7 +218,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/inline_response_200_9.rb b/lib/signrequest_client/models/inline_response_200_9.rb index 1c757ff..09dcae3 100644 --- a/lib/signrequest_client/models/inline_response_200_9.rb +++ b/lib/signrequest_client/models/inline_response_200_9.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class InlineResponse2009 attr_accessor :count @@ -23,7 +22,6 @@ class InlineResponse2009 attr_accessor :results - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -50,7 +48,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'count') self.count = attributes[:'count'] @@ -69,7 +67,6 @@ def initialize(attributes = {}) self.results = value end end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -77,14 +74,14 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if @count.nil? - invalid_properties.push("invalid value for 'count', count cannot be nil.") + invalid_properties.push('invalid value for "count", count cannot be nil.') end if @results.nil? - invalid_properties.push("invalid value for 'results', results cannot be nil.") + invalid_properties.push('invalid value for "results", results cannot be nil.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid @@ -92,7 +89,7 @@ def list_invalid_properties def valid? return false if @count.nil? return false if @results.nil? - return true + true end # Checks equality by comparing each attribute. @@ -128,7 +125,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -210,7 +207,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -221,7 +218,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/inline_response_201.rb b/lib/signrequest_client/models/inline_response_201.rb index 05d19de..7b453a5 100644 --- a/lib/signrequest_client/models/inline_response_201.rb +++ b/lib/signrequest_client/models/inline_response_201.rb @@ -1,24 +1,23 @@ =begin #SignRequest API -#API for SignRequest.com # Getting Started The SignRequest REST API enables you to send out signature requests. Using the API you will always have all the functionality as when using the frontend plus more. When you're logged in and you have a Team enabled, you can also use the endpoints in your browser by visiting them. It is also possible to receive events from SignRequest when, for example, a document has been signed. This way you can keep your application in sync with SignRequest without polling document endpoints. For this a callback url needs to be provided in the [team API settings page](/#/teams). ## API Token In order to use the API you first need to obtain an API token. You can create an API token in the [team API settings page](/#/teams). It is also possible to get or create a token using the [api-tokens endpoint](#operation/api-tokens_create) with your login credentials. Use tokens with a `Authorization: Token YOUR_TOKEN_HERE` header in your requests when making requests to the SignRequest API. cURL example: ```bash curl -H 'Authorization: Token YOUR_TOKEN_HERE' -H 'Content-Type:application/json' ``` ## Creating a Document In order to send out a SignRequest we first need to create a document. There are three ways to create a document using the [documents endpoint](#operation/documents_create). One by sending a POST request that includes a `file`, two by providing `file_from_url` in which case SignRequest will download the document from that location, and three by providing base64 encoded document content in `file_from_content` together with the filename for this content in `file_from_content_name`. This can be useful if you have trouble POSTing the file together with other (nested, in the case of the [signrequest-quick-create endpoint](#operation/signrequest-quick-create_create)) configuration data. Please be sure to add the correct extension to the filename (e.g. my_pdf_file.pdf) in order for SignRequest to be able to determine the content type of the content. Note that when using `file_from_url`, this url needs to be available for SignRequest to download. The download location may also be a Google Drive shareable link for documents (`application/vnd.google-apps.document`) and files (`application/vnd.google-apps.file`) uploaded to Google Drive. If the download location returns a content type of `text/plain` or `text/html`, SignRequest will do its best to make a PDF out of it. This can be used if you want to dynamically create PDF documents from web pages without making a PDF yourself. `external_id` is optional and can be used in order to have a reference to the document in your systems. The `name` field is also optional and can be customized, defaults to the filename (including extension). ## Sending a SignRequest Once you have successfully created a document, you can use the [signrequests endpoint](#operation/signrequests_create) to send a SignRequest using the `url` returned from the [documents endpoint](#operation/documents_create). The minimal data needed to send out a SignRequest is the following: ```json { \"document\": \"https://signrequest.com/api/v1/documents/f2bac751-4fa1-43f1-91de-a1b8905c239a/\", \"from_email\": \"you@yourcompany.com\", \"message\": \"Please sign this document.\\n\\nThanks!\", \"signers\": [ { \"email\": \"tech-support@signrequest.com\" } ] } ``` Note that we always also create a signer for the `from_email` sending the SignRequest, however for this signer the `needs_to_sign` flag is set to `false` meaning that this signer will **not** get a SignRequest. ## Quick Create a SignRequest In some cases it might be desirable to create a document and send the SignRequest in one API call. This can be done using the [signrequest-quick-create endpoint](#tag/signrequest-quick-create). This endpoint takes all of the fields of the [documents](#operation/documents_create) and [signrequests](#operation/signrequests_create) endpoints together, creates the document, and sends the SignRequest. ## Browsable API In addition to our API docs, you can also explore our API endpoints using our [browsable API](/api/v1/). There you'll be able to browse our various endpoints and even perform requests against our live API. # Working with a SignRequest ## Add attachments to a SignRequest Attachments can be added to a SignRequest using the [document-attachments endpoint](#operation/document-attachments_create). Signers will be able to download and read them before signing, but these will not be signed themselves. Document attachments can only be added when the SignRequest is not created yet. ## Customizing the SignRequest email If the Team has a custom color and logo these will be used in the SignRequest email. The `subject` and `message` fields can also be used to customize the email even further. The `message` may contain the following html tags: `a`, `abbr`, `acronym`, `b`, `blockquote`, `code`, `em`, `i`, `ul`, `li`, `ol`, and `strong`. Be aware that when the text to html ratio is too high, the email may end up in spam filters. Custom styles on these tags are not allowed. When the `from_email_name` field is provided, this name will be used in the `From` email header as such `{from_email_name} `. By default `Sender Name (sender@email.com) | SignRequest` is used as the `from_email_name`. Note that it's currently not possible to change the email address used to send a SignRequest. ## Resend the SignRequest email(s) The [resend_signrequest_email](#operation/signrequests_resend_signrequest_email) endpoint can be used to resend the SignRequest email as a reminder to all signers who didn't sign yet but did receive the email before. ## Cancel a SignRequest A SignRequest that has not been fully signed or declined yet can be cancelled using the [cancel_signrequest endpoint](#operation/signrequests_cancel_signrequest). By doing so all signers that have not signed yet will not be able to open and sign the document anymore. ## Download a signed document When a SignRequest has been signed the `pdf` field on the document resource will be filled with a link to download the signed PDF. The signing log PDF can be downloaded from the `pdf` field contained within the `signing_log` object field on the document resource. The recommended way to download the files and store them in your own systems is to setup the [Events callback](#section/Events/Events-callback) functionality and have your application download the files on the `signed` (Document signed) event. Please note that the download links expire and are regenerated on every API call / events callback so download the files right away when needed. ## Deleting documents To delete a document for the owner of the document, send a DELETE request to the [document resource url](#operation/documents_delete). Note that at this point this only makes the document unavailable for the sender. For all signers that do not have a registered SignRequest account, a grace period is started to give them a chance to download the signed document. After this grace period the document will be deleted for these signers automatically. When all signers have requested a delete (manually, automatically, or via the API) or do not have a registered SignRequest account and the grace period has lapsed, the document will be fully deleted. ### Automatic document deletion To automatically delete a document the `auto_delete_days` field on a document can be set to a number of days after which a finished document (signed/cancelled/declined) will be automatically deleted. The behavior is the same as doing a DELETE on the document resource url X number of days after the document is finished. When the document is scheduled to be deleted the `auto_delete_after` will hold the date after which it will be deleted. Note that we can make exceptions (to delete documents right away and entirely) for integration partners when they make the document available in other systems and users do not use SignRequest directly. Please [contact us](https://signrequest.com/en/contact/) to request an app screening if this functionality is required. ## Chaining multiple documents When sending a SignRequest, it's possible to reference a document in the `after_document` field on a `signer`. This should reference a document that the signer should be redirected to after signing. Since the signer is redirected to this document immediately after signing the other document, they do NOT get a SignRequest email. Note that resending the SignRequest email will trigger the SignRequest email even though they didn't receive one before. When `after_document` references a document where the signer in question already has signed or declined they will still receive a SignRequest email as we cannot redirect them anymore. It's only possible to reference documents that are not fully signed (or declined) yet. A `redirect_url` field is also available on a `signer` and on the `signrequest` (the default when not specified on the individual signers explicitly). When specified SignRequest will redirect to this url when a document is signed. Note that this only works when there are no chained documents for this signer anymore. Chaining also works on the [signrequest-quick-create endpoint](#operation/signrequest-quick-create_create). When creating a SignRequest on that endpoint, you get a reference to the created document in the `document` field back which can be used in the next call to `signrequest-quick-create` when creating a chain with `after_document`. ## Signer language If known the language of the signer can be set in the `language` field. This will determine the language of the SignRequest email. The SignRequest browser interface language is by default set to the location, browser, or user account settings when available. To force the language of the interface when a signer lands on the signing page the field `force_language` on the signer can be set to `true`. Note that if the language of the signer is not known it's best to not force the language. Available languages: `en` English `en-gb` English (GB) `nl` Dutch `fr` French `de` German `he` Hebrew `da` Danish `fi` Finnish `hu` Hungarian `it` Italian `no` Norwegian `pl` Polish `pt` Portuguese `es` Spanish `sv` Swedish `ru` Russian ## Text message and bank account verification For a higher degree of authentication of your signers it is possible to enable text message phone number verification and bank account verification. These verifications can be enabled by providing the phone number to `verify_phone_number` (international format including the plus-sign) and/or the bank account to `verify_bank_account` on a signer. Currently it is only possible to verify bank accounts using [iDEAL](https://www.ideal.nl/en/). When enabled, signers can only sign (finalize) a document when they have verified their phone number by a code supplied to them by a text message and/or make a payment of 1 cent. The verifications are logged and visible in the SignRequest signing log after completion. Please note that we cannot force signers to make a payment using a specific bank account. Therefore the content of the field may also specify what type of account to use instead of a specific bank account number, e.g.: \"the bank account you want to use for paying the rent.\" For this service additional fees apply. Please [contact us](https://signrequest.com/en/contact/) for a quote. ## Disable signing tools/features It is possible to disable certain tools/features signers have when signing a document. The following flags can be set to `true` on the signrequest model to disable these features. - `disable_text`: disable adding of text - `disable_date`: disable adding of dates - `disable_attachments`: disable uploading/adding of attachments - `disable_text_signatures`: disable usage of signatures generated by typing (text) - `disable_upload_signatures`: disable usage of uploaded signatures (images) Please note that we strongly **discourage you to disable features** as these are carefully chosen for optimal usability of the SignRequest product. ## Required attachments To require signers to upload attachments (like a passport for example) the `required_attachments` field can be used. The field takes an array of objects with one parameter `name`, for example: `required_attachments: [{\"name\": \"Passport\"}]` ## Templates In the frontend application it is possible to create templates. These templates, for Teams and Personal accounts, can be found in the [templates resource](#tag/templates). In order to send a SignRequest using a template, reference the resource url of the template in the `template` field. This works in both the [documents](#tag/documents) and the [signrequest-quick-create](#tag/signrequest-quick-create) resources. ## Automatic reminders To enable automatic reminders set the `send_reminders` boolean to `true` on the [SignRequest resource](#tag/signrequests). When enabled SignRequest will automatically remind signers to sign a document. # Preparing a document Using the SignRequest frontend web application you have the option to \"prepare\" a document. This helps the receiver as they can only sign the document at the designated place. Using the API you can also **prepare a document by using tags** to specify where a signer needs to add a date, text, checkbox, and/or a signature. Tags need to start with `[[` and end with `]]`. The tag data is separated by a pipe `|`. The first letter of the tag represents the tag type and must be one of the following: - `t` for text - `d` for date - `s` for signature - `c` for checkbox The second piece of data is an integer representing the index of the signer for which this placeholder is intended. The numbers in the tags are used to make distinctions between the signers and group multiple tags (input fields) to one specific signer. The template tags are assigned to the order at which the email addresses are added to the contact field and are not the same as the order of signing. This means that for example `s|1` can be the first or last signer depending on what you specified in the order of signing (if used of course). As the sender is always the first email address added, this means the sender is always `s|0`. If the sender does not need to add a signature or other data input, then `s|0` will be assigned to the next in line. Mismatches in the amount of declared placeholders and available signers will be silently ignored. The extra placeholders will not show up if more than the amount of signers **OR** signers just get an unprepared document to sign when there were no placeholders declared for them. Examples: ``` [[s|0 ]] // A signature for the first signer OR the owner/sender when they need to sign. [[c|0 ]] // A checkbox placeholder for the first signer [[d|1 ]] // A date input placeholder for the second signer [[t|2 ]] // A text input placeholder for the third signer ``` The height / width (font size) and the position of the tag in your document matters. Also as you do not want the **placeholder tag to show up in the document** to avoid this you need to make the font color match the background. Sign this demo document for an example (the color is left gray to see the tags): ```html https://signrequest.com/#/?api=v1&who=m&from_email=you@yourcompany.com&doc_url=https%3A%2F%2Fsignrequest.com%2Fstatic%2Fdemo%2FSignRequestTagsExample.pdf ``` Note that the font chosen can make a difference in the bounding box margins and position. For most fonts the top margin will be bigger as desired. For this reason make sure to **leave enough space or double the line height** in order for the placeholder to not overlap the line above. ## Tag modifiers There are multiple tag modifiers available to further customize the tags. The following key / value pairs can be used after the signer index. - `r` to make a placeholder required to be filled: `1` / `true` for required `0` / `false` for not required - `m` to make a text placeholder multiline: `1` / `true` for multiline `0` / `false` for single line (default) - `n` to set a label/name on a text placeholder: 'a string' - `p` to prefill text/dates on a text/date placeholder: 'a string', for a date placeholder this can also be set to `0` / `false` to not prefill the current date. - `id` to assign an `external_id` to the placeholder: \"your_id\" (also see [Retrieving signer input](#section/Preparing-a-document/Retrieving-signer-input) and [Prefill tags](#section/Preparing-a-document/Prefill-tags-templates)) Examples: ``` [[c|0|r:1 ]] // A checkbox that cannot be skipped (needs to be checked or not) [[c|0|r:0 ]] // A checkbox that can be skipped [[c|0|p:1 ]] // A checkbox that is by default checked (can be changed) [[d|0|n:Birth date|p:0 ]] // A date that is not prefilled with the date of signing and has the label 'Birth date' [[t|0|n:City|p:New York|id:customer_city ]] // A text input placeholder with the label 'City', prefilled with the text 'New York' and an external_id of 'customer_city' that will be available later in the 'inputs' field (see: 'Retrieving signer input') and can be used to prefill the tag using prefill_tags on the document resource (see: 'Prefill tags'). ``` Note that placeholder names / prefilled data can get quite long. If this impacts the placeholder width/height you can choose to make the font between the opening `[[` and closing `]]` tags (really) small. The tag configuration does not need to be human readable as the text is extracted from the PDF format directly. ## Prefill tags / templates Instead of generating a new document and use the `p` tag modifier to prefill signer input data it is also possible to use `prefill_tags`. For this to work all tags need to have an `id` as this is needed to reference the tag. Example: ``` [[c|0|id:checkbox_1 ]] // Should be checked [[c|0|id:checkbox_2 ]] // Should not be checked [[d|0|n:Birth date|id:birth_date ]] // Should be prefilled with the birth date of the signer [[t|0|n:City|id:customer_city ]] // Should be prefilled with 'New York' ``` Now when a document contains the tags above you can prefill them using the `prefill_tags` field on document by referencing the 'id'. ```json \"prefill_tags\": [ {\"external_id\":\"checkbox_1\", \"checkbox_value\":\"true\"}, {\"external_id\":\"checkbox_2\", \"checkbox_value\":\"false\"}, {\"external_id\":\"birth_date\", \"date_value\":\"1984-12-31\"}, // must be in ISO format ([YYYY]-[MM]-[DD]) {\"external_id\":\"customer_city\", \"text\":\"New York\"} ] ``` If you are using templates created from within the SignRequest app you can also set the `external_id` of a template tag in the advanced section when editing a tag. Note that it's also possible to add these tags when using the SignRequest-js client and the [Frontend API](#section/Frontend-API). ## Prepare using the web interface It is also possible to have the sender of a SignRequest prepare the document before sending the request out. To use this functionality, set the `is_being_prepared` flag on the SignRequest resource to `true`. When doing so the SignRequest will not be sent out to the recipient(s) and the `prepare_url` field will be set to a url where your application can redirect the sender to. Please note that if the sender does not have a SignRequest account they will be asked to verify their email after preparing the document. If you're an integration partner please [contact us](https://signrequest.com/en/contact/) for more possibilities when integrating this functionality. Example: ```json { \"file_from_url\": \"https://signrequest.com/static/demo/SignRequestDemoDocument.pdf\", \"from_email\": \"you@yourcompany.com\", \"who\": \"mo\", \"is_being_prepared\": \"true\", \"signers\": [{\"email\": \"you@yourcompany.com\"}, {\"email\": \"tech-support@signrequest.com\"}] } ``` Note that it's perfectly fine to also include tags in the document. The sender will be able to change / remove them. ## Retrieving signer input All text, date, and boolean inputs of signers after a signer signs are available in the `inputs` field of a signer as text. This can be helpful if you need to update your systems based on data signers add to a document. ```json \"inputs\": [ { \"type\": \"d\", // 's' (signature input), 't' (text input), 'd' (date input) or 'c' (checkbox input) \"page_index\": 0, // index of the page this input resides on \"text\": \"09-25-18\", // text as seen on the document (only for date and text inputs) \"checkbox_value\": null, // true or false (only for checkbox inputs) \"date_value\": \"2018-09-25\", // the date in ISO format ([YYYY]-[MM]-[DD]) \"external_id\": null // optionally the external id assigned to a tag (helpful if you need to identify a specific input, also see 'Tag modifiers') } ] ``` ## Tags Example Signer 0: this is the first person that needs to sign (including you). ![Signer 0](https://signrequest.com/assets/images/blogs/template-tags-electronic-signature-0.bf35c985.png) Signer 1: this is the second person that needs to sign (including you). ![Signer 1](https://signrequest.com/assets/images/blogs/template-tags-electronic-signature-1.335ad0c8.png) The result in SignRequest: ![Result in SignRequest](https://signrequest.com/assets/images/blogs/tags-example.2bb33d7f.png) ## Example Documents You can quickly test this feature with our example documents: 1. [Basic example document](https://docs.google.com/document/d/1oI2R1SxfMNZXiz3jCQvorpoklF9xq_dCJnOpkI-zo80/edit?usp=sharing) 2. [Advanced example document](https://docs.google.com/document/d/1-gzqym9clQ1a193JGocXUeIX92cqPINBHOBeGxbDASw/edit) These are shared Google Docs documents with example tags. If you have our Google Docs Add-on you can directly send a SignRequest! If you don't have our Google Docs Add-on for electronic signatures, go to \"Add-ons\" in the Google Docs menu bar and install the Add-on for free. Then, go back to \"Add-ons\" and click \"SignRequest\". ## Walkthrough Video We also have a walkthrough video on YouTube about using templates with tags in a base document: [![Templates with tags in a base document](http://img.youtube.com/vi/y5U5WqTqZBQ/0.jpg)](http://www.youtube.com/watch?v=y5U5WqTqZBQ) # Events ## Events callback In order to receive the `events` as a callback to your application a **callback url** needs to be set in the [team API settings](/#/teams) page. When set, SignRequest will POST events as `application/json` to this endpoint. Your endpoint should return a 200 OK response. SignRequest will retry to deliver events (max 10 times) in case of a timeout or a 500 response from your server. It is also possible to change the **callback url on a per document basis**. To use this functionality you can set the callback url using the `events_callback_url` field when [creating a document](#operation/documents_create) or when using the [signrequest-quick-create endpoint](#tag/signrequest-quick-create). Please be aware that we might add more event types in the future so code defensively for that. For an example of how an event receiver can be written checkout this [repository](https://github.com/SignRequest/signrequest-event-receiver). The following event types are available: - `convert_error`: Document convert error - `converted`: Document converted - `sending_error`: Document sending error - `sent`: Document sent - `declined`: Document declined - `cancelled`: Document cancelled - `signed`: Document signed - `signer_signed`: Signer signed - `signer_email_bounced`: Signer email bounced - `signer_viewed_email`: Signer viewed email - `signer_viewed`: Signer viewed document - `signer_forwarded`: Signer forwarded document - `signer_downloaded`: Signer downloaded - `signrequest_received`: SignRequest received Status codes: - `ok`: ok - `error`: error The event status will be `error` for the following events: `convert_error`, `sending_error`, and `signer_email_bounced`. The document status field can have the following codes: - `co`: converting - `ne`: new - `se`: sent - `vi`: viewed - `si`: signed - `do`: downloaded - `sd`: signed and downloaded - `ca`: cancelled - `de`: declined - `ec`: error converting - `es`: error sending Example callback request: ```json { \"document\": { \"api_used\": true, \"attachments\": [], \"external_id\": \"your_id_of_this_document\", \"file\": \"signrequest download url of the uploaded file\", \"file_from_url\": \"url where signrequest downloaded the document, if this functionality was used\", \"name\": \"document.pdf\", \"pdf\": null, \"prefill_tags\": [], \"security_hash\": null, \"signing_log\": null, \"signrequest\": null, \"status\": \"co\", \"team\": { \"name\": \"the_name_of_your_team\", \"subdomain\": \"the_subdomain_of_your_team\" }, \"template\": null, \"url\": \"https://signrequest.com/api/v1/documents/f2bac751-4fa1-43f1-91de-a1b8905c239a/\", \"user\": null, \"uuid\": \"f2bac751-4fa1-43f1-91de-a1b8905c239a\" }, \"event_hash\": \"89365cda10349ced9c3fd9c457372b37ad2e723c5b9f11a4d0b2c16724d8a2e7\", \"event_time\": \"1537889008\", \"event_type\": \"converted\", \"signer\": null, \"status\": \"ok\", \"team\": { \"name\": \"the_name_of_your_team\", \"subdomain\": \"the_subdomain_of_your_team\" }, \"timestamp\": \"2018-09-25T15:23:28.836457Z\", \"token_name\": \"Token\", \"uuid\": \"ffffd4dd-89c7-4133-ba2d-960f65c8d395\" } ``` If the event is **signer related** the `signer` field will contain all the signer data. All event data can also be fetched using the REST API [Events resource](#tag/events). Be sure to check that out if you're developing your endpoint and see how the data looks. You can check the authenticity (that the event really came from SignRequest) by generating and comparing the `event_hash` that comes with the event. The `event_hash` is generated with the HMAC algorithm using your API Token as a key in SHA256 digest mode. OpenSSL shell example: ```bash echo -n \"${event_time}${event_type}\" | openssl dgst -sha256 -hmac \"YOUR_TOKEN_HERE\" ``` which expands to: ```bash echo -n \"1537889008converted\" | openssl dgst -sha256 -hmac \"YOUR_TOKEN_HERE\" 89365cda10349ced9c3fd9c457372b37ad2e723c5b9f11a4d0b2c16724d8a2e7 ``` If you have multiple API tokens created you can identify the used token by the `token_name` (if you provided one). Always use **SSL enabled endpoints**! Developing your callback endpoint locally? Checkout [UltraHook](http://www.ultrahook.com/) to receive webhooks on localhost, nifty! ## Event webhooks To receive only specific event callbacks, webhook subscriptions can be created for Teams and for Personal accounts. The resource takes an `event_type`, `callback_url` and optionally a `name` to easily identify what webhook is used for. The `integration` field can also be set when this hook is specific to one of the SignRequest supported integrations. Check out the [webhooks resource](#tag/webhooks) for all possible event types to subscribe to. When the webhooks are used on personal accounts these webhooks also receive the `signrequest_received` event which can be used to notify users that they have received a new SignRequest. However, creating webhook subscriptions for personal accounts requires a SignRequest session (logged in user) or Basic auth using a username and password. ## Disable all SignRequest email events It is possible to disable all SignRequest status emails as well as the email that contains the signed documents. When using this functionality the following events will not generate a SignRequest email: - `sent`: Document sent - `signer_email_bounced`: Signer email bounced - `signer_viewed_email`: Signer viewed email - `signer_viewed`: Signer viewed document - `signer_signed`: Signer signed - `signed`: Document signed - `declined`: Document declined - `cancelled`: Document cancelled To enable this feature set the `disable_emails` flag on the [SignRequest resource](#tag/signrequests) to true. Note that the event emails will only be disabled if there is `callback_url` available for the document as your application is expected to notify users instead of SignRequest. The initial SignRequest email (that contains the link to sign) can only be disabled by using the [Embed url](#section/Additional-signing-methods/Embed-url) functionality. # Frontend API Another option to help your users sending SignRequests is using the \"frontend\" api. This involves no token and is merely used to \"prefill\" the SignRequest box found at the homepage for your users. The only requirement is that the document to send out is publicly available in order for SignRequest to download the file. Shareable links of Google Drive documents are also supported here. GET params for prefilling the box: ``` api=v1 // the version of the API to use who=mo // mo='me & others', m='only me', o='only others' signers=first_email@example.com,second_email@example.com // emails of 'signers' comma separated from_email=you@yourcompany.com // email of the person sending the SignRequest doc_url=https%3A%2F%2Fsignrequest.com%2Fstatic%2Fdemo%2FSignRequestDemoDocument.pdf // the url where SignRequest can download the document (quoted) ``` Example resulting url: ``` https://signrequest.com/#/?api=v1&who=mo&signers=tech-support@signrequest.com&from_email=you@yourcompany.com&doc_url=https%3A%2F%2Fsignrequest.com%2Fstatic%2Fdemo%2FSignRequestDemoDocument.pdf ``` Note that you can also use prefill tags here by adding the parameter prefill_tags. The value should be Base64 encoded JSON, JavaScript example: ```javascript btoa(JSON.stringify([{external_id: 'customer_city', text: 'New York'}])); // the output can be used with the parameter: // prefill_tags=W3siZXh0ZXJuYWxfaWQiOiJjdXN0b21lcl9jaXR5IiwidGV4dCI6Ik5ldyBZb3JrIn1d ``` ## SignRequest-js client (beta) Although we consider the library \"beta\" you can count on a stable API (semver). However, if you plan to use this please [contact us](https://signrequest.com/en/contact/) so we know your use case and can help you out where needed. We will open up the repository to the public when out of beta. To use the SignRequest javascript library include the following in your page (npm and bower are coming when out of beta): ```html ``` Or for async loading use: ```html ``` The library uses [UMD](https://github.com/umdjs/umd) (Universal Module Definition). To use a specific version (current is **1.0.5**) use for example: **cdn.signrequest.com/signrequest-js/v1/1.0.5/signrequest-js.min.js**. ### Usage ```javascript // same as the frontend API GET parameters, these are all optional var conf = { subdomain: '', // if you are using this for a specific team set the subdomain here api: 'v1', who: 'mo', signers: 'first_email@example.com,second_email@example.com', from_email: 'you@yourcompany.com', close: true, // close the popup when done? default: true // or use next: next: '', // redirect to this url when done signing themselves, frontend_id: '' // optional shared secret set on document to grant access to users even if they don't have access to team } // these are also optional, the popup will be centered in the window opening the popup var popup_conf = { width: 460, // width of the popup in pixels, default 460 height: 600, // height of the popup in pixels, default the height of the window opening the popup } // to open a specific document first create a document using the REST API with your backend // be sure to also set the correct 'subdomain' in the configuration when you create a document for a specific team var doc_uuid = 'the-uuid-of-the-document'; SignRequest.browser.openPopupForDocUuid(doc_uuid, conf, popup_conf); // to create a document from a url var doc_url = 'https://signrequest.com/static/demo/SignRequestDemoDocument.pdf' SignRequest.browser.openPopupForDocUrl(doc_url, conf, popup_conf); // to create a document from a template uuid var template_uuid = 'the-uuid-of-the-template' SignRequest.browser.openPopupForTemplateUuid(template_uuid, conf, popup_conf); // to open a popup using custom params var popup = SignRequest.browser.openPopup(conf, popup_conf); // if your document contains template tags / placeholders that have an 'external_id' // it is possible to 'prefill' these for a particular SignRequest by updating your conf object with for example: conf.prefill_tags = [{external_id: 'customer_city', text: 'New York'}]; // Now all template tags with this external_id will be prefilled with 'New York' // all popup openers return an instance of the popup to which event callbacks can be registered (they can be chained) // the possible events are: 'opened', 'sent', 'signed', 'declined', 'finished', 'closed', 'any' // note that 'sent', 'finished' and 'closed' can be called fast after each other when the popup autocloses (close: true) // also when sending a SignRequest and the sender also need to sign you can receive the 'signed' or 'declined' event // after the 'sent' event (SignRequest created). // When the sender is done (sending and possibly siging) the 'finished' event is fired. popup = popup.on('closed', function (event_type, payload, event) { // this would fire when the popup closes, you might want to update your page based on events like this console.log(event_type, payload, event); }) // shortcut to fire on all events ('any') popup.onAny(function (event_type, payload, event) { // this would fire on all events console.log(event_type, payload, event); }) // to set a default configuration to use in all future calls for example for a team subdomain SignRequest.browser.setConfig({subdomain: 'the_subdomain_of_your_team'}); // When creating a document for your users using our REST API and open that document in the popup in response to clicking a button // you might need to open the popup before you know the uuid of the document from your backend. // This to prevent popup blockers from kicking in when doing async work before we open a popup. // For this use case you can use the `openLoadingPopup` helper on click and use that already opened popup to load a document later. $('button#your_button').on('click', function () { // using jQuery in the following example (not required for signrequest-js) var popup = SignRequest.browser.openLoadingPopup(); // open a popup on button click right away popup.onAny(function (event_type, payload, event) { // all listeners created on the loading popup will also be registered on the popup events fired later after the we call // SignRequest.browser.openPopupForDocUuid... console.log('Event received: ' + event_type + ', payload: ' + JSON.stringify(payload); }); // Async call some endpoint on your backend that creates a document using the REST API. $.post('/your-endpoint-to-create-a-document', {some: 'data'}).then(function(response){ // instead of opening a new popup we use the one that is 'loading' as otherwise // most browser popup blockers will block opening a new window here (the opening of the window comes too late after the user click). // we assume here your endpoint returns the uuid of the document created in the response SignRequest.browser.openPopupForDocUuid(response.document_uuid, conf, {sr_popup: popup}); // `{sr_popup: popup}` make the library use an existing popup instead of creating a new one }); }); SignRequest.browser.openPopupForDocUrl('https://signrequest.com/static/demo/SignRequestDemoDocument.pdf'); ``` ### Sharing document with external users Normally a document stored within SignRequest would require the recipient to be a member of the document owner's team in order to gain access to the document. If you'd like to share a document outside of your team, you can [create a document](#operation/documents_create) while storing a shared secret on the `frontend_id` field. Then, using the SingRequest-js Client, you can add the `frontend_id` to the `conf` object when calling `openPopupForDocUuid` in order to grant any user presented with the signing popup access to the document. # Additional signing methods ## Embed url Normally SignRequest will send the SignRequest email to signers containing the personal link to sign a document. This is how SignRequest validates an email address and is the preferred way. However, if your application requires a continuous flow (in a sales flow for example) it is possible to generate an `embed_url` and redirect a signer to that link. Combined with a `redirect_url` a continuous flow can be achieved. Doing this moves the responsibility of identifying an email address / user to your application. This also shows in the signing log as SignRequest cannot guarantee that a document is signed by someone having access to an email address. To generate the `embed_url` you need to declare the ID of the logged in user in YOUR application in the `embed_url_user_id` field. This ID will also show in the signing log. The generated `embed_url` can only be used until the document is signed. Note that it is perfectly fine to combine signers with and without a generated `embed_url`. The `order` field also behaves as you would expect. For example, if the first signer (order = 0) has an `embed_url` generated and the second (order = 1) not, the second signer will only receive the SignRequest email when the first one has signed. When using this `embed_url` in an `iframe`, you can add any of the following url parameters to hide some elements in the header: `&hide_login=1` (hide the login button), `&hide_cancel=1` (hide the cancel link), `&hide_decline=1` (hide the option to decline), `&hide_logo=1` (hide the logo) and `&hide_title=1` (hide the document title in the header). Be aware that the `embed_url` may already contain other url parameters. Also note that hiding the login button does not disable to login prompt for signers that already have a SignRequest account. This cannot be disabled. If you also want to disable all other SignRequest emails, see [Disable all SignRequest email events](#section/Events/Disable-all-SignRequest-email-events). ## In person signing In some cases your application might want to generate one url for both the sender of the document and the receiver to sign a document after each other in person. This can be achieved by this signer configuration example: ```json { \"file_from_url\": \"https://signrequest.com/static/demo/SignRequestDemoDocument.pdf\", \"from_email\": \"you@yourcompany.com\", \"who\": \"mo\", \"signers\": [ { \"email\": \"you@yourcompany.com\", \"order\": 1, \"embed_url_user_id\": \"your ID\", }, { \"email\": \"tech-support@signrequest.com\", \"order\": 2, \"in_person\": true } ] } ``` This way you can redirect the user to the `embed_url` of the sender. After the sender has signed they will be redirected to the next `in_person` signer. # Integration Partners ## Salesforce The most straight forward way to integrate Salesforce with SignRequest is to use our managed package. Normally you would use the SignRequest buttons provided in the managed package to create SignRequest documents from Salesforce but if you want to skip that step and create SignRequests using the API (but still sync documents to Salesforce) you can add the following data to a `signrequest`: ```json \"integration_data\": { \"object_type\": \"API NAME OF THE (S)OBJECT, e.g. 'Opportunity' or 'CustomObject__c'\", \"uid\": \"UID OF THE SALESFORCE USER (NOT UUID), e.g. 'https:\\/\\/login.salesforce.com\\/id\\/00D24000000pMDZEA2\\/005240000048zB0AAI'\", \"object_id\": \"OBJECT ID, e.g. 0062400000MaeNv\" }, \"integration\": \"salesforce\" ``` Caveat: The user of the `from_email` needs to be a member of the Team that created the `signrequest`, and the user needs to have a SignRequest account using Salesforce OAuth. ## Zapier Does your app integrate with Zapier? Chances are your digital signatures are just a few clicks away! Checkout our Zapier integration here: https://signrequest.com/en/digital-electronic-signatures-with-zapier/ ## Becoming an integration partner If your application requires to create Teams and act on behalf of them you need to become an integration partner. This only grants you access to resources created by your application of the third party Team. Teams can be created and updated on the [Teams resource](#tag/teams). Please [contact us](https://signrequest.com/en/contact/) to learn more. ## OAuth2 Authorization Framework SignRequest allows partner applications to use the API on behalf of SignRequest users using OAuth2. If you need this functionality you can [create an application here](/api/v1/oauth2/applications/) (choose Client type: Confidential, Authorization grant type: Authorization code) and [contact us](https://signrequest.com/en/contact/) if you need any help. The OAuth2 framework is [rfc-compliant](https://tools.ietf.org/html/rfc6749). OAuth2 endpoints: - https://signrequest.com/api/v1/oauth2/authorize/ Get authorization code GET params: client_id, scope(s)[=we currently only support the 'read', 'write' scopes], response_type[=code], state[=your_random_state_string], redirect_uri[=if not provided the first of your application is used] - https://signrequest.com/api/v1/oauth2/token/ Request a new (refresh) token POST params: code[=the client code], grant_type[=authorization_code], redirect_uri, client_id, client_secret[=required when using the 'confidential' client type] - https://signrequest.com/api/v1/oauth2/revoke_token/ Revoke a token POST params: token[=token to revoke], token_type_hint[=optional, designating either 'access_token' or 'refresh_token'. Use tokens with the `Authorization: Bearer YOUR_TOKEN_HERE` header in your requests. To remove your authorized applications/tokens during development [go here](/api/v1/oauth2/authorized_tokens/). [Contact us](https://signrequest.com/en/contact/) if you want your logo added to the consent screen. # Client libraries The following libraries are not officially supported. Created a client library? Let us know! - PHP: https://github.com/AtaneNL/SignRequest If your application requires - Python: https://github.com/SignRequest/signrequest-python-client - Python: https://github.com/ivansabik/signrequest-python-client - Ruby: https://github.com/SignRequest/signrequest-ruby-client - Event receiver (Python server): https://github.com/SignRequest/signrequest-event-receiver ### More coming soon Documentation about more advanced usage of the SignRequest API and language specific client libraries is coming soon. Feel free to contact us at tech-support@signrequest.com for any questions or feature requests. +#API for SignRequest.com OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class InlineResponse201 - attr_accessor :cancelled - attr_accessor :detail + attr_accessor :cancelled + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -44,16 +43,16 @@ def valid?(value) # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'cancelled' => :'cancelled', - :'detail' => :'detail' + :'detail' => :'detail', + :'cancelled' => :'cancelled' } end # Attribute type mapping. def self.swagger_types { - :'cancelled' => :'BOOLEAN', - :'detail' => :'String' + :'detail' => :'String', + :'cancelled' => :'BOOLEAN' } end @@ -63,49 +62,48 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} - - if attributes.has_key?(:'cancelled') - self.cancelled = attributes[:'cancelled'] - end + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'detail') self.detail = attributes[:'detail'] end + if attributes.has_key?(:'cancelled') + self.cancelled = attributes[:'cancelled'] + end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new - if @cancelled.nil? - invalid_properties.push("invalid value for 'cancelled', cancelled cannot be nil.") + if @detail.nil? + invalid_properties.push('invalid value for "detail", detail cannot be nil.') end - if @detail.nil? - invalid_properties.push("invalid value for 'detail', detail cannot be nil.") + if @cancelled.nil? + invalid_properties.push('invalid value for "cancelled", cancelled cannot be nil.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - return false if @cancelled.nil? return false if @detail.nil? - detail_validator = EnumAttributeValidator.new('String', ["OK"]) + detail_validator = EnumAttributeValidator.new('String', ['OK']) return false unless detail_validator.valid?(@detail) - return true + return false if @cancelled.nil? + true end # Custom attribute writer method checking allowed values (enum). # @param [Object] detail Object to be assigned def detail=(detail) - validator = EnumAttributeValidator.new('String', ["OK"]) + validator = EnumAttributeValidator.new('String', ['OK']) unless validator.valid?(detail) - fail ArgumentError, "invalid value for 'detail', must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "detail", must be one of #{validator.allowable_values}.' end @detail = detail end @@ -115,8 +113,8 @@ def detail=(detail) def ==(o) return true if self.equal?(o) self.class == o.class && - cancelled == o.cancelled && - detail == o.detail + detail == o.detail && + cancelled == o.cancelled end # @see the `==` method @@ -128,7 +126,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [cancelled, detail].hash + [detail, cancelled].hash end # Builds the object from hash @@ -141,7 +139,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -223,7 +221,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -234,7 +232,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/inline_response_201_1.rb b/lib/signrequest_client/models/inline_response_201_1.rb index 7fa81fc..422ff03 100644 --- a/lib/signrequest_client/models/inline_response_201_1.rb +++ b/lib/signrequest_client/models/inline_response_201_1.rb @@ -1,19 +1,18 @@ =begin #SignRequest API -#API for SignRequest.com # Getting Started The SignRequest REST API enables you to send out signature requests. Using the API you will always have all the functionality as when using the frontend plus more. When you're logged in and you have a Team enabled, you can also use the endpoints in your browser by visiting them. It is also possible to receive events from SignRequest when, for example, a document has been signed. This way you can keep your application in sync with SignRequest without polling document endpoints. For this a callback url needs to be provided in the [team API settings page](/#/teams). ## API Token In order to use the API you first need to obtain an API token. You can create an API token in the [team API settings page](/#/teams). It is also possible to get or create a token using the [api-tokens endpoint](#operation/api-tokens_create) with your login credentials. Use tokens with a `Authorization: Token YOUR_TOKEN_HERE` header in your requests when making requests to the SignRequest API. cURL example: ```bash curl -H 'Authorization: Token YOUR_TOKEN_HERE' -H 'Content-Type:application/json' ``` ## Creating a Document In order to send out a SignRequest we first need to create a document. There are three ways to create a document using the [documents endpoint](#operation/documents_create). One by sending a POST request that includes a `file`, two by providing `file_from_url` in which case SignRequest will download the document from that location, and three by providing base64 encoded document content in `file_from_content` together with the filename for this content in `file_from_content_name`. This can be useful if you have trouble POSTing the file together with other (nested, in the case of the [signrequest-quick-create endpoint](#operation/signrequest-quick-create_create)) configuration data. Please be sure to add the correct extension to the filename (e.g. my_pdf_file.pdf) in order for SignRequest to be able to determine the content type of the content. Note that when using `file_from_url`, this url needs to be available for SignRequest to download. The download location may also be a Google Drive shareable link for documents (`application/vnd.google-apps.document`) and files (`application/vnd.google-apps.file`) uploaded to Google Drive. If the download location returns a content type of `text/plain` or `text/html`, SignRequest will do its best to make a PDF out of it. This can be used if you want to dynamically create PDF documents from web pages without making a PDF yourself. `external_id` is optional and can be used in order to have a reference to the document in your systems. The `name` field is also optional and can be customized, defaults to the filename (including extension). ## Sending a SignRequest Once you have successfully created a document, you can use the [signrequests endpoint](#operation/signrequests_create) to send a SignRequest using the `url` returned from the [documents endpoint](#operation/documents_create). The minimal data needed to send out a SignRequest is the following: ```json { \"document\": \"https://signrequest.com/api/v1/documents/f2bac751-4fa1-43f1-91de-a1b8905c239a/\", \"from_email\": \"you@yourcompany.com\", \"message\": \"Please sign this document.\\n\\nThanks!\", \"signers\": [ { \"email\": \"tech-support@signrequest.com\" } ] } ``` Note that we always also create a signer for the `from_email` sending the SignRequest, however for this signer the `needs_to_sign` flag is set to `false` meaning that this signer will **not** get a SignRequest. ## Quick Create a SignRequest In some cases it might be desirable to create a document and send the SignRequest in one API call. This can be done using the [signrequest-quick-create endpoint](#tag/signrequest-quick-create). This endpoint takes all of the fields of the [documents](#operation/documents_create) and [signrequests](#operation/signrequests_create) endpoints together, creates the document, and sends the SignRequest. ## Browsable API In addition to our API docs, you can also explore our API endpoints using our [browsable API](/api/v1/). There you'll be able to browse our various endpoints and even perform requests against our live API. # Working with a SignRequest ## Add attachments to a SignRequest Attachments can be added to a SignRequest using the [document-attachments endpoint](#operation/document-attachments_create). Signers will be able to download and read them before signing, but these will not be signed themselves. Document attachments can only be added when the SignRequest is not created yet. ## Customizing the SignRequest email If the Team has a custom color and logo these will be used in the SignRequest email. The `subject` and `message` fields can also be used to customize the email even further. The `message` may contain the following html tags: `a`, `abbr`, `acronym`, `b`, `blockquote`, `code`, `em`, `i`, `ul`, `li`, `ol`, and `strong`. Be aware that when the text to html ratio is too high, the email may end up in spam filters. Custom styles on these tags are not allowed. When the `from_email_name` field is provided, this name will be used in the `From` email header as such `{from_email_name} `. By default `Sender Name (sender@email.com) | SignRequest` is used as the `from_email_name`. Note that it's currently not possible to change the email address used to send a SignRequest. ## Resend the SignRequest email(s) The [resend_signrequest_email](#operation/signrequests_resend_signrequest_email) endpoint can be used to resend the SignRequest email as a reminder to all signers who didn't sign yet but did receive the email before. ## Cancel a SignRequest A SignRequest that has not been fully signed or declined yet can be cancelled using the [cancel_signrequest endpoint](#operation/signrequests_cancel_signrequest). By doing so all signers that have not signed yet will not be able to open and sign the document anymore. ## Download a signed document When a SignRequest has been signed the `pdf` field on the document resource will be filled with a link to download the signed PDF. The signing log PDF can be downloaded from the `pdf` field contained within the `signing_log` object field on the document resource. The recommended way to download the files and store them in your own systems is to setup the [Events callback](#section/Events/Events-callback) functionality and have your application download the files on the `signed` (Document signed) event. Please note that the download links expire and are regenerated on every API call / events callback so download the files right away when needed. ## Deleting documents To delete a document for the owner of the document, send a DELETE request to the [document resource url](#operation/documents_delete). Note that at this point this only makes the document unavailable for the sender. For all signers that do not have a registered SignRequest account, a grace period is started to give them a chance to download the signed document. After this grace period the document will be deleted for these signers automatically. When all signers have requested a delete (manually, automatically, or via the API) or do not have a registered SignRequest account and the grace period has lapsed, the document will be fully deleted. ### Automatic document deletion To automatically delete a document the `auto_delete_days` field on a document can be set to a number of days after which a finished document (signed/cancelled/declined) will be automatically deleted. The behavior is the same as doing a DELETE on the document resource url X number of days after the document is finished. When the document is scheduled to be deleted the `auto_delete_after` will hold the date after which it will be deleted. Note that we can make exceptions (to delete documents right away and entirely) for integration partners when they make the document available in other systems and users do not use SignRequest directly. Please [contact us](https://signrequest.com/en/contact/) to request an app screening if this functionality is required. ## Chaining multiple documents When sending a SignRequest, it's possible to reference a document in the `after_document` field on a `signer`. This should reference a document that the signer should be redirected to after signing. Since the signer is redirected to this document immediately after signing the other document, they do NOT get a SignRequest email. Note that resending the SignRequest email will trigger the SignRequest email even though they didn't receive one before. When `after_document` references a document where the signer in question already has signed or declined they will still receive a SignRequest email as we cannot redirect them anymore. It's only possible to reference documents that are not fully signed (or declined) yet. A `redirect_url` field is also available on a `signer` and on the `signrequest` (the default when not specified on the individual signers explicitly). When specified SignRequest will redirect to this url when a document is signed. Note that this only works when there are no chained documents for this signer anymore. Chaining also works on the [signrequest-quick-create endpoint](#operation/signrequest-quick-create_create). When creating a SignRequest on that endpoint, you get a reference to the created document in the `document` field back which can be used in the next call to `signrequest-quick-create` when creating a chain with `after_document`. ## Signer language If known the language of the signer can be set in the `language` field. This will determine the language of the SignRequest email. The SignRequest browser interface language is by default set to the location, browser, or user account settings when available. To force the language of the interface when a signer lands on the signing page the field `force_language` on the signer can be set to `true`. Note that if the language of the signer is not known it's best to not force the language. Available languages: `en` English `en-gb` English (GB) `nl` Dutch `fr` French `de` German `he` Hebrew `da` Danish `fi` Finnish `hu` Hungarian `it` Italian `no` Norwegian `pl` Polish `pt` Portuguese `es` Spanish `sv` Swedish `ru` Russian ## Text message and bank account verification For a higher degree of authentication of your signers it is possible to enable text message phone number verification and bank account verification. These verifications can be enabled by providing the phone number to `verify_phone_number` (international format including the plus-sign) and/or the bank account to `verify_bank_account` on a signer. Currently it is only possible to verify bank accounts using [iDEAL](https://www.ideal.nl/en/). When enabled, signers can only sign (finalize) a document when they have verified their phone number by a code supplied to them by a text message and/or make a payment of 1 cent. The verifications are logged and visible in the SignRequest signing log after completion. Please note that we cannot force signers to make a payment using a specific bank account. Therefore the content of the field may also specify what type of account to use instead of a specific bank account number, e.g.: \"the bank account you want to use for paying the rent.\" For this service additional fees apply. Please [contact us](https://signrequest.com/en/contact/) for a quote. ## Disable signing tools/features It is possible to disable certain tools/features signers have when signing a document. The following flags can be set to `true` on the signrequest model to disable these features. - `disable_text`: disable adding of text - `disable_date`: disable adding of dates - `disable_attachments`: disable uploading/adding of attachments - `disable_text_signatures`: disable usage of signatures generated by typing (text) - `disable_upload_signatures`: disable usage of uploaded signatures (images) Please note that we strongly **discourage you to disable features** as these are carefully chosen for optimal usability of the SignRequest product. ## Required attachments To require signers to upload attachments (like a passport for example) the `required_attachments` field can be used. The field takes an array of objects with one parameter `name`, for example: `required_attachments: [{\"name\": \"Passport\"}]` ## Templates In the frontend application it is possible to create templates. These templates, for Teams and Personal accounts, can be found in the [templates resource](#tag/templates). In order to send a SignRequest using a template, reference the resource url of the template in the `template` field. This works in both the [documents](#tag/documents) and the [signrequest-quick-create](#tag/signrequest-quick-create) resources. ## Automatic reminders To enable automatic reminders set the `send_reminders` boolean to `true` on the [SignRequest resource](#tag/signrequests). When enabled SignRequest will automatically remind signers to sign a document. # Preparing a document Using the SignRequest frontend web application you have the option to \"prepare\" a document. This helps the receiver as they can only sign the document at the designated place. Using the API you can also **prepare a document by using tags** to specify where a signer needs to add a date, text, checkbox, and/or a signature. Tags need to start with `[[` and end with `]]`. The tag data is separated by a pipe `|`. The first letter of the tag represents the tag type and must be one of the following: - `t` for text - `d` for date - `s` for signature - `c` for checkbox The second piece of data is an integer representing the index of the signer for which this placeholder is intended. The numbers in the tags are used to make distinctions between the signers and group multiple tags (input fields) to one specific signer. The template tags are assigned to the order at which the email addresses are added to the contact field and are not the same as the order of signing. This means that for example `s|1` can be the first or last signer depending on what you specified in the order of signing (if used of course). As the sender is always the first email address added, this means the sender is always `s|0`. If the sender does not need to add a signature or other data input, then `s|0` will be assigned to the next in line. Mismatches in the amount of declared placeholders and available signers will be silently ignored. The extra placeholders will not show up if more than the amount of signers **OR** signers just get an unprepared document to sign when there were no placeholders declared for them. Examples: ``` [[s|0 ]] // A signature for the first signer OR the owner/sender when they need to sign. [[c|0 ]] // A checkbox placeholder for the first signer [[d|1 ]] // A date input placeholder for the second signer [[t|2 ]] // A text input placeholder for the third signer ``` The height / width (font size) and the position of the tag in your document matters. Also as you do not want the **placeholder tag to show up in the document** to avoid this you need to make the font color match the background. Sign this demo document for an example (the color is left gray to see the tags): ```html https://signrequest.com/#/?api=v1&who=m&from_email=you@yourcompany.com&doc_url=https%3A%2F%2Fsignrequest.com%2Fstatic%2Fdemo%2FSignRequestTagsExample.pdf ``` Note that the font chosen can make a difference in the bounding box margins and position. For most fonts the top margin will be bigger as desired. For this reason make sure to **leave enough space or double the line height** in order for the placeholder to not overlap the line above. ## Tag modifiers There are multiple tag modifiers available to further customize the tags. The following key / value pairs can be used after the signer index. - `r` to make a placeholder required to be filled: `1` / `true` for required `0` / `false` for not required - `m` to make a text placeholder multiline: `1` / `true` for multiline `0` / `false` for single line (default) - `n` to set a label/name on a text placeholder: 'a string' - `p` to prefill text/dates on a text/date placeholder: 'a string', for a date placeholder this can also be set to `0` / `false` to not prefill the current date. - `id` to assign an `external_id` to the placeholder: \"your_id\" (also see [Retrieving signer input](#section/Preparing-a-document/Retrieving-signer-input) and [Prefill tags](#section/Preparing-a-document/Prefill-tags-templates)) Examples: ``` [[c|0|r:1 ]] // A checkbox that cannot be skipped (needs to be checked or not) [[c|0|r:0 ]] // A checkbox that can be skipped [[c|0|p:1 ]] // A checkbox that is by default checked (can be changed) [[d|0|n:Birth date|p:0 ]] // A date that is not prefilled with the date of signing and has the label 'Birth date' [[t|0|n:City|p:New York|id:customer_city ]] // A text input placeholder with the label 'City', prefilled with the text 'New York' and an external_id of 'customer_city' that will be available later in the 'inputs' field (see: 'Retrieving signer input') and can be used to prefill the tag using prefill_tags on the document resource (see: 'Prefill tags'). ``` Note that placeholder names / prefilled data can get quite long. If this impacts the placeholder width/height you can choose to make the font between the opening `[[` and closing `]]` tags (really) small. The tag configuration does not need to be human readable as the text is extracted from the PDF format directly. ## Prefill tags / templates Instead of generating a new document and use the `p` tag modifier to prefill signer input data it is also possible to use `prefill_tags`. For this to work all tags need to have an `id` as this is needed to reference the tag. Example: ``` [[c|0|id:checkbox_1 ]] // Should be checked [[c|0|id:checkbox_2 ]] // Should not be checked [[d|0|n:Birth date|id:birth_date ]] // Should be prefilled with the birth date of the signer [[t|0|n:City|id:customer_city ]] // Should be prefilled with 'New York' ``` Now when a document contains the tags above you can prefill them using the `prefill_tags` field on document by referencing the 'id'. ```json \"prefill_tags\": [ {\"external_id\":\"checkbox_1\", \"checkbox_value\":\"true\"}, {\"external_id\":\"checkbox_2\", \"checkbox_value\":\"false\"}, {\"external_id\":\"birth_date\", \"date_value\":\"1984-12-31\"}, // must be in ISO format ([YYYY]-[MM]-[DD]) {\"external_id\":\"customer_city\", \"text\":\"New York\"} ] ``` If you are using templates created from within the SignRequest app you can also set the `external_id` of a template tag in the advanced section when editing a tag. Note that it's also possible to add these tags when using the SignRequest-js client and the [Frontend API](#section/Frontend-API). ## Prepare using the web interface It is also possible to have the sender of a SignRequest prepare the document before sending the request out. To use this functionality, set the `is_being_prepared` flag on the SignRequest resource to `true`. When doing so the SignRequest will not be sent out to the recipient(s) and the `prepare_url` field will be set to a url where your application can redirect the sender to. Please note that if the sender does not have a SignRequest account they will be asked to verify their email after preparing the document. If you're an integration partner please [contact us](https://signrequest.com/en/contact/) for more possibilities when integrating this functionality. Example: ```json { \"file_from_url\": \"https://signrequest.com/static/demo/SignRequestDemoDocument.pdf\", \"from_email\": \"you@yourcompany.com\", \"who\": \"mo\", \"is_being_prepared\": \"true\", \"signers\": [{\"email\": \"you@yourcompany.com\"}, {\"email\": \"tech-support@signrequest.com\"}] } ``` Note that it's perfectly fine to also include tags in the document. The sender will be able to change / remove them. ## Retrieving signer input All text, date, and boolean inputs of signers after a signer signs are available in the `inputs` field of a signer as text. This can be helpful if you need to update your systems based on data signers add to a document. ```json \"inputs\": [ { \"type\": \"d\", // 's' (signature input), 't' (text input), 'd' (date input) or 'c' (checkbox input) \"page_index\": 0, // index of the page this input resides on \"text\": \"09-25-18\", // text as seen on the document (only for date and text inputs) \"checkbox_value\": null, // true or false (only for checkbox inputs) \"date_value\": \"2018-09-25\", // the date in ISO format ([YYYY]-[MM]-[DD]) \"external_id\": null // optionally the external id assigned to a tag (helpful if you need to identify a specific input, also see 'Tag modifiers') } ] ``` ## Tags Example Signer 0: this is the first person that needs to sign (including you). ![Signer 0](https://signrequest.com/assets/images/blogs/template-tags-electronic-signature-0.bf35c985.png) Signer 1: this is the second person that needs to sign (including you). ![Signer 1](https://signrequest.com/assets/images/blogs/template-tags-electronic-signature-1.335ad0c8.png) The result in SignRequest: ![Result in SignRequest](https://signrequest.com/assets/images/blogs/tags-example.2bb33d7f.png) ## Example Documents You can quickly test this feature with our example documents: 1. [Basic example document](https://docs.google.com/document/d/1oI2R1SxfMNZXiz3jCQvorpoklF9xq_dCJnOpkI-zo80/edit?usp=sharing) 2. [Advanced example document](https://docs.google.com/document/d/1-gzqym9clQ1a193JGocXUeIX92cqPINBHOBeGxbDASw/edit) These are shared Google Docs documents with example tags. If you have our Google Docs Add-on you can directly send a SignRequest! If you don't have our Google Docs Add-on for electronic signatures, go to \"Add-ons\" in the Google Docs menu bar and install the Add-on for free. Then, go back to \"Add-ons\" and click \"SignRequest\". ## Walkthrough Video We also have a walkthrough video on YouTube about using templates with tags in a base document: [![Templates with tags in a base document](http://img.youtube.com/vi/y5U5WqTqZBQ/0.jpg)](http://www.youtube.com/watch?v=y5U5WqTqZBQ) # Events ## Events callback In order to receive the `events` as a callback to your application a **callback url** needs to be set in the [team API settings](/#/teams) page. When set, SignRequest will POST events as `application/json` to this endpoint. Your endpoint should return a 200 OK response. SignRequest will retry to deliver events (max 10 times) in case of a timeout or a 500 response from your server. It is also possible to change the **callback url on a per document basis**. To use this functionality you can set the callback url using the `events_callback_url` field when [creating a document](#operation/documents_create) or when using the [signrequest-quick-create endpoint](#tag/signrequest-quick-create). Please be aware that we might add more event types in the future so code defensively for that. For an example of how an event receiver can be written checkout this [repository](https://github.com/SignRequest/signrequest-event-receiver). The following event types are available: - `convert_error`: Document convert error - `converted`: Document converted - `sending_error`: Document sending error - `sent`: Document sent - `declined`: Document declined - `cancelled`: Document cancelled - `signed`: Document signed - `signer_signed`: Signer signed - `signer_email_bounced`: Signer email bounced - `signer_viewed_email`: Signer viewed email - `signer_viewed`: Signer viewed document - `signer_forwarded`: Signer forwarded document - `signer_downloaded`: Signer downloaded - `signrequest_received`: SignRequest received Status codes: - `ok`: ok - `error`: error The event status will be `error` for the following events: `convert_error`, `sending_error`, and `signer_email_bounced`. The document status field can have the following codes: - `co`: converting - `ne`: new - `se`: sent - `vi`: viewed - `si`: signed - `do`: downloaded - `sd`: signed and downloaded - `ca`: cancelled - `de`: declined - `ec`: error converting - `es`: error sending Example callback request: ```json { \"document\": { \"api_used\": true, \"attachments\": [], \"external_id\": \"your_id_of_this_document\", \"file\": \"signrequest download url of the uploaded file\", \"file_from_url\": \"url where signrequest downloaded the document, if this functionality was used\", \"name\": \"document.pdf\", \"pdf\": null, \"prefill_tags\": [], \"security_hash\": null, \"signing_log\": null, \"signrequest\": null, \"status\": \"co\", \"team\": { \"name\": \"the_name_of_your_team\", \"subdomain\": \"the_subdomain_of_your_team\" }, \"template\": null, \"url\": \"https://signrequest.com/api/v1/documents/f2bac751-4fa1-43f1-91de-a1b8905c239a/\", \"user\": null, \"uuid\": \"f2bac751-4fa1-43f1-91de-a1b8905c239a\" }, \"event_hash\": \"89365cda10349ced9c3fd9c457372b37ad2e723c5b9f11a4d0b2c16724d8a2e7\", \"event_time\": \"1537889008\", \"event_type\": \"converted\", \"signer\": null, \"status\": \"ok\", \"team\": { \"name\": \"the_name_of_your_team\", \"subdomain\": \"the_subdomain_of_your_team\" }, \"timestamp\": \"2018-09-25T15:23:28.836457Z\", \"token_name\": \"Token\", \"uuid\": \"ffffd4dd-89c7-4133-ba2d-960f65c8d395\" } ``` If the event is **signer related** the `signer` field will contain all the signer data. All event data can also be fetched using the REST API [Events resource](#tag/events). Be sure to check that out if you're developing your endpoint and see how the data looks. You can check the authenticity (that the event really came from SignRequest) by generating and comparing the `event_hash` that comes with the event. The `event_hash` is generated with the HMAC algorithm using your API Token as a key in SHA256 digest mode. OpenSSL shell example: ```bash echo -n \"${event_time}${event_type}\" | openssl dgst -sha256 -hmac \"YOUR_TOKEN_HERE\" ``` which expands to: ```bash echo -n \"1537889008converted\" | openssl dgst -sha256 -hmac \"YOUR_TOKEN_HERE\" 89365cda10349ced9c3fd9c457372b37ad2e723c5b9f11a4d0b2c16724d8a2e7 ``` If you have multiple API tokens created you can identify the used token by the `token_name` (if you provided one). Always use **SSL enabled endpoints**! Developing your callback endpoint locally? Checkout [UltraHook](http://www.ultrahook.com/) to receive webhooks on localhost, nifty! ## Event webhooks To receive only specific event callbacks, webhook subscriptions can be created for Teams and for Personal accounts. The resource takes an `event_type`, `callback_url` and optionally a `name` to easily identify what webhook is used for. The `integration` field can also be set when this hook is specific to one of the SignRequest supported integrations. Check out the [webhooks resource](#tag/webhooks) for all possible event types to subscribe to. When the webhooks are used on personal accounts these webhooks also receive the `signrequest_received` event which can be used to notify users that they have received a new SignRequest. However, creating webhook subscriptions for personal accounts requires a SignRequest session (logged in user) or Basic auth using a username and password. ## Disable all SignRequest email events It is possible to disable all SignRequest status emails as well as the email that contains the signed documents. When using this functionality the following events will not generate a SignRequest email: - `sent`: Document sent - `signer_email_bounced`: Signer email bounced - `signer_viewed_email`: Signer viewed email - `signer_viewed`: Signer viewed document - `signer_signed`: Signer signed - `signed`: Document signed - `declined`: Document declined - `cancelled`: Document cancelled To enable this feature set the `disable_emails` flag on the [SignRequest resource](#tag/signrequests) to true. Note that the event emails will only be disabled if there is `callback_url` available for the document as your application is expected to notify users instead of SignRequest. The initial SignRequest email (that contains the link to sign) can only be disabled by using the [Embed url](#section/Additional-signing-methods/Embed-url) functionality. # Frontend API Another option to help your users sending SignRequests is using the \"frontend\" api. This involves no token and is merely used to \"prefill\" the SignRequest box found at the homepage for your users. The only requirement is that the document to send out is publicly available in order for SignRequest to download the file. Shareable links of Google Drive documents are also supported here. GET params for prefilling the box: ``` api=v1 // the version of the API to use who=mo // mo='me & others', m='only me', o='only others' signers=first_email@example.com,second_email@example.com // emails of 'signers' comma separated from_email=you@yourcompany.com // email of the person sending the SignRequest doc_url=https%3A%2F%2Fsignrequest.com%2Fstatic%2Fdemo%2FSignRequestDemoDocument.pdf // the url where SignRequest can download the document (quoted) ``` Example resulting url: ``` https://signrequest.com/#/?api=v1&who=mo&signers=tech-support@signrequest.com&from_email=you@yourcompany.com&doc_url=https%3A%2F%2Fsignrequest.com%2Fstatic%2Fdemo%2FSignRequestDemoDocument.pdf ``` Note that you can also use prefill tags here by adding the parameter prefill_tags. The value should be Base64 encoded JSON, JavaScript example: ```javascript btoa(JSON.stringify([{external_id: 'customer_city', text: 'New York'}])); // the output can be used with the parameter: // prefill_tags=W3siZXh0ZXJuYWxfaWQiOiJjdXN0b21lcl9jaXR5IiwidGV4dCI6Ik5ldyBZb3JrIn1d ``` ## SignRequest-js client (beta) Although we consider the library \"beta\" you can count on a stable API (semver). However, if you plan to use this please [contact us](https://signrequest.com/en/contact/) so we know your use case and can help you out where needed. We will open up the repository to the public when out of beta. To use the SignRequest javascript library include the following in your page (npm and bower are coming when out of beta): ```html ``` Or for async loading use: ```html ``` The library uses [UMD](https://github.com/umdjs/umd) (Universal Module Definition). To use a specific version (current is **1.0.5**) use for example: **cdn.signrequest.com/signrequest-js/v1/1.0.5/signrequest-js.min.js**. ### Usage ```javascript // same as the frontend API GET parameters, these are all optional var conf = { subdomain: '', // if you are using this for a specific team set the subdomain here api: 'v1', who: 'mo', signers: 'first_email@example.com,second_email@example.com', from_email: 'you@yourcompany.com', close: true, // close the popup when done? default: true // or use next: next: '', // redirect to this url when done signing themselves, frontend_id: '' // optional shared secret set on document to grant access to users even if they don't have access to team } // these are also optional, the popup will be centered in the window opening the popup var popup_conf = { width: 460, // width of the popup in pixels, default 460 height: 600, // height of the popup in pixels, default the height of the window opening the popup } // to open a specific document first create a document using the REST API with your backend // be sure to also set the correct 'subdomain' in the configuration when you create a document for a specific team var doc_uuid = 'the-uuid-of-the-document'; SignRequest.browser.openPopupForDocUuid(doc_uuid, conf, popup_conf); // to create a document from a url var doc_url = 'https://signrequest.com/static/demo/SignRequestDemoDocument.pdf' SignRequest.browser.openPopupForDocUrl(doc_url, conf, popup_conf); // to create a document from a template uuid var template_uuid = 'the-uuid-of-the-template' SignRequest.browser.openPopupForTemplateUuid(template_uuid, conf, popup_conf); // to open a popup using custom params var popup = SignRequest.browser.openPopup(conf, popup_conf); // if your document contains template tags / placeholders that have an 'external_id' // it is possible to 'prefill' these for a particular SignRequest by updating your conf object with for example: conf.prefill_tags = [{external_id: 'customer_city', text: 'New York'}]; // Now all template tags with this external_id will be prefilled with 'New York' // all popup openers return an instance of the popup to which event callbacks can be registered (they can be chained) // the possible events are: 'opened', 'sent', 'signed', 'declined', 'finished', 'closed', 'any' // note that 'sent', 'finished' and 'closed' can be called fast after each other when the popup autocloses (close: true) // also when sending a SignRequest and the sender also need to sign you can receive the 'signed' or 'declined' event // after the 'sent' event (SignRequest created). // When the sender is done (sending and possibly siging) the 'finished' event is fired. popup = popup.on('closed', function (event_type, payload, event) { // this would fire when the popup closes, you might want to update your page based on events like this console.log(event_type, payload, event); }) // shortcut to fire on all events ('any') popup.onAny(function (event_type, payload, event) { // this would fire on all events console.log(event_type, payload, event); }) // to set a default configuration to use in all future calls for example for a team subdomain SignRequest.browser.setConfig({subdomain: 'the_subdomain_of_your_team'}); // When creating a document for your users using our REST API and open that document in the popup in response to clicking a button // you might need to open the popup before you know the uuid of the document from your backend. // This to prevent popup blockers from kicking in when doing async work before we open a popup. // For this use case you can use the `openLoadingPopup` helper on click and use that already opened popup to load a document later. $('button#your_button').on('click', function () { // using jQuery in the following example (not required for signrequest-js) var popup = SignRequest.browser.openLoadingPopup(); // open a popup on button click right away popup.onAny(function (event_type, payload, event) { // all listeners created on the loading popup will also be registered on the popup events fired later after the we call // SignRequest.browser.openPopupForDocUuid... console.log('Event received: ' + event_type + ', payload: ' + JSON.stringify(payload); }); // Async call some endpoint on your backend that creates a document using the REST API. $.post('/your-endpoint-to-create-a-document', {some: 'data'}).then(function(response){ // instead of opening a new popup we use the one that is 'loading' as otherwise // most browser popup blockers will block opening a new window here (the opening of the window comes too late after the user click). // we assume here your endpoint returns the uuid of the document created in the response SignRequest.browser.openPopupForDocUuid(response.document_uuid, conf, {sr_popup: popup}); // `{sr_popup: popup}` make the library use an existing popup instead of creating a new one }); }); SignRequest.browser.openPopupForDocUrl('https://signrequest.com/static/demo/SignRequestDemoDocument.pdf'); ``` ### Sharing document with external users Normally a document stored within SignRequest would require the recipient to be a member of the document owner's team in order to gain access to the document. If you'd like to share a document outside of your team, you can [create a document](#operation/documents_create) while storing a shared secret on the `frontend_id` field. Then, using the SingRequest-js Client, you can add the `frontend_id` to the `conf` object when calling `openPopupForDocUuid` in order to grant any user presented with the signing popup access to the document. # Additional signing methods ## Embed url Normally SignRequest will send the SignRequest email to signers containing the personal link to sign a document. This is how SignRequest validates an email address and is the preferred way. However, if your application requires a continuous flow (in a sales flow for example) it is possible to generate an `embed_url` and redirect a signer to that link. Combined with a `redirect_url` a continuous flow can be achieved. Doing this moves the responsibility of identifying an email address / user to your application. This also shows in the signing log as SignRequest cannot guarantee that a document is signed by someone having access to an email address. To generate the `embed_url` you need to declare the ID of the logged in user in YOUR application in the `embed_url_user_id` field. This ID will also show in the signing log. The generated `embed_url` can only be used until the document is signed. Note that it is perfectly fine to combine signers with and without a generated `embed_url`. The `order` field also behaves as you would expect. For example, if the first signer (order = 0) has an `embed_url` generated and the second (order = 1) not, the second signer will only receive the SignRequest email when the first one has signed. When using this `embed_url` in an `iframe`, you can add any of the following url parameters to hide some elements in the header: `&hide_login=1` (hide the login button), `&hide_cancel=1` (hide the cancel link), `&hide_decline=1` (hide the option to decline), `&hide_logo=1` (hide the logo) and `&hide_title=1` (hide the document title in the header). Be aware that the `embed_url` may already contain other url parameters. Also note that hiding the login button does not disable to login prompt for signers that already have a SignRequest account. This cannot be disabled. If you also want to disable all other SignRequest emails, see [Disable all SignRequest email events](#section/Events/Disable-all-SignRequest-email-events). ## In person signing In some cases your application might want to generate one url for both the sender of the document and the receiver to sign a document after each other in person. This can be achieved by this signer configuration example: ```json { \"file_from_url\": \"https://signrequest.com/static/demo/SignRequestDemoDocument.pdf\", \"from_email\": \"you@yourcompany.com\", \"who\": \"mo\", \"signers\": [ { \"email\": \"you@yourcompany.com\", \"order\": 1, \"embed_url_user_id\": \"your ID\", }, { \"email\": \"tech-support@signrequest.com\", \"order\": 2, \"in_person\": true } ] } ``` This way you can redirect the user to the `embed_url` of the sender. After the sender has signed they will be redirected to the next `in_person` signer. # Integration Partners ## Salesforce The most straight forward way to integrate Salesforce with SignRequest is to use our managed package. Normally you would use the SignRequest buttons provided in the managed package to create SignRequest documents from Salesforce but if you want to skip that step and create SignRequests using the API (but still sync documents to Salesforce) you can add the following data to a `signrequest`: ```json \"integration_data\": { \"object_type\": \"API NAME OF THE (S)OBJECT, e.g. 'Opportunity' or 'CustomObject__c'\", \"uid\": \"UID OF THE SALESFORCE USER (NOT UUID), e.g. 'https:\\/\\/login.salesforce.com\\/id\\/00D24000000pMDZEA2\\/005240000048zB0AAI'\", \"object_id\": \"OBJECT ID, e.g. 0062400000MaeNv\" }, \"integration\": \"salesforce\" ``` Caveat: The user of the `from_email` needs to be a member of the Team that created the `signrequest`, and the user needs to have a SignRequest account using Salesforce OAuth. ## Zapier Does your app integrate with Zapier? Chances are your digital signatures are just a few clicks away! Checkout our Zapier integration here: https://signrequest.com/en/digital-electronic-signatures-with-zapier/ ## Becoming an integration partner If your application requires to create Teams and act on behalf of them you need to become an integration partner. This only grants you access to resources created by your application of the third party Team. Teams can be created and updated on the [Teams resource](#tag/teams). Please [contact us](https://signrequest.com/en/contact/) to learn more. ## OAuth2 Authorization Framework SignRequest allows partner applications to use the API on behalf of SignRequest users using OAuth2. If you need this functionality you can [create an application here](/api/v1/oauth2/applications/) (choose Client type: Confidential, Authorization grant type: Authorization code) and [contact us](https://signrequest.com/en/contact/) if you need any help. The OAuth2 framework is [rfc-compliant](https://tools.ietf.org/html/rfc6749). OAuth2 endpoints: - https://signrequest.com/api/v1/oauth2/authorize/ Get authorization code GET params: client_id, scope(s)[=we currently only support the 'read', 'write' scopes], response_type[=code], state[=your_random_state_string], redirect_uri[=if not provided the first of your application is used] - https://signrequest.com/api/v1/oauth2/token/ Request a new (refresh) token POST params: code[=the client code], grant_type[=authorization_code], redirect_uri, client_id, client_secret[=required when using the 'confidential' client type] - https://signrequest.com/api/v1/oauth2/revoke_token/ Revoke a token POST params: token[=token to revoke], token_type_hint[=optional, designating either 'access_token' or 'refresh_token'. Use tokens with the `Authorization: Bearer YOUR_TOKEN_HERE` header in your requests. To remove your authorized applications/tokens during development [go here](/api/v1/oauth2/authorized_tokens/). [Contact us](https://signrequest.com/en/contact/) if you want your logo added to the consent screen. # Client libraries The following libraries are not officially supported. Created a client library? Let us know! - PHP: https://github.com/AtaneNL/SignRequest If your application requires - Python: https://github.com/SignRequest/signrequest-python-client - Python: https://github.com/ivansabik/signrequest-python-client - Ruby: https://github.com/SignRequest/signrequest-ruby-client - Event receiver (Python server): https://github.com/SignRequest/signrequest-event-receiver ### More coming soon Documentation about more advanced usage of the SignRequest API and language specific client libraries is coming soon. Feel free to contact us at tech-support@signrequest.com for any questions or feature requests. +#API for SignRequest.com OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class InlineResponse2011 attr_accessor :detail @@ -59,12 +58,11 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'detail') self.detail = attributes[:'detail'] end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -72,27 +70,27 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if @detail.nil? - invalid_properties.push("invalid value for 'detail', detail cannot be nil.") + invalid_properties.push('invalid value for "detail", detail cannot be nil.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? return false if @detail.nil? - detail_validator = EnumAttributeValidator.new('String', ["OK"]) + detail_validator = EnumAttributeValidator.new('String', ['OK']) return false unless detail_validator.valid?(@detail) - return true + true end # Custom attribute writer method checking allowed values (enum). # @param [Object] detail Object to be assigned def detail=(detail) - validator = EnumAttributeValidator.new('String', ["OK"]) + validator = EnumAttributeValidator.new('String', ['OK']) unless validator.valid?(detail) - fail ArgumentError, "invalid value for 'detail', must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "detail", must be one of #{validator.allowable_values}.' end @detail = detail end @@ -127,7 +125,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -209,7 +207,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -220,7 +218,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/inline_sign_request.rb b/lib/signrequest_client/models/inline_sign_request.rb index a893dd6..b99319e 100644 --- a/lib/signrequest_client/models/inline_sign_request.rb +++ b/lib/signrequest_client/models/inline_sign_request.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class InlineSignRequest # Email of user sending the SignRequest (must be a validated email) attr_accessor :from_email @@ -29,6 +28,9 @@ class InlineSignRequest # URL at which SignRequest will redirect to when a document is signed attr_accessor :redirect_url + # URL at which SignRequest will redirect to when a document is declined + attr_accessor :redirect_url_declined + attr_accessor :required_attachments # Disable uploading/adding of attachments @@ -49,6 +51,12 @@ class InlineSignRequest # Disable usage of uploaded signatures (images) attr_accessor :disable_upload_signatures + # Disables storing timestamp proof hashes in blockchain integrations. + attr_accessor :disable_blockchain_proof + + # When true a text message verification is needed before the signer can see the document + attr_accessor :text_message_verification_locked + # Subject of SignRequest email attr_accessor :subject @@ -95,6 +103,7 @@ def self.attribute_map :'is_being_prepared' => :'is_being_prepared', :'prepare_url' => :'prepare_url', :'redirect_url' => :'redirect_url', + :'redirect_url_declined' => :'redirect_url_declined', :'required_attachments' => :'required_attachments', :'disable_attachments' => :'disable_attachments', :'disable_text_signatures' => :'disable_text_signatures', @@ -102,6 +111,8 @@ def self.attribute_map :'disable_date' => :'disable_date', :'disable_emails' => :'disable_emails', :'disable_upload_signatures' => :'disable_upload_signatures', + :'disable_blockchain_proof' => :'disable_blockchain_proof', + :'text_message_verification_locked' => :'text_message_verification_locked', :'subject' => :'subject', :'message' => :'message', :'who' => :'who', @@ -119,6 +130,7 @@ def self.swagger_types :'is_being_prepared' => :'BOOLEAN', :'prepare_url' => :'String', :'redirect_url' => :'String', + :'redirect_url_declined' => :'String', :'required_attachments' => :'Array', :'disable_attachments' => :'BOOLEAN', :'disable_text_signatures' => :'BOOLEAN', @@ -126,6 +138,8 @@ def self.swagger_types :'disable_date' => :'BOOLEAN', :'disable_emails' => :'BOOLEAN', :'disable_upload_signatures' => :'BOOLEAN', + :'disable_blockchain_proof' => :'BOOLEAN', + :'text_message_verification_locked' => :'BOOLEAN', :'subject' => :'String', :'message' => :'String', :'who' => :'String', @@ -141,7 +155,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'from_email') self.from_email = attributes[:'from_email'] @@ -163,6 +177,10 @@ def initialize(attributes = {}) self.redirect_url = attributes[:'redirect_url'] end + if attributes.has_key?(:'redirect_url_declined') + self.redirect_url_declined = attributes[:'redirect_url_declined'] + end + if attributes.has_key?(:'required_attachments') if (value = attributes[:'required_attachments']).is_a?(Array) self.required_attachments = value @@ -193,6 +211,14 @@ def initialize(attributes = {}) self.disable_upload_signatures = attributes[:'disable_upload_signatures'] end + if attributes.has_key?(:'disable_blockchain_proof') + self.disable_blockchain_proof = attributes[:'disable_blockchain_proof'] + end + + if attributes.has_key?(:'text_message_verification_locked') + self.text_message_verification_locked = attributes[:'text_message_verification_locked'] + end + if attributes.has_key?(:'subject') self.subject = attributes[:'subject'] end @@ -218,7 +244,6 @@ def initialize(attributes = {}) if attributes.has_key?(:'uuid') self.uuid = attributes[:'uuid'] end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -226,34 +251,38 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if !@from_email.nil? && @from_email.to_s.length < 1 - invalid_properties.push("invalid value for 'from_email', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "from_email", the character length must be great than or equal to 1.') end if !@from_email_name.nil? && @from_email_name.to_s.length < 1 - invalid_properties.push("invalid value for 'from_email_name', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "from_email_name", the character length must be great than or equal to 1.') end if !@prepare_url.nil? && @prepare_url.to_s.length < 1 - invalid_properties.push("invalid value for 'prepare_url', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "prepare_url", the character length must be great than or equal to 1.') end if !@redirect_url.nil? && @redirect_url.to_s.length < 1 - invalid_properties.push("invalid value for 'redirect_url', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "redirect_url", the character length must be great than or equal to 1.') + end + + if !@redirect_url_declined.nil? && @redirect_url_declined.to_s.length < 1 + invalid_properties.push('invalid value for "redirect_url_declined", the character length must be great than or equal to 1.') end if !@subject.nil? && @subject.to_s.length < 1 - invalid_properties.push("invalid value for 'subject', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "subject", the character length must be great than or equal to 1.') end if !@message.nil? && @message.to_s.length < 1 - invalid_properties.push("invalid value for 'message', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "message", the character length must be great than or equal to 1.') end if !@uuid.nil? && @uuid.to_s.length < 1 - invalid_properties.push("invalid value for 'uuid', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "uuid", the character length must be great than or equal to 1.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid @@ -263,20 +292,20 @@ def valid? return false if !@from_email_name.nil? && @from_email_name.to_s.length < 1 return false if !@prepare_url.nil? && @prepare_url.to_s.length < 1 return false if !@redirect_url.nil? && @redirect_url.to_s.length < 1 + return false if !@redirect_url_declined.nil? && @redirect_url_declined.to_s.length < 1 return false if !@subject.nil? && @subject.to_s.length < 1 return false if !@message.nil? && @message.to_s.length < 1 - who_validator = EnumAttributeValidator.new('String', ["m", "mo", "o"]) + who_validator = EnumAttributeValidator.new('String', ['m', 'mo', 'o']) return false unless who_validator.valid?(@who) return false if !@uuid.nil? && @uuid.to_s.length < 1 - return true + true end # Custom attribute writer method with validation # @param [Object] from_email Value to be assigned def from_email=(from_email) - if !from_email.nil? && from_email.to_s.length < 1 - fail ArgumentError, "invalid value for 'from_email', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "from_email", the character length must be great than or equal to 1.' end @from_email = from_email @@ -285,9 +314,8 @@ def from_email=(from_email) # Custom attribute writer method with validation # @param [Object] from_email_name Value to be assigned def from_email_name=(from_email_name) - if !from_email_name.nil? && from_email_name.to_s.length < 1 - fail ArgumentError, "invalid value for 'from_email_name', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "from_email_name", the character length must be great than or equal to 1.' end @from_email_name = from_email_name @@ -296,9 +324,8 @@ def from_email_name=(from_email_name) # Custom attribute writer method with validation # @param [Object] prepare_url Value to be assigned def prepare_url=(prepare_url) - if !prepare_url.nil? && prepare_url.to_s.length < 1 - fail ArgumentError, "invalid value for 'prepare_url', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "prepare_url", the character length must be great than or equal to 1.' end @prepare_url = prepare_url @@ -307,20 +334,28 @@ def prepare_url=(prepare_url) # Custom attribute writer method with validation # @param [Object] redirect_url Value to be assigned def redirect_url=(redirect_url) - if !redirect_url.nil? && redirect_url.to_s.length < 1 - fail ArgumentError, "invalid value for 'redirect_url', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "redirect_url", the character length must be great than or equal to 1.' end @redirect_url = redirect_url end + # Custom attribute writer method with validation + # @param [Object] redirect_url_declined Value to be assigned + def redirect_url_declined=(redirect_url_declined) + if !redirect_url_declined.nil? && redirect_url_declined.to_s.length < 1 + fail ArgumentError, 'invalid value for "redirect_url_declined", the character length must be great than or equal to 1.' + end + + @redirect_url_declined = redirect_url_declined + end + # Custom attribute writer method with validation # @param [Object] subject Value to be assigned def subject=(subject) - if !subject.nil? && subject.to_s.length < 1 - fail ArgumentError, "invalid value for 'subject', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "subject", the character length must be great than or equal to 1.' end @subject = subject @@ -329,9 +364,8 @@ def subject=(subject) # Custom attribute writer method with validation # @param [Object] message Value to be assigned def message=(message) - if !message.nil? && message.to_s.length < 1 - fail ArgumentError, "invalid value for 'message', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "message", the character length must be great than or equal to 1.' end @message = message @@ -340,9 +374,9 @@ def message=(message) # Custom attribute writer method checking allowed values (enum). # @param [Object] who Object to be assigned def who=(who) - validator = EnumAttributeValidator.new('String', ["m", "mo", "o"]) + validator = EnumAttributeValidator.new('String', ['m', 'mo', 'o']) unless validator.valid?(who) - fail ArgumentError, "invalid value for 'who', must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "who", must be one of #{validator.allowable_values}.' end @who = who end @@ -350,9 +384,8 @@ def who=(who) # Custom attribute writer method with validation # @param [Object] uuid Value to be assigned def uuid=(uuid) - if !uuid.nil? && uuid.to_s.length < 1 - fail ArgumentError, "invalid value for 'uuid', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "uuid", the character length must be great than or equal to 1.' end @uuid = uuid @@ -368,6 +401,7 @@ def ==(o) is_being_prepared == o.is_being_prepared && prepare_url == o.prepare_url && redirect_url == o.redirect_url && + redirect_url_declined == o.redirect_url_declined && required_attachments == o.required_attachments && disable_attachments == o.disable_attachments && disable_text_signatures == o.disable_text_signatures && @@ -375,6 +409,8 @@ def ==(o) disable_date == o.disable_date && disable_emails == o.disable_emails && disable_upload_signatures == o.disable_upload_signatures && + disable_blockchain_proof == o.disable_blockchain_proof && + text_message_verification_locked == o.text_message_verification_locked && subject == o.subject && message == o.message && who == o.who && @@ -392,7 +428,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [from_email, from_email_name, is_being_prepared, prepare_url, redirect_url, required_attachments, disable_attachments, disable_text_signatures, disable_text, disable_date, disable_emails, disable_upload_signatures, subject, message, who, send_reminders, signers, uuid].hash + [from_email, from_email_name, is_being_prepared, prepare_url, redirect_url, redirect_url_declined, required_attachments, disable_attachments, disable_text_signatures, disable_text, disable_date, disable_emails, disable_upload_signatures, disable_blockchain_proof, text_message_verification_locked, subject, message, who, send_reminders, signers, uuid].hash end # Builds the object from hash @@ -405,7 +441,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -487,7 +523,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -498,7 +534,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/inline_team.rb b/lib/signrequest_client/models/inline_team.rb index 33e7a25..4ab6f36 100644 --- a/lib/signrequest_client/models/inline_team.rb +++ b/lib/signrequest_client/models/inline_team.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class InlineTeam attr_accessor :name @@ -21,7 +20,6 @@ class InlineTeam attr_accessor :url - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -46,7 +44,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'name') self.name = attributes[:'name'] @@ -59,7 +57,6 @@ def initialize(attributes = {}) if attributes.has_key?(:'url') self.url = attributes[:'url'] end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -67,18 +64,18 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if !@name.nil? && @name.to_s.length < 1 - invalid_properties.push("invalid value for 'name', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.') end if !@subdomain.nil? && @subdomain.to_s.length < 1 - invalid_properties.push("invalid value for 'subdomain', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "subdomain", the character length must be great than or equal to 1.') end if !@subdomain.nil? && @subdomain !~ Regexp.new(/^[-a-zA-Z0-9_]+$/) - invalid_properties.push("invalid value for 'subdomain', must conform to the pattern /^[-a-zA-Z0-9_]+$/.") + invalid_properties.push('invalid value for "subdomain", must conform to the pattern /^[-a-zA-Z0-9_]+$/.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid @@ -87,15 +84,14 @@ def valid? return false if !@name.nil? && @name.to_s.length < 1 return false if !@subdomain.nil? && @subdomain.to_s.length < 1 return false if !@subdomain.nil? && @subdomain !~ Regexp.new(/^[-a-zA-Z0-9_]+$/) - return true + true end # Custom attribute writer method with validation # @param [Object] name Value to be assigned def name=(name) - if !name.nil? && name.to_s.length < 1 - fail ArgumentError, "invalid value for 'name', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' end @name = name @@ -104,13 +100,12 @@ def name=(name) # Custom attribute writer method with validation # @param [Object] subdomain Value to be assigned def subdomain=(subdomain) - if !subdomain.nil? && subdomain.to_s.length < 1 - fail ArgumentError, "invalid value for 'subdomain', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "subdomain", the character length must be great than or equal to 1.' end if !subdomain.nil? && subdomain !~ Regexp.new(/^[-a-zA-Z0-9_]+$/) - fail ArgumentError, "invalid value for 'subdomain', must conform to the pattern /^[-a-zA-Z0-9_]+$/." + fail ArgumentError, 'invalid value for "subdomain", must conform to the pattern /^[-a-zA-Z0-9_]+$/.' end @subdomain = subdomain @@ -148,7 +143,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -230,7 +225,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -241,7 +236,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/inline_team_member.rb b/lib/signrequest_client/models/inline_team_member.rb index e6c6d1f..449dd00 100644 --- a/lib/signrequest_client/models/inline_team_member.rb +++ b/lib/signrequest_client/models/inline_team_member.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class InlineTeamMember attr_accessor :uuid @@ -27,7 +26,6 @@ class InlineTeamMember attr_accessor :is_owner - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -58,7 +56,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'uuid') self.uuid = attributes[:'uuid'] @@ -83,7 +81,6 @@ def initialize(attributes = {}) if attributes.has_key?(:'is_owner') self.is_owner = attributes[:'is_owner'] end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -91,25 +88,24 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if !@uuid.nil? && @uuid.to_s.length < 1 - invalid_properties.push("invalid value for 'uuid', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "uuid", the character length must be great than or equal to 1.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? return false if !@uuid.nil? && @uuid.to_s.length < 1 - return true + true end # Custom attribute writer method with validation # @param [Object] uuid Value to be assigned def uuid=(uuid) - if !uuid.nil? && uuid.to_s.length < 1 - fail ArgumentError, "invalid value for 'uuid', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "uuid", the character length must be great than or equal to 1.' end @uuid = uuid @@ -150,7 +146,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -232,7 +228,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -243,7 +239,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/invite_member.rb b/lib/signrequest_client/models/invite_member.rb index d37e15a..b350250 100644 --- a/lib/signrequest_client/models/invite_member.rb +++ b/lib/signrequest_client/models/invite_member.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class InviteMember attr_accessor :email @@ -21,7 +20,6 @@ class InviteMember attr_accessor :is_owner - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -46,7 +44,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'email') self.email = attributes[:'email'] @@ -63,7 +61,6 @@ def initialize(attributes = {}) else self.is_owner = false end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -71,14 +68,14 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if @email.nil? - invalid_properties.push("invalid value for 'email', email cannot be nil.") + invalid_properties.push('invalid value for "email", email cannot be nil.') end if @email.to_s.length < 1 - invalid_properties.push("invalid value for 'email', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "email", the character length must be great than or equal to 1.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid @@ -86,18 +83,18 @@ def list_invalid_properties def valid? return false if @email.nil? return false if @email.to_s.length < 1 - return true + true end # Custom attribute writer method with validation # @param [Object] email Value to be assigned def email=(email) if email.nil? - fail ArgumentError, "email cannot be nil" + fail ArgumentError, 'email cannot be nil' end if email.to_s.length < 1 - fail ArgumentError, "invalid value for 'email', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "email", the character length must be great than or equal to 1.' end @email = email @@ -135,7 +132,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -217,7 +214,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -228,7 +225,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/placeholder.rb b/lib/signrequest_client/models/placeholder.rb index 731a9d1..cf1b3f1 100644 --- a/lib/signrequest_client/models/placeholder.rb +++ b/lib/signrequest_client/models/placeholder.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class Placeholder attr_accessor :uuid @@ -87,7 +86,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'uuid') self.uuid = attributes[:'uuid'] @@ -120,7 +119,6 @@ def initialize(attributes = {}) if attributes.has_key?(:'external_id') self.external_id = attributes[:'external_id'] end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -128,42 +126,41 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if !@uuid.nil? && @uuid.to_s.length < 1 - invalid_properties.push("invalid value for 'uuid', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "uuid", the character length must be great than or equal to 1.') end if @page_index.nil? - invalid_properties.push("invalid value for 'page_index', page_index cannot be nil.") + invalid_properties.push('invalid value for "page_index", page_index cannot be nil.') end if @prefill.nil? - invalid_properties.push("invalid value for 'prefill', prefill cannot be nil.") + invalid_properties.push('invalid value for "prefill", prefill cannot be nil.') end if !@external_id.nil? && @external_id.to_s.length > 255 - invalid_properties.push("invalid value for 'external_id', the character length must be smaller than or equal to 255.") + invalid_properties.push('invalid value for "external_id", the character length must be smaller than or equal to 255.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? return false if !@uuid.nil? && @uuid.to_s.length < 1 - type_validator = EnumAttributeValidator.new('String', ["s", "i", "n", "d", "t", "c"]) + type_validator = EnumAttributeValidator.new('String', ['s', 'i', 'n', 'd', 't', 'c']) return false unless type_validator.valid?(@type) return false if @page_index.nil? return false if @prefill.nil? return false if !@external_id.nil? && @external_id.to_s.length > 255 - return true + true end # Custom attribute writer method with validation # @param [Object] uuid Value to be assigned def uuid=(uuid) - if !uuid.nil? && uuid.to_s.length < 1 - fail ArgumentError, "invalid value for 'uuid', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "uuid", the character length must be great than or equal to 1.' end @uuid = uuid @@ -172,9 +169,9 @@ def uuid=(uuid) # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ["s", "i", "n", "d", "t", "c"]) + validator = EnumAttributeValidator.new('String', ['s', 'i', 'n', 'd', 't', 'c']) unless validator.valid?(type) - fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.' end @type = type end @@ -182,9 +179,8 @@ def type=(type) # Custom attribute writer method with validation # @param [Object] external_id Value to be assigned def external_id=(external_id) - if !external_id.nil? && external_id.to_s.length > 255 - fail ArgumentError, "invalid value for 'external_id', the character length must be smaller than or equal to 255." + fail ArgumentError, 'invalid value for "external_id", the character length must be smaller than or equal to 255.' end @external_id = external_id @@ -227,7 +223,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -309,7 +305,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -320,7 +316,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/required_attachment.rb b/lib/signrequest_client/models/required_attachment.rb index fe86832..0fed45e 100644 --- a/lib/signrequest_client/models/required_attachment.rb +++ b/lib/signrequest_client/models/required_attachment.rb @@ -6,20 +6,18 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class RequiredAttachment attr_accessor :name attr_accessor :uuid - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -42,7 +40,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'name') self.name = attributes[:'name'] @@ -51,7 +49,6 @@ def initialize(attributes = {}) if attributes.has_key?(:'uuid') self.uuid = attributes[:'uuid'] end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -59,22 +56,22 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if @name.nil? - invalid_properties.push("invalid value for 'name', name cannot be nil.") + invalid_properties.push('invalid value for "name", name cannot be nil.') end if @name.to_s.length > 255 - invalid_properties.push("invalid value for 'name', the character length must be smaller than or equal to 255.") + invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.') end if @name.to_s.length < 1 - invalid_properties.push("invalid value for 'name', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.') end if !@uuid.nil? && @uuid.to_s.length < 1 - invalid_properties.push("invalid value for 'uuid', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "uuid", the character length must be great than or equal to 1.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid @@ -84,22 +81,22 @@ def valid? return false if @name.to_s.length > 255 return false if @name.to_s.length < 1 return false if !@uuid.nil? && @uuid.to_s.length < 1 - return true + true end # Custom attribute writer method with validation # @param [Object] name Value to be assigned def name=(name) if name.nil? - fail ArgumentError, "name cannot be nil" + fail ArgumentError, 'name cannot be nil' end if name.to_s.length > 255 - fail ArgumentError, "invalid value for 'name', the character length must be smaller than or equal to 255." + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.' end if name.to_s.length < 1 - fail ArgumentError, "invalid value for 'name', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' end @name = name @@ -108,9 +105,8 @@ def name=(name) # Custom attribute writer method with validation # @param [Object] uuid Value to be assigned def uuid=(uuid) - if !uuid.nil? && uuid.to_s.length < 1 - fail ArgumentError, "invalid value for 'uuid', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "uuid", the character length must be great than or equal to 1.' end @uuid = uuid @@ -147,7 +143,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -229,7 +225,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -240,7 +236,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/sign_request.rb b/lib/signrequest_client/models/sign_request.rb index baec48a..43135f2 100644 --- a/lib/signrequest_client/models/sign_request.rb +++ b/lib/signrequest_client/models/sign_request.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class SignRequest # Email of user sending the SignRequest (must be a validated email) attr_accessor :from_email @@ -29,6 +28,9 @@ class SignRequest # URL at which SignRequest will redirect to when a document is signed attr_accessor :redirect_url + # URL at which SignRequest will redirect to when a document is declined + attr_accessor :redirect_url_declined + # Attachments that signers are required to upload attr_accessor :required_attachments @@ -50,6 +52,12 @@ class SignRequest # Disable usage of uploaded signatures (images) attr_accessor :disable_upload_signatures + # Disables storing timestamp proof hashes in blockchain integrations. + attr_accessor :disable_blockchain_proof + + # When true a text message verification is needed before the signer can see the document + attr_accessor :text_message_verification_locked + # Subject of SignRequest email attr_accessor :subject @@ -104,6 +112,7 @@ def self.attribute_map :'is_being_prepared' => :'is_being_prepared', :'prepare_url' => :'prepare_url', :'redirect_url' => :'redirect_url', + :'redirect_url_declined' => :'redirect_url_declined', :'required_attachments' => :'required_attachments', :'disable_attachments' => :'disable_attachments', :'disable_text_signatures' => :'disable_text_signatures', @@ -111,6 +120,8 @@ def self.attribute_map :'disable_date' => :'disable_date', :'disable_emails' => :'disable_emails', :'disable_upload_signatures' => :'disable_upload_signatures', + :'disable_blockchain_proof' => :'disable_blockchain_proof', + :'text_message_verification_locked' => :'text_message_verification_locked', :'subject' => :'subject', :'message' => :'message', :'who' => :'who', @@ -132,6 +143,7 @@ def self.swagger_types :'is_being_prepared' => :'BOOLEAN', :'prepare_url' => :'String', :'redirect_url' => :'String', + :'redirect_url_declined' => :'String', :'required_attachments' => :'Array', :'disable_attachments' => :'BOOLEAN', :'disable_text_signatures' => :'BOOLEAN', @@ -139,6 +151,8 @@ def self.swagger_types :'disable_date' => :'BOOLEAN', :'disable_emails' => :'BOOLEAN', :'disable_upload_signatures' => :'BOOLEAN', + :'disable_blockchain_proof' => :'BOOLEAN', + :'text_message_verification_locked' => :'BOOLEAN', :'subject' => :'String', :'message' => :'String', :'who' => :'String', @@ -158,7 +172,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'from_email') self.from_email = attributes[:'from_email'] @@ -180,6 +194,10 @@ def initialize(attributes = {}) self.redirect_url = attributes[:'redirect_url'] end + if attributes.has_key?(:'redirect_url_declined') + self.redirect_url_declined = attributes[:'redirect_url_declined'] + end + if attributes.has_key?(:'required_attachments') if (value = attributes[:'required_attachments']).is_a?(Array) self.required_attachments = value @@ -210,6 +228,14 @@ def initialize(attributes = {}) self.disable_upload_signatures = attributes[:'disable_upload_signatures'] end + if attributes.has_key?(:'disable_blockchain_proof') + self.disable_blockchain_proof = attributes[:'disable_blockchain_proof'] + end + + if attributes.has_key?(:'text_message_verification_locked') + self.text_message_verification_locked = attributes[:'text_message_verification_locked'] + end + if attributes.has_key?(:'subject') self.subject = attributes[:'subject'] end @@ -221,7 +247,7 @@ def initialize(attributes = {}) if attributes.has_key?(:'who') self.who = attributes[:'who'] else - self.who = "o" + self.who = 'o' end if attributes.has_key?(:'send_reminders') @@ -253,7 +279,6 @@ def initialize(attributes = {}) if attributes.has_key?(:'integration_data') self.integration_data = attributes[:'integration_data'] end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -261,42 +286,46 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if !@from_email.nil? && @from_email.to_s.length > 255 - invalid_properties.push("invalid value for 'from_email', the character length must be smaller than or equal to 255.") + invalid_properties.push('invalid value for "from_email", the character length must be smaller than or equal to 255.') end if !@from_email.nil? && @from_email.to_s.length < 1 - invalid_properties.push("invalid value for 'from_email', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "from_email", the character length must be great than or equal to 1.') end if !@from_email_name.nil? && @from_email_name.to_s.length > 255 - invalid_properties.push("invalid value for 'from_email_name', the character length must be smaller than or equal to 255.") + invalid_properties.push('invalid value for "from_email_name", the character length must be smaller than or equal to 255.') end if !@prepare_url.nil? && @prepare_url.to_s.length < 1 - invalid_properties.push("invalid value for 'prepare_url', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "prepare_url", the character length must be great than or equal to 1.') end if !@redirect_url.nil? && @redirect_url.to_s.length > 2100 - invalid_properties.push("invalid value for 'redirect_url', the character length must be smaller than or equal to 2100.") + invalid_properties.push('invalid value for "redirect_url", the character length must be smaller than or equal to 2100.') + end + + if !@redirect_url_declined.nil? && @redirect_url_declined.to_s.length > 2100 + invalid_properties.push('invalid value for "redirect_url_declined", the character length must be smaller than or equal to 2100.') end if !@subject.nil? && @subject.to_s.length > 512 - invalid_properties.push("invalid value for 'subject', the character length must be smaller than or equal to 512.") + invalid_properties.push('invalid value for "subject", the character length must be smaller than or equal to 512.') end if @signers.nil? - invalid_properties.push("invalid value for 'signers', signers cannot be nil.") + invalid_properties.push('invalid value for "signers", signers cannot be nil.') end if !@uuid.nil? && @uuid.to_s.length < 1 - invalid_properties.push("invalid value for 'uuid', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "uuid", the character length must be great than or equal to 1.') end if @document.nil? - invalid_properties.push("invalid value for 'document', document cannot be nil.") + invalid_properties.push('invalid value for "document", document cannot be nil.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid @@ -307,27 +336,27 @@ def valid? return false if !@from_email_name.nil? && @from_email_name.to_s.length > 255 return false if !@prepare_url.nil? && @prepare_url.to_s.length < 1 return false if !@redirect_url.nil? && @redirect_url.to_s.length > 2100 + return false if !@redirect_url_declined.nil? && @redirect_url_declined.to_s.length > 2100 return false if !@subject.nil? && @subject.to_s.length > 512 - who_validator = EnumAttributeValidator.new('String', ["m", "mo", "o"]) + who_validator = EnumAttributeValidator.new('String', ['m', 'mo', 'o']) return false unless who_validator.valid?(@who) return false if @signers.nil? return false if !@uuid.nil? && @uuid.to_s.length < 1 return false if @document.nil? - integration_validator = EnumAttributeValidator.new('String', ["mfiles", "salesforce", "formdesk", "zapier", "txhash"]) + integration_validator = EnumAttributeValidator.new('String', ['mfiles', 'salesforce', 'formdesk', 'zapier', 'txhash']) return false unless integration_validator.valid?(@integration) - return true + true end # Custom attribute writer method with validation # @param [Object] from_email Value to be assigned def from_email=(from_email) - if !from_email.nil? && from_email.to_s.length > 255 - fail ArgumentError, "invalid value for 'from_email', the character length must be smaller than or equal to 255." + fail ArgumentError, 'invalid value for "from_email", the character length must be smaller than or equal to 255.' end if !from_email.nil? && from_email.to_s.length < 1 - fail ArgumentError, "invalid value for 'from_email', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "from_email", the character length must be great than or equal to 1.' end @from_email = from_email @@ -336,9 +365,8 @@ def from_email=(from_email) # Custom attribute writer method with validation # @param [Object] from_email_name Value to be assigned def from_email_name=(from_email_name) - if !from_email_name.nil? && from_email_name.to_s.length > 255 - fail ArgumentError, "invalid value for 'from_email_name', the character length must be smaller than or equal to 255." + fail ArgumentError, 'invalid value for "from_email_name", the character length must be smaller than or equal to 255.' end @from_email_name = from_email_name @@ -347,9 +375,8 @@ def from_email_name=(from_email_name) # Custom attribute writer method with validation # @param [Object] prepare_url Value to be assigned def prepare_url=(prepare_url) - if !prepare_url.nil? && prepare_url.to_s.length < 1 - fail ArgumentError, "invalid value for 'prepare_url', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "prepare_url", the character length must be great than or equal to 1.' end @prepare_url = prepare_url @@ -358,20 +385,28 @@ def prepare_url=(prepare_url) # Custom attribute writer method with validation # @param [Object] redirect_url Value to be assigned def redirect_url=(redirect_url) - if !redirect_url.nil? && redirect_url.to_s.length > 2100 - fail ArgumentError, "invalid value for 'redirect_url', the character length must be smaller than or equal to 2100." + fail ArgumentError, 'invalid value for "redirect_url", the character length must be smaller than or equal to 2100.' end @redirect_url = redirect_url end + # Custom attribute writer method with validation + # @param [Object] redirect_url_declined Value to be assigned + def redirect_url_declined=(redirect_url_declined) + if !redirect_url_declined.nil? && redirect_url_declined.to_s.length > 2100 + fail ArgumentError, 'invalid value for "redirect_url_declined", the character length must be smaller than or equal to 2100.' + end + + @redirect_url_declined = redirect_url_declined + end + # Custom attribute writer method with validation # @param [Object] subject Value to be assigned def subject=(subject) - if !subject.nil? && subject.to_s.length > 512 - fail ArgumentError, "invalid value for 'subject', the character length must be smaller than or equal to 512." + fail ArgumentError, 'invalid value for "subject", the character length must be smaller than or equal to 512.' end @subject = subject @@ -380,9 +415,9 @@ def subject=(subject) # Custom attribute writer method checking allowed values (enum). # @param [Object] who Object to be assigned def who=(who) - validator = EnumAttributeValidator.new('String', ["m", "mo", "o"]) + validator = EnumAttributeValidator.new('String', ['m', 'mo', 'o']) unless validator.valid?(who) - fail ArgumentError, "invalid value for 'who', must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "who", must be one of #{validator.allowable_values}.' end @who = who end @@ -390,9 +425,8 @@ def who=(who) # Custom attribute writer method with validation # @param [Object] uuid Value to be assigned def uuid=(uuid) - if !uuid.nil? && uuid.to_s.length < 1 - fail ArgumentError, "invalid value for 'uuid', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "uuid", the character length must be great than or equal to 1.' end @uuid = uuid @@ -401,9 +435,9 @@ def uuid=(uuid) # Custom attribute writer method checking allowed values (enum). # @param [Object] integration Object to be assigned def integration=(integration) - validator = EnumAttributeValidator.new('String', ["mfiles", "salesforce", "formdesk", "zapier", "txhash"]) + validator = EnumAttributeValidator.new('String', ['mfiles', 'salesforce', 'formdesk', 'zapier', 'txhash']) unless validator.valid?(integration) - fail ArgumentError, "invalid value for 'integration', must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "integration", must be one of #{validator.allowable_values}.' end @integration = integration end @@ -418,6 +452,7 @@ def ==(o) is_being_prepared == o.is_being_prepared && prepare_url == o.prepare_url && redirect_url == o.redirect_url && + redirect_url_declined == o.redirect_url_declined && required_attachments == o.required_attachments && disable_attachments == o.disable_attachments && disable_text_signatures == o.disable_text_signatures && @@ -425,6 +460,8 @@ def ==(o) disable_date == o.disable_date && disable_emails == o.disable_emails && disable_upload_signatures == o.disable_upload_signatures && + disable_blockchain_proof == o.disable_blockchain_proof && + text_message_verification_locked == o.text_message_verification_locked && subject == o.subject && message == o.message && who == o.who && @@ -446,7 +483,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [from_email, from_email_name, is_being_prepared, prepare_url, redirect_url, required_attachments, disable_attachments, disable_text_signatures, disable_text, disable_date, disable_emails, disable_upload_signatures, subject, message, who, send_reminders, signers, uuid, url, document, integration, integration_data].hash + [from_email, from_email_name, is_being_prepared, prepare_url, redirect_url, redirect_url_declined, required_attachments, disable_attachments, disable_text_signatures, disable_text, disable_date, disable_emails, disable_upload_signatures, disable_blockchain_proof, text_message_verification_locked, subject, message, who, send_reminders, signers, uuid, url, document, integration, integration_data].hash end # Builds the object from hash @@ -459,7 +496,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -541,7 +578,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -552,7 +589,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/sign_request_quick_create.rb b/lib/signrequest_client/models/sign_request_quick_create.rb index b9ac529..fb40259 100644 --- a/lib/signrequest_client/models/sign_request_quick_create.rb +++ b/lib/signrequest_client/models/sign_request_quick_create.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class SignRequestQuickCreate # Email of user sending the SignRequest (must be a validated email) attr_accessor :from_email @@ -29,6 +28,9 @@ class SignRequestQuickCreate # URL at which SignRequest will redirect to when a document is signed attr_accessor :redirect_url + # URL at which SignRequest will redirect to when a document is declined + attr_accessor :redirect_url_declined + # Attachments that signers are required to upload attr_accessor :required_attachments @@ -50,6 +52,12 @@ class SignRequestQuickCreate # Disable usage of uploaded signatures (images) attr_accessor :disable_upload_signatures + # Disables storing timestamp proof hashes in blockchain integrations. + attr_accessor :disable_blockchain_proof + + # When true a text message verification is needed before the signer can see the document + attr_accessor :text_message_verification_locked + # Subject of SignRequest email attr_accessor :subject @@ -110,6 +118,9 @@ class SignRequestQuickCreate # Number of days after which a finished document (signed/cancelled/declined) will be automatically deleted attr_accessor :auto_delete_days + # Number of days after which a non finished document will be automatically expired + attr_accessor :auto_expire_days + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -140,6 +151,7 @@ def self.attribute_map :'is_being_prepared' => :'is_being_prepared', :'prepare_url' => :'prepare_url', :'redirect_url' => :'redirect_url', + :'redirect_url_declined' => :'redirect_url_declined', :'required_attachments' => :'required_attachments', :'disable_attachments' => :'disable_attachments', :'disable_text_signatures' => :'disable_text_signatures', @@ -147,6 +159,8 @@ def self.attribute_map :'disable_date' => :'disable_date', :'disable_emails' => :'disable_emails', :'disable_upload_signatures' => :'disable_upload_signatures', + :'disable_blockchain_proof' => :'disable_blockchain_proof', + :'text_message_verification_locked' => :'text_message_verification_locked', :'subject' => :'subject', :'message' => :'message', :'who' => :'who', @@ -169,7 +183,8 @@ def self.attribute_map :'prefill_tags' => :'prefill_tags', :'integrations' => :'integrations', :'file_from_sf' => :'file_from_sf', - :'auto_delete_days' => :'auto_delete_days' + :'auto_delete_days' => :'auto_delete_days', + :'auto_expire_days' => :'auto_expire_days' } end @@ -181,6 +196,7 @@ def self.swagger_types :'is_being_prepared' => :'BOOLEAN', :'prepare_url' => :'String', :'redirect_url' => :'String', + :'redirect_url_declined' => :'String', :'required_attachments' => :'Array', :'disable_attachments' => :'BOOLEAN', :'disable_text_signatures' => :'BOOLEAN', @@ -188,6 +204,8 @@ def self.swagger_types :'disable_date' => :'BOOLEAN', :'disable_emails' => :'BOOLEAN', :'disable_upload_signatures' => :'BOOLEAN', + :'disable_blockchain_proof' => :'BOOLEAN', + :'text_message_verification_locked' => :'BOOLEAN', :'subject' => :'String', :'message' => :'String', :'who' => :'String', @@ -210,7 +228,8 @@ def self.swagger_types :'prefill_tags' => :'Array', :'integrations' => :'Array', :'file_from_sf' => :'FileFromSf', - :'auto_delete_days' => :'Integer' + :'auto_delete_days' => :'Integer', + :'auto_expire_days' => :'Integer' } end @@ -220,7 +239,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'from_email') self.from_email = attributes[:'from_email'] @@ -242,6 +261,10 @@ def initialize(attributes = {}) self.redirect_url = attributes[:'redirect_url'] end + if attributes.has_key?(:'redirect_url_declined') + self.redirect_url_declined = attributes[:'redirect_url_declined'] + end + if attributes.has_key?(:'required_attachments') if (value = attributes[:'required_attachments']).is_a?(Array) self.required_attachments = value @@ -272,6 +295,14 @@ def initialize(attributes = {}) self.disable_upload_signatures = attributes[:'disable_upload_signatures'] end + if attributes.has_key?(:'disable_blockchain_proof') + self.disable_blockchain_proof = attributes[:'disable_blockchain_proof'] + end + + if attributes.has_key?(:'text_message_verification_locked') + self.text_message_verification_locked = attributes[:'text_message_verification_locked'] + end + if attributes.has_key?(:'subject') self.subject = attributes[:'subject'] end @@ -283,7 +314,7 @@ def initialize(attributes = {}) if attributes.has_key?(:'who') self.who = attributes[:'who'] else - self.who = "o" + self.who = 'o' end if attributes.has_key?(:'send_reminders') @@ -372,6 +403,9 @@ def initialize(attributes = {}) self.auto_delete_days = attributes[:'auto_delete_days'] end + if attributes.has_key?(:'auto_expire_days') + self.auto_expire_days = attributes[:'auto_expire_days'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -379,66 +413,78 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if !@from_email.nil? && @from_email.to_s.length > 255 - invalid_properties.push("invalid value for 'from_email', the character length must be smaller than or equal to 255.") + invalid_properties.push('invalid value for "from_email", the character length must be smaller than or equal to 255.') end if !@from_email.nil? && @from_email.to_s.length < 1 - invalid_properties.push("invalid value for 'from_email', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "from_email", the character length must be great than or equal to 1.') end if !@from_email_name.nil? && @from_email_name.to_s.length > 255 - invalid_properties.push("invalid value for 'from_email_name', the character length must be smaller than or equal to 255.") + invalid_properties.push('invalid value for "from_email_name", the character length must be smaller than or equal to 255.') end if !@prepare_url.nil? && @prepare_url.to_s.length < 1 - invalid_properties.push("invalid value for 'prepare_url', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "prepare_url", the character length must be great than or equal to 1.') end if !@redirect_url.nil? && @redirect_url.to_s.length > 2100 - invalid_properties.push("invalid value for 'redirect_url', the character length must be smaller than or equal to 2100.") + invalid_properties.push('invalid value for "redirect_url", the character length must be smaller than or equal to 2100.') + end + + if !@redirect_url_declined.nil? && @redirect_url_declined.to_s.length > 2100 + invalid_properties.push('invalid value for "redirect_url_declined", the character length must be smaller than or equal to 2100.') end if !@subject.nil? && @subject.to_s.length > 512 - invalid_properties.push("invalid value for 'subject', the character length must be smaller than or equal to 512.") + invalid_properties.push('invalid value for "subject", the character length must be smaller than or equal to 512.') end if @signers.nil? - invalid_properties.push("invalid value for 'signers', signers cannot be nil.") + invalid_properties.push('invalid value for "signers", signers cannot be nil.') end if !@uuid.nil? && @uuid.to_s.length < 1 - invalid_properties.push("invalid value for 'uuid', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "uuid", the character length must be great than or equal to 1.') end if !@name.nil? && @name.to_s.length > 255 - invalid_properties.push("invalid value for 'name', the character length must be smaller than or equal to 255.") + invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.') end if !@external_id.nil? && @external_id.to_s.length > 255 - invalid_properties.push("invalid value for 'external_id', the character length must be smaller than or equal to 255.") + invalid_properties.push('invalid value for "external_id", the character length must be smaller than or equal to 255.') end if !@frontend_id.nil? && @frontend_id.to_s.length > 255 - invalid_properties.push("invalid value for 'frontend_id', the character length must be smaller than or equal to 255.") + invalid_properties.push('invalid value for "frontend_id", the character length must be smaller than or equal to 255.') end if !@file_from_url.nil? && @file_from_url.to_s.length > 2100 - invalid_properties.push("invalid value for 'file_from_url', the character length must be smaller than or equal to 2100.") + invalid_properties.push('invalid value for "file_from_url", the character length must be smaller than or equal to 2100.') end if !@events_callback_url.nil? && @events_callback_url.to_s.length > 2100 - invalid_properties.push("invalid value for 'events_callback_url', the character length must be smaller than or equal to 2100.") + invalid_properties.push('invalid value for "events_callback_url", the character length must be smaller than or equal to 2100.') end if !@auto_delete_days.nil? && @auto_delete_days > 730 - invalid_properties.push("invalid value for 'auto_delete_days', must be smaller than or equal to 730.") + invalid_properties.push('invalid value for "auto_delete_days", must be smaller than or equal to 730.') end if !@auto_delete_days.nil? && @auto_delete_days < 1 - invalid_properties.push("invalid value for 'auto_delete_days', must be greater than or equal to 1.") + invalid_properties.push('invalid value for "auto_delete_days", must be greater than or equal to 1.') end - return invalid_properties + if !@auto_expire_days.nil? && @auto_expire_days > 730 + invalid_properties.push('invalid value for "auto_expire_days", must be smaller than or equal to 730.') + end + + if !@auto_expire_days.nil? && @auto_expire_days < 1 + invalid_properties.push('invalid value for "auto_expire_days", must be greater than or equal to 1.') + end + + invalid_properties end # Check to see if the all the properties in the model are valid @@ -449,12 +495,13 @@ def valid? return false if !@from_email_name.nil? && @from_email_name.to_s.length > 255 return false if !@prepare_url.nil? && @prepare_url.to_s.length < 1 return false if !@redirect_url.nil? && @redirect_url.to_s.length > 2100 + return false if !@redirect_url_declined.nil? && @redirect_url_declined.to_s.length > 2100 return false if !@subject.nil? && @subject.to_s.length > 512 - who_validator = EnumAttributeValidator.new('String', ["m", "mo", "o"]) + who_validator = EnumAttributeValidator.new('String', ['m', 'mo', 'o']) return false unless who_validator.valid?(@who) return false if @signers.nil? return false if !@uuid.nil? && @uuid.to_s.length < 1 - integration_validator = EnumAttributeValidator.new('String', ["mfiles", "salesforce", "formdesk", "zapier", "txhash"]) + integration_validator = EnumAttributeValidator.new('String', ['mfiles', 'salesforce', 'formdesk', 'zapier', 'txhash']) return false unless integration_validator.valid?(@integration) return false if !@name.nil? && @name.to_s.length > 255 return false if !@external_id.nil? && @external_id.to_s.length > 255 @@ -463,19 +510,20 @@ def valid? return false if !@events_callback_url.nil? && @events_callback_url.to_s.length > 2100 return false if !@auto_delete_days.nil? && @auto_delete_days > 730 return false if !@auto_delete_days.nil? && @auto_delete_days < 1 - return true + return false if !@auto_expire_days.nil? && @auto_expire_days > 730 + return false if !@auto_expire_days.nil? && @auto_expire_days < 1 + true end # Custom attribute writer method with validation # @param [Object] from_email Value to be assigned def from_email=(from_email) - if !from_email.nil? && from_email.to_s.length > 255 - fail ArgumentError, "invalid value for 'from_email', the character length must be smaller than or equal to 255." + fail ArgumentError, 'invalid value for "from_email", the character length must be smaller than or equal to 255.' end if !from_email.nil? && from_email.to_s.length < 1 - fail ArgumentError, "invalid value for 'from_email', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "from_email", the character length must be great than or equal to 1.' end @from_email = from_email @@ -484,9 +532,8 @@ def from_email=(from_email) # Custom attribute writer method with validation # @param [Object] from_email_name Value to be assigned def from_email_name=(from_email_name) - if !from_email_name.nil? && from_email_name.to_s.length > 255 - fail ArgumentError, "invalid value for 'from_email_name', the character length must be smaller than or equal to 255." + fail ArgumentError, 'invalid value for "from_email_name", the character length must be smaller than or equal to 255.' end @from_email_name = from_email_name @@ -495,9 +542,8 @@ def from_email_name=(from_email_name) # Custom attribute writer method with validation # @param [Object] prepare_url Value to be assigned def prepare_url=(prepare_url) - if !prepare_url.nil? && prepare_url.to_s.length < 1 - fail ArgumentError, "invalid value for 'prepare_url', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "prepare_url", the character length must be great than or equal to 1.' end @prepare_url = prepare_url @@ -506,20 +552,28 @@ def prepare_url=(prepare_url) # Custom attribute writer method with validation # @param [Object] redirect_url Value to be assigned def redirect_url=(redirect_url) - if !redirect_url.nil? && redirect_url.to_s.length > 2100 - fail ArgumentError, "invalid value for 'redirect_url', the character length must be smaller than or equal to 2100." + fail ArgumentError, 'invalid value for "redirect_url", the character length must be smaller than or equal to 2100.' end @redirect_url = redirect_url end + # Custom attribute writer method with validation + # @param [Object] redirect_url_declined Value to be assigned + def redirect_url_declined=(redirect_url_declined) + if !redirect_url_declined.nil? && redirect_url_declined.to_s.length > 2100 + fail ArgumentError, 'invalid value for "redirect_url_declined", the character length must be smaller than or equal to 2100.' + end + + @redirect_url_declined = redirect_url_declined + end + # Custom attribute writer method with validation # @param [Object] subject Value to be assigned def subject=(subject) - if !subject.nil? && subject.to_s.length > 512 - fail ArgumentError, "invalid value for 'subject', the character length must be smaller than or equal to 512." + fail ArgumentError, 'invalid value for "subject", the character length must be smaller than or equal to 512.' end @subject = subject @@ -528,9 +582,9 @@ def subject=(subject) # Custom attribute writer method checking allowed values (enum). # @param [Object] who Object to be assigned def who=(who) - validator = EnumAttributeValidator.new('String', ["m", "mo", "o"]) + validator = EnumAttributeValidator.new('String', ['m', 'mo', 'o']) unless validator.valid?(who) - fail ArgumentError, "invalid value for 'who', must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "who", must be one of #{validator.allowable_values}.' end @who = who end @@ -538,9 +592,8 @@ def who=(who) # Custom attribute writer method with validation # @param [Object] uuid Value to be assigned def uuid=(uuid) - if !uuid.nil? && uuid.to_s.length < 1 - fail ArgumentError, "invalid value for 'uuid', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "uuid", the character length must be great than or equal to 1.' end @uuid = uuid @@ -549,9 +602,9 @@ def uuid=(uuid) # Custom attribute writer method checking allowed values (enum). # @param [Object] integration Object to be assigned def integration=(integration) - validator = EnumAttributeValidator.new('String', ["mfiles", "salesforce", "formdesk", "zapier", "txhash"]) + validator = EnumAttributeValidator.new('String', ['mfiles', 'salesforce', 'formdesk', 'zapier', 'txhash']) unless validator.valid?(integration) - fail ArgumentError, "invalid value for 'integration', must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "integration", must be one of #{validator.allowable_values}.' end @integration = integration end @@ -559,9 +612,8 @@ def integration=(integration) # Custom attribute writer method with validation # @param [Object] name Value to be assigned def name=(name) - if !name.nil? && name.to_s.length > 255 - fail ArgumentError, "invalid value for 'name', the character length must be smaller than or equal to 255." + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.' end @name = name @@ -570,9 +622,8 @@ def name=(name) # Custom attribute writer method with validation # @param [Object] external_id Value to be assigned def external_id=(external_id) - if !external_id.nil? && external_id.to_s.length > 255 - fail ArgumentError, "invalid value for 'external_id', the character length must be smaller than or equal to 255." + fail ArgumentError, 'invalid value for "external_id", the character length must be smaller than or equal to 255.' end @external_id = external_id @@ -581,9 +632,8 @@ def external_id=(external_id) # Custom attribute writer method with validation # @param [Object] frontend_id Value to be assigned def frontend_id=(frontend_id) - if !frontend_id.nil? && frontend_id.to_s.length > 255 - fail ArgumentError, "invalid value for 'frontend_id', the character length must be smaller than or equal to 255." + fail ArgumentError, 'invalid value for "frontend_id", the character length must be smaller than or equal to 255.' end @frontend_id = frontend_id @@ -592,9 +642,8 @@ def frontend_id=(frontend_id) # Custom attribute writer method with validation # @param [Object] file_from_url Value to be assigned def file_from_url=(file_from_url) - if !file_from_url.nil? && file_from_url.to_s.length > 2100 - fail ArgumentError, "invalid value for 'file_from_url', the character length must be smaller than or equal to 2100." + fail ArgumentError, 'invalid value for "file_from_url", the character length must be smaller than or equal to 2100.' end @file_from_url = file_from_url @@ -603,9 +652,8 @@ def file_from_url=(file_from_url) # Custom attribute writer method with validation # @param [Object] events_callback_url Value to be assigned def events_callback_url=(events_callback_url) - if !events_callback_url.nil? && events_callback_url.to_s.length > 2100 - fail ArgumentError, "invalid value for 'events_callback_url', the character length must be smaller than or equal to 2100." + fail ArgumentError, 'invalid value for "events_callback_url", the character length must be smaller than or equal to 2100.' end @events_callback_url = events_callback_url @@ -614,18 +662,31 @@ def events_callback_url=(events_callback_url) # Custom attribute writer method with validation # @param [Object] auto_delete_days Value to be assigned def auto_delete_days=(auto_delete_days) - if !auto_delete_days.nil? && auto_delete_days > 730 - fail ArgumentError, "invalid value for 'auto_delete_days', must be smaller than or equal to 730." + fail ArgumentError, 'invalid value for "auto_delete_days", must be smaller than or equal to 730.' end if !auto_delete_days.nil? && auto_delete_days < 1 - fail ArgumentError, "invalid value for 'auto_delete_days', must be greater than or equal to 1." + fail ArgumentError, 'invalid value for "auto_delete_days", must be greater than or equal to 1.' end @auto_delete_days = auto_delete_days end + # Custom attribute writer method with validation + # @param [Object] auto_expire_days Value to be assigned + def auto_expire_days=(auto_expire_days) + if !auto_expire_days.nil? && auto_expire_days > 730 + fail ArgumentError, 'invalid value for "auto_expire_days", must be smaller than or equal to 730.' + end + + if !auto_expire_days.nil? && auto_expire_days < 1 + fail ArgumentError, 'invalid value for "auto_expire_days", must be greater than or equal to 1.' + end + + @auto_expire_days = auto_expire_days + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -636,6 +697,7 @@ def ==(o) is_being_prepared == o.is_being_prepared && prepare_url == o.prepare_url && redirect_url == o.redirect_url && + redirect_url_declined == o.redirect_url_declined && required_attachments == o.required_attachments && disable_attachments == o.disable_attachments && disable_text_signatures == o.disable_text_signatures && @@ -643,6 +705,8 @@ def ==(o) disable_date == o.disable_date && disable_emails == o.disable_emails && disable_upload_signatures == o.disable_upload_signatures && + disable_blockchain_proof == o.disable_blockchain_proof && + text_message_verification_locked == o.text_message_verification_locked && subject == o.subject && message == o.message && who == o.who && @@ -665,7 +729,8 @@ def ==(o) prefill_tags == o.prefill_tags && integrations == o.integrations && file_from_sf == o.file_from_sf && - auto_delete_days == o.auto_delete_days + auto_delete_days == o.auto_delete_days && + auto_expire_days == o.auto_expire_days end # @see the `==` method @@ -677,7 +742,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [from_email, from_email_name, is_being_prepared, prepare_url, redirect_url, required_attachments, disable_attachments, disable_text_signatures, disable_text, disable_date, disable_emails, disable_upload_signatures, subject, message, who, send_reminders, signers, uuid, url, document, integration, integration_data, name, external_id, frontend_id, file, file_from_url, events_callback_url, file_from_content, file_from_content_name, template, prefill_tags, integrations, file_from_sf, auto_delete_days].hash + [from_email, from_email_name, is_being_prepared, prepare_url, redirect_url, redirect_url_declined, required_attachments, disable_attachments, disable_text_signatures, disable_text, disable_date, disable_emails, disable_upload_signatures, disable_blockchain_proof, text_message_verification_locked, subject, message, who, send_reminders, signers, uuid, url, document, integration, integration_data, name, external_id, frontend_id, file, file_from_url, events_callback_url, file_from_content, file_from_content_name, template, prefill_tags, integrations, file_from_sf, auto_delete_days, auto_expire_days].hash end # Builds the object from hash @@ -690,7 +755,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -772,7 +837,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -783,7 +848,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/signer.rb b/lib/signrequest_client/models/signer.rb index aedc9b8..77ec44c 100644 --- a/lib/signrequest_client/models/signer.rb +++ b/lib/signrequest_client/models/signer.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class Signer attr_accessor :email @@ -71,16 +70,24 @@ class Signer attr_accessor :inputs + # Place an approval stamp on a document when a signer approves a document + attr_accessor :use_stamp_for_approve_only + attr_accessor :embed_url attr_accessor :attachments attr_accessor :redirect_url + attr_accessor :redirect_url_declined + attr_accessor :after_document attr_accessor :integrations + # Require the signer to enter this password before signing a document. This field is write only. + attr_accessor :password + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -134,11 +141,14 @@ def self.attribute_map :'message' => :'message', :'embed_url_user_id' => :'embed_url_user_id', :'inputs' => :'inputs', + :'use_stamp_for_approve_only' => :'use_stamp_for_approve_only', :'embed_url' => :'embed_url', :'attachments' => :'attachments', :'redirect_url' => :'redirect_url', + :'redirect_url_declined' => :'redirect_url_declined', :'after_document' => :'after_document', - :'integrations' => :'integrations' + :'integrations' => :'integrations', + :'password' => :'password' } end @@ -173,11 +183,14 @@ def self.swagger_types :'message' => :'String', :'embed_url_user_id' => :'String', :'inputs' => :'Array', + :'use_stamp_for_approve_only' => :'BOOLEAN', :'embed_url' => :'String', :'attachments' => :'Array', :'redirect_url' => :'String', + :'redirect_url_declined' => :'String', :'after_document' => :'String', - :'integrations' => :'Array' + :'integrations' => :'Array', + :'password' => :'String' } end @@ -187,7 +200,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'email') self.email = attributes[:'email'] @@ -305,6 +318,10 @@ def initialize(attributes = {}) end end + if attributes.has_key?(:'use_stamp_for_approve_only') + self.use_stamp_for_approve_only = attributes[:'use_stamp_for_approve_only'] + end + if attributes.has_key?(:'embed_url') self.embed_url = attributes[:'embed_url'] end @@ -319,6 +336,10 @@ def initialize(attributes = {}) self.redirect_url = attributes[:'redirect_url'] end + if attributes.has_key?(:'redirect_url_declined') + self.redirect_url_declined = attributes[:'redirect_url_declined'] + end + if attributes.has_key?(:'after_document') self.after_document = attributes[:'after_document'] end @@ -329,6 +350,9 @@ def initialize(attributes = {}) end end + if attributes.has_key?(:'password') + self.password = attributes[:'password'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -336,70 +360,78 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if @email.nil? - invalid_properties.push("invalid value for 'email', email cannot be nil.") + invalid_properties.push('invalid value for "email", email cannot be nil.') end if @email.to_s.length > 255 - invalid_properties.push("invalid value for 'email', the character length must be smaller than or equal to 255.") + invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 255.') end if @email.to_s.length < 1 - invalid_properties.push("invalid value for 'email', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "email", the character length must be great than or equal to 1.') end if !@display_name.nil? && @display_name.to_s.length < 1 - invalid_properties.push("invalid value for 'display_name', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "display_name", the character length must be great than or equal to 1.') end if !@first_name.nil? && @first_name.to_s.length > 255 - invalid_properties.push("invalid value for 'first_name', the character length must be smaller than or equal to 255.") + invalid_properties.push('invalid value for "first_name", the character length must be smaller than or equal to 255.') end if !@last_name.nil? && @last_name.to_s.length > 255 - invalid_properties.push("invalid value for 'last_name', the character length must be smaller than or equal to 255.") + invalid_properties.push('invalid value for "last_name", the character length must be smaller than or equal to 255.') end if !@order.nil? && @order > 2147483647 - invalid_properties.push("invalid value for 'order', must be smaller than or equal to 2147483647.") + invalid_properties.push('invalid value for "order", must be smaller than or equal to 2147483647.') end if !@order.nil? && @order < 0 - invalid_properties.push("invalid value for 'order', must be greater than or equal to 0.") + invalid_properties.push('invalid value for "order", must be greater than or equal to 0.') end if !@verify_phone_number.nil? && @verify_phone_number.to_s.length > 255 - invalid_properties.push("invalid value for 'verify_phone_number', the character length must be smaller than or equal to 255.") + invalid_properties.push('invalid value for "verify_phone_number", the character length must be smaller than or equal to 255.') end if !@verify_bank_account.nil? && @verify_bank_account.to_s.length > 255 - invalid_properties.push("invalid value for 'verify_bank_account', the character length must be smaller than or equal to 255.") + invalid_properties.push('invalid value for "verify_bank_account", the character length must be smaller than or equal to 255.') end if !@forwarded_to_email.nil? && @forwarded_to_email.to_s.length < 1 - invalid_properties.push("invalid value for 'forwarded_to_email', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "forwarded_to_email", the character length must be great than or equal to 1.') end if !@forwarded_reason.nil? && @forwarded_reason.to_s.length < 1 - invalid_properties.push("invalid value for 'forwarded_reason', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "forwarded_reason", the character length must be great than or equal to 1.') end if !@message.nil? && @message.to_s.length < 1 - invalid_properties.push("invalid value for 'message', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "message", the character length must be great than or equal to 1.') end if !@embed_url_user_id.nil? && @embed_url_user_id.to_s.length > 255 - invalid_properties.push("invalid value for 'embed_url_user_id', the character length must be smaller than or equal to 255.") + invalid_properties.push('invalid value for "embed_url_user_id", the character length must be smaller than or equal to 255.') end if !@embed_url.nil? && @embed_url.to_s.length < 1 - invalid_properties.push("invalid value for 'embed_url', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "embed_url", the character length must be great than or equal to 1.') end if !@redirect_url.nil? && @redirect_url.to_s.length > 2100 - invalid_properties.push("invalid value for 'redirect_url', the character length must be smaller than or equal to 2100.") + invalid_properties.push('invalid value for "redirect_url", the character length must be smaller than or equal to 2100.') end - return invalid_properties + if !@redirect_url_declined.nil? && @redirect_url_declined.to_s.length > 2100 + invalid_properties.push('invalid value for "redirect_url_declined", the character length must be smaller than or equal to 2100.') + end + + if !@password.nil? && @password.to_s.length < 1 + invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.') + end + + invalid_properties end # Check to see if the all the properties in the model are valid @@ -413,7 +445,7 @@ def valid? return false if !@last_name.nil? && @last_name.to_s.length > 255 return false if !@order.nil? && @order > 2147483647 return false if !@order.nil? && @order < 0 - language_validator = EnumAttributeValidator.new('String', ["en", "en-gb", "nl", "fr", "de", "he", "da", "fi", "hu", "it", "no", "pl", "pt", "es", "sv", "ru"]) + language_validator = EnumAttributeValidator.new('String', ['en', 'en-gb', 'nl', 'fr', 'de', 'he', 'da', 'fi', 'hu', 'it', 'no', 'pl', 'pt', 'es', 'sv', 'ru']) return false unless language_validator.valid?(@language) return false if !@verify_phone_number.nil? && @verify_phone_number.to_s.length > 255 return false if !@verify_bank_account.nil? && @verify_bank_account.to_s.length > 255 @@ -423,22 +455,24 @@ def valid? return false if !@embed_url_user_id.nil? && @embed_url_user_id.to_s.length > 255 return false if !@embed_url.nil? && @embed_url.to_s.length < 1 return false if !@redirect_url.nil? && @redirect_url.to_s.length > 2100 - return true + return false if !@redirect_url_declined.nil? && @redirect_url_declined.to_s.length > 2100 + return false if !@password.nil? && @password.to_s.length < 1 + true end # Custom attribute writer method with validation # @param [Object] email Value to be assigned def email=(email) if email.nil? - fail ArgumentError, "email cannot be nil" + fail ArgumentError, 'email cannot be nil' end if email.to_s.length > 255 - fail ArgumentError, "invalid value for 'email', the character length must be smaller than or equal to 255." + fail ArgumentError, 'invalid value for "email", the character length must be smaller than or equal to 255.' end if email.to_s.length < 1 - fail ArgumentError, "invalid value for 'email', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "email", the character length must be great than or equal to 1.' end @email = email @@ -447,9 +481,8 @@ def email=(email) # Custom attribute writer method with validation # @param [Object] display_name Value to be assigned def display_name=(display_name) - if !display_name.nil? && display_name.to_s.length < 1 - fail ArgumentError, "invalid value for 'display_name', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "display_name", the character length must be great than or equal to 1.' end @display_name = display_name @@ -458,9 +491,8 @@ def display_name=(display_name) # Custom attribute writer method with validation # @param [Object] first_name Value to be assigned def first_name=(first_name) - if !first_name.nil? && first_name.to_s.length > 255 - fail ArgumentError, "invalid value for 'first_name', the character length must be smaller than or equal to 255." + fail ArgumentError, 'invalid value for "first_name", the character length must be smaller than or equal to 255.' end @first_name = first_name @@ -469,9 +501,8 @@ def first_name=(first_name) # Custom attribute writer method with validation # @param [Object] last_name Value to be assigned def last_name=(last_name) - if !last_name.nil? && last_name.to_s.length > 255 - fail ArgumentError, "invalid value for 'last_name', the character length must be smaller than or equal to 255." + fail ArgumentError, 'invalid value for "last_name", the character length must be smaller than or equal to 255.' end @last_name = last_name @@ -480,13 +511,12 @@ def last_name=(last_name) # Custom attribute writer method with validation # @param [Object] order Value to be assigned def order=(order) - if !order.nil? && order > 2147483647 - fail ArgumentError, "invalid value for 'order', must be smaller than or equal to 2147483647." + fail ArgumentError, 'invalid value for "order", must be smaller than or equal to 2147483647.' end if !order.nil? && order < 0 - fail ArgumentError, "invalid value for 'order', must be greater than or equal to 0." + fail ArgumentError, 'invalid value for "order", must be greater than or equal to 0.' end @order = order @@ -495,9 +525,9 @@ def order=(order) # Custom attribute writer method checking allowed values (enum). # @param [Object] language Object to be assigned def language=(language) - validator = EnumAttributeValidator.new('String', ["en", "en-gb", "nl", "fr", "de", "he", "da", "fi", "hu", "it", "no", "pl", "pt", "es", "sv", "ru"]) + validator = EnumAttributeValidator.new('String', ['en', 'en-gb', 'nl', 'fr', 'de', 'he', 'da', 'fi', 'hu', 'it', 'no', 'pl', 'pt', 'es', 'sv', 'ru']) unless validator.valid?(language) - fail ArgumentError, "invalid value for 'language', must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "language", must be one of #{validator.allowable_values}.' end @language = language end @@ -505,9 +535,8 @@ def language=(language) # Custom attribute writer method with validation # @param [Object] verify_phone_number Value to be assigned def verify_phone_number=(verify_phone_number) - if !verify_phone_number.nil? && verify_phone_number.to_s.length > 255 - fail ArgumentError, "invalid value for 'verify_phone_number', the character length must be smaller than or equal to 255." + fail ArgumentError, 'invalid value for "verify_phone_number", the character length must be smaller than or equal to 255.' end @verify_phone_number = verify_phone_number @@ -516,9 +545,8 @@ def verify_phone_number=(verify_phone_number) # Custom attribute writer method with validation # @param [Object] verify_bank_account Value to be assigned def verify_bank_account=(verify_bank_account) - if !verify_bank_account.nil? && verify_bank_account.to_s.length > 255 - fail ArgumentError, "invalid value for 'verify_bank_account', the character length must be smaller than or equal to 255." + fail ArgumentError, 'invalid value for "verify_bank_account", the character length must be smaller than or equal to 255.' end @verify_bank_account = verify_bank_account @@ -527,9 +555,8 @@ def verify_bank_account=(verify_bank_account) # Custom attribute writer method with validation # @param [Object] forwarded_to_email Value to be assigned def forwarded_to_email=(forwarded_to_email) - if !forwarded_to_email.nil? && forwarded_to_email.to_s.length < 1 - fail ArgumentError, "invalid value for 'forwarded_to_email', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "forwarded_to_email", the character length must be great than or equal to 1.' end @forwarded_to_email = forwarded_to_email @@ -538,9 +565,8 @@ def forwarded_to_email=(forwarded_to_email) # Custom attribute writer method with validation # @param [Object] forwarded_reason Value to be assigned def forwarded_reason=(forwarded_reason) - if !forwarded_reason.nil? && forwarded_reason.to_s.length < 1 - fail ArgumentError, "invalid value for 'forwarded_reason', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "forwarded_reason", the character length must be great than or equal to 1.' end @forwarded_reason = forwarded_reason @@ -549,9 +575,8 @@ def forwarded_reason=(forwarded_reason) # Custom attribute writer method with validation # @param [Object] message Value to be assigned def message=(message) - if !message.nil? && message.to_s.length < 1 - fail ArgumentError, "invalid value for 'message', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "message", the character length must be great than or equal to 1.' end @message = message @@ -560,9 +585,8 @@ def message=(message) # Custom attribute writer method with validation # @param [Object] embed_url_user_id Value to be assigned def embed_url_user_id=(embed_url_user_id) - if !embed_url_user_id.nil? && embed_url_user_id.to_s.length > 255 - fail ArgumentError, "invalid value for 'embed_url_user_id', the character length must be smaller than or equal to 255." + fail ArgumentError, 'invalid value for "embed_url_user_id", the character length must be smaller than or equal to 255.' end @embed_url_user_id = embed_url_user_id @@ -571,9 +595,8 @@ def embed_url_user_id=(embed_url_user_id) # Custom attribute writer method with validation # @param [Object] embed_url Value to be assigned def embed_url=(embed_url) - if !embed_url.nil? && embed_url.to_s.length < 1 - fail ArgumentError, "invalid value for 'embed_url', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "embed_url", the character length must be great than or equal to 1.' end @embed_url = embed_url @@ -582,14 +605,33 @@ def embed_url=(embed_url) # Custom attribute writer method with validation # @param [Object] redirect_url Value to be assigned def redirect_url=(redirect_url) - if !redirect_url.nil? && redirect_url.to_s.length > 2100 - fail ArgumentError, "invalid value for 'redirect_url', the character length must be smaller than or equal to 2100." + fail ArgumentError, 'invalid value for "redirect_url", the character length must be smaller than or equal to 2100.' end @redirect_url = redirect_url end + # Custom attribute writer method with validation + # @param [Object] redirect_url_declined Value to be assigned + def redirect_url_declined=(redirect_url_declined) + if !redirect_url_declined.nil? && redirect_url_declined.to_s.length > 2100 + fail ArgumentError, 'invalid value for "redirect_url_declined", the character length must be smaller than or equal to 2100.' + end + + @redirect_url_declined = redirect_url_declined + end + + # Custom attribute writer method with validation + # @param [Object] password Value to be assigned + def password=(password) + if !password.nil? && password.to_s.length < 1 + fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.' + end + + @password = password + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -623,11 +665,14 @@ def ==(o) message == o.message && embed_url_user_id == o.embed_url_user_id && inputs == o.inputs && + use_stamp_for_approve_only == o.use_stamp_for_approve_only && embed_url == o.embed_url && attachments == o.attachments && redirect_url == o.redirect_url && + redirect_url_declined == o.redirect_url_declined && after_document == o.after_document && - integrations == o.integrations + integrations == o.integrations && + password == o.password end # @see the `==` method @@ -639,7 +684,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [email, display_name, first_name, last_name, email_viewed, viewed, signed, downloaded, signed_on, needs_to_sign, approve_only, notify_only, in_person, order, language, force_language, emailed, verify_phone_number, verify_bank_account, declined, declined_on, forwarded, forwarded_on, forwarded_to_email, forwarded_reason, message, embed_url_user_id, inputs, embed_url, attachments, redirect_url, after_document, integrations].hash + [email, display_name, first_name, last_name, email_viewed, viewed, signed, downloaded, signed_on, needs_to_sign, approve_only, notify_only, in_person, order, language, force_language, emailed, verify_phone_number, verify_bank_account, declined, declined_on, forwarded, forwarded_on, forwarded_to_email, forwarded_reason, message, embed_url_user_id, inputs, use_stamp_for_approve_only, embed_url, attachments, redirect_url, redirect_url_declined, after_document, integrations, password].hash end # Builds the object from hash @@ -652,7 +697,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -734,7 +779,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -745,7 +790,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/signer_attachment.rb b/lib/signrequest_client/models/signer_attachment.rb index 62fd059..382a286 100644 --- a/lib/signrequest_client/models/signer_attachment.rb +++ b/lib/signrequest_client/models/signer_attachment.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class SignerAttachment attr_accessor :uuid @@ -24,7 +23,6 @@ class SignerAttachment attr_accessor :for_attachment - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -51,7 +49,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'uuid') self.uuid = attributes[:'uuid'] @@ -68,7 +66,6 @@ def initialize(attributes = {}) if attributes.has_key?(:'for_attachment') self.for_attachment = attributes[:'for_attachment'] end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -76,14 +73,14 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if !@uuid.nil? && @uuid.to_s.length < 1 - invalid_properties.push("invalid value for 'uuid', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "uuid", the character length must be great than or equal to 1.') end if !@name.nil? && @name.to_s.length < 1 - invalid_properties.push("invalid value for 'name', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid @@ -91,15 +88,14 @@ def list_invalid_properties def valid? return false if !@uuid.nil? && @uuid.to_s.length < 1 return false if !@name.nil? && @name.to_s.length < 1 - return true + true end # Custom attribute writer method with validation # @param [Object] uuid Value to be assigned def uuid=(uuid) - if !uuid.nil? && uuid.to_s.length < 1 - fail ArgumentError, "invalid value for 'uuid', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "uuid", the character length must be great than or equal to 1.' end @uuid = uuid @@ -108,9 +104,8 @@ def uuid=(uuid) # Custom attribute writer method with validation # @param [Object] name Value to be assigned def name=(name) - if !name.nil? && name.to_s.length < 1 - fail ArgumentError, "invalid value for 'name', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' end @name = name @@ -149,7 +144,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -231,7 +226,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -242,7 +237,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/signer_inputs.rb b/lib/signrequest_client/models/signer_inputs.rb index d1ac4d4..8f4fca2 100644 --- a/lib/signrequest_client/models/signer_inputs.rb +++ b/lib/signrequest_client/models/signer_inputs.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class SignerInputs attr_accessor :type @@ -83,7 +82,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'type') self.type = attributes[:'type'] @@ -112,7 +111,6 @@ def initialize(attributes = {}) if attributes.has_key?(:'placeholder_uuid') self.placeholder_uuid = attributes[:'placeholder_uuid'] end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -120,37 +118,37 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if @page_index.nil? - invalid_properties.push("invalid value for 'page_index', page_index cannot be nil.") + invalid_properties.push('invalid value for "page_index", page_index cannot be nil.') end if !@external_id.nil? && @external_id.to_s.length > 255 - invalid_properties.push("invalid value for 'external_id', the character length must be smaller than or equal to 255.") + invalid_properties.push('invalid value for "external_id", the character length must be smaller than or equal to 255.') end if !@placeholder_uuid.nil? && @placeholder_uuid.to_s.length > 36 - invalid_properties.push("invalid value for 'placeholder_uuid', the character length must be smaller than or equal to 36.") + invalid_properties.push('invalid value for "placeholder_uuid", the character length must be smaller than or equal to 36.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - type_validator = EnumAttributeValidator.new('String', ["s", "i", "n", "d", "t", "c"]) + type_validator = EnumAttributeValidator.new('String', ['s', 'i', 'n', 'd', 't', 'c']) return false unless type_validator.valid?(@type) return false if @page_index.nil? return false if !@external_id.nil? && @external_id.to_s.length > 255 return false if !@placeholder_uuid.nil? && @placeholder_uuid.to_s.length > 36 - return true + true end # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ["s", "i", "n", "d", "t", "c"]) + validator = EnumAttributeValidator.new('String', ['s', 'i', 'n', 'd', 't', 'c']) unless validator.valid?(type) - fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.' end @type = type end @@ -158,9 +156,8 @@ def type=(type) # Custom attribute writer method with validation # @param [Object] external_id Value to be assigned def external_id=(external_id) - if !external_id.nil? && external_id.to_s.length > 255 - fail ArgumentError, "invalid value for 'external_id', the character length must be smaller than or equal to 255." + fail ArgumentError, 'invalid value for "external_id", the character length must be smaller than or equal to 255.' end @external_id = external_id @@ -169,9 +166,8 @@ def external_id=(external_id) # Custom attribute writer method with validation # @param [Object] placeholder_uuid Value to be assigned def placeholder_uuid=(placeholder_uuid) - if !placeholder_uuid.nil? && placeholder_uuid.to_s.length > 36 - fail ArgumentError, "invalid value for 'placeholder_uuid', the character length must be smaller than or equal to 36." + fail ArgumentError, 'invalid value for "placeholder_uuid", the character length must be smaller than or equal to 36.' end @placeholder_uuid = placeholder_uuid @@ -213,7 +209,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -295,7 +291,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -306,7 +302,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/signing_log.rb b/lib/signrequest_client/models/signing_log.rb index a59444b..ed0fcb0 100644 --- a/lib/signrequest_client/models/signing_log.rb +++ b/lib/signrequest_client/models/signing_log.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class SigningLog # Temporary URL to signing log, expires in five minutes attr_accessor :pdf @@ -21,7 +20,6 @@ class SigningLog # SHA256 hash of PDF contents attr_accessor :security_hash - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -44,7 +42,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'pdf') self.pdf = attributes[:'pdf'] @@ -53,7 +51,6 @@ def initialize(attributes = {}) if attributes.has_key?(:'security_hash') self.security_hash = attributes[:'security_hash'] end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -61,25 +58,24 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if !@security_hash.nil? && @security_hash.to_s.length < 1 - invalid_properties.push("invalid value for 'security_hash', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "security_hash", the character length must be great than or equal to 1.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? return false if !@security_hash.nil? && @security_hash.to_s.length < 1 - return true + true end # Custom attribute writer method with validation # @param [Object] security_hash Value to be assigned def security_hash=(security_hash) - if !security_hash.nil? && security_hash.to_s.length < 1 - fail ArgumentError, "invalid value for 'security_hash', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "security_hash", the character length must be great than or equal to 1.' end @security_hash = security_hash @@ -116,7 +112,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -198,7 +194,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -209,7 +205,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/team.rb b/lib/signrequest_client/models/team.rb index 027131c..57740e2 100644 --- a/lib/signrequest_client/models/team.rb +++ b/lib/signrequest_client/models/team.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class Team attr_accessor :name @@ -31,6 +30,11 @@ class Team attr_accessor :members + # When filled this team will be deleted after this date + attr_accessor :delete_after + + # Indicates whether team is in Sandbox mode + attr_accessor :sandbox # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map @@ -42,7 +46,9 @@ def self.attribute_map :'phone' => :'phone', :'primary_color' => :'primary_color', :'events_callback_url' => :'events_callback_url', - :'members' => :'members' + :'members' => :'members', + :'delete_after' => :'delete_after', + :'sandbox' => :'sandbox' } end @@ -56,7 +62,9 @@ def self.swagger_types :'phone' => :'String', :'primary_color' => :'String', :'events_callback_url' => :'String', - :'members' => :'Array' + :'members' => :'Array', + :'delete_after' => :'DateTime', + :'sandbox' => :'BOOLEAN' } end @@ -66,7 +74,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'name') self.name = attributes[:'name'] @@ -102,6 +110,13 @@ def initialize(attributes = {}) end end + if attributes.has_key?(:'delete_after') + self.delete_after = attributes[:'delete_after'] + end + + if attributes.has_key?(:'sandbox') + self.sandbox = attributes[:'sandbox'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -109,42 +124,46 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if @name.nil? - invalid_properties.push("invalid value for 'name', name cannot be nil.") + invalid_properties.push('invalid value for "name", name cannot be nil.') end if @name.to_s.length > 100 - invalid_properties.push("invalid value for 'name', the character length must be smaller than or equal to 100.") + invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.') end if @name.to_s.length < 1 - invalid_properties.push("invalid value for 'name', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.') end if @subdomain.nil? - invalid_properties.push("invalid value for 'subdomain', subdomain cannot be nil.") + invalid_properties.push('invalid value for "subdomain", subdomain cannot be nil.') end if @subdomain.to_s.length > 100 - invalid_properties.push("invalid value for 'subdomain', the character length must be smaller than or equal to 100.") + invalid_properties.push('invalid value for "subdomain", the character length must be smaller than or equal to 100.') end if @subdomain.to_s.length < 1 - invalid_properties.push("invalid value for 'subdomain', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "subdomain", the character length must be great than or equal to 1.') end if !@phone.nil? && @phone.to_s.length > 100 - invalid_properties.push("invalid value for 'phone', the character length must be smaller than or equal to 100.") + invalid_properties.push('invalid value for "phone", the character length must be smaller than or equal to 100.') end if !@primary_color.nil? && @primary_color.to_s.length > 100 - invalid_properties.push("invalid value for 'primary_color', the character length must be smaller than or equal to 100.") + invalid_properties.push('invalid value for "primary_color", the character length must be smaller than or equal to 100.') + end + + if !@primary_color.nil? && @primary_color !~ Regexp.new(/^[#a-zA-Z0-9]+$/) + invalid_properties.push('invalid value for "primary_color", must conform to the pattern /^[#a-zA-Z0-9]+$/.') end if !@events_callback_url.nil? && @events_callback_url.to_s.length > 2100 - invalid_properties.push("invalid value for 'events_callback_url', the character length must be smaller than or equal to 2100.") + invalid_properties.push('invalid value for "events_callback_url", the character length must be smaller than or equal to 2100.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid @@ -158,23 +177,24 @@ def valid? return false if @subdomain.to_s.length < 1 return false if !@phone.nil? && @phone.to_s.length > 100 return false if !@primary_color.nil? && @primary_color.to_s.length > 100 + return false if !@primary_color.nil? && @primary_color !~ Regexp.new(/^[#a-zA-Z0-9]+$/) return false if !@events_callback_url.nil? && @events_callback_url.to_s.length > 2100 - return true + true end # Custom attribute writer method with validation # @param [Object] name Value to be assigned def name=(name) if name.nil? - fail ArgumentError, "name cannot be nil" + fail ArgumentError, 'name cannot be nil' end if name.to_s.length > 100 - fail ArgumentError, "invalid value for 'name', the character length must be smaller than or equal to 100." + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.' end if name.to_s.length < 1 - fail ArgumentError, "invalid value for 'name', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' end @name = name @@ -184,15 +204,15 @@ def name=(name) # @param [Object] subdomain Value to be assigned def subdomain=(subdomain) if subdomain.nil? - fail ArgumentError, "subdomain cannot be nil" + fail ArgumentError, 'subdomain cannot be nil' end if subdomain.to_s.length > 100 - fail ArgumentError, "invalid value for 'subdomain', the character length must be smaller than or equal to 100." + fail ArgumentError, 'invalid value for "subdomain", the character length must be smaller than or equal to 100.' end if subdomain.to_s.length < 1 - fail ArgumentError, "invalid value for 'subdomain', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "subdomain", the character length must be great than or equal to 1.' end @subdomain = subdomain @@ -201,9 +221,8 @@ def subdomain=(subdomain) # Custom attribute writer method with validation # @param [Object] phone Value to be assigned def phone=(phone) - if !phone.nil? && phone.to_s.length > 100 - fail ArgumentError, "invalid value for 'phone', the character length must be smaller than or equal to 100." + fail ArgumentError, 'invalid value for "phone", the character length must be smaller than or equal to 100.' end @phone = phone @@ -212,9 +231,12 @@ def phone=(phone) # Custom attribute writer method with validation # @param [Object] primary_color Value to be assigned def primary_color=(primary_color) - if !primary_color.nil? && primary_color.to_s.length > 100 - fail ArgumentError, "invalid value for 'primary_color', the character length must be smaller than or equal to 100." + fail ArgumentError, 'invalid value for "primary_color", the character length must be smaller than or equal to 100.' + end + + if !primary_color.nil? && primary_color !~ Regexp.new(/^[#a-zA-Z0-9]+$/) + fail ArgumentError, 'invalid value for "primary_color", must conform to the pattern /^[#a-zA-Z0-9]+$/.' end @primary_color = primary_color @@ -223,9 +245,8 @@ def primary_color=(primary_color) # Custom attribute writer method with validation # @param [Object] events_callback_url Value to be assigned def events_callback_url=(events_callback_url) - if !events_callback_url.nil? && events_callback_url.to_s.length > 2100 - fail ArgumentError, "invalid value for 'events_callback_url', the character length must be smaller than or equal to 2100." + fail ArgumentError, 'invalid value for "events_callback_url", the character length must be smaller than or equal to 2100.' end @events_callback_url = events_callback_url @@ -243,7 +264,9 @@ def ==(o) phone == o.phone && primary_color == o.primary_color && events_callback_url == o.events_callback_url && - members == o.members + members == o.members && + delete_after == o.delete_after && + sandbox == o.sandbox end # @see the `==` method @@ -255,7 +278,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [name, subdomain, url, logo, phone, primary_color, events_callback_url, members].hash + [name, subdomain, url, logo, phone, primary_color, events_callback_url, members, delete_after, sandbox].hash end # Builds the object from hash @@ -268,7 +291,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -350,7 +373,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -361,7 +384,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/team_member.rb b/lib/signrequest_client/models/team_member.rb index c07151e..9a389ba 100644 --- a/lib/signrequest_client/models/team_member.rb +++ b/lib/signrequest_client/models/team_member.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class TeamMember attr_accessor :uuid @@ -21,19 +20,21 @@ class TeamMember attr_accessor :user + attr_accessor :team + attr_accessor :is_admin attr_accessor :is_active attr_accessor :is_owner - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'uuid' => :'uuid', :'url' => :'url', :'user' => :'user', + :'team' => :'team', :'is_admin' => :'is_admin', :'is_active' => :'is_active', :'is_owner' => :'is_owner' @@ -46,6 +47,7 @@ def self.swagger_types :'uuid' => :'String', :'url' => :'String', :'user' => :'User', + :'team' => :'DocumentTeam', :'is_admin' => :'BOOLEAN', :'is_active' => :'BOOLEAN', :'is_owner' => :'BOOLEAN' @@ -58,7 +60,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'uuid') self.uuid = attributes[:'uuid'] @@ -72,6 +74,10 @@ def initialize(attributes = {}) self.user = attributes[:'user'] end + if attributes.has_key?(:'team') + self.team = attributes[:'team'] + end + if attributes.has_key?(:'is_admin') self.is_admin = attributes[:'is_admin'] end @@ -83,7 +89,6 @@ def initialize(attributes = {}) if attributes.has_key?(:'is_owner') self.is_owner = attributes[:'is_owner'] end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -91,25 +96,24 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if !@uuid.nil? && @uuid.to_s.length < 1 - invalid_properties.push("invalid value for 'uuid', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "uuid", the character length must be great than or equal to 1.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? return false if !@uuid.nil? && @uuid.to_s.length < 1 - return true + true end # Custom attribute writer method with validation # @param [Object] uuid Value to be assigned def uuid=(uuid) - if !uuid.nil? && uuid.to_s.length < 1 - fail ArgumentError, "invalid value for 'uuid', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "uuid", the character length must be great than or equal to 1.' end @uuid = uuid @@ -123,6 +127,7 @@ def ==(o) uuid == o.uuid && url == o.url && user == o.user && + team == o.team && is_admin == o.is_admin && is_active == o.is_active && is_owner == o.is_owner @@ -137,7 +142,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [uuid, url, user, is_admin, is_active, is_owner].hash + [uuid, url, user, team, is_admin, is_active, is_owner].hash end # Builds the object from hash @@ -150,7 +155,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -232,7 +237,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -243,7 +248,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/template.rb b/lib/signrequest_client/models/template.rb index 61f59be..ed2c6d2 100644 --- a/lib/signrequest_client/models/template.rb +++ b/lib/signrequest_client/models/template.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class Template attr_accessor :url @@ -24,6 +23,8 @@ class Template attr_accessor :user + attr_accessor :team + # `m`: only me, `mo`: me and others, `o`: only others attr_accessor :who @@ -58,6 +59,7 @@ def self.attribute_map :'name' => :'name', :'uuid' => :'uuid', :'user' => :'user', + :'team' => :'team', :'who' => :'who', :'signers' => :'signers' } @@ -70,6 +72,7 @@ def self.swagger_types :'name' => :'String', :'uuid' => :'String', :'user' => :'User', + :'team' => :'DocumentTeam', :'who' => :'String', :'signers' => :'Array' } @@ -81,7 +84,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'url') self.url = attributes[:'url'] @@ -99,6 +102,10 @@ def initialize(attributes = {}) self.user = attributes[:'user'] end + if attributes.has_key?(:'team') + self.team = attributes[:'team'] + end + if attributes.has_key?(:'who') self.who = attributes[:'who'] end @@ -108,7 +115,6 @@ def initialize(attributes = {}) self.signers = value end end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -116,14 +122,14 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if !@name.nil? && @name.to_s.length < 1 - invalid_properties.push("invalid value for 'name', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.') end if !@uuid.nil? && @uuid.to_s.length < 1 - invalid_properties.push("invalid value for 'uuid', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "uuid", the character length must be great than or equal to 1.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid @@ -131,17 +137,16 @@ def list_invalid_properties def valid? return false if !@name.nil? && @name.to_s.length < 1 return false if !@uuid.nil? && @uuid.to_s.length < 1 - who_validator = EnumAttributeValidator.new('String', ["m", "mo", "o"]) + who_validator = EnumAttributeValidator.new('String', ['m', 'mo', 'o']) return false unless who_validator.valid?(@who) - return true + true end # Custom attribute writer method with validation # @param [Object] name Value to be assigned def name=(name) - if !name.nil? && name.to_s.length < 1 - fail ArgumentError, "invalid value for 'name', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' end @name = name @@ -150,9 +155,8 @@ def name=(name) # Custom attribute writer method with validation # @param [Object] uuid Value to be assigned def uuid=(uuid) - if !uuid.nil? && uuid.to_s.length < 1 - fail ArgumentError, "invalid value for 'uuid', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "uuid", the character length must be great than or equal to 1.' end @uuid = uuid @@ -161,9 +165,9 @@ def uuid=(uuid) # Custom attribute writer method checking allowed values (enum). # @param [Object] who Object to be assigned def who=(who) - validator = EnumAttributeValidator.new('String', ["m", "mo", "o"]) + validator = EnumAttributeValidator.new('String', ['m', 'mo', 'o']) unless validator.valid?(who) - fail ArgumentError, "invalid value for 'who', must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "who", must be one of #{validator.allowable_values}.' end @who = who end @@ -177,6 +181,7 @@ def ==(o) name == o.name && uuid == o.uuid && user == o.user && + team == o.team && who == o.who && signers == o.signers end @@ -190,7 +195,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [url, name, uuid, user, who, signers].hash + [url, name, uuid, user, team, who, signers].hash end # Builds the object from hash @@ -203,7 +208,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -285,7 +290,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -296,7 +301,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/user.rb b/lib/signrequest_client/models/user.rb index 00fe1ff..a14200c 100644 --- a/lib/signrequest_client/models/user.rb +++ b/lib/signrequest_client/models/user.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class User attr_accessor :email @@ -23,7 +22,6 @@ class User attr_accessor :display_name - # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -50,7 +48,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'email') self.email = attributes[:'email'] @@ -67,7 +65,6 @@ def initialize(attributes = {}) if attributes.has_key?(:'display_name') self.display_name = attributes[:'display_name'] end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -75,30 +72,30 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if @email.nil? - invalid_properties.push("invalid value for 'email', email cannot be nil.") + invalid_properties.push('invalid value for "email", email cannot be nil.') end if @email.to_s.length > 254 - invalid_properties.push("invalid value for 'email', the character length must be smaller than or equal to 254.") + invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 254.') end if @email.to_s.length < 1 - invalid_properties.push("invalid value for 'email', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "email", the character length must be great than or equal to 1.') end if !@first_name.nil? && @first_name.to_s.length > 255 - invalid_properties.push("invalid value for 'first_name', the character length must be smaller than or equal to 255.") + invalid_properties.push('invalid value for "first_name", the character length must be smaller than or equal to 255.') end if !@last_name.nil? && @last_name.to_s.length > 255 - invalid_properties.push("invalid value for 'last_name', the character length must be smaller than or equal to 255.") + invalid_properties.push('invalid value for "last_name", the character length must be smaller than or equal to 255.') end if !@display_name.nil? && @display_name.to_s.length < 1 - invalid_properties.push("invalid value for 'display_name', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "display_name", the character length must be great than or equal to 1.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid @@ -110,22 +107,22 @@ def valid? return false if !@first_name.nil? && @first_name.to_s.length > 255 return false if !@last_name.nil? && @last_name.to_s.length > 255 return false if !@display_name.nil? && @display_name.to_s.length < 1 - return true + true end # Custom attribute writer method with validation # @param [Object] email Value to be assigned def email=(email) if email.nil? - fail ArgumentError, "email cannot be nil" + fail ArgumentError, 'email cannot be nil' end if email.to_s.length > 254 - fail ArgumentError, "invalid value for 'email', the character length must be smaller than or equal to 254." + fail ArgumentError, 'invalid value for "email", the character length must be smaller than or equal to 254.' end if email.to_s.length < 1 - fail ArgumentError, "invalid value for 'email', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "email", the character length must be great than or equal to 1.' end @email = email @@ -134,9 +131,8 @@ def email=(email) # Custom attribute writer method with validation # @param [Object] first_name Value to be assigned def first_name=(first_name) - if !first_name.nil? && first_name.to_s.length > 255 - fail ArgumentError, "invalid value for 'first_name', the character length must be smaller than or equal to 255." + fail ArgumentError, 'invalid value for "first_name", the character length must be smaller than or equal to 255.' end @first_name = first_name @@ -145,9 +141,8 @@ def first_name=(first_name) # Custom attribute writer method with validation # @param [Object] last_name Value to be assigned def last_name=(last_name) - if !last_name.nil? && last_name.to_s.length > 255 - fail ArgumentError, "invalid value for 'last_name', the character length must be smaller than or equal to 255." + fail ArgumentError, 'invalid value for "last_name", the character length must be smaller than or equal to 255.' end @last_name = last_name @@ -156,9 +151,8 @@ def last_name=(last_name) # Custom attribute writer method with validation # @param [Object] display_name Value to be assigned def display_name=(display_name) - if !display_name.nil? && display_name.to_s.length < 1 - fail ArgumentError, "invalid value for 'display_name', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "display_name", the character length must be great than or equal to 1.' end @display_name = display_name @@ -197,7 +191,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -279,7 +273,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -290,7 +284,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/models/webhook_subscription.rb b/lib/signrequest_client/models/webhook_subscription.rb index 0c0b839..5a408ed 100644 --- a/lib/signrequest_client/models/webhook_subscription.rb +++ b/lib/signrequest_client/models/webhook_subscription.rb @@ -6,14 +6,13 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end require 'date' module SignRequestClient - class WebhookSubscription attr_accessor :url @@ -28,6 +27,8 @@ class WebhookSubscription attr_accessor :integration + attr_accessor :team + attr_accessor :created class EnumAttributeValidator @@ -61,6 +62,7 @@ def self.attribute_map :'event_type' => :'event_type', :'callback_url' => :'callback_url', :'integration' => :'integration', + :'team' => :'team', :'created' => :'created' } end @@ -74,6 +76,7 @@ def self.swagger_types :'event_type' => :'String', :'callback_url' => :'String', :'integration' => :'String', + :'team' => :'DocumentTeam', :'created' => :'DateTime' } end @@ -84,7 +87,7 @@ def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key - attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'url') self.url = attributes[:'url'] @@ -110,10 +113,13 @@ def initialize(attributes = {}) self.integration = attributes[:'integration'] end + if attributes.has_key?(:'team') + self.team = attributes[:'team'] + end + if attributes.has_key?(:'created') self.created = attributes[:'created'] end - end # Show invalid properties with the reasons. Usually used together with valid? @@ -121,30 +127,30 @@ def initialize(attributes = {}) def list_invalid_properties invalid_properties = Array.new if !@uuid.nil? && @uuid.to_s.length < 1 - invalid_properties.push("invalid value for 'uuid', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "uuid", the character length must be great than or equal to 1.') end if !@name.nil? && @name.to_s.length > 255 - invalid_properties.push("invalid value for 'name', the character length must be smaller than or equal to 255.") + invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.') end if @event_type.nil? - invalid_properties.push("invalid value for 'event_type', event_type cannot be nil.") + invalid_properties.push('invalid value for "event_type", event_type cannot be nil.') end if @callback_url.nil? - invalid_properties.push("invalid value for 'callback_url', callback_url cannot be nil.") + invalid_properties.push('invalid value for "callback_url", callback_url cannot be nil.') end if @callback_url.to_s.length > 2100 - invalid_properties.push("invalid value for 'callback_url', the character length must be smaller than or equal to 2100.") + invalid_properties.push('invalid value for "callback_url", the character length must be smaller than or equal to 2100.') end if @callback_url.to_s.length < 1 - invalid_properties.push("invalid value for 'callback_url', the character length must be great than or equal to 1.") + invalid_properties.push('invalid value for "callback_url", the character length must be great than or equal to 1.') end - return invalid_properties + invalid_properties end # Check to see if the all the properties in the model are valid @@ -153,22 +159,21 @@ def valid? return false if !@uuid.nil? && @uuid.to_s.length < 1 return false if !@name.nil? && @name.to_s.length > 255 return false if @event_type.nil? - event_type_validator = EnumAttributeValidator.new('String', ["convert_error", "converted", "sending_error", "sent", "declined", "cancelled", "expired", "signed", "viewed", "downloaded", "signer_signed", "signer_email_bounced", "signer_viewed_email", "signer_viewed", "signer_forwarded", "signer_downloaded", "signrequest_received"]) + event_type_validator = EnumAttributeValidator.new('String', ['convert_error', 'converted', 'sending_error', 'sent', 'declined', 'cancelled', 'expired', 'signed', 'viewed', 'downloaded', 'signer_signed', 'signer_email_bounced', 'signer_viewed_email', 'signer_viewed', 'signer_forwarded', 'signer_downloaded', 'signrequest_received']) return false unless event_type_validator.valid?(@event_type) return false if @callback_url.nil? return false if @callback_url.to_s.length > 2100 return false if @callback_url.to_s.length < 1 - integration_validator = EnumAttributeValidator.new('String', ["mfiles", "salesforce", "formdesk", "zapier", "txhash"]) + integration_validator = EnumAttributeValidator.new('String', ['mfiles', 'salesforce', 'formdesk', 'zapier', 'txhash']) return false unless integration_validator.valid?(@integration) - return true + true end # Custom attribute writer method with validation # @param [Object] uuid Value to be assigned def uuid=(uuid) - if !uuid.nil? && uuid.to_s.length < 1 - fail ArgumentError, "invalid value for 'uuid', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "uuid", the character length must be great than or equal to 1.' end @uuid = uuid @@ -177,9 +182,8 @@ def uuid=(uuid) # Custom attribute writer method with validation # @param [Object] name Value to be assigned def name=(name) - if !name.nil? && name.to_s.length > 255 - fail ArgumentError, "invalid value for 'name', the character length must be smaller than or equal to 255." + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.' end @name = name @@ -188,9 +192,9 @@ def name=(name) # Custom attribute writer method checking allowed values (enum). # @param [Object] event_type Object to be assigned def event_type=(event_type) - validator = EnumAttributeValidator.new('String', ["convert_error", "converted", "sending_error", "sent", "declined", "cancelled", "expired", "signed", "viewed", "downloaded", "signer_signed", "signer_email_bounced", "signer_viewed_email", "signer_viewed", "signer_forwarded", "signer_downloaded", "signrequest_received"]) + validator = EnumAttributeValidator.new('String', ['convert_error', 'converted', 'sending_error', 'sent', 'declined', 'cancelled', 'expired', 'signed', 'viewed', 'downloaded', 'signer_signed', 'signer_email_bounced', 'signer_viewed_email', 'signer_viewed', 'signer_forwarded', 'signer_downloaded', 'signrequest_received']) unless validator.valid?(event_type) - fail ArgumentError, "invalid value for 'event_type', must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "event_type", must be one of #{validator.allowable_values}.' end @event_type = event_type end @@ -199,15 +203,15 @@ def event_type=(event_type) # @param [Object] callback_url Value to be assigned def callback_url=(callback_url) if callback_url.nil? - fail ArgumentError, "callback_url cannot be nil" + fail ArgumentError, 'callback_url cannot be nil' end if callback_url.to_s.length > 2100 - fail ArgumentError, "invalid value for 'callback_url', the character length must be smaller than or equal to 2100." + fail ArgumentError, 'invalid value for "callback_url", the character length must be smaller than or equal to 2100.' end if callback_url.to_s.length < 1 - fail ArgumentError, "invalid value for 'callback_url', the character length must be great than or equal to 1." + fail ArgumentError, 'invalid value for "callback_url", the character length must be great than or equal to 1.' end @callback_url = callback_url @@ -216,9 +220,9 @@ def callback_url=(callback_url) # Custom attribute writer method checking allowed values (enum). # @param [Object] integration Object to be assigned def integration=(integration) - validator = EnumAttributeValidator.new('String', ["mfiles", "salesforce", "formdesk", "zapier", "txhash"]) + validator = EnumAttributeValidator.new('String', ['mfiles', 'salesforce', 'formdesk', 'zapier', 'txhash']) unless validator.valid?(integration) - fail ArgumentError, "invalid value for 'integration', must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "integration", must be one of #{validator.allowable_values}.' end @integration = integration end @@ -234,6 +238,7 @@ def ==(o) event_type == o.event_type && callback_url == o.callback_url && integration == o.integration && + team == o.team && created == o.created end @@ -246,7 +251,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [url, uuid, name, event_type, callback_url, integration, created].hash + [url, uuid, name, event_type, callback_url, integration, team, created].hash end # Builds the object from hash @@ -259,7 +264,7 @@ def build_from_hash(attributes) # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) @@ -341,7 +346,7 @@ def to_hash # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) - value.compact.map{ |v| _to_hash(v) } + value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } @@ -352,7 +357,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/signrequest_client/version.rb b/lib/signrequest_client/version.rb index 5889022..3594da8 100644 --- a/lib/signrequest_client/version.rb +++ b/lib/signrequest_client/version.rb @@ -6,10 +6,10 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end module SignRequestClient - VERSION = "1.0.0" + VERSION = '1.1.0' end diff --git a/signrequest_client.gemspec b/signrequest_client.gemspec index 574e642..d068aea 100644 --- a/signrequest_client.gemspec +++ b/signrequest_client.gemspec @@ -1,5 +1,5 @@ # -*- encoding: utf-8 -*- -# + =begin #SignRequest API @@ -8,7 +8,7 @@ OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.1 +Swagger Codegen version: 2.4.8 =end @@ -24,7 +24,7 @@ Gem::Specification.new do |s| s.homepage = "https://github.com/SignRequest/signrequest-ruby-client/" s.summary = "A ruby wrapper for the SignRequest API" s.description = "This gem maps to a SignRequest API" - s.license = "MIT" + s.license = 'MIT' s.required_ruby_version = ">= 1.9" s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' @@ -38,7 +38,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16' s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12' - s.files = `find *`.split("\n").uniq.sort.select{|f| !f.empty? } + s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } s.test_files = `find spec/*`.split("\n") s.executables = [] s.require_paths = ["lib"] diff --git a/spec/models/document_signing_log_spec.rb b/spec/models/document_signing_log_spec.rb new file mode 100644 index 0000000..8d1f00f --- /dev/null +++ b/spec/models/document_signing_log_spec.rb @@ -0,0 +1,47 @@ +=begin +#SignRequest API + +#API for SignRequest.com # Getting Started The SignRequest REST API enables you to send out signature requests. Using the API you will always have all the functionality as when using the frontend plus more. When you're logged in and you have a Team enabled, you can also use the endpoints in your browser by visiting them. It is also possible to receive events from SignRequest when, for example, a document has been signed. This way you can keep your application in sync with SignRequest without polling document endpoints. For this a callback url needs to be provided in the [team API settings page](/#/teams). ## Sandbox Team The easiest way to get started is by creating a free [Sandbox Team](/#teams?sandbox=true). Sandbox teams allow you to test out the entire SignRequest product without incurring charges. Everything works the same as a paid plan, except that all documents will be watermarked. ## API Token In order to use the API you first need to obtain an API token. You can create an API token in the [team API settings page](/#/teams). Use tokens with a `Authorization: Token YOUR_TOKEN_HERE` header in your requests when making requests to the SignRequest API. cURL example: ```bash curl -H 'Authorization: Token YOUR_TOKEN_HERE' -H 'Content-Type:application/json' ``` ## Creating a Document In order to send out a SignRequest we first need to create a document. There are three ways to create a document using the [documents endpoint](#operation/documents_create). One by sending a POST request that includes a `file`, two by providing `file_from_url` in which case SignRequest will download the document from that location, and three by providing base64 encoded document content in `file_from_content` together with the filename for this content in `file_from_content_name`. This can be useful if you have trouble POSTing the file together with other (nested, in the case of the [signrequest-quick-create endpoint](#operation/signrequest-quick-create_create)) configuration data. Please be sure to add the correct extension to the filename (e.g. my_pdf_file.pdf) in order for SignRequest to be able to determine the content type of the content. Note that when using `file_from_url`, this url needs to be available for SignRequest to download. The download location may also be a Google Drive shareable link for documents (`application/vnd.google-apps.document`) and files (`application/vnd.google-apps.file`) uploaded to Google Drive. If the download location returns a content type of `text/plain` or `text/html`, SignRequest will do its best to make a PDF out of it. This can be used if you want to dynamically create PDF documents from web pages without making a PDF yourself. `external_id` is optional and can be used in order to have a reference to the document in your systems. The `name` field is also optional and can be customized, defaults to the filename (including extension). ## Sending a SignRequest Once you have successfully created a document, you can use the [signrequests endpoint](#operation/signrequests_create) to send a SignRequest using the `url` returned from the [documents endpoint](#operation/documents_create). The minimal data needed to send out a SignRequest is the following: ```json { \"document\": \"https://signrequest.com/api/v1/documents/f2bac751-4fa1-43f1-91de-a1b8905c239a/\", \"from_email\": \"you@yourcompany.com\", \"message\": \"Please sign this document.\\n\\nThanks!\", \"signers\": [ { \"email\": \"tech-support@signrequest.com\" } ] } ``` Note that we always also create a signer for the `from_email` sending the SignRequest, however for this signer the `needs_to_sign` flag is set to `false` meaning that this signer will **not** get a SignRequest. ## Quick Create a SignRequest In some cases it might be desirable to create a document and send the SignRequest in one API call. This can be done using the [signrequest-quick-create endpoint](#tag/signrequest-quick-create). This endpoint takes all of the fields of the [documents](#operation/documents_create) and [signrequests](#operation/signrequests_create) endpoints together, creates the document, and sends the SignRequest. ## Browsable API In addition to our API docs, you can also explore our API endpoints using our [browsable API](/api/v1/). There you'll be able to browse our various endpoints and even perform requests against our live API. # Working with a SignRequest ## Add attachments to a SignRequest Attachments can be added to a SignRequest using the [document-attachments endpoint](#operation/document-attachments_create). Signers will be able to download and read them before signing, but these will not be signed themselves. Document attachments can only be added when the SignRequest is not created yet. ## Customizing the SignRequest email If the Team has a custom color and logo these will be used in the SignRequest email. The `subject` and `message` fields can also be used to customize the email even further. The `message` may contain the following html tags: `a`, `abbr`, `acronym`, `b`, `blockquote`, `code`, `em`, `i`, `ul`, `li`, `ol`, and `strong`. Be aware that when the text to html ratio is too high, the email may end up in spam filters. Custom styles on these tags are not allowed. When the `from_email_name` field is provided, this name will be used in the `From` email header as such `{from_email_name} `. By default `Sender Name (sender@email.com) | SignRequest` is used as the `from_email_name`. Note that it's currently not possible to change the email address used to send a SignRequest. ## Resend the SignRequest email(s) The [resend_signrequest_email](#operation/signrequests_resend_signrequest_email) endpoint can be used to resend the SignRequest email as a reminder to all signers who didn't sign yet but did receive the email before. ## Cancel a SignRequest A SignRequest that has not been fully signed or declined yet can be cancelled using the [cancel_signrequest endpoint](#operation/signrequests_cancel_signrequest). By doing so all signers that have not signed yet will not be able to open and sign the document anymore. ## Download a signed document When a SignRequest has been signed the `pdf` field on the document resource will be filled with a link to download the signed PDF. The signing log PDF can be downloaded from the `pdf` field contained within the `signing_log` object field on the document resource. The recommended way to download the files and store them in your own systems is to setup the [Events callback](#section/Events/Events-callback) functionality and have your application download the files on the `signed` (Document signed) event. Please note that the download links expire and are regenerated on every API call / events callback so download the files right away when needed. ## Deleting documents To delete a document for the owner of the document, send a DELETE request to the [document resource url](#operation/documents_delete). Note that at this point this only makes the document unavailable for the sender. For all signers that do not have a registered SignRequest account, a grace period is started to give them a chance to download the signed document. After this grace period the document will be deleted for these signers automatically. When all signers have requested a delete (manually, automatically, or via the API) or do not have a registered SignRequest account and the grace period has lapsed, the document will be fully deleted. ### Automatic document deletion To automatically delete a document the `auto_delete_days` field on a document can be set to a number of days after which a finished document (signed/cancelled/declined) will be automatically deleted. The behavior is the same as doing a DELETE on the document resource url X number of days after the document is finished. When the document is scheduled to be deleted the `auto_delete_after` will hold the date after which it will be deleted. Note that we can make exceptions (to delete documents right away and entirely) for integration partners when they make the document available in other systems and users do not use SignRequest directly. Please [contact us](https://signrequest.com/en/contact/) to request an app screening if this functionality is required. ## Chaining multiple documents When sending a SignRequest, it's possible to reference a document in the `after_document` field on a `signer`. This should reference a document that the signer should be redirected to after signing. Since the signer is redirected to this document immediately after signing the other document, they do NOT get a SignRequest email. Note that resending the SignRequest email will trigger the SignRequest email even though they didn't receive one before. When `after_document` references a document where the signer in question already has signed or declined they will still receive a SignRequest email as we cannot redirect them anymore. It's only possible to reference documents that are not fully signed (or declined) yet. A `redirect_url` field is also available on a `signer` and on the `signrequest` (the default when not specified on the individual signers explicitly). When specified SignRequest will redirect to this url when a document is signed. Note that this only works when there are no chained documents for this signer anymore. The `redirect_url_declined` field is available on `signer` and on `signrequest` for the case that a user declines the document Chaining also works on the [signrequest-quick-create endpoint](#operation/signrequest-quick-create_create). When creating a SignRequest on that endpoint, you get a reference to the created document in the `document` field back which can be used in the next call to `signrequest-quick-create` when creating a chain with `after_document`. ## Signer language If known the language of the signer can be set in the `language` field. This will determine the language of the SignRequest email. The SignRequest browser interface language is by default set to the location, browser, or user account settings when available. To force the language of the interface when a signer lands on the signing page the field `force_language` on the signer can be set to `true`. Note that if the language of the signer is not known it's best to not force the language. Available languages: `en` English `en-gb` English (GB) `nl` Dutch `fr` French `de` German `he` Hebrew `da` Danish `fi` Finnish `hu` Hungarian `it` Italian `no` Norwegian `pl` Polish `pt` Portuguese `es` Spanish `sv` Swedish `ru` Russian ## Text message and bank account verification For a higher degree of authentication of your signers it is possible to enable text message phone number verification and bank account verification. These verifications can be enabled by providing the phone number to `verify_phone_number` (international format including the plus-sign) and/or the bank account to `verify_bank_account` on a signer. Currently it is only possible to verify bank accounts using [iDEAL](https://www.ideal.nl/en/). When enabled, signers can only sign (finalize) a document when they have verified their phone number by a code supplied to them by a text message and/or make a payment of 1 cent. The verifications are logged and visible in the SignRequest signing log after completion. Please note that we cannot force signers to make a payment using a specific bank account. Therefore the content of the field may also specify what type of account to use instead of a specific bank account number, e.g.: \"the bank account you want to use for paying the rent.\" For this service additional fees apply. Please [contact us](https://signrequest.com/en/contact/) for a quote. ## Disable signing tools/features It is possible to disable certain tools/features signers have when signing a document. The following flags can be set to `true` on the signrequest model to disable these features. - `disable_text`: disable adding of text - `disable_date`: disable adding of dates - `disable_attachments`: disable uploading/adding of attachments - `disable_text_signatures`: disable usage of signatures generated by typing (text) - `disable_upload_signatures`: disable usage of uploaded signatures (images) Please note that we strongly **discourage you to disable features** as these are carefully chosen for optimal usability of the SignRequest product. ## Required attachments To require signers to upload attachments (like a passport for example) the `required_attachments` field can be used. The field takes an array of objects with one parameter `name`, for example: `required_attachments: [{\"name\": \"Passport\"}]` ## Templates In the frontend application it is possible to create templates. These templates, for Teams and Personal accounts, can be found in the [templates resource](#tag/templates). In order to send a SignRequest using a template, reference the resource url of the template in the `template` field. This works in both the [documents](#tag/documents) and the [signrequest-quick-create](#tag/signrequest-quick-create) resources. ## Automatic reminders To enable automatic reminders set the `send_reminders` boolean to `true` on the [SignRequest resource](#tag/signrequests). When enabled SignRequest will automatically remind signers to sign a document. # Preparing a document Using the SignRequest frontend web application you have the option to \"prepare\" a document. This helps the receiver as they can only sign the document at the designated place. Using the API you can also **prepare a document by using tags** to specify where a signer needs to add a date, text, checkbox, and/or a signature. Tags need to start with `[[` and end with `]]`. The tag data is separated by a pipe `|`. The first letter of the tag represents the tag type and must be one of the following: - `t` for text - `d` for date - `s` for signature - `c` for checkbox The second piece of data is an integer representing the index of the signer for which this placeholder is intended. The numbers in the tags are used to make distinctions between the signers and group multiple tags (input fields) to one specific signer. The template tags are assigned to the order at which the email addresses are added to the contact field and are not the same as the order of signing. This means that for example `s|1` can be the first or last signer depending on what you specified in the order of signing (if used of course). As the sender is always the first email address added, this means the sender is always `s|0`. If the sender does not need to add a signature or other data input, then `s|0` will be assigned to the next in line. Mismatches in the amount of declared placeholders and available signers will be silently ignored. The extra placeholders will not show up if more than the amount of signers **OR** signers just get an unprepared document to sign when there were no placeholders declared for them. Examples: ``` [[s|0 ]] // A signature for the first signer OR the owner/sender when they need to sign. [[c|0 ]] // A checkbox placeholder for the first signer [[d|1 ]] // A date input placeholder for the second signer [[t|2 ]] // A text input placeholder for the third signer ``` The height / width (font size) and the position of the tag in your document matters. Also as you do not want the **placeholder tag to show up in the document** to avoid this you need to make the font color match the background. Sign this demo document for an example (the color is left gray to see the tags): ```html https://signrequest.com/#/?api=v1&who=m&from_email=you@yourcompany.com&doc_url=https%3A%2F%2Fsignrequest.com%2Fstatic%2Fdemo%2FSignRequestTagsExample.pdf ``` Note that the font chosen can make a difference in the bounding box margins and position. For most fonts the top margin will be bigger as desired. For this reason make sure to **leave enough space or double the line height** in order for the placeholder to not overlap the line above. ## Tag modifiers There are multiple tag modifiers available to further customize the tags. The following key / value pairs can be used after the signer index. - `r` to make a placeholder required to be filled: `1` / `true` for required `0` / `false` for not required - `m` to make a text placeholder multiline: `1` / `true` for multiline `0` / `false` for single line (default) - `n` to set a label/name on a text placeholder: 'a string' - `p` to prefill text/dates on a text/date placeholder: 'a string', for a date placeholder this can also be set to `0` / `false` to not prefill the current date. - `id` to assign an `external_id` to the placeholder: \"your_id\" (also see [Retrieving signer input](#section/Preparing-a-document/Retrieving-signer-input) and [Prefill tags](#section/Preparing-a-document/Prefill-tags-templates)) Examples: ``` [[c|0|r:1 ]] // A checkbox that cannot be skipped (needs to be checked or not) [[c|0|r:0 ]] // A checkbox that can be skipped [[c|0|p:1 ]] // A checkbox that is by default checked (can be changed) [[d|0|n:Birth date|p:0 ]] // A date that is not prefilled with the date of signing and has the label 'Birth date' [[t|0|n:City|p:New York|id:customer_city ]] // A text input placeholder with the label 'City', prefilled with the text 'New York' and an external_id of 'customer_city' that will be available later in the 'inputs' field (see: 'Retrieving signer input') and can be used to prefill the tag using prefill_tags on the document resource (see: 'Prefill tags'). ``` Note that placeholder names / prefilled data can get quite long. If this impacts the placeholder width/height you can choose to make the font between the opening `[[` and closing `]]` tags (really) small. The tag configuration does not need to be human readable as the text is extracted from the PDF format directly. ## Prefill tags / templates Instead of generating a new document and use the `p` tag modifier to prefill signer input data it is also possible to use `prefill_tags`. For this to work all tags need to have an `id` as this is needed to reference the tag. Example: ``` [[c|0|id:checkbox_1 ]] // Should be checked [[c|0|id:checkbox_2 ]] // Should not be checked [[d|0|n:Birth date|id:birth_date ]] // Should be prefilled with the birth date of the signer [[t|0|n:City|id:customer_city ]] // Should be prefilled with 'New York' ``` Now when a document contains the tags above you can prefill them using the `prefill_tags` field on document by referencing the 'id'. ```json \"prefill_tags\": [ {\"external_id\":\"checkbox_1\", \"checkbox_value\":\"true\"}, {\"external_id\":\"checkbox_2\", \"checkbox_value\":\"false\"}, {\"external_id\":\"birth_date\", \"date_value\":\"1984-12-31\"}, // must be in ISO format ([YYYY]-[MM]-[DD]) {\"external_id\":\"customer_city\", \"text\":\"New York\"} ] ``` If you are using templates created from within the SignRequest app you can also set the `external_id` of a template tag in the advanced section when editing a tag. Note that it's also possible to add these tags when using the SignRequest-js client and the [Frontend API](#section/Frontend-API). ## Prepare using the web interface It is also possible to have the sender of a SignRequest prepare the document before sending the request out. To use this functionality, set the `is_being_prepared` flag on the SignRequest resource to `true`. When doing so the SignRequest will not be sent out to the recipient(s) and the `prepare_url` field will be set to a url where your application can redirect the sender to. Please note that if the sender does not have a SignRequest account they will be asked to verify their email after preparing the document. If you're an integration partner please [contact us](https://signrequest.com/en/contact/) for more possibilities when integrating this functionality. Example: ```json { \"file_from_url\": \"https://signrequest.com/static/demo/SignRequestDemoDocument.pdf\", \"from_email\": \"you@yourcompany.com\", \"who\": \"mo\", \"is_being_prepared\": \"true\", \"signers\": [{\"email\": \"you@yourcompany.com\"}, {\"email\": \"tech-support@signrequest.com\"}] } ``` Note that it's perfectly fine to also include tags in the document. The sender will be able to change / remove them. ## Retrieving signer input All text, date, and boolean inputs of signers after a signer signs are available in the `inputs` field of a signer as text. This can be helpful if you need to update your systems based on data signers add to a document. ```json \"inputs\": [ { \"type\": \"d\", // 's' (signature input), 't' (text input), 'd' (date input) or 'c' (checkbox input) \"page_index\": 0, // index of the page this input resides on \"text\": \"09-25-18\", // text as seen on the document (only for date and text inputs) \"checkbox_value\": null, // true or false (only for checkbox inputs) \"date_value\": \"2018-09-25\", // the date in ISO format ([YYYY]-[MM]-[DD]) \"external_id\": null // optionally the external id assigned to a tag (helpful if you need to identify a specific input, also see 'Tag modifiers') } ] ``` ## Tags Example Signer 0: this is the first person that needs to sign (including you). ![Signer 0](https://signrequest.com/assets/images/blogs/template-tags-electronic-signature-0.bf35c985.png) Signer 1: this is the second person that needs to sign (including you). ![Signer 1](https://signrequest.com/assets/images/blogs/template-tags-electronic-signature-1.335ad0c8.png) The result in SignRequest: ![Result in SignRequest](https://signrequest.com/assets/images/blogs/tags-example.2bb33d7f.png) ## Example Documents You can quickly test this feature with our example documents: 1. [Basic example document](https://docs.google.com/document/d/1oI2R1SxfMNZXiz3jCQvorpoklF9xq_dCJnOpkI-zo80/edit?usp=sharing) 2. [Advanced example document](https://docs.google.com/document/d/1-gzqym9clQ1a193JGocXUeIX92cqPINBHOBeGxbDASw/edit) These are shared Google Docs documents with example tags. If you have our Google Docs Add-on you can directly send a SignRequest! If you don't have our Google Docs Add-on for electronic signatures, go to \"Add-ons\" in the Google Docs menu bar and install the Add-on for free. Then, go back to \"Add-ons\" and click \"SignRequest\". ## Walkthrough Video We also have a walkthrough video on YouTube about using templates with tags in a base document: [![Templates with tags in a base document](http://img.youtube.com/vi/y5U5WqTqZBQ/0.jpg)](http://www.youtube.com/watch?v=y5U5WqTqZBQ) # Events ## Events callback In order to receive the `events` as a callback to your application a **callback url** needs to be set in the [team API settings](/#/teams) page. When set, SignRequest will POST events as `application/json` to this endpoint. Your endpoint should return a 200 OK response. SignRequest will retry delivering events in the case of a timeout or a 500 response from your server. It first waits one minute and then increases on every subsequent attempt according to a Fibonacci sequence for a maximum of ten attempts (1, 1, 2, 3, 5, etc). It is also possible to change the **callback url on a per document basis**. To use this functionality you can set the callback url using the `events_callback_url` field when [creating a document](#operation/documents_create) or when using the [signrequest-quick-create endpoint](#tag/signrequest-quick-create). Please be aware that we might add more event types in the future so code defensively for that. For an example of how an event receiver can be written checkout this [repository](https://github.com/SignRequest/signrequest-event-receiver). The following event types are available: - `convert_error`: Document convert error - `converted`: Document converted - `sending_error`: Document sending error - `sent`: Document sent - `declined`: Document declined - `cancelled`: Document cancelled - `signed`: Document signed - `signer_signed`: Signer signed - `signer_email_bounced`: Signer email bounced - `signer_viewed_email`: Signer viewed email - `signer_viewed`: Signer viewed document - `signer_forwarded`: Signer forwarded document - `signer_downloaded`: Signer downloaded - `signrequest_received`: SignRequest received Status codes: - `ok`: ok - `error`: error The event status will be `error` for the following events: `convert_error`, `sending_error`, and `signer_email_bounced`. The document status field can have the following codes: - `co`: converting - `ne`: new - `se`: sent - `vi`: viewed - `si`: signed - `do`: downloaded - `sd`: signed and downloaded - `ca`: cancelled - `de`: declined - `ec`: error converting - `es`: error sending Example callback request: ```json { \"document\": { \"api_used\": true, \"attachments\": [], \"external_id\": \"your_id_of_this_document\", \"file\": \"signrequest download url of the uploaded file\", \"file_from_url\": \"url where signrequest downloaded the document, if this functionality was used\", \"name\": \"document.pdf\", \"pdf\": null, \"prefill_tags\": [], \"security_hash\": null, \"signing_log\": null, \"signrequest\": null, \"status\": \"co\", \"team\": { \"name\": \"the_name_of_your_team\", \"subdomain\": \"the_subdomain_of_your_team\" }, \"template\": null, \"url\": \"https://signrequest.com/api/v1/documents/f2bac751-4fa1-43f1-91de-a1b8905c239a/\", \"user\": null, \"uuid\": \"f2bac751-4fa1-43f1-91de-a1b8905c239a\" }, \"event_hash\": \"89365cda10349ced9c3fd9c457372b37ad2e723c5b9f11a4d0b2c16724d8a2e7\", \"event_time\": \"1537889008\", \"event_type\": \"converted\", \"signer\": null, \"status\": \"ok\", \"team\": { \"name\": \"the_name_of_your_team\", \"subdomain\": \"the_subdomain_of_your_team\" }, \"timestamp\": \"2018-09-25T15:23:28.836457Z\", \"token_name\": \"Token\", \"uuid\": \"ffffd4dd-89c7-4133-ba2d-960f65c8d395\" } ``` If the event is **signer related** the `signer` field will contain all the signer data. All event data can also be fetched using the REST API [Events resource](#tag/events). Be sure to check that out if you're developing your endpoint and see how the data looks. You can check the authenticity (that the event really came from SignRequest) by generating and comparing the `event_hash` that comes with the event. The `event_hash` is generated with the HMAC algorithm using your API Token as a key in SHA256 digest mode. OpenSSL shell example: ```bash echo -n \"${event_time}${event_type}\" | openssl dgst -sha256 -hmac \"YOUR_TOKEN_HERE\" ``` which expands to: ```bash echo -n \"1537889008converted\" | openssl dgst -sha256 -hmac \"YOUR_TOKEN_HERE\" 89365cda10349ced9c3fd9c457372b37ad2e723c5b9f11a4d0b2c16724d8a2e7 ``` If you have multiple API tokens created you can identify the used token by the `token_name` (if you provided one). Always use **SSL enabled endpoints**! Developing your callback endpoint locally? Checkout [UltraHook](http://www.ultrahook.com/) to receive webhooks on localhost, nifty! ## Event webhooks To receive only specific event callbacks, webhook subscriptions can be created for Teams and for Personal accounts. The resource takes an `event_type`, `callback_url` and optionally a `name` to easily identify what webhook is used for. The `integration` field can also be set when this hook is specific to one of the SignRequest supported integrations. Check out the [webhooks resource](#tag/webhooks) for all possible event types to subscribe to. When the webhooks are used on personal accounts these webhooks also receive the `signrequest_received` event which can be used to notify users that they have received a new SignRequest. However, creating webhook subscriptions for personal accounts requires a SignRequest session (logged in user) or Basic auth using a username and password. ## Disable all SignRequest email events It is possible to disable all SignRequest status emails as well as the email that contains the signed documents. When using this functionality the following events will not generate a SignRequest email: - `sent`: Document sent - `signer_email_bounced`: Signer email bounced - `signer_viewed_email`: Signer viewed email - `signer_viewed`: Signer viewed document - `signer_signed`: Signer signed - `signed`: Document signed - `declined`: Document declined - `cancelled`: Document cancelled To enable this feature set the `disable_emails` flag on the [SignRequest resource](#tag/signrequests) to true. Note that the event emails will only be disabled if there is `callback_url` available for the document as your application is expected to notify users instead of SignRequest. The initial SignRequest email (that contains the link to sign) can only be disabled by using the [Embed url](#section/Additional-signing-methods/Embed-url) functionality. # Frontend API Another option to help your users sending SignRequests is using the \"frontend\" api. This involves no token and is merely used to \"prefill\" the SignRequest box found at the homepage for your users. The only requirement is that the document to send out is publicly available in order for SignRequest to download the file. Shareable links of Google Drive documents are also supported here. GET params for prefilling the box: ``` api=v1 // the version of the API to use who=mo // mo='me & others', m='only me', o='only others' signers=first_email@example.com,second_email@example.com // emails of 'signers' comma separated from_email=you@yourcompany.com // email of the person sending the SignRequest doc_url=https%3A%2F%2Fsignrequest.com%2Fstatic%2Fdemo%2FSignRequestDemoDocument.pdf // the url where SignRequest can download the document (quoted) ``` Example resulting url: ``` https://signrequest.com/#/?api=v1&who=mo&signers=tech-support@signrequest.com&from_email=you@yourcompany.com&doc_url=https%3A%2F%2Fsignrequest.com%2Fstatic%2Fdemo%2FSignRequestDemoDocument.pdf ``` Note that you can also use prefill tags here by adding the parameter prefill_tags. The value should be Base64 encoded JSON, JavaScript example: ```javascript btoa(JSON.stringify([{external_id: 'customer_city', text: 'New York'}])); // the output can be used with the parameter: // prefill_tags=W3siZXh0ZXJuYWxfaWQiOiJjdXN0b21lcl9jaXR5IiwidGV4dCI6Ik5ldyBZb3JrIn1d ``` ## SignRequest-js client (beta) Although we consider the library \"beta\" you can count on a stable API (semver). However, if you plan to use this please [contact us](https://signrequest.com/en/contact/) so we know your use case and can help you out where needed. We will open up the repository to the public when out of beta. To use the SignRequest javascript library include the following in your page (npm and bower are coming when out of beta): ```html ``` Or for async loading use: ```html ``` The library uses [UMD](https://github.com/umdjs/umd) (Universal Module Definition). To use a specific version (current is **1.0.5**) use for example: **cdn.signrequest.com/signrequest-js/v1/1.0.5/signrequest-js.min.js**. ### Usage ```javascript // same as the frontend API GET parameters, these are all optional var conf = { subdomain: '', // if you are using this for a specific team set the subdomain here api: 'v1', who: 'mo', signers: 'first_email@example.com,second_email@example.com', from_email: 'you@yourcompany.com', close: true, // close the popup when done? default: true // or use next: next: '', // redirect to this url when done signing themselves, frontend_id: '' // optional shared secret set on document to grant access to users even if they don't have access to team } // these are also optional, the popup will be centered in the window opening the popup var popup_conf = { width: 460, // width of the popup in pixels, default 460 height: 600, // height of the popup in pixels, default the height of the window opening the popup } // to open a specific document first create a document using the REST API with your backend // be sure to also set the correct 'subdomain' in the configuration when you create a document for a specific team var doc_uuid = 'the-uuid-of-the-document'; SignRequest.browser.openPopupForDocUuid(doc_uuid, conf, popup_conf); // to create a document from a url var doc_url = 'https://signrequest.com/static/demo/SignRequestDemoDocument.pdf' SignRequest.browser.openPopupForDocUrl(doc_url, conf, popup_conf); // to create a document from a template uuid var template_uuid = 'the-uuid-of-the-template' SignRequest.browser.openPopupForTemplateUuid(template_uuid, conf, popup_conf); // to open a popup using custom params var popup = SignRequest.browser.openPopup(conf, popup_conf); // if your document contains template tags / placeholders that have an 'external_id' // it is possible to 'prefill' these for a particular SignRequest by updating your conf object with for example: conf.prefill_tags = [{external_id: 'customer_city', text: 'New York'}]; // Now all template tags with this external_id will be prefilled with 'New York' // all popup openers return an instance of the popup to which event callbacks can be registered (they can be chained) // the possible events are: 'opened', 'sent', 'signed', 'declined', 'finished', 'closed', 'any' // note that 'sent', 'finished' and 'closed' can be called fast after each other when the popup autocloses (close: true) // also when sending a SignRequest and the sender also need to sign you can receive the 'signed' or 'declined' event // after the 'sent' event (SignRequest created). // When the sender is done (sending and possibly siging) the 'finished' event is fired. popup = popup.on('closed', function (event_type, payload, event) { // this would fire when the popup closes, you might want to update your page based on events like this console.log(event_type, payload, event); }) // shortcut to fire on all events ('any') popup.onAny(function (event_type, payload, event) { // this would fire on all events console.log(event_type, payload, event); }) // to set a default configuration to use in all future calls for example for a team subdomain SignRequest.browser.setConfig({subdomain: 'the_subdomain_of_your_team'}); // When creating a document for your users using our REST API and open that document in the popup in response to clicking a button // you might need to open the popup before you know the uuid of the document from your backend. // This to prevent popup blockers from kicking in when doing async work before we open a popup. // For this use case you can use the `openLoadingPopup` helper on click and use that already opened popup to load a document later. $('button#your_button').on('click', function () { // using jQuery in the following example (not required for signrequest-js) var popup = SignRequest.browser.openLoadingPopup(); // open a popup on button click right away popup.onAny(function (event_type, payload, event) { // all listeners created on the loading popup will also be registered on the popup events fired later after the we call // SignRequest.browser.openPopupForDocUuid... console.log('Event received: ' + event_type + ', payload: ' + JSON.stringify(payload); }); // Async call some endpoint on your backend that creates a document using the REST API. $.post('/your-endpoint-to-create-a-document', {some: 'data'}).then(function(response){ // instead of opening a new popup we use the one that is 'loading' as otherwise // most browser popup blockers will block opening a new window here (the opening of the window comes too late after the user click). // we assume here your endpoint returns the uuid of the document created in the response SignRequest.browser.openPopupForDocUuid(response.document_uuid, conf, {sr_popup: popup}); // `{sr_popup: popup}` make the library use an existing popup instead of creating a new one }); }); SignRequest.browser.openPopupForDocUrl('https://signrequest.com/static/demo/SignRequestDemoDocument.pdf'); ``` ### Sharing document with external users Normally a document stored within SignRequest would require the recipient to be a member of the document owner's team in order to gain access to the document. If you'd like to share a document outside of your team, you can [create a document](#operation/documents_create) while storing a shared secret on the `frontend_id` field. Then, using the SingRequest-js Client, you can add the `frontend_id` to the `conf` object when calling `openPopupForDocUuid` in order to grant any user presented with the signing popup access to the document. # Additional signing methods ## Embed url Normally SignRequest will send the SignRequest email to signers containing the personal link to sign a document. This is how SignRequest validates an email address and is the preferred way. However, if your application requires a continuous flow (in a sales flow for example) it is possible to generate an `embed_url` and redirect a signer to that link. Combined with a `redirect_url` and/or `redirect_url_declined` a continuous flow can be achieved. Doing this moves the responsibility of identifying an email address / user to your application. This also shows in the signing log as SignRequest cannot guarantee that a document is signed by someone having access to an email address. To generate the `embed_url` you need to declare the ID of the logged in user in YOUR application in the `embed_url_user_id` field. This ID will also show in the signing log. The generated `embed_url` can only be used until the document is signed. Note that it is perfectly fine to combine signers with and without a generated `embed_url`. The `order` field also behaves as you would expect. For example, if the first signer (order = 0) has an `embed_url` generated and the second (order = 1) not, the second signer will only receive the SignRequest email when the first one has signed. When using this `embed_url` in an `iframe`, you can add any of the following url parameters to hide some elements in the header: `&hide_login=1` (hide the login button), `&hide_cancel=1` (hide the cancel link), `&hide_decline=1` (hide the option to decline), `&hide_logo=1` (hide the logo) and `&hide_title=1` (hide the document title in the header). Be aware that the `embed_url` may already contain other url parameters. Also note that hiding the login button does not disable to login prompt for signers that already have a SignRequest account. This cannot be disabled. If you also want to disable all other SignRequest emails, see [Disable all SignRequest email events](#section/Events/Disable-all-SignRequest-email-events). ## In person signing In some cases your application might want to generate one url for both the sender of the document and the receiver to sign a document after each other in person. This can be achieved by this signer configuration example: ```json { \"file_from_url\": \"https://signrequest.com/static/demo/SignRequestDemoDocument.pdf\", \"from_email\": \"you@yourcompany.com\", \"who\": \"mo\", \"signers\": [ { \"email\": \"you@yourcompany.com\", \"order\": 1, \"embed_url_user_id\": \"your ID\", }, { \"email\": \"tech-support@signrequest.com\", \"order\": 2, \"in_person\": true } ] } ``` This way you can redirect the user to the `embed_url` of the sender. After the sender has signed they will be redirected to the next `in_person` signer. # Integration Partners ## Salesforce The most straight forward way to integrate Salesforce with SignRequest is to use our managed package. Normally you would use the SignRequest buttons provided in the managed package to create SignRequest documents from Salesforce but if you want to skip that step and create SignRequests using the API (but still sync documents to Salesforce) you can add the following data to a `signrequest`: ```json \"integration_data\": { \"object_type\": \"API NAME OF THE (S)OBJECT, e.g. 'Opportunity' or 'CustomObject__c'\", \"uid\": \"UID OF THE SALESFORCE USER (NOT UUID), e.g. 'https:\\/\\/login.salesforce.com\\/id\\/00D24000000pMDZEA2\\/005240000048zB0AAI'\", \"object_id\": \"OBJECT ID, e.g. 0062400000MaeNv\" }, \"integration\": \"salesforce\" ``` Caveat: The user of the `from_email` needs to be a member of the Team that created the `signrequest`, and the user needs to have a SignRequest account using Salesforce OAuth. ## Zapier Does your app integrate with Zapier? Chances are your digital signatures are just a few clicks away! Checkout our Zapier integration here: https://signrequest.com/en/digital-electronic-signatures-with-zapier/ ## Becoming an integration partner If your application requires to create Teams and act on behalf of them you need to become an integration partner. This only grants you access to resources created by your application of the third party Team. Teams can be created and updated on the [Teams resource](#tag/teams). Please [contact us](https://signrequest.com/en/contact/) to learn more. ## OAuth2 Authorization Framework SignRequest allows partner applications to use the API on behalf of SignRequest users using OAuth2. If you need this functionality you can [create an application here](/api/v1/oauth2/applications/) (choose Client type: Confidential, Authorization grant type: Authorization code) and [contact us](https://signrequest.com/en/contact/) if you need any help. The OAuth2 framework is [rfc-compliant](https://tools.ietf.org/html/rfc6749). OAuth2 endpoints: - https://signrequest.com/api/v1/oauth2/authorize/ Get authorization code GET params: client_id, scope(s)[=we currently only support the 'read', 'write' scopes], response_type[=code], state[=your_random_state_string], redirect_uri[=if not provided the first of your application is used] - https://signrequest.com/api/v1/oauth2/token/ Request a new (refresh) token POST params: code[=the client code], grant_type[=authorization_code], redirect_uri, client_id, client_secret[=required when using the 'confidential' client type] - https://signrequest.com/api/v1/oauth2/revoke_token/ Revoke a token POST params: token[=token to revoke], token_type_hint[=optional, designating either 'access_token' or 'refresh_token'. Use tokens with the `Authorization: Bearer YOUR_TOKEN_HERE` header in your requests. To remove your authorized applications/tokens during development [go here](/api/v1/oauth2/authorized_tokens/). [Contact us](https://signrequest.com/en/contact/) if you want your logo added to the consent screen. # Client libraries We have client libraries for the following languages. Is your language missing? Let us know! - Python: https://github.com/SignRequest/signrequest-python-client - Ruby: https://github.com/SignRequest/signrequest-ruby-client - Node.js (Javascript): https://github.com/SignRequest/signrequest-node-client - C# (.NET): https://github.com/SignRequest/signrequest-csharp-client - PHP: https://github.com/SignRequest/signrequest-php-client - Event receiver (Python server): https://github.com/SignRequest/signrequest-event-receiver ### More coming soon Documentation about more advanced usage of the SignRequest API and language specific client libraries is coming soon. Feel free to contact us at tech-support@signrequest.com for any questions or feature requests. + +OpenAPI spec version: v1 +Contact: tech-support@signrequest.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.8 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SignRequestClient::DocumentSigningLog +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'DocumentSigningLog' do + before do + # run before each test + @instance = SignRequestClient::DocumentSigningLog.new + end + + after do + # run after each test + end + + describe 'test an instance of DocumentSigningLog' do + it 'should create an instance of DocumentSigningLog' do + expect(@instance).to be_instance_of(SignRequestClient::DocumentSigningLog) + end + end + describe 'test attribute "pdf"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "security_hash"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/document_signrequest_spec.rb b/spec/models/document_signrequest_spec.rb new file mode 100644 index 0000000..e45ff02 --- /dev/null +++ b/spec/models/document_signrequest_spec.rb @@ -0,0 +1,165 @@ +=begin +#SignRequest API + +#API for SignRequest.com # Getting Started The SignRequest REST API enables you to send out signature requests. Using the API you will always have all the functionality as when using the frontend plus more. When you're logged in and you have a Team enabled, you can also use the endpoints in your browser by visiting them. It is also possible to receive events from SignRequest when, for example, a document has been signed. This way you can keep your application in sync with SignRequest without polling document endpoints. For this a callback url needs to be provided in the [team API settings page](/#/teams). ## Sandbox Team The easiest way to get started is by creating a free [Sandbox Team](/#teams?sandbox=true). Sandbox teams allow you to test out the entire SignRequest product without incurring charges. Everything works the same as a paid plan, except that all documents will be watermarked. ## API Token In order to use the API you first need to obtain an API token. You can create an API token in the [team API settings page](/#/teams). Use tokens with a `Authorization: Token YOUR_TOKEN_HERE` header in your requests when making requests to the SignRequest API. cURL example: ```bash curl -H 'Authorization: Token YOUR_TOKEN_HERE' -H 'Content-Type:application/json' ``` ## Creating a Document In order to send out a SignRequest we first need to create a document. There are three ways to create a document using the [documents endpoint](#operation/documents_create). One by sending a POST request that includes a `file`, two by providing `file_from_url` in which case SignRequest will download the document from that location, and three by providing base64 encoded document content in `file_from_content` together with the filename for this content in `file_from_content_name`. This can be useful if you have trouble POSTing the file together with other (nested, in the case of the [signrequest-quick-create endpoint](#operation/signrequest-quick-create_create)) configuration data. Please be sure to add the correct extension to the filename (e.g. my_pdf_file.pdf) in order for SignRequest to be able to determine the content type of the content. Note that when using `file_from_url`, this url needs to be available for SignRequest to download. The download location may also be a Google Drive shareable link for documents (`application/vnd.google-apps.document`) and files (`application/vnd.google-apps.file`) uploaded to Google Drive. If the download location returns a content type of `text/plain` or `text/html`, SignRequest will do its best to make a PDF out of it. This can be used if you want to dynamically create PDF documents from web pages without making a PDF yourself. `external_id` is optional and can be used in order to have a reference to the document in your systems. The `name` field is also optional and can be customized, defaults to the filename (including extension). ## Sending a SignRequest Once you have successfully created a document, you can use the [signrequests endpoint](#operation/signrequests_create) to send a SignRequest using the `url` returned from the [documents endpoint](#operation/documents_create). The minimal data needed to send out a SignRequest is the following: ```json { \"document\": \"https://signrequest.com/api/v1/documents/f2bac751-4fa1-43f1-91de-a1b8905c239a/\", \"from_email\": \"you@yourcompany.com\", \"message\": \"Please sign this document.\\n\\nThanks!\", \"signers\": [ { \"email\": \"tech-support@signrequest.com\" } ] } ``` Note that we always also create a signer for the `from_email` sending the SignRequest, however for this signer the `needs_to_sign` flag is set to `false` meaning that this signer will **not** get a SignRequest. ## Quick Create a SignRequest In some cases it might be desirable to create a document and send the SignRequest in one API call. This can be done using the [signrequest-quick-create endpoint](#tag/signrequest-quick-create). This endpoint takes all of the fields of the [documents](#operation/documents_create) and [signrequests](#operation/signrequests_create) endpoints together, creates the document, and sends the SignRequest. ## Browsable API In addition to our API docs, you can also explore our API endpoints using our [browsable API](/api/v1/). There you'll be able to browse our various endpoints and even perform requests against our live API. # Working with a SignRequest ## Add attachments to a SignRequest Attachments can be added to a SignRequest using the [document-attachments endpoint](#operation/document-attachments_create). Signers will be able to download and read them before signing, but these will not be signed themselves. Document attachments can only be added when the SignRequest is not created yet. ## Customizing the SignRequest email If the Team has a custom color and logo these will be used in the SignRequest email. The `subject` and `message` fields can also be used to customize the email even further. The `message` may contain the following html tags: `a`, `abbr`, `acronym`, `b`, `blockquote`, `code`, `em`, `i`, `ul`, `li`, `ol`, and `strong`. Be aware that when the text to html ratio is too high, the email may end up in spam filters. Custom styles on these tags are not allowed. When the `from_email_name` field is provided, this name will be used in the `From` email header as such `{from_email_name} `. By default `Sender Name (sender@email.com) | SignRequest` is used as the `from_email_name`. Note that it's currently not possible to change the email address used to send a SignRequest. ## Resend the SignRequest email(s) The [resend_signrequest_email](#operation/signrequests_resend_signrequest_email) endpoint can be used to resend the SignRequest email as a reminder to all signers who didn't sign yet but did receive the email before. ## Cancel a SignRequest A SignRequest that has not been fully signed or declined yet can be cancelled using the [cancel_signrequest endpoint](#operation/signrequests_cancel_signrequest). By doing so all signers that have not signed yet will not be able to open and sign the document anymore. ## Download a signed document When a SignRequest has been signed the `pdf` field on the document resource will be filled with a link to download the signed PDF. The signing log PDF can be downloaded from the `pdf` field contained within the `signing_log` object field on the document resource. The recommended way to download the files and store them in your own systems is to setup the [Events callback](#section/Events/Events-callback) functionality and have your application download the files on the `signed` (Document signed) event. Please note that the download links expire and are regenerated on every API call / events callback so download the files right away when needed. ## Deleting documents To delete a document for the owner of the document, send a DELETE request to the [document resource url](#operation/documents_delete). Note that at this point this only makes the document unavailable for the sender. For all signers that do not have a registered SignRequest account, a grace period is started to give them a chance to download the signed document. After this grace period the document will be deleted for these signers automatically. When all signers have requested a delete (manually, automatically, or via the API) or do not have a registered SignRequest account and the grace period has lapsed, the document will be fully deleted. ### Automatic document deletion To automatically delete a document the `auto_delete_days` field on a document can be set to a number of days after which a finished document (signed/cancelled/declined) will be automatically deleted. The behavior is the same as doing a DELETE on the document resource url X number of days after the document is finished. When the document is scheduled to be deleted the `auto_delete_after` will hold the date after which it will be deleted. Note that we can make exceptions (to delete documents right away and entirely) for integration partners when they make the document available in other systems and users do not use SignRequest directly. Please [contact us](https://signrequest.com/en/contact/) to request an app screening if this functionality is required. ## Chaining multiple documents When sending a SignRequest, it's possible to reference a document in the `after_document` field on a `signer`. This should reference a document that the signer should be redirected to after signing. Since the signer is redirected to this document immediately after signing the other document, they do NOT get a SignRequest email. Note that resending the SignRequest email will trigger the SignRequest email even though they didn't receive one before. When `after_document` references a document where the signer in question already has signed or declined they will still receive a SignRequest email as we cannot redirect them anymore. It's only possible to reference documents that are not fully signed (or declined) yet. A `redirect_url` field is also available on a `signer` and on the `signrequest` (the default when not specified on the individual signers explicitly). When specified SignRequest will redirect to this url when a document is signed. Note that this only works when there are no chained documents for this signer anymore. The `redirect_url_declined` field is available on `signer` and on `signrequest` for the case that a user declines the document Chaining also works on the [signrequest-quick-create endpoint](#operation/signrequest-quick-create_create). When creating a SignRequest on that endpoint, you get a reference to the created document in the `document` field back which can be used in the next call to `signrequest-quick-create` when creating a chain with `after_document`. ## Signer language If known the language of the signer can be set in the `language` field. This will determine the language of the SignRequest email. The SignRequest browser interface language is by default set to the location, browser, or user account settings when available. To force the language of the interface when a signer lands on the signing page the field `force_language` on the signer can be set to `true`. Note that if the language of the signer is not known it's best to not force the language. Available languages: `en` English `en-gb` English (GB) `nl` Dutch `fr` French `de` German `he` Hebrew `da` Danish `fi` Finnish `hu` Hungarian `it` Italian `no` Norwegian `pl` Polish `pt` Portuguese `es` Spanish `sv` Swedish `ru` Russian ## Text message and bank account verification For a higher degree of authentication of your signers it is possible to enable text message phone number verification and bank account verification. These verifications can be enabled by providing the phone number to `verify_phone_number` (international format including the plus-sign) and/or the bank account to `verify_bank_account` on a signer. Currently it is only possible to verify bank accounts using [iDEAL](https://www.ideal.nl/en/). When enabled, signers can only sign (finalize) a document when they have verified their phone number by a code supplied to them by a text message and/or make a payment of 1 cent. The verifications are logged and visible in the SignRequest signing log after completion. Please note that we cannot force signers to make a payment using a specific bank account. Therefore the content of the field may also specify what type of account to use instead of a specific bank account number, e.g.: \"the bank account you want to use for paying the rent.\" For this service additional fees apply. Please [contact us](https://signrequest.com/en/contact/) for a quote. ## Disable signing tools/features It is possible to disable certain tools/features signers have when signing a document. The following flags can be set to `true` on the signrequest model to disable these features. - `disable_text`: disable adding of text - `disable_date`: disable adding of dates - `disable_attachments`: disable uploading/adding of attachments - `disable_text_signatures`: disable usage of signatures generated by typing (text) - `disable_upload_signatures`: disable usage of uploaded signatures (images) Please note that we strongly **discourage you to disable features** as these are carefully chosen for optimal usability of the SignRequest product. ## Required attachments To require signers to upload attachments (like a passport for example) the `required_attachments` field can be used. The field takes an array of objects with one parameter `name`, for example: `required_attachments: [{\"name\": \"Passport\"}]` ## Templates In the frontend application it is possible to create templates. These templates, for Teams and Personal accounts, can be found in the [templates resource](#tag/templates). In order to send a SignRequest using a template, reference the resource url of the template in the `template` field. This works in both the [documents](#tag/documents) and the [signrequest-quick-create](#tag/signrequest-quick-create) resources. ## Automatic reminders To enable automatic reminders set the `send_reminders` boolean to `true` on the [SignRequest resource](#tag/signrequests). When enabled SignRequest will automatically remind signers to sign a document. # Preparing a document Using the SignRequest frontend web application you have the option to \"prepare\" a document. This helps the receiver as they can only sign the document at the designated place. Using the API you can also **prepare a document by using tags** to specify where a signer needs to add a date, text, checkbox, and/or a signature. Tags need to start with `[[` and end with `]]`. The tag data is separated by a pipe `|`. The first letter of the tag represents the tag type and must be one of the following: - `t` for text - `d` for date - `s` for signature - `c` for checkbox The second piece of data is an integer representing the index of the signer for which this placeholder is intended. The numbers in the tags are used to make distinctions between the signers and group multiple tags (input fields) to one specific signer. The template tags are assigned to the order at which the email addresses are added to the contact field and are not the same as the order of signing. This means that for example `s|1` can be the first or last signer depending on what you specified in the order of signing (if used of course). As the sender is always the first email address added, this means the sender is always `s|0`. If the sender does not need to add a signature or other data input, then `s|0` will be assigned to the next in line. Mismatches in the amount of declared placeholders and available signers will be silently ignored. The extra placeholders will not show up if more than the amount of signers **OR** signers just get an unprepared document to sign when there were no placeholders declared for them. Examples: ``` [[s|0 ]] // A signature for the first signer OR the owner/sender when they need to sign. [[c|0 ]] // A checkbox placeholder for the first signer [[d|1 ]] // A date input placeholder for the second signer [[t|2 ]] // A text input placeholder for the third signer ``` The height / width (font size) and the position of the tag in your document matters. Also as you do not want the **placeholder tag to show up in the document** to avoid this you need to make the font color match the background. Sign this demo document for an example (the color is left gray to see the tags): ```html https://signrequest.com/#/?api=v1&who=m&from_email=you@yourcompany.com&doc_url=https%3A%2F%2Fsignrequest.com%2Fstatic%2Fdemo%2FSignRequestTagsExample.pdf ``` Note that the font chosen can make a difference in the bounding box margins and position. For most fonts the top margin will be bigger as desired. For this reason make sure to **leave enough space or double the line height** in order for the placeholder to not overlap the line above. ## Tag modifiers There are multiple tag modifiers available to further customize the tags. The following key / value pairs can be used after the signer index. - `r` to make a placeholder required to be filled: `1` / `true` for required `0` / `false` for not required - `m` to make a text placeholder multiline: `1` / `true` for multiline `0` / `false` for single line (default) - `n` to set a label/name on a text placeholder: 'a string' - `p` to prefill text/dates on a text/date placeholder: 'a string', for a date placeholder this can also be set to `0` / `false` to not prefill the current date. - `id` to assign an `external_id` to the placeholder: \"your_id\" (also see [Retrieving signer input](#section/Preparing-a-document/Retrieving-signer-input) and [Prefill tags](#section/Preparing-a-document/Prefill-tags-templates)) Examples: ``` [[c|0|r:1 ]] // A checkbox that cannot be skipped (needs to be checked or not) [[c|0|r:0 ]] // A checkbox that can be skipped [[c|0|p:1 ]] // A checkbox that is by default checked (can be changed) [[d|0|n:Birth date|p:0 ]] // A date that is not prefilled with the date of signing and has the label 'Birth date' [[t|0|n:City|p:New York|id:customer_city ]] // A text input placeholder with the label 'City', prefilled with the text 'New York' and an external_id of 'customer_city' that will be available later in the 'inputs' field (see: 'Retrieving signer input') and can be used to prefill the tag using prefill_tags on the document resource (see: 'Prefill tags'). ``` Note that placeholder names / prefilled data can get quite long. If this impacts the placeholder width/height you can choose to make the font between the opening `[[` and closing `]]` tags (really) small. The tag configuration does not need to be human readable as the text is extracted from the PDF format directly. ## Prefill tags / templates Instead of generating a new document and use the `p` tag modifier to prefill signer input data it is also possible to use `prefill_tags`. For this to work all tags need to have an `id` as this is needed to reference the tag. Example: ``` [[c|0|id:checkbox_1 ]] // Should be checked [[c|0|id:checkbox_2 ]] // Should not be checked [[d|0|n:Birth date|id:birth_date ]] // Should be prefilled with the birth date of the signer [[t|0|n:City|id:customer_city ]] // Should be prefilled with 'New York' ``` Now when a document contains the tags above you can prefill them using the `prefill_tags` field on document by referencing the 'id'. ```json \"prefill_tags\": [ {\"external_id\":\"checkbox_1\", \"checkbox_value\":\"true\"}, {\"external_id\":\"checkbox_2\", \"checkbox_value\":\"false\"}, {\"external_id\":\"birth_date\", \"date_value\":\"1984-12-31\"}, // must be in ISO format ([YYYY]-[MM]-[DD]) {\"external_id\":\"customer_city\", \"text\":\"New York\"} ] ``` If you are using templates created from within the SignRequest app you can also set the `external_id` of a template tag in the advanced section when editing a tag. Note that it's also possible to add these tags when using the SignRequest-js client and the [Frontend API](#section/Frontend-API). ## Prepare using the web interface It is also possible to have the sender of a SignRequest prepare the document before sending the request out. To use this functionality, set the `is_being_prepared` flag on the SignRequest resource to `true`. When doing so the SignRequest will not be sent out to the recipient(s) and the `prepare_url` field will be set to a url where your application can redirect the sender to. Please note that if the sender does not have a SignRequest account they will be asked to verify their email after preparing the document. If you're an integration partner please [contact us](https://signrequest.com/en/contact/) for more possibilities when integrating this functionality. Example: ```json { \"file_from_url\": \"https://signrequest.com/static/demo/SignRequestDemoDocument.pdf\", \"from_email\": \"you@yourcompany.com\", \"who\": \"mo\", \"is_being_prepared\": \"true\", \"signers\": [{\"email\": \"you@yourcompany.com\"}, {\"email\": \"tech-support@signrequest.com\"}] } ``` Note that it's perfectly fine to also include tags in the document. The sender will be able to change / remove them. ## Retrieving signer input All text, date, and boolean inputs of signers after a signer signs are available in the `inputs` field of a signer as text. This can be helpful if you need to update your systems based on data signers add to a document. ```json \"inputs\": [ { \"type\": \"d\", // 's' (signature input), 't' (text input), 'd' (date input) or 'c' (checkbox input) \"page_index\": 0, // index of the page this input resides on \"text\": \"09-25-18\", // text as seen on the document (only for date and text inputs) \"checkbox_value\": null, // true or false (only for checkbox inputs) \"date_value\": \"2018-09-25\", // the date in ISO format ([YYYY]-[MM]-[DD]) \"external_id\": null // optionally the external id assigned to a tag (helpful if you need to identify a specific input, also see 'Tag modifiers') } ] ``` ## Tags Example Signer 0: this is the first person that needs to sign (including you). ![Signer 0](https://signrequest.com/assets/images/blogs/template-tags-electronic-signature-0.bf35c985.png) Signer 1: this is the second person that needs to sign (including you). ![Signer 1](https://signrequest.com/assets/images/blogs/template-tags-electronic-signature-1.335ad0c8.png) The result in SignRequest: ![Result in SignRequest](https://signrequest.com/assets/images/blogs/tags-example.2bb33d7f.png) ## Example Documents You can quickly test this feature with our example documents: 1. [Basic example document](https://docs.google.com/document/d/1oI2R1SxfMNZXiz3jCQvorpoklF9xq_dCJnOpkI-zo80/edit?usp=sharing) 2. [Advanced example document](https://docs.google.com/document/d/1-gzqym9clQ1a193JGocXUeIX92cqPINBHOBeGxbDASw/edit) These are shared Google Docs documents with example tags. If you have our Google Docs Add-on you can directly send a SignRequest! If you don't have our Google Docs Add-on for electronic signatures, go to \"Add-ons\" in the Google Docs menu bar and install the Add-on for free. Then, go back to \"Add-ons\" and click \"SignRequest\". ## Walkthrough Video We also have a walkthrough video on YouTube about using templates with tags in a base document: [![Templates with tags in a base document](http://img.youtube.com/vi/y5U5WqTqZBQ/0.jpg)](http://www.youtube.com/watch?v=y5U5WqTqZBQ) # Events ## Events callback In order to receive the `events` as a callback to your application a **callback url** needs to be set in the [team API settings](/#/teams) page. When set, SignRequest will POST events as `application/json` to this endpoint. Your endpoint should return a 200 OK response. SignRequest will retry delivering events in the case of a timeout or a 500 response from your server. It first waits one minute and then increases on every subsequent attempt according to a Fibonacci sequence for a maximum of ten attempts (1, 1, 2, 3, 5, etc). It is also possible to change the **callback url on a per document basis**. To use this functionality you can set the callback url using the `events_callback_url` field when [creating a document](#operation/documents_create) or when using the [signrequest-quick-create endpoint](#tag/signrequest-quick-create). Please be aware that we might add more event types in the future so code defensively for that. For an example of how an event receiver can be written checkout this [repository](https://github.com/SignRequest/signrequest-event-receiver). The following event types are available: - `convert_error`: Document convert error - `converted`: Document converted - `sending_error`: Document sending error - `sent`: Document sent - `declined`: Document declined - `cancelled`: Document cancelled - `signed`: Document signed - `signer_signed`: Signer signed - `signer_email_bounced`: Signer email bounced - `signer_viewed_email`: Signer viewed email - `signer_viewed`: Signer viewed document - `signer_forwarded`: Signer forwarded document - `signer_downloaded`: Signer downloaded - `signrequest_received`: SignRequest received Status codes: - `ok`: ok - `error`: error The event status will be `error` for the following events: `convert_error`, `sending_error`, and `signer_email_bounced`. The document status field can have the following codes: - `co`: converting - `ne`: new - `se`: sent - `vi`: viewed - `si`: signed - `do`: downloaded - `sd`: signed and downloaded - `ca`: cancelled - `de`: declined - `ec`: error converting - `es`: error sending Example callback request: ```json { \"document\": { \"api_used\": true, \"attachments\": [], \"external_id\": \"your_id_of_this_document\", \"file\": \"signrequest download url of the uploaded file\", \"file_from_url\": \"url where signrequest downloaded the document, if this functionality was used\", \"name\": \"document.pdf\", \"pdf\": null, \"prefill_tags\": [], \"security_hash\": null, \"signing_log\": null, \"signrequest\": null, \"status\": \"co\", \"team\": { \"name\": \"the_name_of_your_team\", \"subdomain\": \"the_subdomain_of_your_team\" }, \"template\": null, \"url\": \"https://signrequest.com/api/v1/documents/f2bac751-4fa1-43f1-91de-a1b8905c239a/\", \"user\": null, \"uuid\": \"f2bac751-4fa1-43f1-91de-a1b8905c239a\" }, \"event_hash\": \"89365cda10349ced9c3fd9c457372b37ad2e723c5b9f11a4d0b2c16724d8a2e7\", \"event_time\": \"1537889008\", \"event_type\": \"converted\", \"signer\": null, \"status\": \"ok\", \"team\": { \"name\": \"the_name_of_your_team\", \"subdomain\": \"the_subdomain_of_your_team\" }, \"timestamp\": \"2018-09-25T15:23:28.836457Z\", \"token_name\": \"Token\", \"uuid\": \"ffffd4dd-89c7-4133-ba2d-960f65c8d395\" } ``` If the event is **signer related** the `signer` field will contain all the signer data. All event data can also be fetched using the REST API [Events resource](#tag/events). Be sure to check that out if you're developing your endpoint and see how the data looks. You can check the authenticity (that the event really came from SignRequest) by generating and comparing the `event_hash` that comes with the event. The `event_hash` is generated with the HMAC algorithm using your API Token as a key in SHA256 digest mode. OpenSSL shell example: ```bash echo -n \"${event_time}${event_type}\" | openssl dgst -sha256 -hmac \"YOUR_TOKEN_HERE\" ``` which expands to: ```bash echo -n \"1537889008converted\" | openssl dgst -sha256 -hmac \"YOUR_TOKEN_HERE\" 89365cda10349ced9c3fd9c457372b37ad2e723c5b9f11a4d0b2c16724d8a2e7 ``` If you have multiple API tokens created you can identify the used token by the `token_name` (if you provided one). Always use **SSL enabled endpoints**! Developing your callback endpoint locally? Checkout [UltraHook](http://www.ultrahook.com/) to receive webhooks on localhost, nifty! ## Event webhooks To receive only specific event callbacks, webhook subscriptions can be created for Teams and for Personal accounts. The resource takes an `event_type`, `callback_url` and optionally a `name` to easily identify what webhook is used for. The `integration` field can also be set when this hook is specific to one of the SignRequest supported integrations. Check out the [webhooks resource](#tag/webhooks) for all possible event types to subscribe to. When the webhooks are used on personal accounts these webhooks also receive the `signrequest_received` event which can be used to notify users that they have received a new SignRequest. However, creating webhook subscriptions for personal accounts requires a SignRequest session (logged in user) or Basic auth using a username and password. ## Disable all SignRequest email events It is possible to disable all SignRequest status emails as well as the email that contains the signed documents. When using this functionality the following events will not generate a SignRequest email: - `sent`: Document sent - `signer_email_bounced`: Signer email bounced - `signer_viewed_email`: Signer viewed email - `signer_viewed`: Signer viewed document - `signer_signed`: Signer signed - `signed`: Document signed - `declined`: Document declined - `cancelled`: Document cancelled To enable this feature set the `disable_emails` flag on the [SignRequest resource](#tag/signrequests) to true. Note that the event emails will only be disabled if there is `callback_url` available for the document as your application is expected to notify users instead of SignRequest. The initial SignRequest email (that contains the link to sign) can only be disabled by using the [Embed url](#section/Additional-signing-methods/Embed-url) functionality. # Frontend API Another option to help your users sending SignRequests is using the \"frontend\" api. This involves no token and is merely used to \"prefill\" the SignRequest box found at the homepage for your users. The only requirement is that the document to send out is publicly available in order for SignRequest to download the file. Shareable links of Google Drive documents are also supported here. GET params for prefilling the box: ``` api=v1 // the version of the API to use who=mo // mo='me & others', m='only me', o='only others' signers=first_email@example.com,second_email@example.com // emails of 'signers' comma separated from_email=you@yourcompany.com // email of the person sending the SignRequest doc_url=https%3A%2F%2Fsignrequest.com%2Fstatic%2Fdemo%2FSignRequestDemoDocument.pdf // the url where SignRequest can download the document (quoted) ``` Example resulting url: ``` https://signrequest.com/#/?api=v1&who=mo&signers=tech-support@signrequest.com&from_email=you@yourcompany.com&doc_url=https%3A%2F%2Fsignrequest.com%2Fstatic%2Fdemo%2FSignRequestDemoDocument.pdf ``` Note that you can also use prefill tags here by adding the parameter prefill_tags. The value should be Base64 encoded JSON, JavaScript example: ```javascript btoa(JSON.stringify([{external_id: 'customer_city', text: 'New York'}])); // the output can be used with the parameter: // prefill_tags=W3siZXh0ZXJuYWxfaWQiOiJjdXN0b21lcl9jaXR5IiwidGV4dCI6Ik5ldyBZb3JrIn1d ``` ## SignRequest-js client (beta) Although we consider the library \"beta\" you can count on a stable API (semver). However, if you plan to use this please [contact us](https://signrequest.com/en/contact/) so we know your use case and can help you out where needed. We will open up the repository to the public when out of beta. To use the SignRequest javascript library include the following in your page (npm and bower are coming when out of beta): ```html ``` Or for async loading use: ```html ``` The library uses [UMD](https://github.com/umdjs/umd) (Universal Module Definition). To use a specific version (current is **1.0.5**) use for example: **cdn.signrequest.com/signrequest-js/v1/1.0.5/signrequest-js.min.js**. ### Usage ```javascript // same as the frontend API GET parameters, these are all optional var conf = { subdomain: '', // if you are using this for a specific team set the subdomain here api: 'v1', who: 'mo', signers: 'first_email@example.com,second_email@example.com', from_email: 'you@yourcompany.com', close: true, // close the popup when done? default: true // or use next: next: '', // redirect to this url when done signing themselves, frontend_id: '' // optional shared secret set on document to grant access to users even if they don't have access to team } // these are also optional, the popup will be centered in the window opening the popup var popup_conf = { width: 460, // width of the popup in pixels, default 460 height: 600, // height of the popup in pixels, default the height of the window opening the popup } // to open a specific document first create a document using the REST API with your backend // be sure to also set the correct 'subdomain' in the configuration when you create a document for a specific team var doc_uuid = 'the-uuid-of-the-document'; SignRequest.browser.openPopupForDocUuid(doc_uuid, conf, popup_conf); // to create a document from a url var doc_url = 'https://signrequest.com/static/demo/SignRequestDemoDocument.pdf' SignRequest.browser.openPopupForDocUrl(doc_url, conf, popup_conf); // to create a document from a template uuid var template_uuid = 'the-uuid-of-the-template' SignRequest.browser.openPopupForTemplateUuid(template_uuid, conf, popup_conf); // to open a popup using custom params var popup = SignRequest.browser.openPopup(conf, popup_conf); // if your document contains template tags / placeholders that have an 'external_id' // it is possible to 'prefill' these for a particular SignRequest by updating your conf object with for example: conf.prefill_tags = [{external_id: 'customer_city', text: 'New York'}]; // Now all template tags with this external_id will be prefilled with 'New York' // all popup openers return an instance of the popup to which event callbacks can be registered (they can be chained) // the possible events are: 'opened', 'sent', 'signed', 'declined', 'finished', 'closed', 'any' // note that 'sent', 'finished' and 'closed' can be called fast after each other when the popup autocloses (close: true) // also when sending a SignRequest and the sender also need to sign you can receive the 'signed' or 'declined' event // after the 'sent' event (SignRequest created). // When the sender is done (sending and possibly siging) the 'finished' event is fired. popup = popup.on('closed', function (event_type, payload, event) { // this would fire when the popup closes, you might want to update your page based on events like this console.log(event_type, payload, event); }) // shortcut to fire on all events ('any') popup.onAny(function (event_type, payload, event) { // this would fire on all events console.log(event_type, payload, event); }) // to set a default configuration to use in all future calls for example for a team subdomain SignRequest.browser.setConfig({subdomain: 'the_subdomain_of_your_team'}); // When creating a document for your users using our REST API and open that document in the popup in response to clicking a button // you might need to open the popup before you know the uuid of the document from your backend. // This to prevent popup blockers from kicking in when doing async work before we open a popup. // For this use case you can use the `openLoadingPopup` helper on click and use that already opened popup to load a document later. $('button#your_button').on('click', function () { // using jQuery in the following example (not required for signrequest-js) var popup = SignRequest.browser.openLoadingPopup(); // open a popup on button click right away popup.onAny(function (event_type, payload, event) { // all listeners created on the loading popup will also be registered on the popup events fired later after the we call // SignRequest.browser.openPopupForDocUuid... console.log('Event received: ' + event_type + ', payload: ' + JSON.stringify(payload); }); // Async call some endpoint on your backend that creates a document using the REST API. $.post('/your-endpoint-to-create-a-document', {some: 'data'}).then(function(response){ // instead of opening a new popup we use the one that is 'loading' as otherwise // most browser popup blockers will block opening a new window here (the opening of the window comes too late after the user click). // we assume here your endpoint returns the uuid of the document created in the response SignRequest.browser.openPopupForDocUuid(response.document_uuid, conf, {sr_popup: popup}); // `{sr_popup: popup}` make the library use an existing popup instead of creating a new one }); }); SignRequest.browser.openPopupForDocUrl('https://signrequest.com/static/demo/SignRequestDemoDocument.pdf'); ``` ### Sharing document with external users Normally a document stored within SignRequest would require the recipient to be a member of the document owner's team in order to gain access to the document. If you'd like to share a document outside of your team, you can [create a document](#operation/documents_create) while storing a shared secret on the `frontend_id` field. Then, using the SingRequest-js Client, you can add the `frontend_id` to the `conf` object when calling `openPopupForDocUuid` in order to grant any user presented with the signing popup access to the document. # Additional signing methods ## Embed url Normally SignRequest will send the SignRequest email to signers containing the personal link to sign a document. This is how SignRequest validates an email address and is the preferred way. However, if your application requires a continuous flow (in a sales flow for example) it is possible to generate an `embed_url` and redirect a signer to that link. Combined with a `redirect_url` and/or `redirect_url_declined` a continuous flow can be achieved. Doing this moves the responsibility of identifying an email address / user to your application. This also shows in the signing log as SignRequest cannot guarantee that a document is signed by someone having access to an email address. To generate the `embed_url` you need to declare the ID of the logged in user in YOUR application in the `embed_url_user_id` field. This ID will also show in the signing log. The generated `embed_url` can only be used until the document is signed. Note that it is perfectly fine to combine signers with and without a generated `embed_url`. The `order` field also behaves as you would expect. For example, if the first signer (order = 0) has an `embed_url` generated and the second (order = 1) not, the second signer will only receive the SignRequest email when the first one has signed. When using this `embed_url` in an `iframe`, you can add any of the following url parameters to hide some elements in the header: `&hide_login=1` (hide the login button), `&hide_cancel=1` (hide the cancel link), `&hide_decline=1` (hide the option to decline), `&hide_logo=1` (hide the logo) and `&hide_title=1` (hide the document title in the header). Be aware that the `embed_url` may already contain other url parameters. Also note that hiding the login button does not disable to login prompt for signers that already have a SignRequest account. This cannot be disabled. If you also want to disable all other SignRequest emails, see [Disable all SignRequest email events](#section/Events/Disable-all-SignRequest-email-events). ## In person signing In some cases your application might want to generate one url for both the sender of the document and the receiver to sign a document after each other in person. This can be achieved by this signer configuration example: ```json { \"file_from_url\": \"https://signrequest.com/static/demo/SignRequestDemoDocument.pdf\", \"from_email\": \"you@yourcompany.com\", \"who\": \"mo\", \"signers\": [ { \"email\": \"you@yourcompany.com\", \"order\": 1, \"embed_url_user_id\": \"your ID\", }, { \"email\": \"tech-support@signrequest.com\", \"order\": 2, \"in_person\": true } ] } ``` This way you can redirect the user to the `embed_url` of the sender. After the sender has signed they will be redirected to the next `in_person` signer. # Integration Partners ## Salesforce The most straight forward way to integrate Salesforce with SignRequest is to use our managed package. Normally you would use the SignRequest buttons provided in the managed package to create SignRequest documents from Salesforce but if you want to skip that step and create SignRequests using the API (but still sync documents to Salesforce) you can add the following data to a `signrequest`: ```json \"integration_data\": { \"object_type\": \"API NAME OF THE (S)OBJECT, e.g. 'Opportunity' or 'CustomObject__c'\", \"uid\": \"UID OF THE SALESFORCE USER (NOT UUID), e.g. 'https:\\/\\/login.salesforce.com\\/id\\/00D24000000pMDZEA2\\/005240000048zB0AAI'\", \"object_id\": \"OBJECT ID, e.g. 0062400000MaeNv\" }, \"integration\": \"salesforce\" ``` Caveat: The user of the `from_email` needs to be a member of the Team that created the `signrequest`, and the user needs to have a SignRequest account using Salesforce OAuth. ## Zapier Does your app integrate with Zapier? Chances are your digital signatures are just a few clicks away! Checkout our Zapier integration here: https://signrequest.com/en/digital-electronic-signatures-with-zapier/ ## Becoming an integration partner If your application requires to create Teams and act on behalf of them you need to become an integration partner. This only grants you access to resources created by your application of the third party Team. Teams can be created and updated on the [Teams resource](#tag/teams). Please [contact us](https://signrequest.com/en/contact/) to learn more. ## OAuth2 Authorization Framework SignRequest allows partner applications to use the API on behalf of SignRequest users using OAuth2. If you need this functionality you can [create an application here](/api/v1/oauth2/applications/) (choose Client type: Confidential, Authorization grant type: Authorization code) and [contact us](https://signrequest.com/en/contact/) if you need any help. The OAuth2 framework is [rfc-compliant](https://tools.ietf.org/html/rfc6749). OAuth2 endpoints: - https://signrequest.com/api/v1/oauth2/authorize/ Get authorization code GET params: client_id, scope(s)[=we currently only support the 'read', 'write' scopes], response_type[=code], state[=your_random_state_string], redirect_uri[=if not provided the first of your application is used] - https://signrequest.com/api/v1/oauth2/token/ Request a new (refresh) token POST params: code[=the client code], grant_type[=authorization_code], redirect_uri, client_id, client_secret[=required when using the 'confidential' client type] - https://signrequest.com/api/v1/oauth2/revoke_token/ Revoke a token POST params: token[=token to revoke], token_type_hint[=optional, designating either 'access_token' or 'refresh_token'. Use tokens with the `Authorization: Bearer YOUR_TOKEN_HERE` header in your requests. To remove your authorized applications/tokens during development [go here](/api/v1/oauth2/authorized_tokens/). [Contact us](https://signrequest.com/en/contact/) if you want your logo added to the consent screen. # Client libraries We have client libraries for the following languages. Is your language missing? Let us know! - Python: https://github.com/SignRequest/signrequest-python-client - Ruby: https://github.com/SignRequest/signrequest-ruby-client - Node.js (Javascript): https://github.com/SignRequest/signrequest-node-client - C# (.NET): https://github.com/SignRequest/signrequest-csharp-client - PHP: https://github.com/SignRequest/signrequest-php-client - Event receiver (Python server): https://github.com/SignRequest/signrequest-event-receiver ### More coming soon Documentation about more advanced usage of the SignRequest API and language specific client libraries is coming soon. Feel free to contact us at tech-support@signrequest.com for any questions or feature requests. + +OpenAPI spec version: v1 +Contact: tech-support@signrequest.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.8 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SignRequestClient::DocumentSignrequest +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'DocumentSignrequest' do + before do + # run before each test + @instance = SignRequestClient::DocumentSignrequest.new + end + + after do + # run after each test + end + + describe 'test an instance of DocumentSignrequest' do + it 'should create an instance of DocumentSignrequest' do + expect(@instance).to be_instance_of(SignRequestClient::DocumentSignrequest) + end + end + describe 'test attribute "from_email"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from_email_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_being_prepared"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "prepare_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "redirect_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "redirect_url_declined"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "required_attachments"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "disable_attachments"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "disable_text_signatures"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "disable_text"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "disable_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "disable_emails"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "disable_upload_signatures"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "disable_blockchain_proof"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "text_message_verification_locked"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "subject"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "message"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "who"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["m", "mo", "o"]) + # validator.allowable_values.each do |value| + # expect { @instance.who = value }.not_to raise_error + # end + end + end + + describe 'test attribute "send_reminders"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "signers"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "uuid"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/document_team_spec.rb b/spec/models/document_team_spec.rb new file mode 100644 index 0000000..183615c --- /dev/null +++ b/spec/models/document_team_spec.rb @@ -0,0 +1,53 @@ +=begin +#SignRequest API + +#API for SignRequest.com # Getting Started The SignRequest REST API enables you to send out signature requests. Using the API you will always have all the functionality as when using the frontend plus more. When you're logged in and you have a Team enabled, you can also use the endpoints in your browser by visiting them. It is also possible to receive events from SignRequest when, for example, a document has been signed. This way you can keep your application in sync with SignRequest without polling document endpoints. For this a callback url needs to be provided in the [team API settings page](/#/teams). ## Sandbox Team The easiest way to get started is by creating a free [Sandbox Team](/#teams?sandbox=true). Sandbox teams allow you to test out the entire SignRequest product without incurring charges. Everything works the same as a paid plan, except that all documents will be watermarked. ## API Token In order to use the API you first need to obtain an API token. You can create an API token in the [team API settings page](/#/teams). Use tokens with a `Authorization: Token YOUR_TOKEN_HERE` header in your requests when making requests to the SignRequest API. cURL example: ```bash curl -H 'Authorization: Token YOUR_TOKEN_HERE' -H 'Content-Type:application/json' ``` ## Creating a Document In order to send out a SignRequest we first need to create a document. There are three ways to create a document using the [documents endpoint](#operation/documents_create). One by sending a POST request that includes a `file`, two by providing `file_from_url` in which case SignRequest will download the document from that location, and three by providing base64 encoded document content in `file_from_content` together with the filename for this content in `file_from_content_name`. This can be useful if you have trouble POSTing the file together with other (nested, in the case of the [signrequest-quick-create endpoint](#operation/signrequest-quick-create_create)) configuration data. Please be sure to add the correct extension to the filename (e.g. my_pdf_file.pdf) in order for SignRequest to be able to determine the content type of the content. Note that when using `file_from_url`, this url needs to be available for SignRequest to download. The download location may also be a Google Drive shareable link for documents (`application/vnd.google-apps.document`) and files (`application/vnd.google-apps.file`) uploaded to Google Drive. If the download location returns a content type of `text/plain` or `text/html`, SignRequest will do its best to make a PDF out of it. This can be used if you want to dynamically create PDF documents from web pages without making a PDF yourself. `external_id` is optional and can be used in order to have a reference to the document in your systems. The `name` field is also optional and can be customized, defaults to the filename (including extension). ## Sending a SignRequest Once you have successfully created a document, you can use the [signrequests endpoint](#operation/signrequests_create) to send a SignRequest using the `url` returned from the [documents endpoint](#operation/documents_create). The minimal data needed to send out a SignRequest is the following: ```json { \"document\": \"https://signrequest.com/api/v1/documents/f2bac751-4fa1-43f1-91de-a1b8905c239a/\", \"from_email\": \"you@yourcompany.com\", \"message\": \"Please sign this document.\\n\\nThanks!\", \"signers\": [ { \"email\": \"tech-support@signrequest.com\" } ] } ``` Note that we always also create a signer for the `from_email` sending the SignRequest, however for this signer the `needs_to_sign` flag is set to `false` meaning that this signer will **not** get a SignRequest. ## Quick Create a SignRequest In some cases it might be desirable to create a document and send the SignRequest in one API call. This can be done using the [signrequest-quick-create endpoint](#tag/signrequest-quick-create). This endpoint takes all of the fields of the [documents](#operation/documents_create) and [signrequests](#operation/signrequests_create) endpoints together, creates the document, and sends the SignRequest. ## Browsable API In addition to our API docs, you can also explore our API endpoints using our [browsable API](/api/v1/). There you'll be able to browse our various endpoints and even perform requests against our live API. # Working with a SignRequest ## Add attachments to a SignRequest Attachments can be added to a SignRequest using the [document-attachments endpoint](#operation/document-attachments_create). Signers will be able to download and read them before signing, but these will not be signed themselves. Document attachments can only be added when the SignRequest is not created yet. ## Customizing the SignRequest email If the Team has a custom color and logo these will be used in the SignRequest email. The `subject` and `message` fields can also be used to customize the email even further. The `message` may contain the following html tags: `a`, `abbr`, `acronym`, `b`, `blockquote`, `code`, `em`, `i`, `ul`, `li`, `ol`, and `strong`. Be aware that when the text to html ratio is too high, the email may end up in spam filters. Custom styles on these tags are not allowed. When the `from_email_name` field is provided, this name will be used in the `From` email header as such `{from_email_name} `. By default `Sender Name (sender@email.com) | SignRequest` is used as the `from_email_name`. Note that it's currently not possible to change the email address used to send a SignRequest. ## Resend the SignRequest email(s) The [resend_signrequest_email](#operation/signrequests_resend_signrequest_email) endpoint can be used to resend the SignRequest email as a reminder to all signers who didn't sign yet but did receive the email before. ## Cancel a SignRequest A SignRequest that has not been fully signed or declined yet can be cancelled using the [cancel_signrequest endpoint](#operation/signrequests_cancel_signrequest). By doing so all signers that have not signed yet will not be able to open and sign the document anymore. ## Download a signed document When a SignRequest has been signed the `pdf` field on the document resource will be filled with a link to download the signed PDF. The signing log PDF can be downloaded from the `pdf` field contained within the `signing_log` object field on the document resource. The recommended way to download the files and store them in your own systems is to setup the [Events callback](#section/Events/Events-callback) functionality and have your application download the files on the `signed` (Document signed) event. Please note that the download links expire and are regenerated on every API call / events callback so download the files right away when needed. ## Deleting documents To delete a document for the owner of the document, send a DELETE request to the [document resource url](#operation/documents_delete). Note that at this point this only makes the document unavailable for the sender. For all signers that do not have a registered SignRequest account, a grace period is started to give them a chance to download the signed document. After this grace period the document will be deleted for these signers automatically. When all signers have requested a delete (manually, automatically, or via the API) or do not have a registered SignRequest account and the grace period has lapsed, the document will be fully deleted. ### Automatic document deletion To automatically delete a document the `auto_delete_days` field on a document can be set to a number of days after which a finished document (signed/cancelled/declined) will be automatically deleted. The behavior is the same as doing a DELETE on the document resource url X number of days after the document is finished. When the document is scheduled to be deleted the `auto_delete_after` will hold the date after which it will be deleted. Note that we can make exceptions (to delete documents right away and entirely) for integration partners when they make the document available in other systems and users do not use SignRequest directly. Please [contact us](https://signrequest.com/en/contact/) to request an app screening if this functionality is required. ## Chaining multiple documents When sending a SignRequest, it's possible to reference a document in the `after_document` field on a `signer`. This should reference a document that the signer should be redirected to after signing. Since the signer is redirected to this document immediately after signing the other document, they do NOT get a SignRequest email. Note that resending the SignRequest email will trigger the SignRequest email even though they didn't receive one before. When `after_document` references a document where the signer in question already has signed or declined they will still receive a SignRequest email as we cannot redirect them anymore. It's only possible to reference documents that are not fully signed (or declined) yet. A `redirect_url` field is also available on a `signer` and on the `signrequest` (the default when not specified on the individual signers explicitly). When specified SignRequest will redirect to this url when a document is signed. Note that this only works when there are no chained documents for this signer anymore. The `redirect_url_declined` field is available on `signer` and on `signrequest` for the case that a user declines the document Chaining also works on the [signrequest-quick-create endpoint](#operation/signrequest-quick-create_create). When creating a SignRequest on that endpoint, you get a reference to the created document in the `document` field back which can be used in the next call to `signrequest-quick-create` when creating a chain with `after_document`. ## Signer language If known the language of the signer can be set in the `language` field. This will determine the language of the SignRequest email. The SignRequest browser interface language is by default set to the location, browser, or user account settings when available. To force the language of the interface when a signer lands on the signing page the field `force_language` on the signer can be set to `true`. Note that if the language of the signer is not known it's best to not force the language. Available languages: `en` English `en-gb` English (GB) `nl` Dutch `fr` French `de` German `he` Hebrew `da` Danish `fi` Finnish `hu` Hungarian `it` Italian `no` Norwegian `pl` Polish `pt` Portuguese `es` Spanish `sv` Swedish `ru` Russian ## Text message and bank account verification For a higher degree of authentication of your signers it is possible to enable text message phone number verification and bank account verification. These verifications can be enabled by providing the phone number to `verify_phone_number` (international format including the plus-sign) and/or the bank account to `verify_bank_account` on a signer. Currently it is only possible to verify bank accounts using [iDEAL](https://www.ideal.nl/en/). When enabled, signers can only sign (finalize) a document when they have verified their phone number by a code supplied to them by a text message and/or make a payment of 1 cent. The verifications are logged and visible in the SignRequest signing log after completion. Please note that we cannot force signers to make a payment using a specific bank account. Therefore the content of the field may also specify what type of account to use instead of a specific bank account number, e.g.: \"the bank account you want to use for paying the rent.\" For this service additional fees apply. Please [contact us](https://signrequest.com/en/contact/) for a quote. ## Disable signing tools/features It is possible to disable certain tools/features signers have when signing a document. The following flags can be set to `true` on the signrequest model to disable these features. - `disable_text`: disable adding of text - `disable_date`: disable adding of dates - `disable_attachments`: disable uploading/adding of attachments - `disable_text_signatures`: disable usage of signatures generated by typing (text) - `disable_upload_signatures`: disable usage of uploaded signatures (images) Please note that we strongly **discourage you to disable features** as these are carefully chosen for optimal usability of the SignRequest product. ## Required attachments To require signers to upload attachments (like a passport for example) the `required_attachments` field can be used. The field takes an array of objects with one parameter `name`, for example: `required_attachments: [{\"name\": \"Passport\"}]` ## Templates In the frontend application it is possible to create templates. These templates, for Teams and Personal accounts, can be found in the [templates resource](#tag/templates). In order to send a SignRequest using a template, reference the resource url of the template in the `template` field. This works in both the [documents](#tag/documents) and the [signrequest-quick-create](#tag/signrequest-quick-create) resources. ## Automatic reminders To enable automatic reminders set the `send_reminders` boolean to `true` on the [SignRequest resource](#tag/signrequests). When enabled SignRequest will automatically remind signers to sign a document. # Preparing a document Using the SignRequest frontend web application you have the option to \"prepare\" a document. This helps the receiver as they can only sign the document at the designated place. Using the API you can also **prepare a document by using tags** to specify where a signer needs to add a date, text, checkbox, and/or a signature. Tags need to start with `[[` and end with `]]`. The tag data is separated by a pipe `|`. The first letter of the tag represents the tag type and must be one of the following: - `t` for text - `d` for date - `s` for signature - `c` for checkbox The second piece of data is an integer representing the index of the signer for which this placeholder is intended. The numbers in the tags are used to make distinctions between the signers and group multiple tags (input fields) to one specific signer. The template tags are assigned to the order at which the email addresses are added to the contact field and are not the same as the order of signing. This means that for example `s|1` can be the first or last signer depending on what you specified in the order of signing (if used of course). As the sender is always the first email address added, this means the sender is always `s|0`. If the sender does not need to add a signature or other data input, then `s|0` will be assigned to the next in line. Mismatches in the amount of declared placeholders and available signers will be silently ignored. The extra placeholders will not show up if more than the amount of signers **OR** signers just get an unprepared document to sign when there were no placeholders declared for them. Examples: ``` [[s|0 ]] // A signature for the first signer OR the owner/sender when they need to sign. [[c|0 ]] // A checkbox placeholder for the first signer [[d|1 ]] // A date input placeholder for the second signer [[t|2 ]] // A text input placeholder for the third signer ``` The height / width (font size) and the position of the tag in your document matters. Also as you do not want the **placeholder tag to show up in the document** to avoid this you need to make the font color match the background. Sign this demo document for an example (the color is left gray to see the tags): ```html https://signrequest.com/#/?api=v1&who=m&from_email=you@yourcompany.com&doc_url=https%3A%2F%2Fsignrequest.com%2Fstatic%2Fdemo%2FSignRequestTagsExample.pdf ``` Note that the font chosen can make a difference in the bounding box margins and position. For most fonts the top margin will be bigger as desired. For this reason make sure to **leave enough space or double the line height** in order for the placeholder to not overlap the line above. ## Tag modifiers There are multiple tag modifiers available to further customize the tags. The following key / value pairs can be used after the signer index. - `r` to make a placeholder required to be filled: `1` / `true` for required `0` / `false` for not required - `m` to make a text placeholder multiline: `1` / `true` for multiline `0` / `false` for single line (default) - `n` to set a label/name on a text placeholder: 'a string' - `p` to prefill text/dates on a text/date placeholder: 'a string', for a date placeholder this can also be set to `0` / `false` to not prefill the current date. - `id` to assign an `external_id` to the placeholder: \"your_id\" (also see [Retrieving signer input](#section/Preparing-a-document/Retrieving-signer-input) and [Prefill tags](#section/Preparing-a-document/Prefill-tags-templates)) Examples: ``` [[c|0|r:1 ]] // A checkbox that cannot be skipped (needs to be checked or not) [[c|0|r:0 ]] // A checkbox that can be skipped [[c|0|p:1 ]] // A checkbox that is by default checked (can be changed) [[d|0|n:Birth date|p:0 ]] // A date that is not prefilled with the date of signing and has the label 'Birth date' [[t|0|n:City|p:New York|id:customer_city ]] // A text input placeholder with the label 'City', prefilled with the text 'New York' and an external_id of 'customer_city' that will be available later in the 'inputs' field (see: 'Retrieving signer input') and can be used to prefill the tag using prefill_tags on the document resource (see: 'Prefill tags'). ``` Note that placeholder names / prefilled data can get quite long. If this impacts the placeholder width/height you can choose to make the font between the opening `[[` and closing `]]` tags (really) small. The tag configuration does not need to be human readable as the text is extracted from the PDF format directly. ## Prefill tags / templates Instead of generating a new document and use the `p` tag modifier to prefill signer input data it is also possible to use `prefill_tags`. For this to work all tags need to have an `id` as this is needed to reference the tag. Example: ``` [[c|0|id:checkbox_1 ]] // Should be checked [[c|0|id:checkbox_2 ]] // Should not be checked [[d|0|n:Birth date|id:birth_date ]] // Should be prefilled with the birth date of the signer [[t|0|n:City|id:customer_city ]] // Should be prefilled with 'New York' ``` Now when a document contains the tags above you can prefill them using the `prefill_tags` field on document by referencing the 'id'. ```json \"prefill_tags\": [ {\"external_id\":\"checkbox_1\", \"checkbox_value\":\"true\"}, {\"external_id\":\"checkbox_2\", \"checkbox_value\":\"false\"}, {\"external_id\":\"birth_date\", \"date_value\":\"1984-12-31\"}, // must be in ISO format ([YYYY]-[MM]-[DD]) {\"external_id\":\"customer_city\", \"text\":\"New York\"} ] ``` If you are using templates created from within the SignRequest app you can also set the `external_id` of a template tag in the advanced section when editing a tag. Note that it's also possible to add these tags when using the SignRequest-js client and the [Frontend API](#section/Frontend-API). ## Prepare using the web interface It is also possible to have the sender of a SignRequest prepare the document before sending the request out. To use this functionality, set the `is_being_prepared` flag on the SignRequest resource to `true`. When doing so the SignRequest will not be sent out to the recipient(s) and the `prepare_url` field will be set to a url where your application can redirect the sender to. Please note that if the sender does not have a SignRequest account they will be asked to verify their email after preparing the document. If you're an integration partner please [contact us](https://signrequest.com/en/contact/) for more possibilities when integrating this functionality. Example: ```json { \"file_from_url\": \"https://signrequest.com/static/demo/SignRequestDemoDocument.pdf\", \"from_email\": \"you@yourcompany.com\", \"who\": \"mo\", \"is_being_prepared\": \"true\", \"signers\": [{\"email\": \"you@yourcompany.com\"}, {\"email\": \"tech-support@signrequest.com\"}] } ``` Note that it's perfectly fine to also include tags in the document. The sender will be able to change / remove them. ## Retrieving signer input All text, date, and boolean inputs of signers after a signer signs are available in the `inputs` field of a signer as text. This can be helpful if you need to update your systems based on data signers add to a document. ```json \"inputs\": [ { \"type\": \"d\", // 's' (signature input), 't' (text input), 'd' (date input) or 'c' (checkbox input) \"page_index\": 0, // index of the page this input resides on \"text\": \"09-25-18\", // text as seen on the document (only for date and text inputs) \"checkbox_value\": null, // true or false (only for checkbox inputs) \"date_value\": \"2018-09-25\", // the date in ISO format ([YYYY]-[MM]-[DD]) \"external_id\": null // optionally the external id assigned to a tag (helpful if you need to identify a specific input, also see 'Tag modifiers') } ] ``` ## Tags Example Signer 0: this is the first person that needs to sign (including you). ![Signer 0](https://signrequest.com/assets/images/blogs/template-tags-electronic-signature-0.bf35c985.png) Signer 1: this is the second person that needs to sign (including you). ![Signer 1](https://signrequest.com/assets/images/blogs/template-tags-electronic-signature-1.335ad0c8.png) The result in SignRequest: ![Result in SignRequest](https://signrequest.com/assets/images/blogs/tags-example.2bb33d7f.png) ## Example Documents You can quickly test this feature with our example documents: 1. [Basic example document](https://docs.google.com/document/d/1oI2R1SxfMNZXiz3jCQvorpoklF9xq_dCJnOpkI-zo80/edit?usp=sharing) 2. [Advanced example document](https://docs.google.com/document/d/1-gzqym9clQ1a193JGocXUeIX92cqPINBHOBeGxbDASw/edit) These are shared Google Docs documents with example tags. If you have our Google Docs Add-on you can directly send a SignRequest! If you don't have our Google Docs Add-on for electronic signatures, go to \"Add-ons\" in the Google Docs menu bar and install the Add-on for free. Then, go back to \"Add-ons\" and click \"SignRequest\". ## Walkthrough Video We also have a walkthrough video on YouTube about using templates with tags in a base document: [![Templates with tags in a base document](http://img.youtube.com/vi/y5U5WqTqZBQ/0.jpg)](http://www.youtube.com/watch?v=y5U5WqTqZBQ) # Events ## Events callback In order to receive the `events` as a callback to your application a **callback url** needs to be set in the [team API settings](/#/teams) page. When set, SignRequest will POST events as `application/json` to this endpoint. Your endpoint should return a 200 OK response. SignRequest will retry delivering events in the case of a timeout or a 500 response from your server. It first waits one minute and then increases on every subsequent attempt according to a Fibonacci sequence for a maximum of ten attempts (1, 1, 2, 3, 5, etc). It is also possible to change the **callback url on a per document basis**. To use this functionality you can set the callback url using the `events_callback_url` field when [creating a document](#operation/documents_create) or when using the [signrequest-quick-create endpoint](#tag/signrequest-quick-create). Please be aware that we might add more event types in the future so code defensively for that. For an example of how an event receiver can be written checkout this [repository](https://github.com/SignRequest/signrequest-event-receiver). The following event types are available: - `convert_error`: Document convert error - `converted`: Document converted - `sending_error`: Document sending error - `sent`: Document sent - `declined`: Document declined - `cancelled`: Document cancelled - `signed`: Document signed - `signer_signed`: Signer signed - `signer_email_bounced`: Signer email bounced - `signer_viewed_email`: Signer viewed email - `signer_viewed`: Signer viewed document - `signer_forwarded`: Signer forwarded document - `signer_downloaded`: Signer downloaded - `signrequest_received`: SignRequest received Status codes: - `ok`: ok - `error`: error The event status will be `error` for the following events: `convert_error`, `sending_error`, and `signer_email_bounced`. The document status field can have the following codes: - `co`: converting - `ne`: new - `se`: sent - `vi`: viewed - `si`: signed - `do`: downloaded - `sd`: signed and downloaded - `ca`: cancelled - `de`: declined - `ec`: error converting - `es`: error sending Example callback request: ```json { \"document\": { \"api_used\": true, \"attachments\": [], \"external_id\": \"your_id_of_this_document\", \"file\": \"signrequest download url of the uploaded file\", \"file_from_url\": \"url where signrequest downloaded the document, if this functionality was used\", \"name\": \"document.pdf\", \"pdf\": null, \"prefill_tags\": [], \"security_hash\": null, \"signing_log\": null, \"signrequest\": null, \"status\": \"co\", \"team\": { \"name\": \"the_name_of_your_team\", \"subdomain\": \"the_subdomain_of_your_team\" }, \"template\": null, \"url\": \"https://signrequest.com/api/v1/documents/f2bac751-4fa1-43f1-91de-a1b8905c239a/\", \"user\": null, \"uuid\": \"f2bac751-4fa1-43f1-91de-a1b8905c239a\" }, \"event_hash\": \"89365cda10349ced9c3fd9c457372b37ad2e723c5b9f11a4d0b2c16724d8a2e7\", \"event_time\": \"1537889008\", \"event_type\": \"converted\", \"signer\": null, \"status\": \"ok\", \"team\": { \"name\": \"the_name_of_your_team\", \"subdomain\": \"the_subdomain_of_your_team\" }, \"timestamp\": \"2018-09-25T15:23:28.836457Z\", \"token_name\": \"Token\", \"uuid\": \"ffffd4dd-89c7-4133-ba2d-960f65c8d395\" } ``` If the event is **signer related** the `signer` field will contain all the signer data. All event data can also be fetched using the REST API [Events resource](#tag/events). Be sure to check that out if you're developing your endpoint and see how the data looks. You can check the authenticity (that the event really came from SignRequest) by generating and comparing the `event_hash` that comes with the event. The `event_hash` is generated with the HMAC algorithm using your API Token as a key in SHA256 digest mode. OpenSSL shell example: ```bash echo -n \"${event_time}${event_type}\" | openssl dgst -sha256 -hmac \"YOUR_TOKEN_HERE\" ``` which expands to: ```bash echo -n \"1537889008converted\" | openssl dgst -sha256 -hmac \"YOUR_TOKEN_HERE\" 89365cda10349ced9c3fd9c457372b37ad2e723c5b9f11a4d0b2c16724d8a2e7 ``` If you have multiple API tokens created you can identify the used token by the `token_name` (if you provided one). Always use **SSL enabled endpoints**! Developing your callback endpoint locally? Checkout [UltraHook](http://www.ultrahook.com/) to receive webhooks on localhost, nifty! ## Event webhooks To receive only specific event callbacks, webhook subscriptions can be created for Teams and for Personal accounts. The resource takes an `event_type`, `callback_url` and optionally a `name` to easily identify what webhook is used for. The `integration` field can also be set when this hook is specific to one of the SignRequest supported integrations. Check out the [webhooks resource](#tag/webhooks) for all possible event types to subscribe to. When the webhooks are used on personal accounts these webhooks also receive the `signrequest_received` event which can be used to notify users that they have received a new SignRequest. However, creating webhook subscriptions for personal accounts requires a SignRequest session (logged in user) or Basic auth using a username and password. ## Disable all SignRequest email events It is possible to disable all SignRequest status emails as well as the email that contains the signed documents. When using this functionality the following events will not generate a SignRequest email: - `sent`: Document sent - `signer_email_bounced`: Signer email bounced - `signer_viewed_email`: Signer viewed email - `signer_viewed`: Signer viewed document - `signer_signed`: Signer signed - `signed`: Document signed - `declined`: Document declined - `cancelled`: Document cancelled To enable this feature set the `disable_emails` flag on the [SignRequest resource](#tag/signrequests) to true. Note that the event emails will only be disabled if there is `callback_url` available for the document as your application is expected to notify users instead of SignRequest. The initial SignRequest email (that contains the link to sign) can only be disabled by using the [Embed url](#section/Additional-signing-methods/Embed-url) functionality. # Frontend API Another option to help your users sending SignRequests is using the \"frontend\" api. This involves no token and is merely used to \"prefill\" the SignRequest box found at the homepage for your users. The only requirement is that the document to send out is publicly available in order for SignRequest to download the file. Shareable links of Google Drive documents are also supported here. GET params for prefilling the box: ``` api=v1 // the version of the API to use who=mo // mo='me & others', m='only me', o='only others' signers=first_email@example.com,second_email@example.com // emails of 'signers' comma separated from_email=you@yourcompany.com // email of the person sending the SignRequest doc_url=https%3A%2F%2Fsignrequest.com%2Fstatic%2Fdemo%2FSignRequestDemoDocument.pdf // the url where SignRequest can download the document (quoted) ``` Example resulting url: ``` https://signrequest.com/#/?api=v1&who=mo&signers=tech-support@signrequest.com&from_email=you@yourcompany.com&doc_url=https%3A%2F%2Fsignrequest.com%2Fstatic%2Fdemo%2FSignRequestDemoDocument.pdf ``` Note that you can also use prefill tags here by adding the parameter prefill_tags. The value should be Base64 encoded JSON, JavaScript example: ```javascript btoa(JSON.stringify([{external_id: 'customer_city', text: 'New York'}])); // the output can be used with the parameter: // prefill_tags=W3siZXh0ZXJuYWxfaWQiOiJjdXN0b21lcl9jaXR5IiwidGV4dCI6Ik5ldyBZb3JrIn1d ``` ## SignRequest-js client (beta) Although we consider the library \"beta\" you can count on a stable API (semver). However, if you plan to use this please [contact us](https://signrequest.com/en/contact/) so we know your use case and can help you out where needed. We will open up the repository to the public when out of beta. To use the SignRequest javascript library include the following in your page (npm and bower are coming when out of beta): ```html ``` Or for async loading use: ```html ``` The library uses [UMD](https://github.com/umdjs/umd) (Universal Module Definition). To use a specific version (current is **1.0.5**) use for example: **cdn.signrequest.com/signrequest-js/v1/1.0.5/signrequest-js.min.js**. ### Usage ```javascript // same as the frontend API GET parameters, these are all optional var conf = { subdomain: '', // if you are using this for a specific team set the subdomain here api: 'v1', who: 'mo', signers: 'first_email@example.com,second_email@example.com', from_email: 'you@yourcompany.com', close: true, // close the popup when done? default: true // or use next: next: '', // redirect to this url when done signing themselves, frontend_id: '' // optional shared secret set on document to grant access to users even if they don't have access to team } // these are also optional, the popup will be centered in the window opening the popup var popup_conf = { width: 460, // width of the popup in pixels, default 460 height: 600, // height of the popup in pixels, default the height of the window opening the popup } // to open a specific document first create a document using the REST API with your backend // be sure to also set the correct 'subdomain' in the configuration when you create a document for a specific team var doc_uuid = 'the-uuid-of-the-document'; SignRequest.browser.openPopupForDocUuid(doc_uuid, conf, popup_conf); // to create a document from a url var doc_url = 'https://signrequest.com/static/demo/SignRequestDemoDocument.pdf' SignRequest.browser.openPopupForDocUrl(doc_url, conf, popup_conf); // to create a document from a template uuid var template_uuid = 'the-uuid-of-the-template' SignRequest.browser.openPopupForTemplateUuid(template_uuid, conf, popup_conf); // to open a popup using custom params var popup = SignRequest.browser.openPopup(conf, popup_conf); // if your document contains template tags / placeholders that have an 'external_id' // it is possible to 'prefill' these for a particular SignRequest by updating your conf object with for example: conf.prefill_tags = [{external_id: 'customer_city', text: 'New York'}]; // Now all template tags with this external_id will be prefilled with 'New York' // all popup openers return an instance of the popup to which event callbacks can be registered (they can be chained) // the possible events are: 'opened', 'sent', 'signed', 'declined', 'finished', 'closed', 'any' // note that 'sent', 'finished' and 'closed' can be called fast after each other when the popup autocloses (close: true) // also when sending a SignRequest and the sender also need to sign you can receive the 'signed' or 'declined' event // after the 'sent' event (SignRequest created). // When the sender is done (sending and possibly siging) the 'finished' event is fired. popup = popup.on('closed', function (event_type, payload, event) { // this would fire when the popup closes, you might want to update your page based on events like this console.log(event_type, payload, event); }) // shortcut to fire on all events ('any') popup.onAny(function (event_type, payload, event) { // this would fire on all events console.log(event_type, payload, event); }) // to set a default configuration to use in all future calls for example for a team subdomain SignRequest.browser.setConfig({subdomain: 'the_subdomain_of_your_team'}); // When creating a document for your users using our REST API and open that document in the popup in response to clicking a button // you might need to open the popup before you know the uuid of the document from your backend. // This to prevent popup blockers from kicking in when doing async work before we open a popup. // For this use case you can use the `openLoadingPopup` helper on click and use that already opened popup to load a document later. $('button#your_button').on('click', function () { // using jQuery in the following example (not required for signrequest-js) var popup = SignRequest.browser.openLoadingPopup(); // open a popup on button click right away popup.onAny(function (event_type, payload, event) { // all listeners created on the loading popup will also be registered on the popup events fired later after the we call // SignRequest.browser.openPopupForDocUuid... console.log('Event received: ' + event_type + ', payload: ' + JSON.stringify(payload); }); // Async call some endpoint on your backend that creates a document using the REST API. $.post('/your-endpoint-to-create-a-document', {some: 'data'}).then(function(response){ // instead of opening a new popup we use the one that is 'loading' as otherwise // most browser popup blockers will block opening a new window here (the opening of the window comes too late after the user click). // we assume here your endpoint returns the uuid of the document created in the response SignRequest.browser.openPopupForDocUuid(response.document_uuid, conf, {sr_popup: popup}); // `{sr_popup: popup}` make the library use an existing popup instead of creating a new one }); }); SignRequest.browser.openPopupForDocUrl('https://signrequest.com/static/demo/SignRequestDemoDocument.pdf'); ``` ### Sharing document with external users Normally a document stored within SignRequest would require the recipient to be a member of the document owner's team in order to gain access to the document. If you'd like to share a document outside of your team, you can [create a document](#operation/documents_create) while storing a shared secret on the `frontend_id` field. Then, using the SingRequest-js Client, you can add the `frontend_id` to the `conf` object when calling `openPopupForDocUuid` in order to grant any user presented with the signing popup access to the document. # Additional signing methods ## Embed url Normally SignRequest will send the SignRequest email to signers containing the personal link to sign a document. This is how SignRequest validates an email address and is the preferred way. However, if your application requires a continuous flow (in a sales flow for example) it is possible to generate an `embed_url` and redirect a signer to that link. Combined with a `redirect_url` and/or `redirect_url_declined` a continuous flow can be achieved. Doing this moves the responsibility of identifying an email address / user to your application. This also shows in the signing log as SignRequest cannot guarantee that a document is signed by someone having access to an email address. To generate the `embed_url` you need to declare the ID of the logged in user in YOUR application in the `embed_url_user_id` field. This ID will also show in the signing log. The generated `embed_url` can only be used until the document is signed. Note that it is perfectly fine to combine signers with and without a generated `embed_url`. The `order` field also behaves as you would expect. For example, if the first signer (order = 0) has an `embed_url` generated and the second (order = 1) not, the second signer will only receive the SignRequest email when the first one has signed. When using this `embed_url` in an `iframe`, you can add any of the following url parameters to hide some elements in the header: `&hide_login=1` (hide the login button), `&hide_cancel=1` (hide the cancel link), `&hide_decline=1` (hide the option to decline), `&hide_logo=1` (hide the logo) and `&hide_title=1` (hide the document title in the header). Be aware that the `embed_url` may already contain other url parameters. Also note that hiding the login button does not disable to login prompt for signers that already have a SignRequest account. This cannot be disabled. If you also want to disable all other SignRequest emails, see [Disable all SignRequest email events](#section/Events/Disable-all-SignRequest-email-events). ## In person signing In some cases your application might want to generate one url for both the sender of the document and the receiver to sign a document after each other in person. This can be achieved by this signer configuration example: ```json { \"file_from_url\": \"https://signrequest.com/static/demo/SignRequestDemoDocument.pdf\", \"from_email\": \"you@yourcompany.com\", \"who\": \"mo\", \"signers\": [ { \"email\": \"you@yourcompany.com\", \"order\": 1, \"embed_url_user_id\": \"your ID\", }, { \"email\": \"tech-support@signrequest.com\", \"order\": 2, \"in_person\": true } ] } ``` This way you can redirect the user to the `embed_url` of the sender. After the sender has signed they will be redirected to the next `in_person` signer. # Integration Partners ## Salesforce The most straight forward way to integrate Salesforce with SignRequest is to use our managed package. Normally you would use the SignRequest buttons provided in the managed package to create SignRequest documents from Salesforce but if you want to skip that step and create SignRequests using the API (but still sync documents to Salesforce) you can add the following data to a `signrequest`: ```json \"integration_data\": { \"object_type\": \"API NAME OF THE (S)OBJECT, e.g. 'Opportunity' or 'CustomObject__c'\", \"uid\": \"UID OF THE SALESFORCE USER (NOT UUID), e.g. 'https:\\/\\/login.salesforce.com\\/id\\/00D24000000pMDZEA2\\/005240000048zB0AAI'\", \"object_id\": \"OBJECT ID, e.g. 0062400000MaeNv\" }, \"integration\": \"salesforce\" ``` Caveat: The user of the `from_email` needs to be a member of the Team that created the `signrequest`, and the user needs to have a SignRequest account using Salesforce OAuth. ## Zapier Does your app integrate with Zapier? Chances are your digital signatures are just a few clicks away! Checkout our Zapier integration here: https://signrequest.com/en/digital-electronic-signatures-with-zapier/ ## Becoming an integration partner If your application requires to create Teams and act on behalf of them you need to become an integration partner. This only grants you access to resources created by your application of the third party Team. Teams can be created and updated on the [Teams resource](#tag/teams). Please [contact us](https://signrequest.com/en/contact/) to learn more. ## OAuth2 Authorization Framework SignRequest allows partner applications to use the API on behalf of SignRequest users using OAuth2. If you need this functionality you can [create an application here](/api/v1/oauth2/applications/) (choose Client type: Confidential, Authorization grant type: Authorization code) and [contact us](https://signrequest.com/en/contact/) if you need any help. The OAuth2 framework is [rfc-compliant](https://tools.ietf.org/html/rfc6749). OAuth2 endpoints: - https://signrequest.com/api/v1/oauth2/authorize/ Get authorization code GET params: client_id, scope(s)[=we currently only support the 'read', 'write' scopes], response_type[=code], state[=your_random_state_string], redirect_uri[=if not provided the first of your application is used] - https://signrequest.com/api/v1/oauth2/token/ Request a new (refresh) token POST params: code[=the client code], grant_type[=authorization_code], redirect_uri, client_id, client_secret[=required when using the 'confidential' client type] - https://signrequest.com/api/v1/oauth2/revoke_token/ Revoke a token POST params: token[=token to revoke], token_type_hint[=optional, designating either 'access_token' or 'refresh_token'. Use tokens with the `Authorization: Bearer YOUR_TOKEN_HERE` header in your requests. To remove your authorized applications/tokens during development [go here](/api/v1/oauth2/authorized_tokens/). [Contact us](https://signrequest.com/en/contact/) if you want your logo added to the consent screen. # Client libraries We have client libraries for the following languages. Is your language missing? Let us know! - Python: https://github.com/SignRequest/signrequest-python-client - Ruby: https://github.com/SignRequest/signrequest-ruby-client - Node.js (Javascript): https://github.com/SignRequest/signrequest-node-client - C# (.NET): https://github.com/SignRequest/signrequest-csharp-client - PHP: https://github.com/SignRequest/signrequest-php-client - Event receiver (Python server): https://github.com/SignRequest/signrequest-event-receiver ### More coming soon Documentation about more advanced usage of the SignRequest API and language specific client libraries is coming soon. Feel free to contact us at tech-support@signrequest.com for any questions or feature requests. + +OpenAPI spec version: v1 +Contact: tech-support@signrequest.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.8 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SignRequestClient::DocumentTeam +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'DocumentTeam' do + before do + # run before each test + @instance = SignRequestClient::DocumentTeam.new + end + + after do + # run after each test + end + + describe 'test an instance of DocumentTeam' do + it 'should create an instance of DocumentTeam' do + expect(@instance).to be_instance_of(SignRequestClient::DocumentTeam) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "subdomain"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end