Current section

Files

Jump to
docusign lib docusign api account_watermarks.ex
Raw

lib/docusign/api/account_watermarks.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.AccountWatermarks do
@moduledoc """
API calls for all endpoints tagged `AccountWatermarks`.
"""
import DocuSign.RequestBuilder
alias DocuSign.Connection
alias DocuSign.Model.ErrorDetails
alias DocuSign.Model.Watermark
@doc """
Get watermark information.
Enables you to preview a watermark specified by the request.
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, DocuSign.Model.Watermark.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec watermark_get_watermark(DocuSign.Connection.t(), String.t(), keyword()) ::
{:ok, Watermark.t()}
| {:ok, ErrorDetails.t()}
| {:error, Tesla.Env.t()}
def watermark_get_watermark(connection, account_id, _opts \\ []) do
request =
%{}
|> method(:get)
|> url("/v2.1/accounts/#{account_id}/watermark")
|> Enum.to_list()
connection
|> Connection.request(request)
|> evaluate_response([
{200, Watermark},
{400, ErrorDetails}
])
end
@doc """
Get watermark preview.
Update the watermark for the account. **Note:** Many of the request fields must be set to specific values. If you use an invalid value for one of these fields, the endpoint may return 200 OK but set the field to a default value. See the request body for more information.
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `opts` (keyword): Optional parameters
- `:body` (Watermark): When **true,** the account has the watermark feature enabled, and the envelope is not complete, then the watermark for the account is added to the PDF documents. This option can remove the watermark.
### Returns
- `{:ok, DocuSign.Model.Watermark.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec watermark_preview_put_watermark_preview(DocuSign.Connection.t(), String.t(), keyword()) ::
{:ok, Watermark.t()}
| {:ok, ErrorDetails.t()}
| {:error, Tesla.Env.t()}
def watermark_preview_put_watermark_preview(connection, account_id, opts \\ []) do
optional_params = %{
:body => :body
}
request =
%{}
|> method(:put)
|> url("/v2.1/accounts/#{account_id}/watermark/preview")
|> add_optional_params(optional_params, opts)
|> ensure_body()
|> Enum.to_list()
connection
|> Connection.request(request)
|> evaluate_response([
{200, Watermark},
{400, ErrorDetails}
])
end
@doc """
Update watermark information.
Returns information about the watermark for the account.
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `opts` (keyword): Optional parameters
- `:body` (Watermark): When **true,** the account has the watermark feature enabled, and the envelope is not complete, then the watermark for the account is added to the PDF documents. This option can remove the watermark.
### Returns
- `{:ok, DocuSign.Model.Watermark.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec watermark_put_watermark(DocuSign.Connection.t(), String.t(), keyword()) ::
{:ok, Watermark.t()}
| {:ok, ErrorDetails.t()}
| {:error, Tesla.Env.t()}
def watermark_put_watermark(connection, account_id, opts \\ []) do
optional_params = %{
:body => :body
}
request =
%{}
|> method(:put)
|> url("/v2.1/accounts/#{account_id}/watermark")
|> add_optional_params(optional_params, opts)
|> ensure_body()
|> Enum.to_list()
connection
|> Connection.request(request)
|> evaluate_response([
{200, Watermark},
{400, ErrorDetails}
])
end
end