/* 
 * DocuSign REST API
 *
 * The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
 *
 * OpenAPI spec version: v2.1
 * Contact: devcenter@docusign.com
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 */

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using RestSharp;
using DocuSign.eSign.Client;
using DocuSign.eSign.Model;

namespace DocuSign.eSign.Api
{
    /// <summary>
    /// Represents a collection of functions to interact with the API endpoints
    /// </summary>
    public interface IWorkspacesApi : IApiAccessor
    {
        #region Synchronous Operations
        /// <summary>
        /// Create a Workspace
        /// </summary>
        /// <remarks>
        /// Creates a new workspace.
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>
        /// <param name="workspace"> (optional)</param>
        
        /// <returns></returns>
        Workspace CreateWorkspace (string accountId, Workspace workspace = null);

        /// <summary>
        /// Create a Workspace
        /// </summary>
        /// <remarks>
        /// Creates a new workspace.
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>
        /// <param name="workspace"> (optional)</param>
        
        /// <returns>ApiResponse of </returns>
        ApiResponse<Workspace> CreateWorkspaceWithHttpInfo (string accountId, Workspace workspace = null);
        /// <summary>
        /// Creates a workspace file.
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>
        
        
        /// <returns></returns>
        WorkspaceItem CreateWorkspaceFile (string accountId, string workspaceId, string folderId);

        /// <summary>
        /// Creates a workspace file.
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>
        
        
        /// <returns>ApiResponse of </returns>
        ApiResponse<WorkspaceItem> CreateWorkspaceFileWithHttpInfo (string accountId, string workspaceId, string folderId);
        /// <summary>
        /// Delete Workspace
        /// </summary>
        /// <remarks>
        /// Deletes an existing workspace (logically).
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>
        
        
        /// <returns></returns>
        Workspace DeleteWorkspace (string accountId, string workspaceId);

        /// <summary>
        /// Delete Workspace
        /// </summary>
        /// <remarks>
        /// Deletes an existing workspace (logically).
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>
        
        
        /// <returns>ApiResponse of </returns>
        ApiResponse<Workspace> DeleteWorkspaceWithHttpInfo (string accountId, string workspaceId);
        /// <summary>
        /// Deletes workspace one or more specific files/folders from the given folder or root.
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>
        /// <param name="workspaceItemList"> (optional)</param>
        
        /// <returns></returns>
        void DeleteWorkspaceFolderItems (string accountId, string workspaceId, string folderId, WorkspaceItemList workspaceItemList = null);

        /// <summary>
        /// Deletes workspace one or more specific files/folders from the given folder or root.
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>
        /// <param name="workspaceItemList"> (optional)</param>
        
        /// <returns>ApiResponse of Object(void)</returns>
        ApiResponse<Object> DeleteWorkspaceFolderItemsWithHttpInfo (string accountId, string workspaceId, string folderId, WorkspaceItemList workspaceItemList = null);
        /// <summary>
        /// Get Workspace
        /// </summary>
        /// <remarks>
        /// Retrives properties about a workspace given a unique workspaceId. 
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>
        
        
        /// <returns></returns>
        Workspace GetWorkspace (string accountId, string workspaceId);

        /// <summary>
        /// Get Workspace
        /// </summary>
        /// <remarks>
        /// Retrives properties about a workspace given a unique workspaceId. 
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>
        
        
        /// <returns>ApiResponse of </returns>
        ApiResponse<Workspace> GetWorkspaceWithHttpInfo (string accountId, string workspaceId);
        /// <summary>
        /// Get Workspace File
        /// </summary>
        /// <remarks>
        /// Retrieves a workspace file (the binary).
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>/// <param name="fileId">Specifies the room file ID GUID.</param>
        
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns></returns>
        void GetWorkspaceFile (string accountId, string workspaceId, string folderId, string fileId, WorkspacesApi.GetWorkspaceFileOptions options = null);

        /// <summary>
        /// Get Workspace File
        /// </summary>
        /// <remarks>
        /// Retrieves a workspace file (the binary).
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>/// <param name="fileId">Specifies the room file ID GUID.</param>
        
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns>ApiResponse of Object(void)</returns>
        ApiResponse<Object> GetWorkspaceFileWithHttpInfo (string accountId, string workspaceId, string folderId, string fileId, WorkspacesApi.GetWorkspaceFileOptions options = null);
        /// <summary>
        /// List File Pages
        /// </summary>
        /// <remarks>
        /// Retrieves a workspace file as rasterized pages.
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>/// <param name="fileId">Specifies the room file ID GUID.</param>
        
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns></returns>
        PageImages ListWorkspaceFilePages (string accountId, string workspaceId, string folderId, string fileId, WorkspacesApi.ListWorkspaceFilePagesOptions options = null);

        /// <summary>
        /// List File Pages
        /// </summary>
        /// <remarks>
        /// Retrieves a workspace file as rasterized pages.
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>/// <param name="fileId">Specifies the room file ID GUID.</param>
        
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns>ApiResponse of </returns>
        ApiResponse<PageImages> ListWorkspaceFilePagesWithHttpInfo (string accountId, string workspaceId, string folderId, string fileId, WorkspacesApi.ListWorkspaceFilePagesOptions options = null);
        /// <summary>
        /// List Workspace Folder Contents
        /// </summary>
        /// <remarks>
        /// Retrieves workspace folder contents, which can include sub folders and files.
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>
        
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns></returns>
        WorkspaceFolderContents ListWorkspaceFolderItems (string accountId, string workspaceId, string folderId, WorkspacesApi.ListWorkspaceFolderItemsOptions options = null);

        /// <summary>
        /// List Workspace Folder Contents
        /// </summary>
        /// <remarks>
        /// Retrieves workspace folder contents, which can include sub folders and files.
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>
        
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns>ApiResponse of </returns>
        ApiResponse<WorkspaceFolderContents> ListWorkspaceFolderItemsWithHttpInfo (string accountId, string workspaceId, string folderId, WorkspacesApi.ListWorkspaceFolderItemsOptions options = null);
        /// <summary>
        /// List Workspaces
        /// </summary>
        /// <remarks>
        /// Gets information about the Workspaces that have been created.
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>
        
        
        /// <returns></returns>
        WorkspaceList ListWorkspaces (string accountId);

        /// <summary>
        /// List Workspaces
        /// </summary>
        /// <remarks>
        /// Gets information about the Workspaces that have been created.
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>
        
        
        /// <returns>ApiResponse of </returns>
        ApiResponse<WorkspaceList> ListWorkspacesWithHttpInfo (string accountId);
        /// <summary>
        /// Update Workspace
        /// </summary>
        /// <remarks>
        /// Updates information about a specific workspace.
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>
        /// <param name="workspace"> (optional)</param>
        
        /// <returns></returns>
        Workspace UpdateWorkspace (string accountId, string workspaceId, Workspace workspace = null);

        /// <summary>
        /// Update Workspace
        /// </summary>
        /// <remarks>
        /// Updates information about a specific workspace.
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>
        /// <param name="workspace"> (optional)</param>
        
        /// <returns>ApiResponse of </returns>
        ApiResponse<Workspace> UpdateWorkspaceWithHttpInfo (string accountId, string workspaceId, Workspace workspace = null);
        /// <summary>
        /// Update Workspace File Metadata
        /// </summary>
        /// <remarks>
        /// Updates workspace item metadata for one or more specific files/folders.
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>/// <param name="fileId">Specifies the room file ID GUID.</param>
        
        
        /// <returns></returns>
        WorkspaceItem UpdateWorkspaceFile (string accountId, string workspaceId, string folderId, string fileId);

        /// <summary>
        /// Update Workspace File Metadata
        /// </summary>
        /// <remarks>
        /// Updates workspace item metadata for one or more specific files/folders.
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>/// <param name="fileId">Specifies the room file ID GUID.</param>
        
        
        /// <returns>ApiResponse of </returns>
        ApiResponse<WorkspaceItem> UpdateWorkspaceFileWithHttpInfo (string accountId, string workspaceId, string folderId, string fileId);
        #endregion Synchronous Operations
        #region Asynchronous Operations
        /// <summary>
        /// Create a Workspace
        /// </summary>
        /// <remarks>
        /// Creates a new workspace.
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>
        /// <param name="workspace"> (optional)</param>
        
        /// <returns>Task of Workspace</returns>
        System.Threading.Tasks.Task<Workspace> CreateWorkspaceAsync (string accountId, Workspace workspace = null);

        /// <summary>
        /// Create a Workspace
        /// </summary>
        /// <remarks>
        /// Creates a new workspace.
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>
        /// <param name="workspace"> (optional)</param>
        
        /// <returns>Task of ApiResponse (Workspace)</returns>
        System.Threading.Tasks.Task<ApiResponse<Workspace>> CreateWorkspaceAsyncWithHttpInfo (string accountId, Workspace workspace = null);
        /// <summary>
        /// Creates a workspace file.
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>
        
        
        /// <returns>Task of WorkspaceItem</returns>
        System.Threading.Tasks.Task<WorkspaceItem> CreateWorkspaceFileAsync (string accountId, string workspaceId, string folderId);

        /// <summary>
        /// Creates a workspace file.
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>
        
        
        /// <returns>Task of ApiResponse (WorkspaceItem)</returns>
        System.Threading.Tasks.Task<ApiResponse<WorkspaceItem>> CreateWorkspaceFileAsyncWithHttpInfo (string accountId, string workspaceId, string folderId);
        /// <summary>
        /// Delete Workspace
        /// </summary>
        /// <remarks>
        /// Deletes an existing workspace (logically).
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>
        
        
        /// <returns>Task of Workspace</returns>
        System.Threading.Tasks.Task<Workspace> DeleteWorkspaceAsync (string accountId, string workspaceId);

