Current section

Files

Jump to
docusign lib docusign api envelope_recipients.ex
Raw

lib/docusign/api/envelope_recipients.ex

# NOTE: This class is auto generated by the swagger code generator program.
# https://github.com/swagger-api/swagger-codegen.git
# Do not edit the class manually.
defmodule DocuSign.Api.EnvelopeRecipients do
@moduledoc """
API calls for all endpoints tagged `EnvelopeRecipients`.
"""
alias DocuSign.Connection
import DocuSign.RequestBuilder
@doc """
Deletes a recipient from an envelope.
Deletes a recipient from a `draft` or `sent` envelope. If the envelope is \"In Process\" (has been sent and is not completed or voided), recipients that have completed their actions cannot be deleted.
## Parameters
- connection (DocuSign.Connection): Connection to server
- account_id (String.t): The external account number (int) or account ID Guid.
- envelope_id (String.t): The envelope's GUID. Eg 93be49ab-afa0-4adf-933c-f752070d71ec
- recipient_id (String.t): The `recipientId` used when the envelope or template was created.
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, %DocuSign.Model.EnvelopeRecipients{}} on success
{:error, info} on failure
"""
@spec recipients_delete_recipient(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
keyword()
) :: {:ok, DocuSign.Model.EnvelopeRecipients.t()} | {:error, Tesla.Env.t()}
def recipients_delete_recipient(connection, account_id, envelope_id, recipient_id, _opts \\ []) do
%{}
|> method(:delete)
|> url("/v2/accounts/#{account_id}/envelopes/#{envelope_id}/recipients/#{recipient_id}")
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%DocuSign.Model.EnvelopeRecipients{})
end
@doc """
Deletes recipients from an envelope.
Deletes one or more recipients from a draft or sent envelope. Recipients to be deleted are listed in the request, with the `recipientId` being used as the key for deleting recipients. If the envelope is `In Process`, meaning that it has been sent and has not been completed or voided, recipients that have completed their actions cannot be deleted.
## Parameters
- connection (DocuSign.Connection): Connection to server
- account_id (String.t): The external account number (int) or account ID Guid.
- envelope_id (String.t): The envelope's GUID. Eg 93be49ab-afa0-4adf-933c-f752070d71ec
- opts (KeywordList): [optional] Optional parameters
- :envelope_recipients (EnvelopeRecipients):
## Returns
{:ok, %DocuSign.Model.EnvelopeRecipients{}} on success
{:error, info} on failure
"""
@spec recipients_delete_recipients(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, DocuSign.Model.EnvelopeRecipients.t()} | {:error, Tesla.Env.t()}
def recipients_delete_recipients(connection, account_id, envelope_id, opts \\ []) do
optional_params = %{
EnvelopeRecipients: :body
}
%{}
|> method(:delete)
|> url("/v2/accounts/#{account_id}/envelopes/#{envelope_id}/recipients")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%DocuSign.Model.EnvelopeRecipients{})
end
@doc """
Gets the status of recipients for an envelope.
Retrieves the status of all recipients in a single envelope and identifies the current recipient in the routing list. The `currentRoutingOrder` property of the response contains the `routingOrder` value of the current recipient indicating that the envelope has been sent to the recipient, but the recipient has not completed their actions.
## Parameters
- connection (DocuSign.Connection): Connection to server
- account_id (String.t): The external account number (int) or account ID Guid.
- envelope_id (String.t): The envelope's GUID. Eg 93be49ab-afa0-4adf-933c-f752070d71ec
- opts (KeywordList): [optional] Optional parameters
- :include_anchor_tab_locations (String.t): When set to **true** and `include_tabs` is set to **true**, all tabs with anchor tab properties are included in the response.
- :include_extended (String.t): When set to **true**, the extended properties are included in the response.
- :include_tabs (String.t): When set to **true**, the tab information associated with the recipient is included in the response.
## Returns
{:ok, %DocuSign.Model.EnvelopeRecipients{}} on success
{:error, info} on failure
"""
@spec recipients_get_recipients(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, DocuSign.Model.EnvelopeRecipients.t()} | {:error, Tesla.Env.t()}
def recipients_get_recipients(connection, account_id, envelope_id, opts \\ []) do
optional_params = %{
include_anchor_tab_locations: :query,
include_extended: :query,
include_tabs: :query
}
%{}
|> method(:get)
|> url("/v2/accounts/#{account_id}/envelopes/#{envelope_id}/recipients")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%DocuSign.Model.EnvelopeRecipients{})
end
@doc """
Adds one or more recipients to an envelope.
Adds one or more recipients to an envelope. For an in process envelope, one that has been sent and has not been completed or voided, an email is sent to a new recipient when they are reached in the routing order. If the new recipient's routing order is before or the same as the envelope's next recipient, an email is only sent if the optional `resend_envelope` query string is set to **true**.
## Parameters
- connection (DocuSign.Connection): Connection to server
- account_id (String.t): The external account number (int) or account ID Guid.
- envelope_id (String.t): The envelope's GUID. Eg 93be49ab-afa0-4adf-933c-f752070d71ec
- opts (KeywordList): [optional] Optional parameters
- :resend_envelope (String.t): When set to **true**, resends the envelope if the new recipient's routing order is before or the same as the envelope's next recipient.
- :envelope_recipients (EnvelopeRecipients):
## Returns
{:ok, %DocuSign.Model.EnvelopeRecipients{}} on success
{:error, info} on failure
"""
@spec recipients_post_recipients(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, DocuSign.Model.EnvelopeRecipients.t()} | {:error, Tesla.Env.t()}
def recipients_post_recipients(connection, account_id, envelope_id, opts \\ []) do
optional_params = %{
resend_envelope: :query,
EnvelopeRecipients: :body
}
%{}
|> method(:post)
|> url("/v2/accounts/#{account_id}/envelopes/#{envelope_id}/recipients")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%DocuSign.Model.EnvelopeRecipients{})
end
@doc """
Updates recipients in a draft envelope or corrects recipient information for an in process envelope.
Updates recipients in a draft envelope or corrects recipient information for an in process envelope. For draft envelopes, you can edit the following properties: `email`, `userName`, `routingOrder`, `faxNumber`, `deliveryMethod`, `accessCode`, and `requireIdLookup`. Once an envelope has been sent, you can only edit: `email`, `userName`, `signerName`, `routingOrder`, `faxNumber`, and `deliveryMethod`. You can also select to resend an envelope by using the `resend_envelope` option. If you send information for a recipient that does not already exist in a draft envelope, the recipient is added to the envelope (similar to the POST).
## Parameters
- connection (DocuSign.Connection): Connection to server
- account_id (String.t): The external account number (int) or account ID Guid.
- envelope_id (String.t): The envelope's GUID. Eg 93be49ab-afa0-4adf-933c-f752070d71ec
- opts (KeywordList): [optional] Optional parameters
- :offline_signing (String.t):
- :resend_envelope (String.t): When set to **true**, resends the envelope if the new recipient's routing order is before or the same as the envelope's next recipient.
- :envelope_recipients (EnvelopeRecipients):
## Returns
{:ok, %DocuSign.Model.RecipientsUpdateSummary{}} on success
{:error, info} on failure
"""
@spec recipients_put_recipients(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, DocuSign.Model.RecipientsUpdateSummary.t()} | {:error, Tesla.Env.t()}
def recipients_put_recipients(connection, account_id, envelope_id, opts \\ []) do
optional_params = %{
offline_signing: :query,
resend_envelope: :query,
EnvelopeRecipients: :body
}
%{}
|> method(:put)
|> url("/v2/accounts/#{account_id}/envelopes/#{envelope_id}/recipients")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%DocuSign.Model.RecipientsUpdateSummary{})
end
end