Current section
Files
Jump to
Current section
Files
lib/docusign/api/account_permission_profiles.ex
# NOTE: This file is auto generated by OpenAPI Generator 6.2.1 (https://openapi-generator.tech).
# Do not edit this file manually.
defmodule DocuSign.Api.AccountPermissionProfiles do
@moduledoc """
API calls for all endpoints tagged `AccountPermissionProfiles`.
"""
alias DocuSign.Connection
import DocuSign.RequestBuilder
@doc """
Deletes a permission profile from an account.
This method deletes a permission profile from an account. To delete a permission profile, it must not have any users associated with it. When you use this method to delete a permission profile, you can reassign the users associated with it to a new permission profile at the same time by using the `move_users_to` query parameter. ### Related topics - [How to delete a permission profile](/docs/esign-rest-api/how-to/permission-profile-deleting/)
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `permission_profile_id` (String.t): The ID of the permission profile. Use [AccountPermissionProfiles: list](/docs/esign-rest-api/reference/accounts/accountpermissionprofiles/list/) to get a list of permission profiles and their IDs. You can also download a CSV file of all permission profiles and their IDs from the **Settings > Permission Profiles** page of your eSignature account page.
- `opts` (keyword): Optional parameters
- `:move_users_to` (String.t):
### Returns
- `{:ok, nil}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec permission_profiles_delete_permission_profiles(
Tesla.Env.client(),
String.t(),
String.t(),
keyword()
) :: {:ok, nil} | {:ok, DocuSign.Model.ErrorDetails.t()} | {:error, Tesla.Env.t()}
def permission_profiles_delete_permission_profiles(
connection,
account_id,
permission_profile_id,
opts \\ []
) do
optional_params = %{
:move_users_to => :query
}
request =
%{}
|> method(:delete)
|> url("/v2.1/accounts/#{account_id}/permission_profiles/#{permission_profile_id}")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, false},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Returns a permission profile for an account.
This method returns information about a specific permission profile that is associated with an account. ### Related topics - [How to set a permission profile](/docs/esign-rest-api/how-to/permission-profile-setting/)
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `permission_profile_id` (String.t): The ID of the permission profile. Use [AccountPermissionProfiles: list](/docs/esign-rest-api/reference/accounts/accountpermissionprofiles/list/) to get a list of permission profiles and their IDs. You can also download a CSV file of all permission profiles and their IDs from the **Settings > Permission Profiles** page of your eSignature account page.
- `opts` (keyword): Optional parameters
- `:include` (String.t): A comma-separated list of additional properties to return in the response. The only valid value for this request is `metadata`, which returns metadata indicating whether the properties associated with the account permission profile are editable.
### Returns
- `{:ok, DocuSign.Model.PermissionProfile.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec permission_profiles_get_permission_profile(
Tesla.Env.client(),
String.t(),
String.t(),
keyword()
) ::
{:ok, DocuSign.Model.ErrorDetails.t()}
| {:ok, DocuSign.Model.PermissionProfile.t()}
| {:error, Tesla.Env.t()}
def permission_profiles_get_permission_profile(
connection,
account_id,
permission_profile_id,
opts \\ []
) do
optional_params = %{
:include => :query
}
request =
%{}
|> method(:get)
|> url("/v2.1/accounts/#{account_id}/permission_profiles/#{permission_profile_id}")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %DocuSign.Model.PermissionProfile{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Gets a list of permission profiles.
This method returns a list of permission profiles that are associated with an account. Example: ```json { \"permissionProfiles\": [ { \"permissionProfileId\": \"1665536\", \"permissionProfileName\": \"Account Administrator\", \"modifiedDateTime\": \"2018-03-26T03:54:40.4470000Z\", \"modifiedByUsername\": \"\" }, { \"permissionProfileId\": \"1665537\", \"permissionProfileName\": \"DocuSign Sender\", \"modifiedDateTime\": \"2018-03-26T03:54:40.4470000Z\", \"modifiedByUsername\": \"\" }, { \"permissionProfileId\": \"1665538\", \"permissionProfileName\": \"DocuSign Viewer\", \"modifiedDateTime\": \"2016-06-02T01:53:15.6830000Z\", \"modifiedByUsername\": \"\" }, { \"permissionProfileId\": \"10325926\", \"permissionProfileName\": \"DS Manage Company Member Accounts\", \"modifiedDateTime\": \"2020-05-15T00:28:36.8230000Z\", \"modifiedByUsername\": \"Nat Irving\" } ] } ```
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `opts` (keyword): Optional parameters
- `:include` (String.t): A comma-separated list of additional properties to return in the response. Valid values are: - `user_count`: The total number of users associated with the permission profile. - `closed_users`: Includes closed users in the `user_count`. - `account_management`: The account management settings. - `metadata`: Metadata indicating whether the properties associated with the account permission profile are editable. Example: `user_count,closed_users`
### Returns
- `{:ok, DocuSign.Model.PermissionProfileInformation.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec permission_profiles_get_permission_profiles(Tesla.Env.client(), String.t(), keyword()) ::
{:ok, DocuSign.Model.PermissionProfileInformation.t()}
| {:ok, DocuSign.Model.ErrorDetails.t()}
| {:error, Tesla.Env.t()}
def permission_profiles_get_permission_profiles(connection, account_id, opts \\ []) do
optional_params = %{
:include => :query
}
request =
%{}
|> method(:get)
|> url("/v2.1/accounts/#{account_id}/permission_profiles")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %DocuSign.Model.PermissionProfileInformation{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Creates a new permission profile for an account.
This method creates a new permission profile for an account. ### Related topics - [How to create a permission profile](/docs/esign-rest-api/how-to/permission-profile-creating/)
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `opts` (keyword): Optional parameters
- `:include` (String.t): A comma-separated list of additional properties to return in the response. The only valid value for this request is `metadata`, which returns metadata indicating whether the properties associated with the account permission profile are editable.
- `:body` (PermissionProfile):
### Returns
- `{:ok, DocuSign.Model.PermissionProfile.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec permission_profiles_post_permission_profiles(Tesla.Env.client(), String.t(), keyword()) ::
{:ok, DocuSign.Model.ErrorDetails.t()}
| {:ok, DocuSign.Model.PermissionProfile.t()}
| {:error, Tesla.Env.t()}
def permission_profiles_post_permission_profiles(connection, account_id, opts \\ []) do
optional_params = %{
:include => :query,
:body => :body
}
request =
%{}
|> method(:post)
|> url("/v2.1/accounts/#{account_id}/permission_profiles")
|> add_optional_params(optional_params, opts)
|> ensure_body()
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{201, %DocuSign.Model.PermissionProfile{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Updates a permission profile.
This method updates an account permission profile. ### Related topics - [How to update individual permission settings](/docs/esign-rest-api/how-to/permission-profile-updating/)
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `permission_profile_id` (String.t): The ID of the permission profile. Use [AccountPermissionProfiles: list](/docs/esign-rest-api/reference/accounts/accountpermissionprofiles/list/) to get a list of permission profiles and their IDs. You can also download a CSV file of all permission profiles and their IDs from the **Settings > Permission Profiles** page of your eSignature account page.
- `opts` (keyword): Optional parameters
- `:include` (String.t): A comma-separated list of additional properties to return in the response. The only valid value for this request is `metadata`, which returns metadata indicating whether the properties associated with the account permission profile are editable.
- `:body` (PermissionProfile):
### Returns
- `{:ok, DocuSign.Model.PermissionProfile.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec permission_profiles_put_permission_profiles(
Tesla.Env.client(),
String.t(),
String.t(),
keyword()
) ::
{:ok, DocuSign.Model.ErrorDetails.t()}
| {:ok, DocuSign.Model.PermissionProfile.t()}
| {:error, Tesla.Env.t()}
def permission_profiles_put_permission_profiles(
connection,
account_id,
permission_profile_id,
opts \\ []
) do
optional_params = %{
:include => :query,
:body => :body
}
request =
%{}
|> method(:put)
|> url("/v2.1/accounts/#{account_id}/permission_profiles/#{permission_profile_id}")
|> add_optional_params(optional_params, opts)
|> ensure_body()
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %DocuSign.Model.PermissionProfile{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
end