# NOTE: This file is auto generated by OpenAPI Generator 7.12.0 (https://openapi-generator.tech). # Do not edit this file manually. defmodule DocuSign.Api.TemplateDocumentVisibility do @moduledoc """ API calls for all endpoints tagged `TemplateDocumentVisibility`. """ import DocuSign.RequestBuilder alias DocuSign.Connection alias DocuSign.Model.DocumentVisibilityList alias DocuSign.Model.ErrorDetails alias DocuSign.Model.TemplateDocumentVisibilityList @doc """ Returns document visibility for a template recipient This method returns information about document visibility for a template recipient. ### Parameters - `connection` (DocuSign.Connection): Connection to server - `account_id` (String.t): The external account number (int) or account ID GUID. - `recipient_id` (String.t): A local reference used to map recipients to other objects, such as specific document tabs. A `recipientId` must be either an integer or a GUID, and the `recipientId` must be unique within an envelope. For example, many envelopes assign the first recipient a `recipientId` of `1`. - `template_id` (String.t): The ID of the template. - `opts` (keyword): Optional parameters ### Returns - `{:ok, DocuSign.Model.DocumentVisibilityList.t}` on success - `{:error, Tesla.Env.t}` on failure """ @spec recipients_get_template_recipient_document_visibility( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, ErrorDetails.t()} | {:ok, DocumentVisibilityList.t()} | {:error, Tesla.Env.t()} def recipients_get_template_recipient_document_visibility( connection, account_id, recipient_id, template_id, _opts \\ [] ) do request = %{} |> method(:get) |> url("/v2.1/accounts/#{account_id}/templates/#{template_id}/recipients/#{recipient_id}/document_visibility") |> Enum.to_list() connection |> Connection.request(request) |> evaluate_response([ {200, DocumentVisibilityList}, {400, ErrorDetails} ]) end @doc """ Updates document visibility for a template recipient This method updates the document visibility for a template recipient. **Note:** A document cannot be hidden from a recipient if the recipient has tabs assigned to them on the document. Carbon Copy, Certified Delivery (Needs to Sign), Editor, and Agent recipients can always see all documents. ### Parameters - `connection` (DocuSign.Connection): Connection to server - `account_id` (String.t): The external account number (int) or account ID GUID. - `recipient_id` (String.t): A local reference used to map recipients to other objects, such as specific document tabs. A `recipientId` must be either an integer or a GUID, and the `recipientId` must be unique within an envelope. For example, many envelopes assign the first recipient a `recipientId` of `1`. - `template_id` (String.t): The ID of the template. - `opts` (keyword): Optional parameters - `:body` (TemplateDocumentVisibilityList): ### Returns - `{:ok, DocuSign.Model.TemplateDocumentVisibilityList.t}` on success - `{:error, Tesla.Env.t}` on failure """ @spec recipients_put_template_recipient_document_visibility( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, TemplateDocumentVisibilityList.t()} | {:ok, ErrorDetails.t()} | {:error, Tesla.Env.t()} def recipients_put_template_recipient_document_visibility( connection, account_id, recipient_id, template_id, opts \\ [] ) do optional_params = %{ :body => :body } request = %{} |> method(:put) |> url("/v2.1/accounts/#{account_id}/templates/#{template_id}/recipients/#{recipient_id}/document_visibility") |> add_optional_params(optional_params, opts) |> ensure_body() |> Enum.to_list() connection |> Connection.request(request) |> evaluate_response([ {200, TemplateDocumentVisibilityList}, {400, ErrorDetails} ]) end @doc """ Updates document visibility for template recipients This method updates document visibility for one or more template recipients based on the `recipientId` and `visible` values that you include in the request body. **Note:** A document cannot be hidden from a recipient if the recipient has tabs assigned to them on the document. Carbon Copy, Certified Delivery (Needs to Sign), Editor, and Agent recipients can always see all documents. ### Parameters - `connection` (DocuSign.Connection): Connection to server - `account_id` (String.t): The external account number (int) or account ID GUID. - `template_id` (String.t): The ID of the template. - `opts` (keyword): Optional parameters - `:body` (TemplateDocumentVisibilityList): ### Returns - `{:ok, DocuSign.Model.TemplateDocumentVisibilityList.t}` on success - `{:error, Tesla.Env.t}` on failure """ @spec recipients_put_template_recipients_document_visibility( Tesla.Env.client(), String.t(), String.t(), keyword() ) :: {:ok, TemplateDocumentVisibilityList.t()} | {:ok, ErrorDetails.t()} | {:error, Tesla.Env.t()} def recipients_put_template_recipients_document_visibility(connection, account_id, template_id, opts \\ []) do optional_params = %{ :body => :body } request = %{} |> method(:put) |> url("/v2.1/accounts/#{account_id}/templates/#{template_id}/recipients/document_visibility") |> add_optional_params(optional_params, opts) |> ensure_body() |> Enum.to_list() connection |> Connection.request(request) |> evaluate_response([ {200, TemplateDocumentVisibilityList}, {400, ErrorDetails} ]) end end