# 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.WorkspaceItems do @moduledoc """ API calls for all endpoints tagged `WorkspaceItems`. """ alias DocuSign.Connection import DocuSign.RequestBuilder @doc """ Get Workspace File Retrieves a workspace file (the binary). ## Parameters - connection (DocuSign.Connection): Connection to server - account_id (String.t): The external account number (int) or account ID Guid. - file_id (String.t): Specifies the room file ID GUID. - folder_id (String.t): The ID of the folder being accessed. - workspace_id (String.t): Specifies the workspace ID GUID. - opts (KeywordList): [optional] Optional parameters - :is_download (String.t): When set to **true**, the Content-Disposition header is set in the response. The value of the header provides the filename of the file. Default is **false**. - :pdf_version (String.t): When set to **true** the file returned as a PDF. ## Returns {:ok, %{}} on success {:error, info} on failure """ @spec workspace_file_get_workspace_file( Tesla.Env.client(), String.t(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, nil} | {:error, Tesla.Env.t()} def workspace_file_get_workspace_file( connection, account_id, file_id, folder_id, workspace_id, opts \\ [] ) do optional_params = %{ is_download: :query, pdf_version: :query } %{} |> method(:get) |> url( "/v2/accounts/#{account_id}/workspaces/#{workspace_id}/folders/#{folder_id}/files/#{file_id}" ) |> add_optional_params(optional_params, opts) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> decode(false) end @doc """ List File Pages Retrieves a workspace file as rasterized pages. ## Parameters - connection (DocuSign.Connection): Connection to server - account_id (String.t): The external account number (int) or account ID Guid. - file_id (String.t): Specifies the room file ID GUID. - folder_id (String.t): The ID of the folder being accessed. - workspace_id (String.t): Specifies the workspace ID GUID. - opts (KeywordList): [optional] Optional parameters - :count (String.t): The maximum number of results to be returned by this request. - :dpi (String.t): Number of dots per inch for the resulting image. The default if not used is 94. The range is 1-310. - :max_height (String.t): Sets the maximum height (in pixels) of the returned image. - :max_width (String.t): Sets the maximum width (in pixels) of the returned image. - :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.PageImages{}} on success {:error, info} on failure """ @spec workspace_file_pages_get_workspace_file_pages( Tesla.Env.client(), String.t(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, DocuSign.Model.PageImages.t()} | {:error, Tesla.Env.t()} def workspace_file_pages_get_workspace_file_pages( connection, account_id, file_id, folder_id, workspace_id, opts \\ [] ) do optional_params = %{ count: :query, dpi: :query, max_height: :query, max_width: :query, start_position: :query } %{} |> method(:get) |> url( "/v2/accounts/#{account_id}/workspaces/#{workspace_id}/folders/#{folder_id}/files/#{file_id}/pages" ) |> add_optional_params(optional_params, opts) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> decode(%DocuSign.Model.PageImages{}) end @doc """ Creates a workspace file. ## Parameters - connection (DocuSign.Connection): Connection to server - account_id (String.t): The external account number (int) or account ID Guid. - folder_id (String.t): The ID of the folder being accessed. - workspace_id (String.t): Specifies the workspace ID GUID. - opts (KeywordList): [optional] Optional parameters ## Returns {:ok, %DocuSign.Model.WorkspaceItems{}} on success {:error, info} on failure """ @spec workspace_file_post_workspace_files( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, DocuSign.Model.WorkspaceItems.t()} | {:error, Tesla.Env.t()} def workspace_file_post_workspace_files( connection, account_id, folder_id, workspace_id, _opts \\ [] ) do %{} |> method(:post) |> url("/v2/accounts/#{account_id}/workspaces/#{workspace_id}/folders/#{folder_id}/files") |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> decode(%DocuSign.Model.WorkspaceItems{}) end @doc """ Update Workspace File Metadata Updates workspace item metadata for one or more specific files/folders. ## Parameters - connection (DocuSign.Connection): Connection to server - account_id (String.t): The external account number (int) or account ID Guid. - file_id (String.t): Specifies the room file ID GUID. - folder_id (String.t): The ID of the folder being accessed. - workspace_id (String.t): Specifies the workspace ID GUID. - opts (KeywordList): [optional] Optional parameters ## Returns {:ok, %DocuSign.Model.WorkspaceItems{}} on success {:error, info} on failure """ @spec workspace_file_put_workspace_file( Tesla.Env.client(), String.t(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, DocuSign.Model.WorkspaceItems.t()} | {:error, Tesla.Env.t()} def workspace_file_put_workspace_file( connection, account_id, file_id, folder_id, workspace_id, _opts \\ [] ) do %{} |> method(:put) |> url( "/v2/accounts/#{account_id}/workspaces/#{workspace_id}/folders/#{folder_id}/files/#{file_id}" ) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> decode(%DocuSign.Model.WorkspaceItems{}) end @doc """ Deletes workspace one or more specific files/folders from the given folder or root. ## Parameters - connection (DocuSign.Connection): Connection to server - account_id (String.t): The external account number (int) or account ID Guid. - folder_id (String.t): The ID of the folder being accessed. - workspace_id (String.t): Specifies the workspace ID GUID. - opts (KeywordList): [optional] Optional parameters - :workspace_item_list (WorkspaceItemList): ## Returns {:ok, %{}} on success {:error, info} on failure """ @spec workspace_folder_delete_workspace_items( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, nil} | {:error, Tesla.Env.t()} def workspace_folder_delete_workspace_items( connection, account_id, folder_id, workspace_id, opts \\ [] ) do optional_params = %{ workspaceItemList: :body } %{} |> method(:delete) |> url("/v2/accounts/#{account_id}/workspaces/#{workspace_id}/folders/#{folder_id}") |> add_optional_params(optional_params, opts) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> decode(false) end @doc """ List Workspace Folder Contents Retrieves workspace folder contents, which can include sub folders and files. ## Parameters - connection (DocuSign.Connection): Connection to server - account_id (String.t): The external account number (int) or account ID Guid. - folder_id (String.t): The ID of the folder being accessed. - workspace_id (String.t): Specifies the workspace ID GUID. - opts (KeywordList): [optional] Optional parameters - :count (String.t): The maximum number of results to be returned by this request. - :include_files (String.t): When set to **true**, file information is returned in the response along with folder information. The default is **false**. - :include_sub_folders (String.t): When set to **true**, information about the sub-folders of the current folder is returned. The default is **false**. - :include_thumbnails (String.t): When set to **true**, thumbnails are returned as part of the response. The default is **false**. - :include_user_detail (String.t): Set to **true** to return extended details about the user. The default is **false**. - :start_position (String.t): The position within the total result set from which to start returning values. - :workspace_user_id (String.t): If set, then the results are filtered to those associated with the specified userId. ## Returns {:ok, %DocuSign.Model.WorkspaceFolderContents{}} on success {:error, info} on failure """ @spec workspace_folder_get_workspace_folder( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, DocuSign.Model.WorkspaceFolderContents.t()} | {:error, Tesla.Env.t()} def workspace_folder_get_workspace_folder( connection, account_id, folder_id, workspace_id, opts \\ [] ) do optional_params = %{ count: :query, include_files: :query, include_sub_folders: :query, include_thumbnails: :query, include_user_detail: :query, start_position: :query, workspace_user_id: :query } %{} |> method(:get) |> url("/v2/accounts/#{account_id}/workspaces/#{workspace_id}/folders/#{folder_id}") |> add_optional_params(optional_params, opts) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> decode(%DocuSign.Model.WorkspaceFolderContents{}) end end