Current section
Files
Jump to
Current section
Files
lib/docusign/api/account_brands.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.AccountBrands do
@moduledoc """
API calls for all endpoints tagged `AccountBrands`.
"""
alias DocuSign.Connection
import DocuSign.RequestBuilder
@doc """
Deletes a brand.
This method deletes a brand from an account. **Note:** Branding for either signing or sending must be enabled for the account (`canSelfBrandSend` , `canSelfBrandSign`, or both of these account settings must be **true**).
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `brand_id` (String.t): The ID of the brand.
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, nil}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec brand_delete_brand(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, nil} | {:ok, DocuSign.Model.ErrorDetails.t()} | {:error, Tesla.Env.t()}
def brand_delete_brand(connection, account_id, brand_id, _opts \\ []) do
request =
%{}
|> method(:delete)
|> url("/v2.1/accounts/#{account_id}/brands/#{brand_id}")
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, false},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Exports a brand.
This method exports information about a brand to an XML file. **Note:** Branding for either signing or sending must be enabled for the account (`canSelfBrandSend` , `canSelfBrandSign`, or both of these account settings must be **true**).
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `brand_id` (String.t): The ID of the brand.
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, nil}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec brand_export_get_brand_export_file(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, nil} | {:ok, DocuSign.Model.ErrorDetails.t()} | {:error, Tesla.Env.t()}
def brand_export_get_brand_export_file(connection, account_id, brand_id, _opts \\ []) do
request =
%{}
|> method(:get)
|> url("/v2.1/accounts/#{account_id}/brands/#{brand_id}/file")
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, false},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Gets information about a brand.
This method returns details about an account brand. **Note:** Branding for either signing or sending must be enabled for the account (`canSelfBrandSend` , `canSelfBrandSign`, or both of these account settings must be **true**).
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `brand_id` (String.t): The ID of the brand.
- `opts` (keyword): Optional parameters
- `:include_external_references` (String.t): When **true,** the landing pages and links associated with the brand are included in the response.
- `:include_logos` (String.t): When **true,** the URIs for the logos associated with the brand are included in the response.
### Returns
- `{:ok, DocuSign.Model.Brand.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec brand_get_brand(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, DocuSign.Model.ErrorDetails.t()}
| {:ok, DocuSign.Model.Brand.t()}
| {:error, Tesla.Env.t()}
def brand_get_brand(connection, account_id, brand_id, opts \\ []) do
optional_params = %{
:include_external_references => :query,
:include_logos => :query
}
request =
%{}
|> method(:get)
|> url("/v2.1/accounts/#{account_id}/brands/#{brand_id}")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %DocuSign.Model.Brand{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Deletes a brand logo.
This method deletes a single logo from an account brand. **Note:** Branding for either signing or sending must be enabled for the account (`canSelfBrandSend` , `canSelfBrandSign`, or both of these account settings must be **true**).
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `brand_id` (String.t): The ID of the brand.
- `logo_type` (String.t): The type of logo. Valid values are: - `primary` - `secondary` - `email`
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, nil}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec brand_logo_delete_brand_logo(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
keyword()
) :: {:ok, nil} | {:ok, DocuSign.Model.ErrorDetails.t()} | {:error, Tesla.Env.t()}
def brand_logo_delete_brand_logo(connection, account_id, brand_id, logo_type, _opts \\ []) do
request =
%{}
|> method(:delete)
|> url("/v2.1/accounts/#{account_id}/brands/#{brand_id}/logos/#{logo_type}")
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, false},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Gets a brand logo.
This method returns a specific logo that is used in a brand. **Note:** Branding for either signing or sending must be enabled for the account (`canSelfBrandSend` , `canSelfBrandSign`, or both of these account settings must be **true**).
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `brand_id` (String.t): The ID of the brand.
- `logo_type` (String.t): The type of logo. Valid values are: - `primary` - `secondary` - `email`
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, String.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec brand_logo_get_brand_logo(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
keyword()
) :: {:ok, DocuSign.Model.ErrorDetails.t()} | {:ok, String.t()} | {:error, Tesla.Env.t()}
def brand_logo_get_brand_logo(connection, account_id, brand_id, logo_type, _opts \\ []) do
request =
%{}
|> method(:get)
|> url("/v2.1/accounts/#{account_id}/brands/#{brand_id}/logos/#{logo_type}")
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, false},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Updates a brand logo.
This method updates a single brand logo. You pass in the new version of the resource in the `Content-Disposition` header. Example: `Content-Disposition: form-data; name=\"file\"; filename=\"logo.jpg\"` **Note:** Branding for either signing or sending must be enabled for the account (`canSelfBrandSend` , `canSelfBrandSign`, or both of these account settings must be **true**).
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `brand_id` (String.t): The ID of the brand.
- `logo_type` (String.t): The type of logo. Valid values are: - `primary` - `secondary` - `email`
- `logo_file_bytes` (String.t): Brand logo binary Stream. Supported formats: JPG, GIF, PNG. Maximum file size: 300 KB. Recommended dimensions: 296 x 76 pixels (larger images will be resized). Changes may take up to one hour to display in all places
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, nil}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec brand_logo_put_brand_logo(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
String.t(),
keyword()
) :: {:ok, nil} | {:ok, DocuSign.Model.ErrorDetails.t()} | {:error, Tesla.Env.t()}
def brand_logo_put_brand_logo(
connection,
account_id,
brand_id,
logo_type,
logo_file_bytes,
_opts \\ []
) do
request =
%{}
|> method(:put)
|> url("/v2.1/accounts/#{account_id}/brands/#{brand_id}/logos/#{logo_type}")
|> add_param(:body, :body, logo_file_bytes)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, false},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Updates an existing brand.
This method updates an account brand. **Note:** Branding for either signing or sending must be enabled for the account (`canSelfBrandSend` , `canSelfBrandSign`, or both of these account settings must be **true**).
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `brand_id` (String.t): The ID of the brand.
- `opts` (keyword): Optional parameters
- `:replace_brand` (String.t): When **true,** replaces the brand instead of updating it. The only unchanged value is the brand ID. The request body must be XML. The default value is **false.**
- `:body` (Brand):
### Returns
- `{:ok, DocuSign.Model.Brand.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec brand_put_brand(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, DocuSign.Model.ErrorDetails.t()}
| {:ok, DocuSign.Model.Brand.t()}
| {:error, Tesla.Env.t()}
def brand_put_brand(connection, account_id, brand_id, opts \\ []) do
optional_params = %{
:replace_brand => :query,
:body => :body
}
request =
%{}
|> method(:put)
|> url("/v2.1/accounts/#{account_id}/brands/#{brand_id}")
|> add_optional_params(optional_params, opts)
|> ensure_body()
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %DocuSign.Model.Brand{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Returns a branding resource file.
This method returns a specific branding resource file. A brand uses a set of brand resource files to control the sending, signing, email message, and captive (embedded) signing experiences. You can modify the default email messages and formats in these files and upload them to your brand to customize the user experience. **Important:** When you upload a modified resource file, only the elements that differ from the master resource file are saved as your resource file. Similarly, when you download your resource files, only the modified elements are included in the file. **Note:** Branding for either signing or sending must be enabled for the account (`canSelfBrandSend` , `canSelfBrandSign`, or both of these account settings must be **true**).
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `brand_id` (String.t): The ID of the brand.
- `resource_content_type` (String.t): The type of brand resource file to return. Valid values are: - `sending` - `signing` - `email` - `signing_captive`
- `opts` (keyword): Optional parameters
- `:langcode` (String.t): The ISO 3166-1 alpha-2 codes for the languages that the brand supports.
- `:return_master` (String.t): Specifies which resource file data to return. When **true,** only the master resource file is returned. When **false,** only the elements that you modified are returned.
### Returns
- `{:ok, nil}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec brand_resources_get_brand_resources(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
keyword()
) :: {:ok, nil} | {:ok, DocuSign.Model.ErrorDetails.t()} | {:error, Tesla.Env.t()}
def brand_resources_get_brand_resources(
connection,
account_id,
brand_id,
resource_content_type,
opts \\ []
) do
optional_params = %{
:langcode => :query,
:return_master => :query
}
request =
%{}
|> method(:get)
|> url("/v2.1/accounts/#{account_id}/brands/#{brand_id}/resources/#{resource_content_type}")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, false},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Returns metadata about the branding resources for an account.
This method returns metadata about the branding resources that are associated with an account. **Note:** Branding for either signing or sending must be enabled for the account (`canSelfBrandSend` , `canSelfBrandSign`, or both of these account settings must be **true**).
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `brand_id` (String.t): The ID of the brand.
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, DocuSign.Model.BrandResourcesList.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec brand_resources_get_brand_resources_list(
Tesla.Env.client(),
String.t(),
String.t(),
keyword()
) ::
{:ok, DocuSign.Model.BrandResourcesList.t()}
| {:ok, DocuSign.Model.ErrorDetails.t()}
| {:error, Tesla.Env.t()}
def brand_resources_get_brand_resources_list(connection, account_id, brand_id, _opts \\ []) do
request =
%{}
|> method(:get)
|> url("/v2.1/accounts/#{account_id}/brands/#{brand_id}/resources")
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %DocuSign.Model.BrandResourcesList{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Updates a branding resource file.
This method updates a branding resource file. You pass in the new version of the resource file in the `Content-Disposition` header. Example: `Content-Disposition: form-data; name=\"file\"; filename=\"DocuSign_SigningResource_4328673.xml\"` **Note:** Branding for either signing or sending must be enabled for the account (`canSelfBrandSend` , `canSelfBrandSign`, or both of these account settings must be **true**). **Important:** Customizing resource files is an advanced branding configuration option which can significantly impact your account, and should be done only by someone with expertise in XML and HTML. The master resource files are subject to change without notice. If you customize your resource files, after each release, DocuSign recommends you review any changes and update your custom files as needed. When you upload a modified resource file, only the elements that differ from the master resource file are saved as your resource file. Similarly, when you download your resource files, only the modified elements are included in the file.
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `brand_id` (String.t): The ID of the brand.
- `resource_content_type` (String.t): The type of brand resource file that you are updating. Valid values are: - `sending` - `signing` - `email` - `signing_captive`
- `file_periodxml` (String.t): Brand resource XML file.
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, DocuSign.Model.BrandResources.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec brand_resources_put_brand_resources(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
String.t(),
keyword()
) ::
{:ok, DocuSign.Model.BrandResources.t()}
| {:ok, DocuSign.Model.ErrorDetails.t()}
| {:error, Tesla.Env.t()}
def brand_resources_put_brand_resources(
connection,
account_id,
brand_id,
resource_content_type,
file_periodxml,
_opts \\ []
) do
request =
%{}
|> method(:put)
|> url("/v2.1/accounts/#{account_id}/brands/#{brand_id}/resources/#{resource_content_type}")
|> add_param(:file, :"file.xml", file_periodxml)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %DocuSign.Model.BrandResources{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Deletes one or more brand profiles.
This method deletes one or more brand profiles from an account, based on the brand IDs that you include in the `brandsRequest`. Either or both of the following settings must be enabled for the account to use this method: - `canSelfBrandSign` - `canSelfBrandSend` ### Related topics - [How to create a brand](/docs/esign-rest-api/how-to/create-brand/)
### 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` (BrandsRequest):
### Returns
- `{:ok, DocuSign.Model.AccountBrands.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec brands_delete_brands(Tesla.Env.client(), String.t(), keyword()) ::
{:ok, DocuSign.Model.AccountBrands.t()}
| {:ok, DocuSign.Model.ErrorDetails.t()}
| {:error, Tesla.Env.t()}
def brands_delete_brands(connection, account_id, opts \\ []) do
optional_params = %{
:body => :body
}
request =
%{}
|> method(:delete)
|> url("/v2.1/accounts/#{account_id}/brands")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %DocuSign.Model.AccountBrands{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Gets a list of brands.
This method returns details about all of the brands associated with an account, including the default brand profiles. Either or both of the following settings must be enabled for the account to use this method: - `canSelfBrandSign` - `canSelfBrandSend` ### Related topics - [How to create a brand](/docs/esign-rest-api/how-to/create-brand/)
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `opts` (keyword): Optional parameters
- `:exclude_distributor_brand` (String.t): When **true,** excludes distributor brand information from the response set.
- `:include_logos` (String.t): When **true,** returns the logos associated with the brand.
### Returns
- `{:ok, DocuSign.Model.AccountBrands.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec brands_get_brands(Tesla.Env.client(), String.t(), keyword()) ::
{:ok, DocuSign.Model.AccountBrands.t()}
| {:ok, DocuSign.Model.ErrorDetails.t()}
| {:error, Tesla.Env.t()}
def brands_get_brands(connection, account_id, opts \\ []) do
optional_params = %{
:exclude_distributor_brand => :query,
:include_logos => :query
}
request =
%{}
|> method(:get)
|> url("/v2.1/accounts/#{account_id}/brands")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %DocuSign.Model.AccountBrands{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Creates one or more brand profiles for an account.
This method creates one or more brand profile files for an account. To specify logos for the brand, use the [AccountBrands: updateLogo](/docs/esign-rest-api/reference/accounts/accountbrands/updatelogo/) method after you create the brand. Either or both of the following settings must be enabled for the account to use this method: - `canSelfBrandSign` - `canSelfBrandSend` ### Related topics - [How to create a brand](/docs/esign-rest-api/how-to/create-brand/)
### 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` (Brand):
### Returns
- `{:ok, DocuSign.Model.AccountBrands.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec brands_post_brands(Tesla.Env.client(), String.t(), keyword()) ::
{:ok, DocuSign.Model.AccountBrands.t()}
| {:ok, DocuSign.Model.ErrorDetails.t()}
| {:error, Tesla.Env.t()}
def brands_post_brands(connection, account_id, opts \\ []) do
optional_params = %{
:body => :body
}
request =
%{}
|> method(:post)
|> url("/v2.1/accounts/#{account_id}/brands")
|> add_optional_params(optional_params, opts)
|> ensure_body()
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{201, %DocuSign.Model.AccountBrands{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
end