        /// <summary>
        /// Delete Workspace
        /// </summary>
        /// <remarks>
        /// Deletes an existing workspace (logically).
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>
        
        
        /// <returns>Task of ApiResponse (Workspace)</returns>
        System.Threading.Tasks.Task<ApiResponse<Workspace>> DeleteWorkspaceAsyncWithHttpInfo (string accountId, string workspaceId);
        /// <summary>
        /// Deletes workspace one or more specific files/folders from the given folder or root.
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>
        /// <param name="workspaceItemList"> (optional)</param>
        
        /// <returns>Task of void</returns>
        System.Threading.Tasks.Task DeleteWorkspaceFolderItemsAsync (string accountId, string workspaceId, string folderId, WorkspaceItemList workspaceItemList = null);

        /// <summary>
        /// Deletes workspace one or more specific files/folders from the given folder or root.
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>
        /// <param name="workspaceItemList"> (optional)</param>
        
        /// <returns>Task of ApiResponse</returns>
        System.Threading.Tasks.Task<ApiResponse<Object>> DeleteWorkspaceFolderItemsAsyncWithHttpInfo (string accountId, string workspaceId, string folderId, WorkspaceItemList workspaceItemList = null);
        /// <summary>
        /// Get Workspace
        /// </summary>
        /// <remarks>
        /// Retrives properties about a workspace given a unique workspaceId. 
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>
        
        
        /// <returns>Task of Workspace</returns>
        System.Threading.Tasks.Task<Workspace> GetWorkspaceAsync (string accountId, string workspaceId);

        /// <summary>
        /// Get Workspace
        /// </summary>
        /// <remarks>
        /// Retrives properties about a workspace given a unique workspaceId. 
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>
        
        
        /// <returns>Task of ApiResponse (Workspace)</returns>
        System.Threading.Tasks.Task<ApiResponse<Workspace>> GetWorkspaceAsyncWithHttpInfo (string accountId, string workspaceId);
        /// <summary>
        /// Get Workspace File
        /// </summary>
        /// <remarks>
        /// Retrieves a workspace file (the binary).
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>/// <param name="fileId">Specifies the room file ID GUID.</param>
        
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns>Task of void</returns>
        System.Threading.Tasks.Task GetWorkspaceFileAsync (string accountId, string workspaceId, string folderId, string fileId, WorkspacesApi.GetWorkspaceFileOptions options = null);

        /// <summary>
        /// Get Workspace File
        /// </summary>
        /// <remarks>
        /// Retrieves a workspace file (the binary).
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>/// <param name="fileId">Specifies the room file ID GUID.</param>
        
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns>Task of ApiResponse</returns>
        System.Threading.Tasks.Task<ApiResponse<Object>> GetWorkspaceFileAsyncWithHttpInfo (string accountId, string workspaceId, string folderId, string fileId, WorkspacesApi.GetWorkspaceFileOptions options = null);
        /// <summary>
        /// List File Pages
        /// </summary>
        /// <remarks>
        /// Retrieves a workspace file as rasterized pages.
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>/// <param name="fileId">Specifies the room file ID GUID.</param>
        
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns>Task of PageImages</returns>
        System.Threading.Tasks.Task<PageImages> ListWorkspaceFilePagesAsync (string accountId, string workspaceId, string folderId, string fileId, WorkspacesApi.ListWorkspaceFilePagesOptions options = null);

        /// <summary>
        /// List File Pages
        /// </summary>
        /// <remarks>
        /// Retrieves a workspace file as rasterized pages.
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>/// <param name="fileId">Specifies the room file ID GUID.</param>
        
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns>Task of ApiResponse (PageImages)</returns>
        System.Threading.Tasks.Task<ApiResponse<PageImages>> ListWorkspaceFilePagesAsyncWithHttpInfo (string accountId, string workspaceId, string folderId, string fileId, WorkspacesApi.ListWorkspaceFilePagesOptions options = null);
        /// <summary>
        /// List Workspace Folder Contents
        /// </summary>
        /// <remarks>
        /// Retrieves workspace folder contents, which can include sub folders and files.
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>
        
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns>Task of WorkspaceFolderContents</returns>
        System.Threading.Tasks.Task<WorkspaceFolderContents> ListWorkspaceFolderItemsAsync (string accountId, string workspaceId, string folderId, WorkspacesApi.ListWorkspaceFolderItemsOptions options = null);

        /// <summary>
        /// List Workspace Folder Contents
        /// </summary>
        /// <remarks>
        /// Retrieves workspace folder contents, which can include sub folders and files.
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>
        
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns>Task of ApiResponse (WorkspaceFolderContents)</returns>
        System.Threading.Tasks.Task<ApiResponse<WorkspaceFolderContents>> ListWorkspaceFolderItemsAsyncWithHttpInfo (string accountId, string workspaceId, string folderId, WorkspacesApi.ListWorkspaceFolderItemsOptions options = null);
        /// <summary>
        /// List Workspaces
        /// </summary>
        /// <remarks>
        /// Gets information about the Workspaces that have been created.
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>
        
        
        /// <returns>Task of WorkspaceList</returns>
        System.Threading.Tasks.Task<WorkspaceList> ListWorkspacesAsync (string accountId);

        /// <summary>
        /// List Workspaces
        /// </summary>
        /// <remarks>
        /// Gets information about the Workspaces that have been created.
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>
        
        
        /// <returns>Task of ApiResponse (WorkspaceList)</returns>
        System.Threading.Tasks.Task<ApiResponse<WorkspaceList>> ListWorkspacesAsyncWithHttpInfo (string accountId);
        /// <summary>
        /// Update Workspace
        /// </summary>
        /// <remarks>
        /// Updates information about a specific workspace.
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>
        /// <param name="workspace"> (optional)</param>
        
        /// <returns>Task of Workspace</returns>
        System.Threading.Tasks.Task<Workspace> UpdateWorkspaceAsync (string accountId, string workspaceId, Workspace workspace = null);

        /// <summary>
        /// Update Workspace
        /// </summary>
        /// <remarks>
        /// Updates information about a specific workspace.
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>
        /// <param name="workspace"> (optional)</param>
        
        /// <returns>Task of ApiResponse (Workspace)</returns>
        System.Threading.Tasks.Task<ApiResponse<Workspace>> UpdateWorkspaceAsyncWithHttpInfo (string accountId, string workspaceId, Workspace workspace = null);
        /// <summary>
        /// Update Workspace File Metadata
        /// </summary>
        /// <remarks>
        /// Updates workspace item metadata for one or more specific files/folders.
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>/// <param name="fileId">Specifies the room file ID GUID.</param>
        
        
        /// <returns>Task of WorkspaceItem</returns>
        System.Threading.Tasks.Task<WorkspaceItem> UpdateWorkspaceFileAsync (string accountId, string workspaceId, string folderId, string fileId);

        /// <summary>
        /// Update Workspace File Metadata
        /// </summary>
        /// <remarks>
        /// Updates workspace item metadata for one or more specific files/folders.
        /// </remarks>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>/// <param name="fileId">Specifies the room file ID GUID.</param>
        
        
        /// <returns>Task of ApiResponse (WorkspaceItem)</returns>
        System.Threading.Tasks.Task<ApiResponse<WorkspaceItem>> UpdateWorkspaceFileAsyncWithHttpInfo (string accountId, string workspaceId, string folderId, string fileId);
        #endregion Asynchronous Operations
    }

    /// <summary>
    /// Represents a collection of functions to interact with the API endpoints
    /// </summary>
    public partial class WorkspacesApi : IWorkspacesApi
    {
        private DocuSign.eSign.Client.ExceptionFactory _exceptionFactory = (name, response) => null;

        /// <summary>
        /// Initializes a new instance of the <see cref="WorkspacesApi"/> class
        /// using AplClient object
        /// </summary>
        /// <param name="aplClient">An instance of AplClient</param>
        /// <returns></returns>
        public WorkspacesApi(ApiClient aplClient)
        {
            this.ApiClient = aplClient;

            ExceptionFactory = Configuration.DefaultExceptionFactory;
        }

        /// <summary>
        /// Gets the base path of the API client.
        /// </summary>
        /// <value>The base path</value>
        public String GetBasePath()
        {
            return this.ApiClient.RestClient.BaseUrl.ToString();
        }

        /// <summary>
        /// Gets or sets the ApiClient object
        /// </summary>
        /// <value>An instance of the ApiClient</value>
        public ApiClient ApiClient { get; set; }

        /// <summary>
        /// Provides a factory method hook for the creation of exceptions.
        /// </summary>
        public DocuSign.eSign.Client.ExceptionFactory ExceptionFactory
        {
            get
            {
                if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1)
                {
                    throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported.");
                }
                return _exceptionFactory;
            }
            set { _exceptionFactory = value; }
        }



        /// <summary>
        /// Create a Workspace Creates a new workspace.
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>
        /// <param name="workspace"> (optional)</param>
        
        /// <returns>Workspace</returns>
        public Workspace CreateWorkspace (string accountId, Workspace workspace = null)
        {
             ApiResponse<Workspace> localVarResponse = CreateWorkspaceWithHttpInfo(accountId, workspace);
             return localVarResponse.Data;
        }

        /// <summary>
        /// Create a Workspace Creates a new workspace.
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>
        /// <param name="workspace"> (optional)</param>
        
