# NOTE: This class is auto generated by the swagger code generator program. # https://github.com/swagger-api/swagger-codegen.git # Do not edit the class manually. defmodule DocuSign.Api.PowerForms do @moduledoc """ API calls for all endpoints tagged `PowerForms`. """ alias DocuSign.Connection import DocuSign.RequestBuilder @doc """ Delete a PowerForm. ## Parameters - connection (DocuSign.Connection): Connection to server - account_id (String.t): The external account number (int) or account ID Guid. - power_form_id (String.t): - opts (KeywordList): [optional] Optional parameters ## Returns {:ok, %{}} on success {:error, info} on failure """ @spec power_forms_delete_power_form(Tesla.Env.client(), String.t(), String.t(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t()} def power_forms_delete_power_form(connection, account_id, power_form_id, _opts \\ []) do %{} |> method(:delete) |> url("/v2/accounts/#{account_id}/powerforms/#{power_form_id}") |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> decode(false) end @doc """ Deletes one or more PowerForms ## Parameters - connection (DocuSign.Connection): Connection to server - account_id (String.t): The external account number (int) or account ID Guid. - opts (KeywordList): [optional] Optional parameters - :power_forms_request (PowerFormsRequest): ## Returns {:ok, %DocuSign.Model.PowerFormsResponse{}} on success {:error, info} on failure """ @spec power_forms_delete_power_forms_list(Tesla.Env.client(), String.t(), keyword()) :: {:ok, DocuSign.Model.PowerFormsResponse.t()} | {:error, Tesla.Env.t()} def power_forms_delete_power_forms_list(connection, account_id, opts \\ []) do optional_params = %{ powerFormsRequest: :body } %{} |> method(:delete) |> url("/v2/accounts/#{account_id}/powerforms") |> add_optional_params(optional_params, opts) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> decode(%DocuSign.Model.PowerFormsResponse{}) end @doc """ Returns a single PowerForm. ## Parameters - connection (DocuSign.Connection): Connection to server - account_id (String.t): The external account number (int) or account ID Guid. - power_form_id (String.t): - opts (KeywordList): [optional] Optional parameters ## Returns {:ok, %DocuSign.Model.PowerForms{}} on success {:error, info} on failure """ @spec power_forms_get_power_form(Tesla.Env.client(), String.t(), String.t(), keyword()) :: {:ok, DocuSign.Model.PowerForms.t()} | {:error, Tesla.Env.t()} def power_forms_get_power_form(connection, account_id, power_form_id, _opts \\ []) do %{} |> method(:get) |> url("/v2/accounts/#{account_id}/powerforms/#{power_form_id}") |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> decode(%DocuSign.Model.PowerForms{}) end @doc """ Returns the list of PowerForms available to the user. ## Parameters - connection (DocuSign.Connection): Connection to server - account_id (String.t): The external account number (int) or account ID Guid. - opts (KeywordList): [optional] Optional parameters - :from_date (String.t): Start of the search date range. Only returns templates created on or after this date/time. If no value is specified, there is no limit on the earliest date created. - :order (String.t): An optional value that sets the direction order used to sort the item list. Valid values are: * asc = ascending sort order * desc = descending sort order - :order_by (String.t): An optional value that sets the file attribute used to sort the item list. Valid values are: * modified * name - :to_date (String.t): End of the search date range. Only returns templates created up to this date/time. If no value is provided, this defaults to the current date. ## Returns {:ok, %DocuSign.Model.PowerFormsResponse{}} on success {:error, info} on failure """ @spec power_forms_get_power_forms_list(Tesla.Env.client(), String.t(), keyword()) :: {:ok, DocuSign.Model.PowerFormsResponse.t()} | {:error, Tesla.Env.t()} def power_forms_get_power_forms_list(connection, account_id, opts \\ []) do optional_params = %{ from_date: :query, order: :query, order_by: :query, to_date: :query } %{} |> method(:get) |> url("/v2/accounts/#{account_id}/powerforms") |> add_optional_params(optional_params, opts) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> decode(%DocuSign.Model.PowerFormsResponse{}) end @doc """ Returns the list of PowerForms available to the user. ## Parameters - connection (DocuSign.Connection): Connection to server - account_id (String.t): The external account number (int) or account ID Guid. - opts (KeywordList): [optional] Optional parameters - :start_position (String.t): The position within the total result set from which to start returning values. The value **thumbnail** may be used to return the page image. ## Returns {:ok, %DocuSign.Model.PowerFormSendersResponse{}} on success {:error, info} on failure """ @spec power_forms_get_power_forms_senders(Tesla.Env.client(), String.t(), keyword()) :: {:ok, DocuSign.Model.PowerFormSendersResponse.t()} | {:error, Tesla.Env.t()} def power_forms_get_power_forms_senders(connection, account_id, opts \\ []) do optional_params = %{ start_position: :query } %{} |> method(:get) |> url("/v2/accounts/#{account_id}/powerforms/senders") |> add_optional_params(optional_params, opts) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> decode(%DocuSign.Model.PowerFormSendersResponse{}) end @doc """ Creates a new PowerForm. ## Parameters - connection (DocuSign.Connection): Connection to server - account_id (String.t): The external account number (int) or account ID Guid. - opts (KeywordList): [optional] Optional parameters - :power_forms (PowerForms): ## Returns {:ok, %DocuSign.Model.PowerForms{}} on success {:error, info} on failure """ @spec power_forms_post_power_form(Tesla.Env.client(), String.t(), keyword()) :: {:ok, DocuSign.Model.PowerForms.t()} | {:error, Tesla.Env.t()} def power_forms_post_power_form(connection, account_id, opts \\ []) do optional_params = %{ PowerForms: :body } %{} |> method(:post) |> url("/v2/accounts/#{account_id}/powerforms") |> add_optional_params(optional_params, opts) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> decode(%DocuSign.Model.PowerForms{}) end @doc """ Creates a new PowerForm. ## Parameters - connection (DocuSign.Connection): Connection to server - account_id (String.t): The external account number (int) or account ID Guid. - power_form_id (String.t): - opts (KeywordList): [optional] Optional parameters - :power_forms (PowerForms): ## Returns {:ok, %DocuSign.Model.PowerForms{}} on success {:error, info} on failure """ @spec power_forms_put_power_form(Tesla.Env.client(), String.t(), String.t(), keyword()) :: {:ok, DocuSign.Model.PowerForms.t()} | {:error, Tesla.Env.t()} def power_forms_put_power_form(connection, account_id, power_form_id, opts \\ []) do optional_params = %{ PowerForms: :body } %{} |> method(:put) |> url("/v2/accounts/#{account_id}/powerforms/#{power_form_id}") |> add_optional_params(optional_params, opts) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> decode(%DocuSign.Model.PowerForms{}) end end