Current section

Files

Jump to
docusign lib docusign api template_recipients.ex
Raw

lib/docusign/api/template_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.TemplateRecipients do
@moduledoc """
API calls for all endpoints tagged `TemplateRecipients`.
"""
alias DocuSign.Connection
import DocuSign.RequestBuilder
@doc """
Deletes the specified recipient file from a template.
Deletes the specified recipient file from the specified template.
## Parameters
- connection (DocuSign.Connection): Connection to server
- account_id (String.t): The external account number (int) or account ID Guid.
- recipient_id (String.t): The `recipientId` used when the envelope or template was created.
- template_id (String.t): The ID of the template being accessed.
- opts (KeywordList): [optional] Optional parameters
- :template_recipients (TemplateRecipients):
## Returns
{:ok, %DocuSign.Model.TemplateRecipients{}} on success
{:error, info} on failure
"""
@spec recipients_delete_template_recipient(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
keyword()
) :: {:ok, DocuSign.Model.TemplateRecipients.t()} | {:error, Tesla.Env.t()}
def recipients_delete_template_recipient(
connection,
account_id,
recipient_id,
template_id,
opts \\ []
) do
optional_params = %{
templateRecipients: :body
}
%{}
|> method(:delete)
|> url("/v2/accounts/#{account_id}/templates/#{template_id}/recipients/#{recipient_id}")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%DocuSign.Model.TemplateRecipients{})
end
@doc """
Deletes recipients from a template.
Deletes one or more recipients from a template. Recipients to be deleted are listed in the request, with the `recipientId` being used as the key for deleting recipients.
## Parameters
- connection (DocuSign.Connection): Connection to server
- account_id (String.t): The external account number (int) or account ID Guid.
- template_id (String.t): The ID of the template being accessed.
- opts (KeywordList): [optional] Optional parameters
- :template_recipients (TemplateRecipients):
## Returns
{:ok, %DocuSign.Model.TemplateRecipients{}} on success
{:error, info} on failure
"""
@spec recipients_delete_template_recipients(
Tesla.Env.client(),
String.t(),
String.t(),
keyword()
) :: {:ok, DocuSign.Model.TemplateRecipients.t()} | {:error, Tesla.Env.t()}
def recipients_delete_template_recipients(connection, account_id, template_id, opts \\ []) do
optional_params = %{
templateRecipients: :body
}
%{}
|> method(:delete)
|> url("/v2/accounts/#{account_id}/templates/#{template_id}/recipients")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%DocuSign.Model.TemplateRecipients{})
end
@doc """
Gets recipient information from a template.
Retrieves the information for all recipients in the specified template.
## Parameters
- connection (DocuSign.Connection): Connection to server
- account_id (String.t): The external account number (int) or account ID Guid.
- template_id (String.t): The ID of the template being accessed.
- 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.TemplateRecipients{}} on success
{:error, info} on failure
"""
@spec recipients_get_template_recipients(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, DocuSign.Model.TemplateRecipients.t()} | {:error, Tesla.Env.t()}
def recipients_get_template_recipients(connection, account_id, template_id, opts \\ []) do
optional_params = %{
include_anchor_tab_locations: :query,
include_extended: :query,
include_tabs: :query
}
%{}
|> method(:get)
|> url("/v2/accounts/#{account_id}/templates/#{template_id}/recipients")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%DocuSign.Model.TemplateRecipients{})
end
@doc """
Adds tabs for a recipient.
Adds one or more recipients to a template.
## Parameters
- connection (DocuSign.Connection): Connection to server
- account_id (String.t): The external account number (int) or account ID Guid.
- template_id (String.t): The ID of the template being accessed.
- 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.
- :template_recipients (TemplateRecipients):
## Returns
{:ok, %DocuSign.Model.TemplateRecipients{}} on success
{:error, info} on failure
"""
@spec recipients_post_template_recipients(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, DocuSign.Model.TemplateRecipients.t()} | {:error, Tesla.Env.t()}
def recipients_post_template_recipients(connection, account_id, template_id, opts \\ []) do
optional_params = %{
resend_envelope: :query,
templateRecipients: :body
}
%{}
|> method(:post)
|> url("/v2/accounts/#{account_id}/templates/#{template_id}/recipients")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%DocuSign.Model.TemplateRecipients{})
end
@doc """
Updates recipients in a template.
Updates recipients in a template. You can edit the following properties: `email`, `userName`, `routingOrder`, `faxNumber`, `deliveryMethod`, `accessCode`, and `requireIdLookup`.
## Parameters
- connection (DocuSign.Connection): Connection to server
- account_id (String.t): The external account number (int) or account ID Guid.
- template_id (String.t): The ID of the template being accessed.
- 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.
- :template_recipients (TemplateRecipients):
## Returns
{:ok, %DocuSign.Model.RecipientsUpdateSummary{}} on success
{:error, info} on failure
"""
@spec recipients_put_template_recipients(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, DocuSign.Model.RecipientsUpdateSummary.t()} | {:error, Tesla.Env.t()}
def recipients_put_template_recipients(connection, account_id, template_id, opts \\ []) do
optional_params = %{
resend_envelope: :query,
templateRecipients: :body
}
%{}
|> method(:put)
|> url("/v2/accounts/#{account_id}/templates/#{template_id}/recipients")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%DocuSign.Model.RecipientsUpdateSummary{})
end
end