Current section
Files
Jump to
Current section
Files
lib/docusign/api/envelope_attachments.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.EnvelopeAttachments do
@moduledoc """
API calls for all endpoints tagged `EnvelopeAttachments`.
"""
alias DocuSign.Connection
import DocuSign.RequestBuilder
@doc """
Delete one or more attachments from a DRAFT envelope.
## 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_attachments_request (EnvelopeAttachmentsRequest):
## Returns
{:ok, %DocuSign.Model.EnvelopeAttachmentsResult{}} on success
{:error, info} on failure
"""
@spec attachments_delete_attachments(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, DocuSign.Model.EnvelopeAttachmentsResult.t()} | {:error, Tesla.Env.t()}
def attachments_delete_attachments(connection, account_id, envelope_id, opts \\ []) do
optional_params = %{
envelopeAttachmentsRequest: :body
}
%{}
|> method(:delete)
|> url("/v2/accounts/#{account_id}/envelopes/#{envelope_id}/attachments")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%DocuSign.Model.EnvelopeAttachmentsResult{})
end
@doc """
Retrieves an attachment from the envelope.
## Parameters
- connection (DocuSign.Connection): Connection to server
- account_id (String.t): The external account number (int) or account ID Guid.
- attachment_id (String.t):
- envelope_id (String.t): The envelope's GUID. Eg 93be49ab-afa0-4adf-933c-f752070d71ec
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, %{}} on success
{:error, info} on failure
"""
@spec attachments_get_attachment(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
keyword()
) :: {:ok, nil} | {:error, Tesla.Env.t()}
def attachments_get_attachment(connection, account_id, attachment_id, envelope_id, _opts \\ []) do
%{}
|> method(:get)
|> url("/v2/accounts/#{account_id}/envelopes/#{envelope_id}/attachments/#{attachment_id}")
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(false)
end
@doc """
Returns a list of attachments associated with the specified envelope
## 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
## Returns
{:ok, %DocuSign.Model.EnvelopeAttachmentsResult{}} on success
{:error, info} on failure
"""
@spec attachments_get_attachments(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, DocuSign.Model.EnvelopeAttachmentsResult.t()} | {:error, Tesla.Env.t()}
def attachments_get_attachments(connection, account_id, envelope_id, _opts \\ []) do
%{}
|> method(:get)
|> url("/v2/accounts/#{account_id}/envelopes/#{envelope_id}/attachments")
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%DocuSign.Model.EnvelopeAttachmentsResult{})
end
@doc """
Add an attachment to a DRAFT or IN-PROCESS envelope.
## Parameters
- connection (DocuSign.Connection): Connection to server
- account_id (String.t): The external account number (int) or account ID Guid.
- attachment_id (String.t):
- envelope_id (String.t): The envelope's GUID. Eg 93be49ab-afa0-4adf-933c-f752070d71ec
- opts (KeywordList): [optional] Optional parameters
- :attachment (Attachment):
## Returns
{:ok, %DocuSign.Model.EnvelopeAttachmentsResult{}} on success
{:error, info} on failure
"""
@spec attachments_put_attachment(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
keyword()
) :: {:ok, DocuSign.Model.EnvelopeAttachmentsResult.t()} | {:error, Tesla.Env.t()}
def attachments_put_attachment(connection, account_id, attachment_id, envelope_id, opts \\ []) do
optional_params = %{
attachment: :body
}
%{}
|> method(:put)
|> url("/v2/accounts/#{account_id}/envelopes/#{envelope_id}/attachments/#{attachment_id}")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%DocuSign.Model.EnvelopeAttachmentsResult{})
end
@doc """
Add one or more attachments to a DRAFT or IN-PROCESS envelope.
Supported attachment formats include: .asp, .bmp, .csv, .doc, .docm, .docx, .dot, .dotm, .dotx, .gif, .htm, .html, .jpeg, .jpg, .msg, .pdf, .png, .pot, .potx, .pps, .ppt, .pptm, .pptx, .ps, .rtf, .tif, .tiff, .txt, .wpd, .xls, .xlsm, .xlsx, .xml, and .xps. For more information on supported file formats please see [Supported File Formats](https://support.docusign.com/guides/ndse-user-guide-supported-file-formats).
## 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_attachments_request (EnvelopeAttachmentsRequest):
## Returns
{:ok, %DocuSign.Model.EnvelopeAttachmentsResult{}} on success
{:error, info} on failure
"""
@spec attachments_put_attachments(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, DocuSign.Model.EnvelopeAttachmentsResult.t()} | {:error, Tesla.Env.t()}
def attachments_put_attachments(connection, account_id, envelope_id, opts \\ []) do
optional_params = %{
envelopeAttachmentsRequest: :body
}
%{}
|> method(:put)
|> url("/v2/accounts/#{account_id}/envelopes/#{envelope_id}/attachments")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%DocuSign.Model.EnvelopeAttachmentsResult{})
end
end