Current section
Files
Jump to
Current section
Files
lib/docusign/api/connect_events.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.ConnectEvents do
@moduledoc """
API calls for all endpoints tagged `ConnectEvents`.
"""
alias DocuSign.Connection
import DocuSign.RequestBuilder
@doc """
Deletes a Connect failure log entry.
Deletes the Connect failure log information for the specified entry. **Note:** To use this function, you must be an account administrator and Connect must be enabled on your account.
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `failure_id` (String.t): The ID of the Connect post failure. Use `all` to delete all failures for the account.
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, map()}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec connect_failures_delete_connect_failure_log(
Tesla.Env.client(),
String.t(),
String.t(),
keyword()
) :: {:ok, Map.t()} | {:ok, DocuSign.Model.ErrorDetails.t()} | {:error, Tesla.Env.t()}
def connect_failures_delete_connect_failure_log(connection, account_id, failure_id, _opts \\ []) do
request =
%{}
|> method(:delete)
|> url("/v2.1/accounts/#{account_id}/connect/failures/#{failure_id}")
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Gets the Connect failure log information.
Retrieves the Connect failure log information. You can use this log to determine which envelopes failed to post, in order to create a republish request. **Note:** To use this function, you must be an account administrator and Connect must be enabled on your 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
- `:from_date` (String.t): The start date for a date range in UTC DateTime format. **Note:** If this property is null, no date filtering is applied.
- `:to_date` (String.t): The end of a search date range in UTC DateTime format. When you use this parameter, only templates created up to this date and time are returned. **Note:** If this property is null, the value defaults to the current date.
### Returns
- `{:ok, DocuSign.Model.ConnectLogs.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec connect_failures_get_connect_logs(Tesla.Env.client(), String.t(), keyword()) ::
{:ok, DocuSign.Model.ErrorDetails.t()}
| {:ok, DocuSign.Model.ConnectLogs.t()}
| {:error, Tesla.Env.t()}
def connect_failures_get_connect_logs(connection, account_id, opts \\ []) do
optional_params = %{
:from_date => :query,
:to_date => :query
}
request =
%{}
|> method(:get)
|> url("/v2.1/accounts/#{account_id}/connect/failures")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %DocuSign.Model.ConnectLogs{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Deletes a specified Connect log entry.
Deletes a specified entry from the Connect Log. **Note:** To use this function, you must be an account administrator and Connect must be enabled on your account.
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `log_id` (String.t): The ID of the Connect log entry.
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, nil}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec connect_log_delete_connect_log(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, nil} | {:ok, DocuSign.Model.ErrorDetails.t()} | {:error, Tesla.Env.t()}
def connect_log_delete_connect_log(connection, account_id, log_id, _opts \\ []) do
request =
%{}
|> method(:delete)
|> url("/v2.1/accounts/#{account_id}/connect/logs/#{log_id}")
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, false},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Deletes a list of Connect log entries.
Deletes a list of Connect log entries for your account. **Note:** To use this function, you must be an account administrator and Connect must be enabled on your 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
### Returns
- `{:ok, nil}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec connect_log_delete_connect_logs(Tesla.Env.client(), String.t(), keyword()) ::
{:ok, nil} | {:ok, DocuSign.Model.ErrorDetails.t()} | {:error, Tesla.Env.t()}
def connect_log_delete_connect_logs(connection, account_id, _opts \\ []) do
request =
%{}
|> method(:delete)
|> url("/v2.1/accounts/#{account_id}/connect/logs")
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, false},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Gets a Connect log entry.
Retrieves the specified Connect log entry for your account. The `enableLog` setting in the Connect configuration must be set to **true** to enable logging. If logging is not enabled, then no log entries are recorded. **Note:** To use this function, you must be an account administrator and Connect must be enabled on your account.
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `log_id` (String.t): The ID of the Connect log entry.
- `opts` (keyword): Optional parameters
- `:additional_info` (String.t): When **true,** the response includes the `connectDebugLog` information.
### Returns
- `{:ok, DocuSign.Model.ConnectLog.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec connect_log_get_connect_log(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, DocuSign.Model.ConnectLog.t()}
| {:ok, DocuSign.Model.ErrorDetails.t()}
| {:error, Tesla.Env.t()}
def connect_log_get_connect_log(connection, account_id, log_id, opts \\ []) do
optional_params = %{
:additional_info => :query
}
request =
%{}
|> method(:get)
|> url("/v2.1/accounts/#{account_id}/connect/logs/#{log_id}")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %DocuSign.Model.ConnectLog{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Gets the Connect log.
Retrieves a list of the 100 most recent connect log entries for your account. The `enableLog` setting in the Connect configuration must be set to **true** to enable logging. If logging is not enabled, then no log entries are recorded. **Note:** To use this function, you must be an account administrator and Connect must be enabled on your 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
- `:from_date` (String.t): The start date for a date range in UTC DateTime format. **Note:** If this property is null, no date filtering is applied.
- `:to_date` (String.t): The end of a search date range in UTC DateTime format. When you use this parameter, only templates created up to this date and time are returned. **Note:** If this property is null, the value defaults to the current date.
### Returns
- `{:ok, DocuSign.Model.ConnectLogs.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec connect_log_get_connect_logs(Tesla.Env.client(), String.t(), keyword()) ::
{:ok, DocuSign.Model.ErrorDetails.t()}
| {:ok, DocuSign.Model.ConnectLogs.t()}
| {:error, Tesla.Env.t()}
def connect_log_get_connect_logs(connection, account_id, opts \\ []) do
optional_params = %{
:from_date => :query,
:to_date => :query
}
request =
%{}
|> method(:get)
|> url("/v2.1/accounts/#{account_id}/connect/logs")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %DocuSign.Model.ConnectLogs{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Republishes Connect information for multiple envelopes.
Republishes Connect information for the specified set of envelopes. The primary use is to republish Connect post failures by including envelope IDs for the envelopes that failed to post in the request. The list of envelope IDs that failed to post correctly can be retrieved by calling to [Connect::listEventLogs](/docs/esign-rest-api/reference/connect/connectevents/list/) retrieve the failure log. **Note:** To use this function, you must be an account administrator and Connect must be enabled on your 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` (ConnectFailureFilter):
### Returns
- `{:ok, DocuSign.Model.ConnectFailureResults.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec connect_publish_put_connect_retry(Tesla.Env.client(), String.t(), keyword()) ::
{:ok, DocuSign.Model.ErrorDetails.t()}
| {:ok, DocuSign.Model.ConnectFailureResults.t()}
| {:error, Tesla.Env.t()}
def connect_publish_put_connect_retry(connection, account_id, opts \\ []) do
optional_params = %{
:body => :body
}
request =
%{}
|> method(:put)
|> url("/v2.1/accounts/#{account_id}/connect/envelopes/retry_queue")
|> add_optional_params(optional_params, opts)
|> ensure_body()
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %DocuSign.Model.ConnectFailureResults{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Republishes Connect information for the specified envelope.
Republishes Connect information for the specified envelope. **Note:** To use this function, you must be an account administrator and Connect must be enabled on your account.
### 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.ConnectFailureResults.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec connect_publish_put_connect_retry_by_envelope(
Tesla.Env.client(),
String.t(),
String.t(),
keyword()
) ::
{:ok, DocuSign.Model.ErrorDetails.t()}
| {:ok, DocuSign.Model.ConnectFailureResults.t()}
| {:error, Tesla.Env.t()}
def connect_publish_put_connect_retry_by_envelope(
connection,
account_id,
envelope_id,
_opts \\ []
) do
request =
%{}
|> method(:put)
|> url("/v2.1/accounts/#{account_id}/connect/envelopes/#{envelope_id}/retry_queue")
|> ensure_body()
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %DocuSign.Model.ConnectFailureResults{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
end