Current section
Files
Jump to
Current section
Files
lib/docusign/api/template_document_tabs.ex
# NOTE: This file is auto generated by OpenAPI Generator 6.4.0 (https://openapi-generator.tech).
# Do not edit this file manually.
defmodule DocuSign.Api.TemplateDocumentTabs do
@moduledoc """
API calls for all endpoints tagged `TemplateDocumentTabs`.
"""
alias DocuSign.Connection
import DocuSign.RequestBuilder
@doc """
Deletes tabs from a template.
Deletes tabs from the document specified by `documentId` in the template specified by `templateId`.
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `document_id` (String.t): The unique ID of the document within the envelope. Unlike other IDs in the eSignature API, you specify the `documentId` yourself. Typically the first document has the ID `1`, the second document `2`, and so on, but you can use any numbering scheme that fits within a 32-bit signed integer (1 through 2147483647). Tab objects have a `documentId` property that specifies the document on which to place the tab.
- `template_id` (String.t): The ID of the template.
- `opts` (keyword): Optional parameters
- `:body` (TemplateTabs):
### Returns
- `{:ok, DocuSign.Model.Tabs.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec tabs_delete_template_document_tabs(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
keyword()
) ::
{:ok, DocuSign.Model.Tabs.t()}
| {:ok, DocuSign.Model.ErrorDetails.t()}
| {:error, Tesla.Env.t()}
def tabs_delete_template_document_tabs(
connection,
account_id,
document_id,
template_id,
opts \\ []
) do
optional_params = %{
:body => :body
}
request =
%{}
|> method(:delete)
|> url(
"/v2.1/accounts/#{account_id}/templates/#{template_id}/documents/#{document_id}/tabs"
)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %DocuSign.Model.Tabs{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Returns tabs on a template.
Returns the tabs on the document specified by `documentId` in the template specified by `templateId`.
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `document_id` (String.t): The unique ID of the document within the envelope. Unlike other IDs in the eSignature API, you specify the `documentId` yourself. Typically the first document has the ID `1`, the second document `2`, and so on, but you can use any numbering scheme that fits within a 32-bit signed integer (1 through 2147483647). Tab objects have a `documentId` property that specifies the document on which to place the tab.
- `template_id` (String.t): The ID of the template.
- `opts` (keyword): Optional parameters
- `:page_numbers` (String.t): Filters for tabs that occur on the pages that you specify. Enter as a comma-separated list of page Guids. Example: `page_numbers=2,6`
### Returns
- `{:ok, DocuSign.Model.TemplateDocumentTabs.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec tabs_get_template_document_tabs(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
keyword()
) ::
{:ok, DocuSign.Model.TemplateDocumentTabs.t()}
| {:ok, DocuSign.Model.ErrorDetails.t()}
| {:error, Tesla.Env.t()}
def tabs_get_template_document_tabs(
connection,
account_id,
document_id,
template_id,
opts \\ []
) do
optional_params = %{
:page_numbers => :query
}
request =
%{}
|> method(:get)
|> url(
"/v2.1/accounts/#{account_id}/templates/#{template_id}/documents/#{document_id}/tabs"
)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %DocuSign.Model.TemplateDocumentTabs{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Returns tabs on the specified page.
Returns the tabs from the page specified by `pageNumber` of the document specified by `documentId` in the template specified by `templateId`.
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `document_id` (String.t): The unique ID of the document within the envelope. Unlike other IDs in the eSignature API, you specify the `documentId` yourself. Typically the first document has the ID `1`, the second document `2`, and so on, but you can use any numbering scheme that fits within a 32-bit signed integer (1 through 2147483647). Tab objects have a `documentId` property that specifies the document on which to place the tab.
- `page_number` (String.t): The page number being accessed.
- `template_id` (String.t): The ID of the template.
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, DocuSign.Model.TemplateDocumentTabs.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec tabs_get_template_page_tabs(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
String.t(),
keyword()
) ::
{:ok, DocuSign.Model.TemplateDocumentTabs.t()}
| {:ok, DocuSign.Model.ErrorDetails.t()}
| {:error, Tesla.Env.t()}
def tabs_get_template_page_tabs(
connection,
account_id,
document_id,
page_number,
template_id,
_opts \\ []
) do
request =
%{}
|> method(:get)
|> url(
"/v2.1/accounts/#{account_id}/templates/#{template_id}/documents/#{document_id}/pages/#{page_number}/tabs"
)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %DocuSign.Model.TemplateDocumentTabs{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Adds tabs to a document in a template.
Adds tabs to the document specified by `documentId` in the template specified by `templateId`. In the request body, you only need to specify the tabs that your are adding. For example, to add a text [prefill tab](/docs/esign-rest-api/reference/templates/templatedocumenttabs/create/#definition__templatetabs_prefilltabs), your request body might look like this: ``` { \"prefillTabs\": { \"textTabs\": [ { \"value\": \"a prefill text tab\", \"pageNumber\": \"1\", \"documentId\": \"1\", \"xPosition\": 316, \"yPosition\": 97 } ] } } ```
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `document_id` (String.t): The unique ID of the document within the envelope. Unlike other IDs in the eSignature API, you specify the `documentId` yourself. Typically the first document has the ID `1`, the second document `2`, and so on, but you can use any numbering scheme that fits within a 32-bit signed integer (1 through 2147483647). Tab objects have a `documentId` property that specifies the document on which to place the tab.
- `template_id` (String.t): The ID of the template.
- `opts` (keyword): Optional parameters
- `:body` (TemplateTabs):
### Returns
- `{:ok, DocuSign.Model.Tabs.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec tabs_post_template_document_tabs(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
keyword()
) ::
{:ok, DocuSign.Model.Tabs.t()}
| {:ok, DocuSign.Model.ErrorDetails.t()}
| {:error, Tesla.Env.t()}
def tabs_post_template_document_tabs(
connection,
account_id,
document_id,
template_id,
opts \\ []
) do
optional_params = %{
:body => :body
}
request =
%{}
|> method(:post)
|> url(
"/v2.1/accounts/#{account_id}/templates/#{template_id}/documents/#{document_id}/tabs"
)
|> add_optional_params(optional_params, opts)
|> ensure_body()
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{201, %DocuSign.Model.Tabs{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Updates the tabs for a template.
Updates tabs in the document specified by `documentId` in the template specified by `templateId`.
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `document_id` (String.t): The unique ID of the document within the envelope. Unlike other IDs in the eSignature API, you specify the `documentId` yourself. Typically the first document has the ID `1`, the second document `2`, and so on, but you can use any numbering scheme that fits within a 32-bit signed integer (1 through 2147483647). Tab objects have a `documentId` property that specifies the document on which to place the tab.
- `template_id` (String.t): The ID of the template.
- `opts` (keyword): Optional parameters
- `:body` (TemplateTabs):
### Returns
- `{:ok, DocuSign.Model.Tabs.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec tabs_put_template_document_tabs(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
keyword()
) ::
{:ok, DocuSign.Model.Tabs.t()}
| {:ok, DocuSign.Model.ErrorDetails.t()}
| {:error, Tesla.Env.t()}
def tabs_put_template_document_tabs(
connection,
account_id,
document_id,
template_id,
opts \\ []
) do
optional_params = %{
:body => :body
}
request =
%{}
|> method(:put)
|> url(
"/v2.1/accounts/#{account_id}/templates/#{template_id}/documents/#{document_id}/tabs"
)
|> add_optional_params(optional_params, opts)
|> ensure_body()
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %DocuSign.Model.Tabs{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
end