        /// <returns>ApiResponse of Workspace</returns>
        public ApiResponse< Workspace > CreateWorkspaceWithHttpInfo (string accountId, Workspace workspace = null)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null)
                throw new ApiException(400, "Missing required parameter 'accountId' when calling WorkspacesApi->CreateWorkspace");

            var localVarPath = "/v2.1/accounts/{accountId}/workspaces";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new Dictionary<String, String>();
            var localVarHeaderParams = new Dictionary<String, String>(this.ApiClient.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (accountId != null) localVarPathParams.Add("accountId", this.ApiClient.ParameterToString(accountId)); // path parameter


            if (workspace != null && workspace.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.ApiClient.Serialize(workspace); // http body (model) parameter
            }
            else
            {
                localVarPostBody = workspace; // byte array
            }

            // authentication (docusignAccessCode) required
            // oauth required
            if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken))
            {
                localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken;
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse) this.ApiClient.CallApi(localVarPath,
                Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("CreateWorkspace", localVarResponse);
                if (exception != null) throw exception;
            }

            
            // DocuSign: Handle for PDF return types
            if (localVarResponse.ContentType != null && !localVarResponse.ContentType.ToLower().Contains("json"))
            {
                return new ApiResponse<Workspace>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (Workspace) this.ApiClient.Deserialize(localVarResponse.RawBytes, typeof(Workspace)));
            }
            else
            {
                return new ApiResponse<Workspace>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (Workspace) this.ApiClient.Deserialize(localVarResponse, typeof(Workspace)));
            }
            
        }

        /// <summary>
        /// Create a Workspace Creates a new workspace.
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>
        /// <param name="workspace"> (optional)</param>
        
        /// <returns>Task of Workspace</returns>
        public async System.Threading.Tasks.Task<Workspace> CreateWorkspaceAsync (string accountId, Workspace workspace = null)
        {
             ApiResponse<Workspace> localVarResponse = await CreateWorkspaceAsyncWithHttpInfo(accountId, workspace);
             return localVarResponse.Data;

        }

        /// <summary>
        /// Create a Workspace Creates a new workspace.
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>
        /// <param name="workspace"> (optional)</param>
        
        /// <returns>Task of ApiResponse (Workspace)</returns>
        public async System.Threading.Tasks.Task<ApiResponse<Workspace>> CreateWorkspaceAsyncWithHttpInfo (string accountId, Workspace workspace = null)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null)
                throw new ApiException(400, "Missing required parameter 'accountId' when calling WorkspacesApi->CreateWorkspace");

            var localVarPath = "/v2.1/accounts/{accountId}/workspaces";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new Dictionary<String, String>();
            var localVarHeaderParams = new Dictionary<String, String>(this.ApiClient.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (accountId != null) localVarPathParams.Add("accountId", this.ApiClient.ParameterToString(accountId)); // path parameter


            if (workspace != null && workspace.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.ApiClient.Serialize(workspace); // http body (model) parameter
            }
            else
            {
                localVarPostBody = workspace; // byte array
            }

            // authentication (docusignAccessCode) required
            // oauth required
            if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken))
            {
                localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken;
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse) await this.ApiClient.CallApiAsync(localVarPath,
                Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("CreateWorkspace", localVarResponse);
                if (exception != null) throw exception;
            }

            return new ApiResponse<Workspace>(localVarStatusCode,
                localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                (Workspace) this.ApiClient.Deserialize(localVarResponse, typeof(Workspace)));
            
        }



        /// <summary>
        /// Creates a workspace file. 
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>
        
        
        /// <returns>WorkspaceItem</returns>
        public WorkspaceItem CreateWorkspaceFile (string accountId, string workspaceId, string folderId)
        {
             ApiResponse<WorkspaceItem> localVarResponse = CreateWorkspaceFileWithHttpInfo(accountId, workspaceId, folderId);
             return localVarResponse.Data;
        }

        /// <summary>
        /// Creates a workspace file. 
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>
        
        
        /// <returns>ApiResponse of WorkspaceItem</returns>
        public ApiResponse< WorkspaceItem > CreateWorkspaceFileWithHttpInfo (string accountId, string workspaceId, string folderId)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null)
                throw new ApiException(400, "Missing required parameter 'accountId' when calling WorkspacesApi->CreateWorkspaceFile");
            // verify the required parameter 'workspaceId' is set
            if (workspaceId == null)
                throw new ApiException(400, "Missing required parameter 'workspaceId' when calling WorkspacesApi->CreateWorkspaceFile");
            // verify the required parameter 'folderId' is set
            if (folderId == null)
                throw new ApiException(400, "Missing required parameter 'folderId' when calling WorkspacesApi->CreateWorkspaceFile");

            var localVarPath = "/v2.1/accounts/{accountId}/workspaces/{workspaceId}/folders/{folderId}/files";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new Dictionary<String, String>();
            var localVarHeaderParams = new Dictionary<String, String>(this.ApiClient.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (accountId != null) localVarPathParams.Add("accountId", this.ApiClient.ParameterToString(accountId)); // path parameter
            if (workspaceId != null) localVarPathParams.Add("workspaceId", this.ApiClient.ParameterToString(workspaceId)); // path parameter
            if (folderId != null) localVarPathParams.Add("folderId", this.ApiClient.ParameterToString(folderId)); // path parameter



            // authentication (docusignAccessCode) required
            // oauth required
            if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken))
            {
                localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken;
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse) this.ApiClient.CallApi(localVarPath,
                Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("CreateWorkspaceFile", localVarResponse);
                if (exception != null) throw exception;
            }

            
            // DocuSign: Handle for PDF return types
            if (localVarResponse.ContentType != null && !localVarResponse.ContentType.ToLower().Contains("json"))
            {
                return new ApiResponse<WorkspaceItem>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (WorkspaceItem) this.ApiClient.Deserialize(localVarResponse.RawBytes, typeof(WorkspaceItem)));
            }
            else
            {
                return new ApiResponse<WorkspaceItem>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (WorkspaceItem) this.ApiClient.Deserialize(localVarResponse, typeof(WorkspaceItem)));
            }
            
        }

        /// <summary>
        /// Creates a workspace file. 
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>
        
        
        /// <returns>Task of WorkspaceItem</returns>
        public async System.Threading.Tasks.Task<WorkspaceItem> CreateWorkspaceFileAsync (string accountId, string workspaceId, string folderId)
        {
             ApiResponse<WorkspaceItem> localVarResponse = await CreateWorkspaceFileAsyncWithHttpInfo(accountId, workspaceId, folderId);
             return localVarResponse.Data;

        }

        /// <summary>
        /// Creates a workspace file. 
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>
        
        
        /// <returns>Task of ApiResponse (WorkspaceItem)</returns>
        public async System.Threading.Tasks.Task<ApiResponse<WorkspaceItem>> CreateWorkspaceFileAsyncWithHttpInfo (string accountId, string workspaceId, string folderId)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null)
                throw new ApiException(400, "Missing required parameter 'accountId' when calling WorkspacesApi->CreateWorkspaceFile");
            // verify the required parameter 'workspaceId' is set
            if (workspaceId == null)
                throw new ApiException(400, "Missing required parameter 'workspaceId' when calling WorkspacesApi->CreateWorkspaceFile");
            // verify the required parameter 'folderId' is set
            if (folderId == null)
                throw new ApiException(400, "Missing required parameter 'folderId' when calling WorkspacesApi->CreateWorkspaceFile");

            var localVarPath = "/v2.1/accounts/{accountId}/workspaces/{workspaceId}/folders/{folderId}/files";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new Dictionary<String, String>();
            var localVarHeaderParams = new Dictionary<String, String>(this.ApiClient.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (accountId != null) localVarPathParams.Add("accountId", this.ApiClient.ParameterToString(accountId)); // path parameter
            if (workspaceId != null) localVarPathParams.Add("workspaceId", this.ApiClient.ParameterToString(workspaceId)); // path parameter
            if (folderId != null) localVarPathParams.Add("folderId", this.ApiClient.ParameterToString(folderId)); // path parameter



            // authentication (docusignAccessCode) required
            // oauth required
            if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken))
            {
                localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken;
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse) await this.ApiClient.CallApiAsync(localVarPath,
                Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("CreateWorkspaceFile", localVarResponse);
                if (exception != null) throw exception;
            }

            return new ApiResponse<WorkspaceItem>(localVarStatusCode,
                localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                (WorkspaceItem) this.ApiClient.Deserialize(localVarResponse, typeof(WorkspaceItem)));
            
        }



        /// <summary>
        /// Delete Workspace Deletes an existing workspace (logically).
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>
        
        
        /// <returns>Workspace</returns>
        public Workspace DeleteWorkspace (string accountId, string workspaceId)
        {
             ApiResponse<Workspace> localVarResponse = DeleteWorkspaceWithHttpInfo(accountId, workspaceId);
             return localVarResponse.Data;
        }

        /// <summary>
        /// Delete Workspace Deletes an existing workspace (logically).
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>
        
        
        /// <returns>ApiResponse of Workspace</returns>
        public ApiResponse< Workspace > DeleteWorkspaceWithHttpInfo (string accountId, string workspaceId)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null)
                throw new ApiException(400, "Missing required parameter 'accountId' when calling WorkspacesApi->DeleteWorkspace");
            // verify the required parameter 'workspaceId' is set
            if (workspaceId == null)
                throw new ApiException(400, "Missing required parameter 'workspaceId' when calling WorkspacesApi->DeleteWorkspace");

            var localVarPath = "/v2.1/accounts/{accountId}/workspaces/{workspaceId}";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new Dictionary<String, String>();
            var localVarHeaderParams = new Dictionary<String, String>(this.ApiClient.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (accountId != null) localVarPathParams.Add("accountId", this.ApiClient.ParameterToString(accountId)); // path parameter
            if (workspaceId != null) localVarPathParams.Add("workspaceId", this.ApiClient.ParameterToString(workspaceId)); // path parameter



            // authentication (docusignAccessCode) required
            // oauth required
            if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken))
            {
                localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken;
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse) this.ApiClient.CallApi(localVarPath,
                Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("DeleteWorkspace", localVarResponse);
                if (exception != null) throw exception;
            }

            
            // DocuSign: Handle for PDF return types
            if (localVarResponse.ContentType != null && !localVarResponse.ContentType.ToLower().Contains("json"))
            {
                return new ApiResponse<Workspace>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (Workspace) this.ApiClient.Deserialize(localVarResponse.RawBytes, typeof(Workspace)));
            }
            else
            {
                return new ApiResponse<Workspace>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (Workspace) this.ApiClient.Deserialize(localVarResponse, typeof(Workspace)));
            }
            
        }

        /// <summary>
        /// Delete Workspace Deletes an existing workspace (logically).
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>
        
        
        /// <returns>Task of Workspace</returns>
        public async System.Threading.Tasks.Task<Workspace> DeleteWorkspaceAsync (string accountId, string workspaceId)
        {
             ApiResponse<Workspace> localVarResponse = await DeleteWorkspaceAsyncWithHttpInfo(accountId, workspaceId);
             return localVarResponse.Data;

        }

        /// <summary>
        /// Delete Workspace Deletes an existing workspace (logically).
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>
        
        
        /// <returns>Task of ApiResponse (Workspace)</returns>
        public async System.Threading.Tasks.Task<ApiResponse<Workspace>> DeleteWorkspaceAsyncWithHttpInfo (string accountId, string workspaceId)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null)
                throw new ApiException(400, "Missing required parameter 'accountId' when calling WorkspacesApi->DeleteWorkspace");
            // verify the required parameter 'workspaceId' is set
            if (workspaceId == null)
                throw new ApiException(400, "Missing required parameter 'workspaceId' when calling WorkspacesApi->DeleteWorkspace");

            var localVarPath = "/v2.1/accounts/{accountId}/workspaces/{workspaceId}";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new Dictionary<String, String>();
            var localVarHeaderParams = new Dictionary<String, String>(this.ApiClient.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (accountId != null) localVarPathParams.Add("accountId", this.ApiClient.ParameterToString(accountId)); // path parameter
            if (workspaceId != null) localVarPathParams.Add("workspaceId", this.ApiClient.ParameterToString(workspaceId)); // path parameter



            // authentication (docusignAccessCode) required
            // oauth required
            if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken))
            {
                localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken;
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse) await this.ApiClient.CallApiAsync(localVarPath,
                Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("DeleteWorkspace", localVarResponse);
                if (exception != null) throw exception;
            }

            return new ApiResponse<Workspace>(localVarStatusCode,
                localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                (Workspace) this.ApiClient.Deserialize(localVarResponse, typeof(Workspace)));
            
        }



        /// <summary>
        /// Deletes workspace one or more specific files/folders from the given folder or root. 
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>
        /// <param name="workspaceItemList"> (optional)</param>
        
        /// <returns></returns>
        public void DeleteWorkspaceFolderItems (string accountId, string workspaceId, string folderId, WorkspaceItemList workspaceItemList = null)
        {
             DeleteWorkspaceFolderItemsWithHttpInfo(accountId, workspaceId, folderId, workspaceItemList);
        }

        /// <summary>
        /// Deletes workspace one or more specific files/folders from the given folder or root. 
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>
        /// <param name="workspaceItemList"> (optional)</param>
        
        /// <returns>ApiResponse of Object(void)</returns>
        public ApiResponse<Object> DeleteWorkspaceFolderItemsWithHttpInfo (string accountId, string workspaceId, string folderId, WorkspaceItemList workspaceItemList = null)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null)
                throw new ApiException(400, "Missing required parameter 'accountId' when calling WorkspacesApi->DeleteWorkspaceFolderItems");
            // verify the required parameter 'workspaceId' is set
            if (workspaceId == null)
                throw new ApiException(400, "Missing required parameter 'workspaceId' when calling WorkspacesApi->DeleteWorkspaceFolderItems");
            // verify the required parameter 'folderId' is set
            if (folderId == null)
                throw new ApiException(400, "Missing required parameter 'folderId' when calling WorkspacesApi->DeleteWorkspaceFolderItems");

            var localVarPath = "/v2.1/accounts/{accountId}/workspaces/{workspaceId}/folders/{folderId}";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new Dictionary<String, String>();
            var localVarHeaderParams = new Dictionary<String, String>(this.ApiClient.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (accountId != null) localVarPathParams.Add("accountId", this.ApiClient.ParameterToString(accountId)); // path parameter
            if (workspaceId != null) localVarPathParams.Add("workspaceId", this.ApiClient.ParameterToString(workspaceId)); // path parameter
            if (folderId != null) localVarPathParams.Add("folderId", this.ApiClient.ParameterToString(folderId)); // path parameter


            if (workspaceItemList != null && workspaceItemList.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.ApiClient.Serialize(workspaceItemList); // http body (model) parameter
            }
            else
            {
                localVarPostBody = workspaceItemList; // byte array
            }

            // authentication (docusignAccessCode) required
            // oauth required
            if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken))
            {
                localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken;
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse) this.ApiClient.CallApi(localVarPath,
                Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("DeleteWorkspaceFolderItems", localVarResponse);
                if (exception != null) throw exception;
            }

            return new ApiResponse<Object>(localVarStatusCode,
                localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                null);
        }

        /// <summary>
        /// Deletes workspace one or more specific files/folders from the given folder or root. 
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>
        /// <param name="workspaceItemList"> (optional)</param>
        
        /// <returns>Task of void</returns>
        public async System.Threading.Tasks.Task DeleteWorkspaceFolderItemsAsync (string accountId, string workspaceId, string folderId, WorkspaceItemList workspaceItemList = null)
        {
             await DeleteWorkspaceFolderItemsAsyncWithHttpInfo(accountId, workspaceId, folderId, workspaceItemList);

        }

        /// <summary>
        /// Deletes workspace one or more specific files/folders from the given folder or root. 
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>
        /// <param name="workspaceItemList"> (optional)</param>
        
        /// <returns>Task of ApiResponse</returns>
        public async System.Threading.Tasks.Task<ApiResponse<Object>> DeleteWorkspaceFolderItemsAsyncWithHttpInfo (string accountId, string workspaceId, string folderId, WorkspaceItemList workspaceItemList = null)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null)
                throw new ApiException(400, "Missing required parameter 'accountId' when calling WorkspacesApi->DeleteWorkspaceFolderItems");
            // verify the required parameter 'workspaceId' is set
            if (workspaceId == null)
                throw new ApiException(400, "Missing required parameter 'workspaceId' when calling WorkspacesApi->DeleteWorkspaceFolderItems");
            // verify the required parameter 'folderId' is set
            if (folderId == null)
                throw new ApiException(400, "Missing required parameter 'folderId' when calling WorkspacesApi->DeleteWorkspaceFolderItems");

            var localVarPath = "/v2.1/accounts/{accountId}/workspaces/{workspaceId}/folders/{folderId}";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new Dictionary<String, String>();
            var localVarHeaderParams = new Dictionary<String, String>(this.ApiClient.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (accountId != null) localVarPathParams.Add("accountId", this.ApiClient.ParameterToString(accountId)); // path parameter
            if (workspaceId != null) localVarPathParams.Add("workspaceId", this.ApiClient.ParameterToString(workspaceId)); // path parameter
            if (folderId != null) localVarPathParams.Add("folderId", this.ApiClient.ParameterToString(folderId)); // path parameter


            if (workspaceItemList != null && workspaceItemList.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.ApiClient.Serialize(workspaceItemList); // http body (model) parameter
            }
            else
            {
                localVarPostBody = workspaceItemList; // byte array
            }

            // authentication (docusignAccessCode) required
            // oauth required
            if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken))
            {
                localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken;
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse) await this.ApiClient.CallApiAsync(localVarPath,
                Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("DeleteWorkspaceFolderItems", localVarResponse);
                if (exception != null) throw exception;
            }

            
            return new ApiResponse<Object>(localVarStatusCode,
                localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                null);
        }



        /// <summary>
        /// Get Workspace Retrives properties about a workspace given a unique workspaceId. 
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>
        
        
        /// <returns>Workspace</returns>
        public Workspace GetWorkspace (string accountId, string workspaceId)
        {
             ApiResponse<Workspace> localVarResponse = GetWorkspaceWithHttpInfo(accountId, workspaceId);
             return localVarResponse.Data;
        }

        /// <summary>
        /// Get Workspace Retrives properties about a workspace given a unique workspaceId. 
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>
        
        
        /// <returns>ApiResponse of Workspace</returns>
        public ApiResponse< Workspace > GetWorkspaceWithHttpInfo (string accountId, string workspaceId)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null)
                throw new ApiException(400, "Missing required parameter 'accountId' when calling WorkspacesApi->GetWorkspace");
            // verify the required parameter 'workspaceId' is set
            if (workspaceId == null)
                throw new ApiException(400, "Missing required parameter 'workspaceId' when calling WorkspacesApi->GetWorkspace");

            var localVarPath = "/v2.1/accounts/{accountId}/workspaces/{workspaceId}";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new Dictionary<String, String>();
            var localVarHeaderParams = new Dictionary<String, String>(this.ApiClient.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (accountId != null) localVarPathParams.Add("accountId", this.ApiClient.ParameterToString(accountId)); // path parameter
            if (workspaceId != null) localVarPathParams.Add("workspaceId", this.ApiClient.ParameterToString(workspaceId)); // path parameter



            // authentication (docusignAccessCode) required
            // oauth required
            if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken))
            {
                localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken;
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse) this.ApiClient.CallApi(localVarPath,
                Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("GetWorkspace", localVarResponse);
                if (exception != null) throw exception;
            }

            
            // DocuSign: Handle for PDF return types
            if (localVarResponse.ContentType != null && !localVarResponse.ContentType.ToLower().Contains("json"))
            {
                return new ApiResponse<Workspace>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (Workspace) this.ApiClient.Deserialize(localVarResponse.RawBytes, typeof(Workspace)));
            }
            else
            {
                return new ApiResponse<Workspace>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (Workspace) this.ApiClient.Deserialize(localVarResponse, typeof(Workspace)));
            }
            
        }

        /// <summary>
        /// Get Workspace Retrives properties about a workspace given a unique workspaceId. 
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>
        
        
        /// <returns>Task of Workspace</returns>
        public async System.Threading.Tasks.Task<Workspace> GetWorkspaceAsync (string accountId, string workspaceId)
        {
             ApiResponse<Workspace> localVarResponse = await GetWorkspaceAsyncWithHttpInfo(accountId, workspaceId);
             return localVarResponse.Data;

        }

        /// <summary>
        /// Get Workspace Retrives properties about a workspace given a unique workspaceId. 
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>
        
        
        /// <returns>Task of ApiResponse (Workspace)</returns>
        public async System.Threading.Tasks.Task<ApiResponse<Workspace>> GetWorkspaceAsyncWithHttpInfo (string accountId, string workspaceId)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null)
                throw new ApiException(400, "Missing required parameter 'accountId' when calling WorkspacesApi->GetWorkspace");
            // verify the required parameter 'workspaceId' is set
            if (workspaceId == null)
                throw new ApiException(400, "Missing required parameter 'workspaceId' when calling WorkspacesApi->GetWorkspace");

            var localVarPath = "/v2.1/accounts/{accountId}/workspaces/{workspaceId}";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new Dictionary<String, String>();
            var localVarHeaderParams = new Dictionary<String, String>(this.ApiClient.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (accountId != null) localVarPathParams.Add("accountId", this.ApiClient.ParameterToString(accountId)); // path parameter
            if (workspaceId != null) localVarPathParams.Add("workspaceId", this.ApiClient.ParameterToString(workspaceId)); // path parameter



            // authentication (docusignAccessCode) required
            // oauth required
            if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken))
            {
                localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken;
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse) await this.ApiClient.CallApiAsync(localVarPath,
                Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("GetWorkspace", localVarResponse);
                if (exception != null) throw exception;
            }

            return new ApiResponse<Workspace>(localVarStatusCode,
                localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                (Workspace) this.ApiClient.Deserialize(localVarResponse, typeof(Workspace)));
            
        }


        /// <summary>
        /// Get Workspace File Retrieves a workspace file (the binary).
        /// </summary>
        public class GetWorkspaceFileOptions
        {
            /// 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**. 
            public string isDownload {get; set;}
            /// When set to **true** the file returned as a PDF. 
            public string pdfVersion {get; set;}
        }

        /// <summary>
        /// Get Workspace File Retrieves a workspace file (the binary).
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>/// <param name="fileId">Specifies the room file ID GUID.</param>
        
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns></returns>
        public void GetWorkspaceFile (string accountId, string workspaceId, string folderId, string fileId, WorkspacesApi.GetWorkspaceFileOptions options = null)
        {
             GetWorkspaceFileWithHttpInfo(accountId, workspaceId, folderId, fileId, options);
        }

        /// <summary>
        /// Get Workspace File Retrieves a workspace file (the binary).
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>/// <param name="fileId">Specifies the room file ID GUID.</param>
        
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns>ApiResponse of Object(void)</returns>
        public ApiResponse<Object> GetWorkspaceFileWithHttpInfo (string accountId, string workspaceId, string folderId, string fileId, WorkspacesApi.GetWorkspaceFileOptions options = null)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null)
                throw new ApiException(400, "Missing required parameter 'accountId' when calling WorkspacesApi->GetWorkspaceFile");
            // verify the required parameter 'workspaceId' is set
            if (workspaceId == null)
                throw new ApiException(400, "Missing required parameter 'workspaceId' when calling WorkspacesApi->GetWorkspaceFile");
            // verify the required parameter 'folderId' is set
            if (folderId == null)
                throw new ApiException(400, "Missing required parameter 'folderId' when calling WorkspacesApi->GetWorkspaceFile");
            // verify the required parameter 'fileId' is set
            if (fileId == null)
                throw new ApiException(400, "Missing required parameter 'fileId' when calling WorkspacesApi->GetWorkspaceFile");

            var localVarPath = "/v2.1/accounts/{accountId}/workspaces/{workspaceId}/folders/{folderId}/files/{fileId}";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new Dictionary<String, String>();
            var localVarHeaderParams = new Dictionary<String, String>(this.ApiClient.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (accountId != null) localVarPathParams.Add("accountId", this.ApiClient.ParameterToString(accountId)); // path parameter
            if (workspaceId != null) localVarPathParams.Add("workspaceId", this.ApiClient.ParameterToString(workspaceId)); // path parameter
            if (folderId != null) localVarPathParams.Add("folderId", this.ApiClient.ParameterToString(folderId)); // path parameter
            if (fileId != null) localVarPathParams.Add("fileId", this.ApiClient.ParameterToString(fileId)); // path parameter

            if (options != null)
            {
                if (options.isDownload != null) localVarQueryParams.Add("is_download", this.ApiClient.ParameterToString(options.isDownload)); // query parameter
                if (options.pdfVersion != null) localVarQueryParams.Add("pdf_version", this.ApiClient.ParameterToString(options.pdfVersion)); // query parameter
            }


            // authentication (docusignAccessCode) required
            // oauth required
            if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken))
            {
                localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken;
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse) this.ApiClient.CallApi(localVarPath,
                Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("GetWorkspaceFile", localVarResponse);
                if (exception != null) throw exception;
            }

            return new ApiResponse<Object>(localVarStatusCode,
                localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                null);
        }

        /// <summary>
        /// Get Workspace File Retrieves a workspace file (the binary).
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>/// <param name="fileId">Specifies the room file ID GUID.</param>
        
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns>Task of void</returns>
        public async System.Threading.Tasks.Task GetWorkspaceFileAsync (string accountId, string workspaceId, string folderId, string fileId, WorkspacesApi.GetWorkspaceFileOptions options = null)
        {
             await GetWorkspaceFileAsyncWithHttpInfo(accountId, workspaceId, folderId, fileId, options);

        }

        /// <summary>
        /// Get Workspace File Retrieves a workspace file (the binary).
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>/// <param name="fileId">Specifies the room file ID GUID.</param>
        
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns>Task of ApiResponse</returns>
        public async System.Threading.Tasks.Task<ApiResponse<Object>> GetWorkspaceFileAsyncWithHttpInfo (string accountId, string workspaceId, string folderId, string fileId, WorkspacesApi.GetWorkspaceFileOptions options = null)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null)
                throw new ApiException(400, "Missing required parameter 'accountId' when calling WorkspacesApi->GetWorkspaceFile");
            // verify the required parameter 'workspaceId' is set
            if (workspaceId == null)
                throw new ApiException(400, "Missing required parameter 'workspaceId' when calling WorkspacesApi->GetWorkspaceFile");
            // verify the required parameter 'folderId' is set
            if (folderId == null)
                throw new ApiException(400, "Missing required parameter 'folderId' when calling WorkspacesApi->GetWorkspaceFile");
            // verify the required parameter 'fileId' is set
            if (fileId == null)
                throw new ApiException(400, "Missing required parameter 'fileId' when calling WorkspacesApi->GetWorkspaceFile");

            var localVarPath = "/v2.1/accounts/{accountId}/workspaces/{workspaceId}/folders/{folderId}/files/{fileId}";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new Dictionary<String, String>();
            var localVarHeaderParams = new Dictionary<String, String>(this.ApiClient.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (accountId != null) localVarPathParams.Add("accountId", this.ApiClient.ParameterToString(accountId)); // path parameter
            if (workspaceId != null) localVarPathParams.Add("workspaceId", this.ApiClient.ParameterToString(workspaceId)); // path parameter
            if (folderId != null) localVarPathParams.Add("folderId", this.ApiClient.ParameterToString(folderId)); // path parameter
            if (fileId != null) localVarPathParams.Add("fileId", this.ApiClient.ParameterToString(fileId)); // path parameter

            if (options != null)
            {
                if (options.isDownload != null) localVarQueryParams.Add("is_download", this.ApiClient.ParameterToString(options.isDownload)); // query parameter
                if (options.pdfVersion != null) localVarQueryParams.Add("pdf_version", this.ApiClient.ParameterToString(options.pdfVersion)); // query parameter
            }


            // authentication (docusignAccessCode) required
            // oauth required
            if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken))
            {
                localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken;
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse) await this.ApiClient.CallApiAsync(localVarPath,
                Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("GetWorkspaceFile", localVarResponse);
                if (exception != null) throw exception;
            }

            
            return new ApiResponse<Object>(localVarStatusCode,
                localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                null);
        }


        /// <summary>
        /// List File Pages Retrieves a workspace file as rasterized pages.
        /// </summary>
        public class ListWorkspaceFilePagesOptions
        {
            /// The maximum number of results to be returned by this request. 
            public string count {get; set;}
            /// Number of dots per inch for the resulting image. The default if not used is 94. The range is 1-310. 
            public string dpi {get; set;}
            /// Sets the maximum height (in pixels) of the returned image. 
            public string maxHeight {get; set;}
            /// Sets the maximum width (in pixels) of the returned image. 
            public string maxWidth {get; set;}
            /// The position within the total result set from which to start returning values. The value **thumbnail** may be used to return the page image. 
            public string startPosition {get; set;}
        }

        /// <summary>
        /// List File Pages Retrieves a workspace file as rasterized pages.
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>/// <param name="fileId">Specifies the room file ID GUID.</param>
        
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns>PageImages</returns>
        public PageImages ListWorkspaceFilePages (string accountId, string workspaceId, string folderId, string fileId, WorkspacesApi.ListWorkspaceFilePagesOptions options = null)
        {
             ApiResponse<PageImages> localVarResponse = ListWorkspaceFilePagesWithHttpInfo(accountId, workspaceId, folderId, fileId, options);
             return localVarResponse.Data;
        }

        /// <summary>
        /// List File Pages Retrieves a workspace file as rasterized pages.
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>/// <param name="fileId">Specifies the room file ID GUID.</param>
        
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns>ApiResponse of PageImages</returns>
        public ApiResponse< PageImages > ListWorkspaceFilePagesWithHttpInfo (string accountId, string workspaceId, string folderId, string fileId, WorkspacesApi.ListWorkspaceFilePagesOptions options = null)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null)
                throw new ApiException(400, "Missing required parameter 'accountId' when calling WorkspacesApi->ListWorkspaceFilePages");
            // verify the required parameter 'workspaceId' is set
            if (workspaceId == null)
                throw new ApiException(400, "Missing required parameter 'workspaceId' when calling WorkspacesApi->ListWorkspaceFilePages");
            // verify the required parameter 'folderId' is set
            if (folderId == null)
                throw new ApiException(400, "Missing required parameter 'folderId' when calling WorkspacesApi->ListWorkspaceFilePages");
            // verify the required parameter 'fileId' is set
            if (fileId == null)
                throw new ApiException(400, "Missing required parameter 'fileId' when calling WorkspacesApi->ListWorkspaceFilePages");

            var localVarPath = "/v2.1/accounts/{accountId}/workspaces/{workspaceId}/folders/{folderId}/files/{fileId}/pages";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new Dictionary<String, String>();
            var localVarHeaderParams = new Dictionary<String, String>(this.ApiClient.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (accountId != null) localVarPathParams.Add("accountId", this.ApiClient.ParameterToString(accountId)); // path parameter
            if (workspaceId != null) localVarPathParams.Add("workspaceId", this.ApiClient.ParameterToString(workspaceId)); // path parameter
            if (folderId != null) localVarPathParams.Add("folderId", this.ApiClient.ParameterToString(folderId)); // path parameter
            if (fileId != null) localVarPathParams.Add("fileId", this.ApiClient.ParameterToString(fileId)); // path parameter

            if (options != null)
            {
                if (options.count != null) localVarQueryParams.Add("count", this.ApiClient.ParameterToString(options.count)); // query parameter
                if (options.dpi != null) localVarQueryParams.Add("dpi", this.ApiClient.ParameterToString(options.dpi)); // query parameter
                if (options.maxHeight != null) localVarQueryParams.Add("max_height", this.ApiClient.ParameterToString(options.maxHeight)); // query parameter
                if (options.maxWidth != null) localVarQueryParams.Add("max_width", this.ApiClient.ParameterToString(options.maxWidth)); // query parameter
                if (options.startPosition != null) localVarQueryParams.Add("start_position", this.ApiClient.ParameterToString(options.startPosition)); // query parameter
            }


            // authentication (docusignAccessCode) required
            // oauth required
            if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken))
            {
                localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken;
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse) this.ApiClient.CallApi(localVarPath,
                Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("ListWorkspaceFilePages", localVarResponse);
                if (exception != null) throw exception;
            }

            
            // DocuSign: Handle for PDF return types
            if (localVarResponse.ContentType != null && !localVarResponse.ContentType.ToLower().Contains("json"))
            {
                return new ApiResponse<PageImages>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (PageImages) this.ApiClient.Deserialize(localVarResponse.RawBytes, typeof(PageImages)));
            }
            else
            {
                return new ApiResponse<PageImages>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (PageImages) this.ApiClient.Deserialize(localVarResponse, typeof(PageImages)));
            }
            
        }

        /// <summary>
        /// List File Pages Retrieves a workspace file as rasterized pages.
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>/// <param name="fileId">Specifies the room file ID GUID.</param>
        
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns>Task of PageImages</returns>
        public async System.Threading.Tasks.Task<PageImages> ListWorkspaceFilePagesAsync (string accountId, string workspaceId, string folderId, string fileId, WorkspacesApi.ListWorkspaceFilePagesOptions options = null)
        {
             ApiResponse<PageImages> localVarResponse = await ListWorkspaceFilePagesAsyncWithHttpInfo(accountId, workspaceId, folderId, fileId, options);
             return localVarResponse.Data;

        }

        /// <summary>
        /// List File Pages Retrieves a workspace file as rasterized pages.
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>/// <param name="fileId">Specifies the room file ID GUID.</param>
        
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns>Task of ApiResponse (PageImages)</returns>
        public async System.Threading.Tasks.Task<ApiResponse<PageImages>> ListWorkspaceFilePagesAsyncWithHttpInfo (string accountId, string workspaceId, string folderId, string fileId, WorkspacesApi.ListWorkspaceFilePagesOptions options = null)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null)
                throw new ApiException(400, "Missing required parameter 'accountId' when calling WorkspacesApi->ListWorkspaceFilePages");
            // verify the required parameter 'workspaceId' is set
            if (workspaceId == null)
                throw new ApiException(400, "Missing required parameter 'workspaceId' when calling WorkspacesApi->ListWorkspaceFilePages");
            // verify the required parameter 'folderId' is set
            if (folderId == null)
                throw new ApiException(400, "Missing required parameter 'folderId' when calling WorkspacesApi->ListWorkspaceFilePages");
            // verify the required parameter 'fileId' is set
            if (fileId == null)
                throw new ApiException(400, "Missing required parameter 'fileId' when calling WorkspacesApi->ListWorkspaceFilePages");

            var localVarPath = "/v2.1/accounts/{accountId}/workspaces/{workspaceId}/folders/{folderId}/files/{fileId}/pages";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new Dictionary<String, String>();
            var localVarHeaderParams = new Dictionary<String, String>(this.ApiClient.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (accountId != null) localVarPathParams.Add("accountId", this.ApiClient.ParameterToString(accountId)); // path parameter
            if (workspaceId != null) localVarPathParams.Add("workspaceId", this.ApiClient.ParameterToString(workspaceId)); // path parameter
            if (folderId != null) localVarPathParams.Add("folderId", this.ApiClient.ParameterToString(folderId)); // path parameter
            if (fileId != null) localVarPathParams.Add("fileId", this.ApiClient.ParameterToString(fileId)); // path parameter

            if (options != null)
            {
                if (options.count != null) localVarQueryParams.Add("count", this.ApiClient.ParameterToString(options.count)); // query parameter
                if (options.dpi != null) localVarQueryParams.Add("dpi", this.ApiClient.ParameterToString(options.dpi)); // query parameter
                if (options.maxHeight != null) localVarQueryParams.Add("max_height", this.ApiClient.ParameterToString(options.maxHeight)); // query parameter
                if (options.maxWidth != null) localVarQueryParams.Add("max_width", this.ApiClient.ParameterToString(options.maxWidth)); // query parameter
                if (options.startPosition != null) localVarQueryParams.Add("start_position", this.ApiClient.ParameterToString(options.startPosition)); // query parameter
            }


            // authentication (docusignAccessCode) required
            // oauth required
            if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken))
            {
                localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken;
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse) await this.ApiClient.CallApiAsync(localVarPath,
                Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("ListWorkspaceFilePages", localVarResponse);
                if (exception != null) throw exception;
            }

            return new ApiResponse<PageImages>(localVarStatusCode,
                localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                (PageImages) this.ApiClient.Deserialize(localVarResponse, typeof(PageImages)));
            
        }


        /// <summary>
        /// List Workspace Folder Contents Retrieves workspace folder contents, which can include sub folders and files.
        /// </summary>
        public class ListWorkspaceFolderItemsOptions
        {
            /// The maximum number of results to be returned by this request. 
            public string count {get; set;}
            /// When set to **true**, file information is returned in the response along with folder information. The default is **false**. 
            public string includeFiles {get; set;}
            /// When set to **true**, information about the sub-folders of the current folder is returned. The default is **false**. 
            public string includeSubFolders {get; set;}
            /// When set to **true**, thumbnails are returned as part of the response.  The default is **false**. 
            public string includeThumbnails {get; set;}
            /// Set to **true** to return extended details about the user. The default is **false**. 
            public string includeUserDetail {get; set;}
            /// The position within the total result set from which to start returning values. 
            public string startPosition {get; set;}
            /// If set, then the results are filtered to those associated with the specified userId. 
            public string workspaceUserId {get; set;}
        }

        /// <summary>
        /// List Workspace Folder Contents Retrieves workspace folder contents, which can include sub folders and files.
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>
        
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns>WorkspaceFolderContents</returns>
        public WorkspaceFolderContents ListWorkspaceFolderItems (string accountId, string workspaceId, string folderId, WorkspacesApi.ListWorkspaceFolderItemsOptions options = null)
        {
             ApiResponse<WorkspaceFolderContents> localVarResponse = ListWorkspaceFolderItemsWithHttpInfo(accountId, workspaceId, folderId, options);
             return localVarResponse.Data;
        }

        /// <summary>
        /// List Workspace Folder Contents Retrieves workspace folder contents, which can include sub folders and files.
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>
        
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns>ApiResponse of WorkspaceFolderContents</returns>
        public ApiResponse< WorkspaceFolderContents > ListWorkspaceFolderItemsWithHttpInfo (string accountId, string workspaceId, string folderId, WorkspacesApi.ListWorkspaceFolderItemsOptions options = null)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null)
                throw new ApiException(400, "Missing required parameter 'accountId' when calling WorkspacesApi->ListWorkspaceFolderItems");
            // verify the required parameter 'workspaceId' is set
            if (workspaceId == null)
                throw new ApiException(400, "Missing required parameter 'workspaceId' when calling WorkspacesApi->ListWorkspaceFolderItems");
            // verify the required parameter 'folderId' is set
            if (folderId == null)
                throw new ApiException(400, "Missing required parameter 'folderId' when calling WorkspacesApi->ListWorkspaceFolderItems");

            var localVarPath = "/v2.1/accounts/{accountId}/workspaces/{workspaceId}/folders/{folderId}";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new Dictionary<String, String>();
            var localVarHeaderParams = new Dictionary<String, String>(this.ApiClient.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (accountId != null) localVarPathParams.Add("accountId", this.ApiClient.ParameterToString(accountId)); // path parameter
            if (workspaceId != null) localVarPathParams.Add("workspaceId", this.ApiClient.ParameterToString(workspaceId)); // path parameter
            if (folderId != null) localVarPathParams.Add("folderId", this.ApiClient.ParameterToString(folderId)); // path parameter

            if (options != null)
            {
                if (options.count != null) localVarQueryParams.Add("count", this.ApiClient.ParameterToString(options.count)); // query parameter
                if (options.includeFiles != null) localVarQueryParams.Add("include_files", this.ApiClient.ParameterToString(options.includeFiles)); // query parameter
                if (options.includeSubFolders != null) localVarQueryParams.Add("include_sub_folders", this.ApiClient.ParameterToString(options.includeSubFolders)); // query parameter
                if (options.includeThumbnails != null) localVarQueryParams.Add("include_thumbnails", this.ApiClient.ParameterToString(options.includeThumbnails)); // query parameter
                if (options.includeUserDetail != null) localVarQueryParams.Add("include_user_detail", this.ApiClient.ParameterToString(options.includeUserDetail)); // query parameter
                if (options.startPosition != null) localVarQueryParams.Add("start_position", this.ApiClient.ParameterToString(options.startPosition)); // query parameter
                if (options.workspaceUserId != null) localVarQueryParams.Add("workspace_user_id", this.ApiClient.ParameterToString(options.workspaceUserId)); // query parameter
            }


            // authentication (docusignAccessCode) required
            // oauth required
            if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken))
            {
                localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken;
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse) this.ApiClient.CallApi(localVarPath,
                Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("ListWorkspaceFolderItems", localVarResponse);
                if (exception != null) throw exception;
            }

            
            // DocuSign: Handle for PDF return types
            if (localVarResponse.ContentType != null && !localVarResponse.ContentType.ToLower().Contains("json"))
            {
                return new ApiResponse<WorkspaceFolderContents>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (WorkspaceFolderContents) this.ApiClient.Deserialize(localVarResponse.RawBytes, typeof(WorkspaceFolderContents)));
            }
            else
            {
                return new ApiResponse<WorkspaceFolderContents>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (WorkspaceFolderContents) this.ApiClient.Deserialize(localVarResponse, typeof(WorkspaceFolderContents)));
            }
            
        }

        /// <summary>
        /// List Workspace Folder Contents Retrieves workspace folder contents, which can include sub folders and files.
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>
        
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns>Task of WorkspaceFolderContents</returns>
        public async System.Threading.Tasks.Task<WorkspaceFolderContents> ListWorkspaceFolderItemsAsync (string accountId, string workspaceId, string folderId, WorkspacesApi.ListWorkspaceFolderItemsOptions options = null)
        {
             ApiResponse<WorkspaceFolderContents> localVarResponse = await ListWorkspaceFolderItemsAsyncWithHttpInfo(accountId, workspaceId, folderId, options);
             return localVarResponse.Data;

        }

        /// <summary>
        /// List Workspace Folder Contents Retrieves workspace folder contents, which can include sub folders and files.
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>
        
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns>Task of ApiResponse (WorkspaceFolderContents)</returns>
        public async System.Threading.Tasks.Task<ApiResponse<WorkspaceFolderContents>> ListWorkspaceFolderItemsAsyncWithHttpInfo (string accountId, string workspaceId, string folderId, WorkspacesApi.ListWorkspaceFolderItemsOptions options = null)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null)
                throw new ApiException(400, "Missing required parameter 'accountId' when calling WorkspacesApi->ListWorkspaceFolderItems");
            // verify the required parameter 'workspaceId' is set
            if (workspaceId == null)
                throw new ApiException(400, "Missing required parameter 'workspaceId' when calling WorkspacesApi->ListWorkspaceFolderItems");
            // verify the required parameter 'folderId' is set
            if (folderId == null)
                throw new ApiException(400, "Missing required parameter 'folderId' when calling WorkspacesApi->ListWorkspaceFolderItems");

            var localVarPath = "/v2.1/accounts/{accountId}/workspaces/{workspaceId}/folders/{folderId}";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new Dictionary<String, String>();
            var localVarHeaderParams = new Dictionary<String, String>(this.ApiClient.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (accountId != null) localVarPathParams.Add("accountId", this.ApiClient.ParameterToString(accountId)); // path parameter
            if (workspaceId != null) localVarPathParams.Add("workspaceId", this.ApiClient.ParameterToString(workspaceId)); // path parameter
            if (folderId != null) localVarPathParams.Add("folderId", this.ApiClient.ParameterToString(folderId)); // path parameter

            if (options != null)
            {
                if (options.count != null) localVarQueryParams.Add("count", this.ApiClient.ParameterToString(options.count)); // query parameter
                if (options.includeFiles != null) localVarQueryParams.Add("include_files", this.ApiClient.ParameterToString(options.includeFiles)); // query parameter
                if (options.includeSubFolders != null) localVarQueryParams.Add("include_sub_folders", this.ApiClient.ParameterToString(options.includeSubFolders)); // query parameter
                if (options.includeThumbnails != null) localVarQueryParams.Add("include_thumbnails", this.ApiClient.ParameterToString(options.includeThumbnails)); // query parameter
                if (options.includeUserDetail != null) localVarQueryParams.Add("include_user_detail", this.ApiClient.ParameterToString(options.includeUserDetail)); // query parameter
                if (options.startPosition != null) localVarQueryParams.Add("start_position", this.ApiClient.ParameterToString(options.startPosition)); // query parameter
                if (options.workspaceUserId != null) localVarQueryParams.Add("workspace_user_id", this.ApiClient.ParameterToString(options.workspaceUserId)); // query parameter
            }


            // authentication (docusignAccessCode) required
            // oauth required
            if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken))
            {
                localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken;
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse) await this.ApiClient.CallApiAsync(localVarPath,
                Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("ListWorkspaceFolderItems", localVarResponse);
                if (exception != null) throw exception;
            }

            return new ApiResponse<WorkspaceFolderContents>(localVarStatusCode,
                localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                (WorkspaceFolderContents) this.ApiClient.Deserialize(localVarResponse, typeof(WorkspaceFolderContents)));
            
        }



        /// <summary>
        /// List Workspaces Gets information about the Workspaces that have been created.
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>
        
        
        /// <returns>WorkspaceList</returns>
        public WorkspaceList ListWorkspaces (string accountId)
        {
             ApiResponse<WorkspaceList> localVarResponse = ListWorkspacesWithHttpInfo(accountId);
             return localVarResponse.Data;
        }

        /// <summary>
        /// List Workspaces Gets information about the Workspaces that have been created.
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>
        
        
        /// <returns>ApiResponse of WorkspaceList</returns>
        public ApiResponse< WorkspaceList > ListWorkspacesWithHttpInfo (string accountId)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null)
                throw new ApiException(400, "Missing required parameter 'accountId' when calling WorkspacesApi->ListWorkspaces");

            var localVarPath = "/v2.1/accounts/{accountId}/workspaces";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new Dictionary<String, String>();
            var localVarHeaderParams = new Dictionary<String, String>(this.ApiClient.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (accountId != null) localVarPathParams.Add("accountId", this.ApiClient.ParameterToString(accountId)); // path parameter



            // authentication (docusignAccessCode) required
            // oauth required
            if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken))
            {
                localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken;
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse) this.ApiClient.CallApi(localVarPath,
                Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("ListWorkspaces", localVarResponse);
                if (exception != null) throw exception;
            }

            
            // DocuSign: Handle for PDF return types
            if (localVarResponse.ContentType != null && !localVarResponse.ContentType.ToLower().Contains("json"))
            {
                return new ApiResponse<WorkspaceList>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (WorkspaceList) this.ApiClient.Deserialize(localVarResponse.RawBytes, typeof(WorkspaceList)));
            }
            else
            {
                return new ApiResponse<WorkspaceList>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (WorkspaceList) this.ApiClient.Deserialize(localVarResponse, typeof(WorkspaceList)));
            }
            
        }

        /// <summary>
        /// List Workspaces Gets information about the Workspaces that have been created.
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>
        
        
        /// <returns>Task of WorkspaceList</returns>
        public async System.Threading.Tasks.Task<WorkspaceList> ListWorkspacesAsync (string accountId)
        {
             ApiResponse<WorkspaceList> localVarResponse = await ListWorkspacesAsyncWithHttpInfo(accountId);
             return localVarResponse.Data;

        }

        /// <summary>
        /// List Workspaces Gets information about the Workspaces that have been created.
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>
        
        
        /// <returns>Task of ApiResponse (WorkspaceList)</returns>
        public async System.Threading.Tasks.Task<ApiResponse<WorkspaceList>> ListWorkspacesAsyncWithHttpInfo (string accountId)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null)
                throw new ApiException(400, "Missing required parameter 'accountId' when calling WorkspacesApi->ListWorkspaces");

            var localVarPath = "/v2.1/accounts/{accountId}/workspaces";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new Dictionary<String, String>();
            var localVarHeaderParams = new Dictionary<String, String>(this.ApiClient.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (accountId != null) localVarPathParams.Add("accountId", this.ApiClient.ParameterToString(accountId)); // path parameter



            // authentication (docusignAccessCode) required
            // oauth required
            if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken))
            {
                localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken;
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse) await this.ApiClient.CallApiAsync(localVarPath,
                Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("ListWorkspaces", localVarResponse);
                if (exception != null) throw exception;
            }

            return new ApiResponse<WorkspaceList>(localVarStatusCode,
                localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                (WorkspaceList) this.ApiClient.Deserialize(localVarResponse, typeof(WorkspaceList)));
            
        }



        /// <summary>
        /// Update Workspace Updates information about a specific workspace.
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>
        /// <param name="workspace"> (optional)</param>
        
        /// <returns>Workspace</returns>
        public Workspace UpdateWorkspace (string accountId, string workspaceId, Workspace workspace = null)
        {
             ApiResponse<Workspace> localVarResponse = UpdateWorkspaceWithHttpInfo(accountId, workspaceId, workspace);
             return localVarResponse.Data;
        }

        /// <summary>
        /// Update Workspace Updates information about a specific workspace.
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>
        /// <param name="workspace"> (optional)</param>
        
        /// <returns>ApiResponse of Workspace</returns>
        public ApiResponse< Workspace > UpdateWorkspaceWithHttpInfo (string accountId, string workspaceId, Workspace workspace = null)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null)
                throw new ApiException(400, "Missing required parameter 'accountId' when calling WorkspacesApi->UpdateWorkspace");
            // verify the required parameter 'workspaceId' is set
            if (workspaceId == null)
                throw new ApiException(400, "Missing required parameter 'workspaceId' when calling WorkspacesApi->UpdateWorkspace");

            var localVarPath = "/v2.1/accounts/{accountId}/workspaces/{workspaceId}";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new Dictionary<String, String>();
            var localVarHeaderParams = new Dictionary<String, String>(this.ApiClient.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (accountId != null) localVarPathParams.Add("accountId", this.ApiClient.ParameterToString(accountId)); // path parameter
            if (workspaceId != null) localVarPathParams.Add("workspaceId", this.ApiClient.ParameterToString(workspaceId)); // path parameter


            if (workspace != null && workspace.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.ApiClient.Serialize(workspace); // http body (model) parameter
            }
            else
            {
                localVarPostBody = workspace; // byte array
            }

            // authentication (docusignAccessCode) required
            // oauth required
            if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken))
            {
                localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken;
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse) this.ApiClient.CallApi(localVarPath,
                Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("UpdateWorkspace", localVarResponse);
                if (exception != null) throw exception;
            }

            
            // DocuSign: Handle for PDF return types
            if (localVarResponse.ContentType != null && !localVarResponse.ContentType.ToLower().Contains("json"))
            {
                return new ApiResponse<Workspace>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (Workspace) this.ApiClient.Deserialize(localVarResponse.RawBytes, typeof(Workspace)));
            }
            else
            {
                return new ApiResponse<Workspace>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (Workspace) this.ApiClient.Deserialize(localVarResponse, typeof(Workspace)));
            }
            
        }

        /// <summary>
        /// Update Workspace Updates information about a specific workspace.
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>
        /// <param name="workspace"> (optional)</param>
        
        /// <returns>Task of Workspace</returns>
        public async System.Threading.Tasks.Task<Workspace> UpdateWorkspaceAsync (string accountId, string workspaceId, Workspace workspace = null)
        {
             ApiResponse<Workspace> localVarResponse = await UpdateWorkspaceAsyncWithHttpInfo(accountId, workspaceId, workspace);
             return localVarResponse.Data;

        }

        /// <summary>
        /// Update Workspace Updates information about a specific workspace.
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>
        /// <param name="workspace"> (optional)</param>
        
        /// <returns>Task of ApiResponse (Workspace)</returns>
        public async System.Threading.Tasks.Task<ApiResponse<Workspace>> UpdateWorkspaceAsyncWithHttpInfo (string accountId, string workspaceId, Workspace workspace = null)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null)
                throw new ApiException(400, "Missing required parameter 'accountId' when calling WorkspacesApi->UpdateWorkspace");
            // verify the required parameter 'workspaceId' is set
            if (workspaceId == null)
                throw new ApiException(400, "Missing required parameter 'workspaceId' when calling WorkspacesApi->UpdateWorkspace");

            var localVarPath = "/v2.1/accounts/{accountId}/workspaces/{workspaceId}";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new Dictionary<String, String>();
            var localVarHeaderParams = new Dictionary<String, String>(this.ApiClient.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (accountId != null) localVarPathParams.Add("accountId", this.ApiClient.ParameterToString(accountId)); // path parameter
            if (workspaceId != null) localVarPathParams.Add("workspaceId", this.ApiClient.ParameterToString(workspaceId)); // path parameter


            if (workspace != null && workspace.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.ApiClient.Serialize(workspace); // http body (model) parameter
            }
            else
            {
                localVarPostBody = workspace; // byte array
            }

            // authentication (docusignAccessCode) required
            // oauth required
            if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken))
            {
                localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken;
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse) await this.ApiClient.CallApiAsync(localVarPath,
                Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("UpdateWorkspace", localVarResponse);
                if (exception != null) throw exception;
            }

            return new ApiResponse<Workspace>(localVarStatusCode,
                localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                (Workspace) this.ApiClient.Deserialize(localVarResponse, typeof(Workspace)));
            
        }



        /// <summary>
        /// Update Workspace File Metadata Updates workspace item metadata for one or more specific files/folders.
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>/// <param name="fileId">Specifies the room file ID GUID.</param>
        
        
        /// <returns>WorkspaceItem</returns>
        public WorkspaceItem UpdateWorkspaceFile (string accountId, string workspaceId, string folderId, string fileId)
        {
             ApiResponse<WorkspaceItem> localVarResponse = UpdateWorkspaceFileWithHttpInfo(accountId, workspaceId, folderId, fileId);
             return localVarResponse.Data;
        }

        /// <summary>
        /// Update Workspace File Metadata Updates workspace item metadata for one or more specific files/folders.
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>/// <param name="fileId">Specifies the room file ID GUID.</param>
        
        
        /// <returns>ApiResponse of WorkspaceItem</returns>
        public ApiResponse< WorkspaceItem > UpdateWorkspaceFileWithHttpInfo (string accountId, string workspaceId, string folderId, string fileId)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null)
                throw new ApiException(400, "Missing required parameter 'accountId' when calling WorkspacesApi->UpdateWorkspaceFile");
            // verify the required parameter 'workspaceId' is set
            if (workspaceId == null)
                throw new ApiException(400, "Missing required parameter 'workspaceId' when calling WorkspacesApi->UpdateWorkspaceFile");
            // verify the required parameter 'folderId' is set
            if (folderId == null)
                throw new ApiException(400, "Missing required parameter 'folderId' when calling WorkspacesApi->UpdateWorkspaceFile");
            // verify the required parameter 'fileId' is set
            if (fileId == null)
                throw new ApiException(400, "Missing required parameter 'fileId' when calling WorkspacesApi->UpdateWorkspaceFile");

            var localVarPath = "/v2.1/accounts/{accountId}/workspaces/{workspaceId}/folders/{folderId}/files/{fileId}";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new Dictionary<String, String>();
            var localVarHeaderParams = new Dictionary<String, String>(this.ApiClient.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (accountId != null) localVarPathParams.Add("accountId", this.ApiClient.ParameterToString(accountId)); // path parameter
            if (workspaceId != null) localVarPathParams.Add("workspaceId", this.ApiClient.ParameterToString(workspaceId)); // path parameter
            if (folderId != null) localVarPathParams.Add("folderId", this.ApiClient.ParameterToString(folderId)); // path parameter
            if (fileId != null) localVarPathParams.Add("fileId", this.ApiClient.ParameterToString(fileId)); // path parameter



            // authentication (docusignAccessCode) required
            // oauth required
            if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken))
            {
                localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken;
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse) this.ApiClient.CallApi(localVarPath,
                Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("UpdateWorkspaceFile", localVarResponse);
                if (exception != null) throw exception;
            }

            
            // DocuSign: Handle for PDF return types
            if (localVarResponse.ContentType != null && !localVarResponse.ContentType.ToLower().Contains("json"))
            {
                return new ApiResponse<WorkspaceItem>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (WorkspaceItem) this.ApiClient.Deserialize(localVarResponse.RawBytes, typeof(WorkspaceItem)));
            }
            else
            {
                return new ApiResponse<WorkspaceItem>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (WorkspaceItem) this.ApiClient.Deserialize(localVarResponse, typeof(WorkspaceItem)));
            }
            
        }

        /// <summary>
        /// Update Workspace File Metadata Updates workspace item metadata for one or more specific files/folders.
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>/// <param name="fileId">Specifies the room file ID GUID.</param>
        
        
        /// <returns>Task of WorkspaceItem</returns>
        public async System.Threading.Tasks.Task<WorkspaceItem> UpdateWorkspaceFileAsync (string accountId, string workspaceId, string folderId, string fileId)
        {
             ApiResponse<WorkspaceItem> localVarResponse = await UpdateWorkspaceFileAsyncWithHttpInfo(accountId, workspaceId, folderId, fileId);
             return localVarResponse.Data;

        }

        /// <summary>
        /// Update Workspace File Metadata Updates workspace item metadata for one or more specific files/folders.
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>/// <param name="workspaceId">Specifies the workspace ID GUID.</param>/// <param name="folderId">The ID of the folder being accessed.</param>/// <param name="fileId">Specifies the room file ID GUID.</param>
        
        
        /// <returns>Task of ApiResponse (WorkspaceItem)</returns>
        public async System.Threading.Tasks.Task<ApiResponse<WorkspaceItem>> UpdateWorkspaceFileAsyncWithHttpInfo (string accountId, string workspaceId, string folderId, string fileId)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null)
                throw new ApiException(400, "Missing required parameter 'accountId' when calling WorkspacesApi->UpdateWorkspaceFile");
            // verify the required parameter 'workspaceId' is set
            if (workspaceId == null)
                throw new ApiException(400, "Missing required parameter 'workspaceId' when calling WorkspacesApi->UpdateWorkspaceFile");
            // verify the required parameter 'folderId' is set
            if (folderId == null)
                throw new ApiException(400, "Missing required parameter 'folderId' when calling WorkspacesApi->UpdateWorkspaceFile");
            // verify the required parameter 'fileId' is set
            if (fileId == null)
                throw new ApiException(400, "Missing required parameter 'fileId' when calling WorkspacesApi->UpdateWorkspaceFile");

            var localVarPath = "/v2.1/accounts/{accountId}/workspaces/{workspaceId}/folders/{folderId}/files/{fileId}";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new Dictionary<String, String>();
            var localVarHeaderParams = new Dictionary<String, String>(this.ApiClient.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType = this.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (accountId != null) localVarPathParams.Add("accountId", this.ApiClient.ParameterToString(accountId)); // path parameter
            if (workspaceId != null) localVarPathParams.Add("workspaceId", this.ApiClient.ParameterToString(workspaceId)); // path parameter
            if (folderId != null) localVarPathParams.Add("folderId", this.ApiClient.ParameterToString(folderId)); // path parameter
            if (fileId != null) localVarPathParams.Add("fileId", this.ApiClient.ParameterToString(fileId)); // path parameter



            // authentication (docusignAccessCode) required
            // oauth required
            if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken))
            {
                localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken;
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse) await this.ApiClient.CallApiAsync(localVarPath,
                Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int) localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("UpdateWorkspaceFile", localVarResponse);
                if (exception != null) throw exception;
            }

            return new ApiResponse<WorkspaceItem>(localVarStatusCode,
                localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                (WorkspaceItem) this.ApiClient.Deserialize(localVarResponse, typeof(WorkspaceItem)));
            
        }

    }
}