# 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.EnvelopeRecipientTabs do @moduledoc """ API calls for all endpoints tagged `EnvelopeRecipientTabs`. """ alias DocuSign.Connection import DocuSign.RequestBuilder @doc """ Deletes the tabs associated with a recipient. **Note:** It is an error to delete a tab that has the `templateLocked` property set to true. This property corresponds to the **Restrict changes** option in the web app. Deletes one or more tabs associated with a recipient in a draft envelope. ### 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` - `recipient_id` (String.t): A local reference that senders use to map recipients to other objects, such as specific document tabs. Within an envelope, each `recipientId` must be unique, but there is no uniqueness requirement across envelopes. For example, many envelopes assign the first recipient a `recipientId` of `1`. - `opts` (keyword): Optional parameters - `:body` (EnvelopeRecipientTabs): ### Returns - `{:ok, DocuSign.Model.EnvelopeRecipientTabs.t}` on success - `{:error, Tesla.Env.t}` on failure """ @spec recipients_delete_recipient_tabs( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, DocuSign.Model.EnvelopeRecipientTabs.t()} | {:ok, DocuSign.Model.ErrorDetails.t()} | {:error, Tesla.Env.t()} def recipients_delete_recipient_tabs( connection, account_id, envelope_id, recipient_id, opts \\ [] ) do optional_params = %{ :body => :body } request = %{} |> method(:delete) |> url( "/v2.1/accounts/#{account_id}/envelopes/#{envelope_id}/recipients/#{recipient_id}/tabs" ) |> add_optional_params(optional_params, opts) |> Enum.into([]) connection |> Connection.request(request) |> evaluate_response([ {200, %DocuSign.Model.EnvelopeRecipientTabs{}}, {400, %DocuSign.Model.ErrorDetails{}} ]) end @doc """ Gets the tabs information for a signer or sign-in-person recipient in an envelope. Retrieves information about the tabs associated with a recipient. You can make a single API call to get all the tab values and information from a given, completed envelope in addition to draft ones. Tab values can be retrieved by using the [EnvelopeRecipients:list method](/docs/esign-rest-api/reference/envelopes/enveloperecipients/list/) with query parameter `include_tabs` set to **true.** ### 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` - `recipient_id` (String.t): A local reference that senders use to map recipients to other objects, such as specific document tabs. Within an envelope, each `recipientId` must be unique, but there is no uniqueness requirement across envelopes. For example, many envelopes assign the first recipient a `recipientId` of `1`. - `opts` (keyword): Optional parameters - `:include_anchor_tab_locations` (String.t): When **true,** all tabs with anchor tab properties are included in the response. The default value is **false.** - `:include_metadata` (String.t): When **true,** the response includes metadata indicating which properties are editable. ### Returns - `{:ok, DocuSign.Model.EnvelopeRecipientTabs.t}` on success - `{:error, Tesla.Env.t}` on failure """ @spec recipients_get_recipient_tabs( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, DocuSign.Model.EnvelopeRecipientTabs.t()} | {:ok, DocuSign.Model.ErrorDetails.t()} | {:error, Tesla.Env.t()} def recipients_get_recipient_tabs(connection, account_id, envelope_id, recipient_id, opts \\ []) do optional_params = %{ :include_anchor_tab_locations => :query, :include_metadata => :query } request = %{} |> method(:get) |> url( "/v2.1/accounts/#{account_id}/envelopes/#{envelope_id}/recipients/#{recipient_id}/tabs" ) |> add_optional_params(optional_params, opts) |> Enum.into([]) connection |> Connection.request(request) |> evaluate_response([ {200, %DocuSign.Model.EnvelopeRecipientTabs{}}, {400, %DocuSign.Model.ErrorDetails{}} ]) end @doc """ Adds tabs for a recipient. Adds one or more tabs for a recipient. ### 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` - `recipient_id` (String.t): A local reference that senders use to map recipients to other objects, such as specific document tabs. Within an envelope, each `recipientId` must be unique, but there is no uniqueness requirement across envelopes. For example, many envelopes assign the first recipient a `recipientId` of `1`. - `opts` (keyword): Optional parameters - `:body` (EnvelopeRecipientTabs): ### Returns - `{:ok, DocuSign.Model.EnvelopeRecipientTabs.t}` on success - `{:error, Tesla.Env.t}` on failure """ @spec recipients_post_recipient_tabs( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, DocuSign.Model.EnvelopeRecipientTabs.t()} | {:ok, DocuSign.Model.ErrorDetails.t()} | {:error, Tesla.Env.t()} def recipients_post_recipient_tabs( connection, account_id, envelope_id, recipient_id, opts \\ [] ) do optional_params = %{ :body => :body } request = %{} |> method(:post) |> url( "/v2.1/accounts/#{account_id}/envelopes/#{envelope_id}/recipients/#{recipient_id}/tabs" ) |> add_optional_params(optional_params, opts) |> ensure_body() |> Enum.into([]) connection |> Connection.request(request) |> evaluate_response([ {201, %DocuSign.Model.EnvelopeRecipientTabs{}}, {400, %DocuSign.Model.ErrorDetails{}} ]) end @doc """ Updates the tabs for a recipient. Updates one or more tabs for a recipient in a draft envelope. A draft envelope is one that is not yet complete. **Note:** It is an error to update a tab that has the `templateLocked` property set to true. This property corresponds to the **Restrict changes** option in the web app. ### 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` - `recipient_id` (String.t): A local reference that senders use to map recipients to other objects, such as specific document tabs. Within an envelope, each `recipientId` must be unique, but there is no uniqueness requirement across envelopes. For example, many envelopes assign the first recipient a `recipientId` of `1`. - `opts` (keyword): Optional parameters - `:body` (EnvelopeRecipientTabs): ### Returns - `{:ok, DocuSign.Model.EnvelopeRecipientTabs.t}` on success - `{:error, Tesla.Env.t}` on failure """ @spec recipients_put_recipient_tabs( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, DocuSign.Model.EnvelopeRecipientTabs.t()} | {:ok, DocuSign.Model.ErrorDetails.t()} | {:error, Tesla.Env.t()} def recipients_put_recipient_tabs(connection, account_id, envelope_id, recipient_id, opts \\ []) do optional_params = %{ :body => :body } request = %{} |> method(:put) |> url( "/v2.1/accounts/#{account_id}/envelopes/#{envelope_id}/recipients/#{recipient_id}/tabs" ) |> add_optional_params(optional_params, opts) |> ensure_body() |> Enum.into([]) connection |> Connection.request(request) |> evaluate_response([ {200, %DocuSign.Model.EnvelopeRecipientTabs{}}, {400, %DocuSign.Model.ErrorDetails{}} ]) end end