Current section

Files

Jump to
docusign lib docusign api envelope_attachments.ex
Raw

lib/docusign/api/envelope_attachments.ex

# NOTE: This file is auto generated by OpenAPI Generator 7.12.0 (https://openapi-generator.tech).
# Do not edit this file manually.
defmodule DocuSign.Api.EnvelopeAttachments do
@moduledoc """
API calls for all endpoints tagged `EnvelopeAttachments`.
"""
import DocuSign.RequestBuilder
alias DocuSign.Connection
alias DocuSign.Model.EnvelopeAttachmentsResult
alias DocuSign.Model.ErrorDetails
@doc """
Deletes one or more envelope attachments from a draft envelope.
Deletes one or more envelope attachments from a draft envelope. <!-- std notice DEVDOCS-114911 --> <ds-inlinemessage kind=\"information\" markdown=\"1\"> It's easy to confuse envelope attachments, which are developer-only files associated with an envelope, with signer attachments. To learn about the different types of attachments, see [Attachments](/docs/esign-rest-api/esign101/concepts/documents/attachments/) in the concept guide. </ds-inlinemessage> <!-- end notice DEVDOCS-114911 -->
### 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. Example: `93be49ab-xxxx-xxxx-xxxx-f752070d71ec`
- `opts` (keyword): Optional parameters
- `:body` (EnvelopeAttachmentsRequest):
### Returns
- `{:ok, DocuSign.Model.EnvelopeAttachmentsResult.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec attachments_delete_attachments(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, ErrorDetails.t()}
| {:ok, EnvelopeAttachmentsResult.t()}
| {:error, Tesla.Env.t()}
def attachments_delete_attachments(connection, account_id, envelope_id, opts \\ []) do
optional_params = %{
:body => :body
}
request =
%{}
|> method(:delete)
|> url("/v2.1/accounts/#{account_id}/envelopes/#{envelope_id}/attachments")
|> add_optional_params(optional_params, opts)
|> Enum.to_list()
connection
|> Connection.request(request)
|> evaluate_response([
{200, EnvelopeAttachmentsResult},
{400, ErrorDetails}
])
end
@doc """
Retrieves an envelope attachment from an envelope.
Retrieves an envelope attachment from an envelope. <!-- std notice DEVDOCS-114911 --> <ds-inlinemessage kind=\"information\" markdown=\"1\"> It's easy to confuse envelope attachments, which are developer-only files associated with an envelope, with signer attachments. To learn about the different types of attachments, see [Attachments](/docs/esign-rest-api/esign101/concepts/documents/attachments/) in the concept guide. </ds-inlinemessage> <!-- end notice DEVDOCS-114911 -->
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `attachment_id` (String.t): The unique identifier for the attachment.
- `envelope_id` (String.t): The envelope's GUID. Example: `93be49ab-xxxx-xxxx-xxxx-f752070d71ec`
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, String.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec attachments_get_attachment(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
keyword()
) :: {:ok, ErrorDetails.t()} | {:ok, String.t()} | {:error, Tesla.Env.t()}
def attachments_get_attachment(connection, account_id, attachment_id, envelope_id, _opts \\ []) do
request =
%{}
|> method(:get)
|> url("/v2.1/accounts/#{account_id}/envelopes/#{envelope_id}/attachments/#{attachment_id}")
|> Enum.to_list()
connection
|> Connection.request(request)
|> evaluate_response([
{200, false},
{400, ErrorDetails}
])
end
@doc """
Returns a list of envelope attachments associated with a specified envelope.
Returns a list of envelope attachments associated with a specified envelope. <!-- std notice DEVDOCS-114911 --> <ds-inlinemessage kind=\"information\" markdown=\"1\"> It's easy to confuse envelope attachments, which are developer-only files associated with an envelope, with signer attachments. To get a list of user-visible attachments, use [EnvelopeDocuments: get](/docs/esign-rest-api/reference/envelopes/envelopedocuments/get/). To learn about the different types of attachments, see [Attachments](/docs/esign-rest-api/esign101/concepts/documents/attachments/) in the concept guide. </ds-inlinemessage> <!-- end notice DEVDOCS-114911 -->
### 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. Example: `93be49ab-xxxx-xxxx-xxxx-f752070d71ec`
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, DocuSign.Model.EnvelopeAttachmentsResult.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec attachments_get_attachments(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, ErrorDetails.t()}
| {:ok, EnvelopeAttachmentsResult.t()}
| {:error, Tesla.Env.t()}
def attachments_get_attachments(connection, account_id, envelope_id, _opts \\ []) do
request =
%{}
|> method(:get)
|> url("/v2.1/accounts/#{account_id}/envelopes/#{envelope_id}/attachments")
|> Enum.to_list()
connection
|> Connection.request(request)
|> evaluate_response([
{200, EnvelopeAttachmentsResult},
{400, ErrorDetails}
])
end
@doc """
Updates an envelope attachment in a draft or in-process envelope.
Updates an envelope attachment to a draft or in-process envelope. <!-- std notice DEVDOCS-114911 --> <ds-inlinemessage kind=\"information\" markdown=\"1\"> It's easy to confuse envelope attachments, which are developer-only files associated with an envelope, with signer attachments. To learn about the different types of attachments, see [Attachments](/docs/esign-rest-api/esign101/concepts/documents/attachments/) in the concept guide. </ds-inlinemessage> <!-- end notice DEVDOCS-114911 -->
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `attachment_id` (String.t): The unique identifier for the attachment.
- `envelope_id` (String.t): The envelope's GUID. Example: `93be49ab-xxxx-xxxx-xxxx-f752070d71ec`
- `opts` (keyword): Optional parameters
- `:body` (Attachment):
### Returns
- `{:ok, DocuSign.Model.EnvelopeAttachmentsResult.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec attachments_put_attachment(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
keyword()
) ::
{:ok, ErrorDetails.t()}
| {:ok, EnvelopeAttachmentsResult.t()}
| {:error, Tesla.Env.t()}
def attachments_put_attachment(connection, account_id, attachment_id, envelope_id, opts \\ []) do
optional_params = %{
:body => :body
}
request =
%{}
|> method(:put)
|> url("/v2.1/accounts/#{account_id}/envelopes/#{envelope_id}/attachments/#{attachment_id}")
|> add_optional_params(optional_params, opts)
|> ensure_body()
|> Enum.to_list()
connection
|> Connection.request(request)
|> evaluate_response([
{200, EnvelopeAttachmentsResult},
{400, ErrorDetails}
])
end
@doc """
Adds one or more envelope attachments to a draft or in-process envelope.
Adds one or more envelope attachments to a draft or in-process envelope. Each envelope can have a maximum of 12 attachments. Envelope attachments are files that an application can include in an envelope. They are not converted to PDF. Envelope attachments are available only through the API. There is no user interface in the Docusign web application for them. For a list of supported file formats, see [Supported File Formats](https://support.docusign.com/s/document-item?bundleId=gbo1643332197980&topicId=xln1578456261162.html). <!-- std notice DEVDOCS-114911 --> <ds-inlinemessage kind=\"information\" markdown=\"1\"> It's easy to confuse envelope attachments, which are developer-only files associated with an envelope, with signer attachments. To learn about the different types of attachments, see [Attachments](/docs/esign-rest-api/esign101/concepts/documents/attachments/) in the concept guide. </ds-inlinemessage> <!-- end notice DEVDOCS-114911 -->
### 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. Example: `93be49ab-xxxx-xxxx-xxxx-f752070d71ec`
- `opts` (keyword): Optional parameters
- `:body` (EnvelopeAttachmentsRequest):
### Returns
- `{:ok, DocuSign.Model.EnvelopeAttachmentsResult.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec attachments_put_attachments(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, ErrorDetails.t()}
| {:ok, EnvelopeAttachmentsResult.t()}
| {:error, Tesla.Env.t()}
def attachments_put_attachments(connection, account_id, envelope_id, opts \\ []) do
optional_params = %{
:body => :body
}
request =
%{}
|> method(:put)
|> url("/v2.1/accounts/#{account_id}/envelopes/#{envelope_id}/attachments")
|> add_optional_params(optional_params, opts)
|> ensure_body()
|> Enum.to_list()
connection
|> Connection.request(request)
|> evaluate_response([
{200, EnvelopeAttachmentsResult},
{400, ErrorDetails}
])
end
end