Current section
Files
Jump to
Current section
Files
lib/docusign/api/user_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.UserProfiles do
@moduledoc """
API calls for all endpoints tagged `UserProfiles`.
"""
alias DocuSign.Connection
import DocuSign.RequestBuilder
@doc """
Retrieves the user profile for a specified user.
Retrieves the user profile information, the privacy settings and personal information (address, phone number, etc.) for the specified user. The userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the specified account.
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `user_id` (String.t): The ID of the user to access. **Note:** Users can only access their own information. A user, even one with Admin rights, cannot access another user's settings.
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, DocuSign.Model.UserProfile.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec user_profile_get_profile(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, DocuSign.Model.ErrorDetails.t()}
| {:ok, DocuSign.Model.UserProfile.t()}
| {:error, Tesla.Env.t()}
def user_profile_get_profile(connection, account_id, user_id, _opts \\ []) do
request =
%{}
|> method(:get)
|> url("/v2.1/accounts/#{account_id}/users/#{user_id}/profile")
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, %DocuSign.Model.UserProfile{}},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
@doc """
Updates the user profile information for the specified user.
Updates the user's detail information, profile information, privacy settings, and personal information in the user ID card. You can also change a user's name by changing the information in the `userDetails` property. When changing a user's name, you can either change the information in the `userName` property OR change the information in `firstName`, `middleName`, `lastName, suffixName`, and `title` properties. Changes to `firstName`, `middleName`, `lastName`, `suffixName`, and `title` properties take precedence over changes to the `userName` property.
### Parameters
- `connection` (DocuSign.Connection): Connection to server
- `account_id` (String.t): The external account number (int) or account ID GUID.
- `user_id` (String.t): The ID of the user to access. **Note:** Users can only access their own information. A user, even one with Admin rights, cannot access another user's settings.
- `opts` (keyword): Optional parameters
- `:body` (UserProfile):
### Returns
- `{:ok, nil}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec user_profile_put_profile(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
{:ok, nil} | {:ok, DocuSign.Model.ErrorDetails.t()} | {:error, Tesla.Env.t()}
def user_profile_put_profile(connection, account_id, user_id, opts \\ []) do
optional_params = %{
:body => :body
}
request =
%{}
|> method(:put)
|> url("/v2.1/accounts/#{account_id}/users/#{user_id}/profile")
|> add_optional_params(optional_params, opts)
|> ensure_body()
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, false},
{400, %DocuSign.Model.ErrorDetails{}}
])
end
end