UNPKG

@docusign/iam-sdk

Version:

Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@docusign/iam-sdk* API.

105 lines (98 loc) 4.02 kB
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { workspacesWorkspaceDocumentsAddWorkspaceDocument } from "../funcs/workspacesWorkspaceDocumentsAddWorkspaceDocument.js"; import { workspacesWorkspaceDocumentsDeleteWorkspaceDocument } from "../funcs/workspacesWorkspaceDocumentsDeleteWorkspaceDocument.js"; import { workspacesWorkspaceDocumentsGetWorkspaceDocument } from "../funcs/workspacesWorkspaceDocumentsGetWorkspaceDocument.js"; import { workspacesWorkspaceDocumentsGetWorkspaceDocumentContents } from "../funcs/workspacesWorkspaceDocumentsGetWorkspaceDocumentContents.js"; import { workspacesWorkspaceDocumentsGetWorkspaceDocuments } from "../funcs/workspacesWorkspaceDocumentsGetWorkspaceDocuments.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class WorkspaceDocuments extends ClientSDK { /** * Get documents in the workspace accessible to the calling user * * @remarks * This operation retrieves the documents in the workspace that are accessible to the calling user. Documents may be added directly or automatically through tasks such as envelopes. Documents may be used to create envelopes. * * Pagination is supported by passing `start_position` and `count` in the request. The response will include `resultSetSize`, `start_position`, and `end_position` which may be utilized for subsequent requests. */ async getWorkspaceDocuments( request: operations.GetWorkspaceDocumentsRequest, options?: RequestOptions, ): Promise<components.GetWorkspaceDocumentsResponse> { return unwrapAsync(workspacesWorkspaceDocumentsGetWorkspaceDocuments( this, request, options, )); } /** * Add a document to a workspace via file contents upload * * @remarks * This operation adds a document to a workspace via file contents upload. The file is passed in the request body as a multipart/form-data file. The file name is used as the document name. * * Once added, it may be used to create an envelope associated with the workspace. */ async addWorkspaceDocument( request: operations.AddWorkspaceDocumentRequest, options?: RequestOptions, ): Promise<components.CreateWorkspaceDocumentResponse> { return unwrapAsync(workspacesWorkspaceDocumentsAddWorkspaceDocument( this, request, options, )); } /** * Get information about the document * * @remarks * This operation retrieves information about the document. The response includes the document ID, name, and metadata. */ async getWorkspaceDocument( request: operations.GetWorkspaceDocumentRequest, options?: RequestOptions, ): Promise<components.GetWorkspaceDocumentResponse> { return unwrapAsync(workspacesWorkspaceDocumentsGetWorkspaceDocument( this, request, options, )); } /** * Deletes a document in the workspace * * @remarks * This operation permanently deletes a document by ID. */ async deleteWorkspaceDocument( request: operations.DeleteWorkspaceDocumentRequest, options?: RequestOptions, ): Promise<void> { return unwrapAsync(workspacesWorkspaceDocumentsDeleteWorkspaceDocument( this, request, options, )); } /** * Get the file contents of the document * * @remarks * This operation retrieves the file contents of the document. The file is returned as a stream in the response body. The Content-Disposition response header contains the document name as the `filename`. */ async getWorkspaceDocumentContents( request: operations.GetWorkspaceDocumentContentsRequest, options?: RequestOptions, ): Promise<ReadableStream<Uint8Array>> { return unwrapAsync(workspacesWorkspaceDocumentsGetWorkspaceDocumentContents( this, request, options, )); } }