Current section
Files
Jump to
Current section
Files
lib/docusign/api/envelope_document_visibility.ex
# NOTE: This file is auto generated by OpenAPI Generator
# https://openapi-generator.tech
# Do not edit this file manually.
defmodule DocuSign.Api.EnvelopeDocumentVisibility do
@moduledoc """
API calls for all endpoints tagged `EnvelopeDocumentVisibility`.
"""
import DocuSign.RequestBuilder
alias DocuSign.Connection
alias DocuSign.Model.DocumentVisibilityList
alias DocuSign.Model.ErrorDetails
@doc """
Returns document visibility for a recipient
This method returns information about document visibility for a recipient.
### 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`
- `recipient_id` (String.t): A local reference used to map recipients to other objects, such as specific document tabs. A `recipientId` must be either an integer or a GUID, and the `recipientId` must be unique within an envelope. For example, many envelopes assign the first recipient a `recipientId` of `1`.
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, DocuSign.Model.DocumentVisibilityList.t}` on success
- `{:error, Req.Response.t}` on failure
"""
@spec recipients_get_recipient_document_visibility(
DocuSign.Connection.t(),
String.t(),
String.t(),
String.t(),
keyword()
) ::
{:ok, DocumentVisibilityList.t()}
| {:error, Req.Response.t()}
def recipients_get_recipient_document_visibility(connection, account_id, envelope_id, recipient_id, _opts \\ []) do
request =
%{}
|> method(:get)
|> url("/v2.1/accounts/#{account_id}/envelopes/#{envelope_id}/recipients/#{recipient_id}/document_visibility")
|> Enum.to_list()
connection
|> Connection.request(request)
|> evaluate_response([
{200, DocumentVisibilityList},
{400, ErrorDetails}
])
end
@doc """
Updates document visibility for a recipient
This method updates document visibility for a recipient. **Note:** A document cannot be hidden from a recipient if the recipient has tabs assigned to them on the document. Carbon Copy, Certified Delivery (Needs to Sign), Editor, and Agent recipients can always see all documents.
### 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`
- `recipient_id` (String.t): A local reference used to map recipients to other objects, such as specific document tabs. A `recipientId` must be either an integer or a GUID, and the `recipientId` must be unique within an envelope. For example, many envelopes assign the first recipient a `recipientId` of `1`.
- `opts` (keyword): Optional parameters
- `:body` (DocumentVisibilityList):
### Returns
- `{:ok, DocuSign.Model.DocumentVisibilityList.t}` on success
- `{:error, Req.Response.t}` on failure
"""
@spec recipients_put_recipient_document_visibility(
DocuSign.Connection.t(),
String.t(),
String.t(),
String.t(),
keyword()
) ::
{:ok, DocumentVisibilityList.t()}
| {:error, Req.Response.t()}
def recipients_put_recipient_document_visibility(connection, account_id, envelope_id, recipient_id, opts \\ []) do
optional_params = %{
:body => :body
}
request =
%{}
|> method(:put)
|> url("/v2.1/accounts/#{account_id}/envelopes/#{envelope_id}/recipients/#{recipient_id}/document_visibility")
|> add_optional_params(optional_params, opts)
|> ensure_body()
|> Enum.to_list()
connection
|> Connection.request(request)
|> evaluate_response([
{200, DocumentVisibilityList},
{400, ErrorDetails}
])
end
@doc """
Updates document visibility for recipients
This method updates document visibility for one or more recipients based on the `recipientId` and `visible` values that you include in the request body. **Note:** A document cannot be hidden from a recipient if the recipient has tabs assigned to them on the document. Carbon Copy, Certified Delivery (Needs to Sign), Editor, and Agent recipients can always see all documents.
### 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` (DocumentVisibilityList):
### Returns
- `{:ok, DocuSign.Model.DocumentVisibilityList.t}` on success
- `{:error, Req.Response.t}` on failure
"""
@spec recipients_put_recipients_document_visibility(DocuSign.Connection.t(), String.t(), String.t(), keyword()) ::
{:ok, DocumentVisibilityList.t()}
| {:error, Req.Response.t()}
def recipients_put_recipients_document_visibility(connection, account_id, envelope_id, opts \\ []) do
optional_params = %{
:body => :body
}
request =
%{}
|> method(:put)
|> url("/v2.1/accounts/#{account_id}/envelopes/#{envelope_id}/recipients/document_visibility")
|> add_optional_params(optional_params, opts)
|> ensure_body()
|> Enum.to_list()
connection
|> Connection.request(request)
|> evaluate_response([
{200, DocumentVisibilityList},
{400, ErrorDetails}
])
end
end