From cfbcdf6fa65815366d5a903ec312038caae438e4 Mon Sep 17 00:00:00 2001 From: automation-bot Date: Tue, 9 Sep 2025 06:28:40 +0000 Subject: [PATCH] chore: regenerate typescript SDK via Speakeasy --- README.md | 64 ++- RELEASES.md | 12 +- docs/models/components/createworkspacebody.md | 18 + .../createworkspaceenveloperesponse.md | 15 + .../components/createworkspaceresponse.md | 19 + .../createworkspaceuploadrequestassignment.md | 21 + .../createworkspaceuploadrequestbody.md | 25 + .../components/createworkspaceuserresponse.md | 20 + .../getworkspaceassignablerolesresponse.md | 22 + .../getworkspacedocumentresponse.md | 24 + .../getworkspacedocumentsresponse.md | 19 + .../getworkspaceenvelopesresponse.md | 22 + .../models/components/getworkspaceresponse.md | 23 + .../components/getworkspacesresponse.md | 19 + .../getworkspaceuploadrequestresponse.md | 47 ++ .../getworkspaceuploadrequestsresponse.md | 19 + .../components/getworkspaceusersresponse.md | 21 + .../getworkspaceuserssortingoption.md | 15 + docs/models/components/provisions.md | 2 +- .../components/revokeworkspaceuserdetails.md | 15 + .../updateworkspaceuploadrequestbody.md | 37 ++ .../components/updateworkspaceuserresponse.md | 15 + docs/models/components/workspacedocument.md | 23 + .../components/workspacedocumentowner.md | 16 + .../components/workspaceenvelopeforcreate.md | 18 + .../components/workspaceenvelopesummary.md | 25 + .../models/components/workspacerolesummary.md | 18 + docs/models/components/workspacesummary.md | 18 + .../components/workspaceuploadrequest.md | 45 ++ .../workspaceuploadrequestassignment.md | 18 + .../workspaceuploadrequestdocument.md | 16 + .../components/workspaceuploadrequestowner.md | 17 + ...orkspaceuploadrequestresponsibilitytype.md | 17 + .../workspaceuploadrequeststatus.md | 17 + .../components/workspaceuserforcreate.md | 22 + .../components/workspaceuserforupdate.md | 15 + .../models/components/workspaceusersummary.md | 20 + docs/models/errors/errordetails.md | 18 + docs/models/errors/errort.md | 2 +- .../operations/addworkspaceuserrequest.md | 20 + .../completeworkspaceuploadrequestrequest.md | 21 + .../createworkspaceenveloperequest.md | 23 + .../operations/createworkspacerequest.md | 21 + .../createworkspaceuploadrequestrequest.md | 32 ++ .../deleteworkspacedocumentrequest.md | 21 + .../deleteworkspaceuploadrequestrequest.md | 21 + .../getworkspaceassignablerolesrequest.md | 22 + .../getworkspacedocumentcontentsrequest.md | 21 + .../operations/getworkspacedocumentrequest.md | 21 + .../getworkspacedocumentsrequest.md | 22 + .../getworkspaceenvelopesrequest.md | 19 + docs/models/operations/getworkspacerequest.md | 19 + .../models/operations/getworkspacesrequest.md | 19 + .../getworkspaceuploadrequestrequest.md | 21 + .../getworkspaceuploadrequestsrequest.md | 19 + .../operations/getworkspaceusersrequest.md | 23 + .../restoreworkspaceuseraccessrequest.md | 21 + .../revokeworkspaceuseraccessrequest.md | 22 + .../operations/triggerworkflowrequest.md | 7 + .../updateworkspaceuploadrequestrequest.md | 28 + .../operations/updateworkspaceuserrequest.md | 22 + docs/sdks/agreements/README.md | 4 + docs/sdks/auth/README.md | 5 + docs/sdks/tabinfo/README.md | 1 + .../sdks/workflowinstancemanagement/README.md | 3 + docs/sdks/workflows/README.md | 5 + docs/sdks/workspacedocuments/README.md | 327 +++++++++++ docs/sdks/workspaces1/README.md | 6 + docs/sdks/workspaces2/README.md | 501 +++++++++++++++++ docs/sdks/workspaceuploadrequest/README.md | 517 ++++++++++++++++++ docs/sdks/workspaceusers/README.md | 407 ++++++++++++++ examples/.env.template | 14 +- examples/README.md | 5 + examples/authGetUserInfo.example.ts | 4 +- examples/package-lock.json | 15 +- jsr.json | 2 +- package-lock.json | 18 +- package.json | 17 +- ...rkspaceDocumentsDeleteWorkspaceDocument.ts | 198 +++++++ ...sWorkspaceDocumentsGetWorkspaceDocument.ts | 198 +++++++ ...ceDocumentsGetWorkspaceDocumentContents.ts | 200 +++++++ ...WorkspaceDocumentsGetWorkspaceDocuments.ts | 203 +++++++ ...adRequestCompleteWorkspaceUploadRequest.ts | 200 +++++++ ...loadRequestCreateWorkspaceUploadRequest.ts | 199 +++++++ ...loadRequestDeleteWorkspaceUploadRequest.ts | 200 +++++++ ...eUploadRequestGetWorkspaceUploadRequest.ts | 198 +++++++ ...UploadRequestGetWorkspaceUploadRequests.ts | 194 +++++++ ...loadRequestUpdateWorkspaceUploadRequest.ts | 203 +++++++ ...orkspacesWorkspaceUsersAddWorkspaceUser.ts | 198 +++++++ ...rkspacesWorkspaceUsersGetWorkspaceUsers.ts | 203 +++++++ ...orkspaceUsersRestoreWorkspaceUserAccess.ts | 198 +++++++ ...WorkspaceUsersRevokeWorkspaceUserAccess.ts | 201 +++++++ ...spacesWorkspaceUsersUpdateWorkspaceUser.ts | 201 +++++++ .../workspacesWorkspacesCreateWorkspace.ts | 192 +++++++ ...spacesWorkspacesCreateWorkspaceEnvelope.ts | 205 +++++++ src/funcs/workspacesWorkspacesGetWorkspace.ts | 193 +++++++ ...esWorkspacesGetWorkspaceAssignableRoles.ts | 205 +++++++ ...rkspacesWorkspacesGetWorkspaceEnvelopes.ts | 196 +++++++ .../workspacesWorkspacesGetWorkspaces.ts | 195 +++++++ src/lib/config.ts | 6 +- src/lib/security.ts | 5 +- src/models/components/agreement.ts | 3 + src/models/components/createworkspacebody.ts | 85 +++ .../createworkspaceenveloperesponse.ts | 77 +++ .../components/createworkspaceresponse.ts | 114 ++++ .../createworkspaceuploadrequestassignment.ts | 126 +++++ .../createworkspaceuploadrequestbody.ts | 123 +++++ .../components/createworkspaceuserresponse.ts | 123 +++++ .../getworkspaceassignablerolesresponse.ts | 132 +++++ .../getworkspacedocumentresponse.ts | 132 +++++ .../getworkspacedocumentsresponse.ts | 120 ++++ .../getworkspaceenvelopesresponse.ts | 77 +++ src/models/components/getworkspaceresponse.ts | 117 ++++ .../components/getworkspacesresponse.ts | 118 ++++ .../getworkspaceuploadrequestresponse.ts | 244 +++++++++ .../getworkspaceuploadrequestsresponse.ts | 82 +++ .../components/getworkspaceusersresponse.ts | 118 ++++ .../getworkspaceuserssortingoption.ts | 39 ++ src/models/components/index.ts | 34 ++ .../components/revokeworkspaceuserdetails.ts | 81 +++ .../updateworkspaceuploadrequestbody.ts | 237 ++++++++ .../components/updateworkspaceuserresponse.ts | 80 +++ src/models/components/workspacedocument.ts | 134 +++++ .../components/workspacedocumentowner.ts | 87 +++ .../components/workspaceenvelopeforcreate.ts | 87 +++ .../components/workspaceenvelopesummary.ts | 125 +++++ src/models/components/workspacerolesummary.ts | 105 ++++ src/models/components/workspacesummary.ts | 105 ++++ .../components/workspaceuploadrequest.ts | 238 ++++++++ .../workspaceuploadrequestassignment.ts | 99 ++++ .../workspaceuploadrequestdocument.ts | 89 +++ .../components/workspaceuploadrequestowner.ts | 80 +++ ...orkspaceuploadrequestresponsibilitytype.ts | 43 ++ .../workspaceuploadrequeststatus.ts | 44 ++ .../components/workspaceuserforcreate.ts | 103 ++++ .../components/workspaceuserforupdate.ts | 78 +++ src/models/components/workspaceusersummary.ts | 121 ++++ src/models/errors/error.ts | 10 +- src/models/errors/errordetails.ts | 107 ++++ src/models/errors/index.ts | 1 + src/models/operations/addworkspaceuser.ts | 97 ++++ .../completeworkspaceuploadrequest.ts | 88 +++ src/models/operations/createworkspace.ts | 86 +++ .../operations/createworkspaceenvelope.ts | 97 ++++ .../createworkspaceuploadrequest.ts | 101 ++++ .../operations/deleteworkspacedocument.ts | 85 +++ .../deleteworkspaceuploadrequest.ts | 88 +++ src/models/operations/getworkspace.ts | 76 +++ .../operations/getworkspaceassignableroles.ts | 110 ++++ src/models/operations/getworkspacedocument.ts | 85 +++ .../getworkspacedocumentcontents.ts | 88 +++ .../operations/getworkspacedocuments.ts | 110 ++++ .../operations/getworkspaceenvelopes.ts | 78 +++ src/models/operations/getworkspaces.ts | 92 ++++ .../operations/getworkspaceuploadrequest.ts | 85 +++ .../operations/getworkspaceuploadrequests.ts | 79 +++ src/models/operations/getworkspaceusers.ts | 114 ++++ src/models/operations/index.ts | 21 + .../operations/restoreworkspaceuseraccess.ts | 86 +++ .../operations/revokeworkspaceuseraccess.ts | 108 ++++ .../updateworkspaceuploadrequest.ts | 108 ++++ src/models/operations/updateworkspaceuser.ts | 104 ++++ src/sdk/sdk.ts | 6 + src/sdk/workspacedocuments.ts | 84 +++ src/sdk/workspaces1.ts | 33 ++ src/sdk/workspaces2.ts | 136 +++++ src/sdk/workspaceuploadrequest.ts | 130 +++++ src/sdk/workspaceusers.ts | 104 ++++ src/security/scopes.ts | 18 + 169 files changed, 13689 insertions(+), 52 deletions(-) create mode 100644 docs/models/components/createworkspacebody.md create mode 100644 docs/models/components/createworkspaceenveloperesponse.md create mode 100644 docs/models/components/createworkspaceresponse.md create mode 100644 docs/models/components/createworkspaceuploadrequestassignment.md create mode 100644 docs/models/components/createworkspaceuploadrequestbody.md create mode 100644 docs/models/components/createworkspaceuserresponse.md create mode 100644 docs/models/components/getworkspaceassignablerolesresponse.md create mode 100644 docs/models/components/getworkspacedocumentresponse.md create mode 100644 docs/models/components/getworkspacedocumentsresponse.md create mode 100644 docs/models/components/getworkspaceenvelopesresponse.md create mode 100644 docs/models/components/getworkspaceresponse.md create mode 100644 docs/models/components/getworkspacesresponse.md create mode 100644 docs/models/components/getworkspaceuploadrequestresponse.md create mode 100644 docs/models/components/getworkspaceuploadrequestsresponse.md create mode 100644 docs/models/components/getworkspaceusersresponse.md create mode 100644 docs/models/components/getworkspaceuserssortingoption.md create mode 100644 docs/models/components/revokeworkspaceuserdetails.md create mode 100644 docs/models/components/updateworkspaceuploadrequestbody.md create mode 100644 docs/models/components/updateworkspaceuserresponse.md create mode 100644 docs/models/components/workspacedocument.md create mode 100644 docs/models/components/workspacedocumentowner.md create mode 100644 docs/models/components/workspaceenvelopeforcreate.md create mode 100644 docs/models/components/workspaceenvelopesummary.md create mode 100644 docs/models/components/workspacerolesummary.md create mode 100644 docs/models/components/workspacesummary.md create mode 100644 docs/models/components/workspaceuploadrequest.md create mode 100644 docs/models/components/workspaceuploadrequestassignment.md create mode 100644 docs/models/components/workspaceuploadrequestdocument.md create mode 100644 docs/models/components/workspaceuploadrequestowner.md create mode 100644 docs/models/components/workspaceuploadrequestresponsibilitytype.md create mode 100644 docs/models/components/workspaceuploadrequeststatus.md create mode 100644 docs/models/components/workspaceuserforcreate.md create mode 100644 docs/models/components/workspaceuserforupdate.md create mode 100644 docs/models/components/workspaceusersummary.md create mode 100644 docs/models/errors/errordetails.md create mode 100644 docs/models/operations/addworkspaceuserrequest.md create mode 100644 docs/models/operations/completeworkspaceuploadrequestrequest.md create mode 100644 docs/models/operations/createworkspaceenveloperequest.md create mode 100644 docs/models/operations/createworkspacerequest.md create mode 100644 docs/models/operations/createworkspaceuploadrequestrequest.md create mode 100644 docs/models/operations/deleteworkspacedocumentrequest.md create mode 100644 docs/models/operations/deleteworkspaceuploadrequestrequest.md create mode 100644 docs/models/operations/getworkspaceassignablerolesrequest.md create mode 100644 docs/models/operations/getworkspacedocumentcontentsrequest.md create mode 100644 docs/models/operations/getworkspacedocumentrequest.md create mode 100644 docs/models/operations/getworkspacedocumentsrequest.md create mode 100644 docs/models/operations/getworkspaceenvelopesrequest.md create mode 100644 docs/models/operations/getworkspacerequest.md create mode 100644 docs/models/operations/getworkspacesrequest.md create mode 100644 docs/models/operations/getworkspaceuploadrequestrequest.md create mode 100644 docs/models/operations/getworkspaceuploadrequestsrequest.md create mode 100644 docs/models/operations/getworkspaceusersrequest.md create mode 100644 docs/models/operations/restoreworkspaceuseraccessrequest.md create mode 100644 docs/models/operations/revokeworkspaceuseraccessrequest.md create mode 100644 docs/models/operations/updateworkspaceuploadrequestrequest.md create mode 100644 docs/models/operations/updateworkspaceuserrequest.md create mode 100644 docs/sdks/workspacedocuments/README.md create mode 100644 docs/sdks/workspaces1/README.md create mode 100644 docs/sdks/workspaces2/README.md create mode 100644 docs/sdks/workspaceuploadrequest/README.md create mode 100644 docs/sdks/workspaceusers/README.md create mode 100644 src/funcs/workspacesWorkspaceDocumentsDeleteWorkspaceDocument.ts create mode 100644 src/funcs/workspacesWorkspaceDocumentsGetWorkspaceDocument.ts create mode 100644 src/funcs/workspacesWorkspaceDocumentsGetWorkspaceDocumentContents.ts create mode 100644 src/funcs/workspacesWorkspaceDocumentsGetWorkspaceDocuments.ts create mode 100644 src/funcs/workspacesWorkspaceUploadRequestCompleteWorkspaceUploadRequest.ts create mode 100644 src/funcs/workspacesWorkspaceUploadRequestCreateWorkspaceUploadRequest.ts create mode 100644 src/funcs/workspacesWorkspaceUploadRequestDeleteWorkspaceUploadRequest.ts create mode 100644 src/funcs/workspacesWorkspaceUploadRequestGetWorkspaceUploadRequest.ts create mode 100644 src/funcs/workspacesWorkspaceUploadRequestGetWorkspaceUploadRequests.ts create mode 100644 src/funcs/workspacesWorkspaceUploadRequestUpdateWorkspaceUploadRequest.ts create mode 100644 src/funcs/workspacesWorkspaceUsersAddWorkspaceUser.ts create mode 100644 src/funcs/workspacesWorkspaceUsersGetWorkspaceUsers.ts create mode 100644 src/funcs/workspacesWorkspaceUsersRestoreWorkspaceUserAccess.ts create mode 100644 src/funcs/workspacesWorkspaceUsersRevokeWorkspaceUserAccess.ts create mode 100644 src/funcs/workspacesWorkspaceUsersUpdateWorkspaceUser.ts create mode 100644 src/funcs/workspacesWorkspacesCreateWorkspace.ts create mode 100644 src/funcs/workspacesWorkspacesCreateWorkspaceEnvelope.ts create mode 100644 src/funcs/workspacesWorkspacesGetWorkspace.ts create mode 100644 src/funcs/workspacesWorkspacesGetWorkspaceAssignableRoles.ts create mode 100644 src/funcs/workspacesWorkspacesGetWorkspaceEnvelopes.ts create mode 100644 src/funcs/workspacesWorkspacesGetWorkspaces.ts create mode 100644 src/models/components/createworkspacebody.ts create mode 100644 src/models/components/createworkspaceenveloperesponse.ts create mode 100644 src/models/components/createworkspaceresponse.ts create mode 100644 src/models/components/createworkspaceuploadrequestassignment.ts create mode 100644 src/models/components/createworkspaceuploadrequestbody.ts create mode 100644 src/models/components/createworkspaceuserresponse.ts create mode 100644 src/models/components/getworkspaceassignablerolesresponse.ts create mode 100644 src/models/components/getworkspacedocumentresponse.ts create mode 100644 src/models/components/getworkspacedocumentsresponse.ts create mode 100644 src/models/components/getworkspaceenvelopesresponse.ts create mode 100644 src/models/components/getworkspaceresponse.ts create mode 100644 src/models/components/getworkspacesresponse.ts create mode 100644 src/models/components/getworkspaceuploadrequestresponse.ts create mode 100644 src/models/components/getworkspaceuploadrequestsresponse.ts create mode 100644 src/models/components/getworkspaceusersresponse.ts create mode 100644 src/models/components/getworkspaceuserssortingoption.ts create mode 100644 src/models/components/revokeworkspaceuserdetails.ts create mode 100644 src/models/components/updateworkspaceuploadrequestbody.ts create mode 100644 src/models/components/updateworkspaceuserresponse.ts create mode 100644 src/models/components/workspacedocument.ts create mode 100644 src/models/components/workspacedocumentowner.ts create mode 100644 src/models/components/workspaceenvelopeforcreate.ts create mode 100644 src/models/components/workspaceenvelopesummary.ts create mode 100644 src/models/components/workspacerolesummary.ts create mode 100644 src/models/components/workspacesummary.ts create mode 100644 src/models/components/workspaceuploadrequest.ts create mode 100644 src/models/components/workspaceuploadrequestassignment.ts create mode 100644 src/models/components/workspaceuploadrequestdocument.ts create mode 100644 src/models/components/workspaceuploadrequestowner.ts create mode 100644 src/models/components/workspaceuploadrequestresponsibilitytype.ts create mode 100644 src/models/components/workspaceuploadrequeststatus.ts create mode 100644 src/models/components/workspaceuserforcreate.ts create mode 100644 src/models/components/workspaceuserforupdate.ts create mode 100644 src/models/components/workspaceusersummary.ts create mode 100644 src/models/errors/errordetails.ts create mode 100644 src/models/operations/addworkspaceuser.ts create mode 100644 src/models/operations/completeworkspaceuploadrequest.ts create mode 100644 src/models/operations/createworkspace.ts create mode 100644 src/models/operations/createworkspaceenvelope.ts create mode 100644 src/models/operations/createworkspaceuploadrequest.ts create mode 100644 src/models/operations/deleteworkspacedocument.ts create mode 100644 src/models/operations/deleteworkspaceuploadrequest.ts create mode 100644 src/models/operations/getworkspace.ts create mode 100644 src/models/operations/getworkspaceassignableroles.ts create mode 100644 src/models/operations/getworkspacedocument.ts create mode 100644 src/models/operations/getworkspacedocumentcontents.ts create mode 100644 src/models/operations/getworkspacedocuments.ts create mode 100644 src/models/operations/getworkspaceenvelopes.ts create mode 100644 src/models/operations/getworkspaces.ts create mode 100644 src/models/operations/getworkspaceuploadrequest.ts create mode 100644 src/models/operations/getworkspaceuploadrequests.ts create mode 100644 src/models/operations/getworkspaceusers.ts create mode 100644 src/models/operations/restoreworkspaceuseraccess.ts create mode 100644 src/models/operations/revokeworkspaceuseraccess.ts create mode 100644 src/models/operations/updateworkspaceuploadrequest.ts create mode 100644 src/models/operations/updateworkspaceuser.ts create mode 100644 src/sdk/workspacedocuments.ts create mode 100644 src/sdk/workspaces1.ts create mode 100644 src/sdk/workspaces2.ts create mode 100644 src/sdk/workspaceuploadrequest.ts create mode 100644 src/sdk/workspaceusers.ts diff --git a/README.md b/README.md index 1ec98b7..9d54b11 100644 --- a/README.md +++ b/README.md @@ -222,6 +222,42 @@ run(); * [deleteAgreement](docs/sdks/agreements/README.md#deleteagreement) - Delete a specific agreement * [createAgreementSummary](docs/sdks/agreements/README.md#createagreementsummary) - Create an AI-generated summary of an agreement document +### [workspaces](docs/sdks/workspaces1/README.md) + + +#### [workspaces.workspaceDocuments](docs/sdks/workspacedocuments/README.md) + +* [getWorkspaceDocuments](docs/sdks/workspacedocuments/README.md#getworkspacedocuments) - Get documents in the workspace accessible to the calling user +* [getWorkspaceDocument](docs/sdks/workspacedocuments/README.md#getworkspacedocument) - Get information about the document +* [deleteWorkspaceDocument](docs/sdks/workspacedocuments/README.md#deleteworkspacedocument) - Deletes a document in the workspace +* [getWorkspaceDocumentContents](docs/sdks/workspacedocuments/README.md#getworkspacedocumentcontents) - Get the file contents of the document + +#### [workspaces.workspaces](docs/sdks/workspaces2/README.md) + +* [getWorkspaces](docs/sdks/workspaces2/README.md#getworkspaces) - Gets workspaces available to the calling user +* [createWorkspace](docs/sdks/workspaces2/README.md#createworkspace) - Creates a new workspace +* [getWorkspace](docs/sdks/workspaces2/README.md#getworkspace) - Returns details about the workspace +* [getWorkspaceAssignableRoles](docs/sdks/workspaces2/README.md#getworkspaceassignableroles) - Returns the roles the caller can assign to workspace users +* [createWorkspaceEnvelope](docs/sdks/workspaces2/README.md#createworkspaceenvelope) - Creates an envelope with the given documents. Returns the ID of the created envelope +* [getWorkspaceEnvelopes](docs/sdks/workspaces2/README.md#getworkspaceenvelopes) - Returns the envelopes associated with the given workspace + +#### [workspaces.workspaceUploadRequest](docs/sdks/workspaceuploadrequest/README.md) + +* [createWorkspaceUploadRequest](docs/sdks/workspaceuploadrequest/README.md#createworkspaceuploadrequest) - Creates a new upload request within a workspace +* [getWorkspaceUploadRequests](docs/sdks/workspaceuploadrequest/README.md#getworkspaceuploadrequests) - Gets upload requests within a workspace +* [getWorkspaceUploadRequest](docs/sdks/workspaceuploadrequest/README.md#getworkspaceuploadrequest) - Gets details for a specific upload request +* [updateWorkspaceUploadRequest](docs/sdks/workspaceuploadrequest/README.md#updateworkspaceuploadrequest) - Updates a specific upload request +* [deleteWorkspaceUploadRequest](docs/sdks/workspaceuploadrequest/README.md#deleteworkspaceuploadrequest) - Deletes a specific upload request +* [completeWorkspaceUploadRequest](docs/sdks/workspaceuploadrequest/README.md#completeworkspaceuploadrequest) - Complete an upload request + +#### [workspaces.workspaceUsers](docs/sdks/workspaceusers/README.md) + +* [getWorkspaceUsers](docs/sdks/workspaceusers/README.md#getworkspaceusers) - Retrieves the list of users in the given workspace +* [addWorkspaceUser](docs/sdks/workspaceusers/README.md#addworkspaceuser) - Adds a user to the workspace by email address +* [updateWorkspaceUser](docs/sdks/workspaceusers/README.md#updateworkspaceuser) - Updates the specified user's role +* [revokeWorkspaceUserAccess](docs/sdks/workspaceusers/README.md#revokeworkspaceuseraccess) - Revokes the specified user's access to the workspace +* [restoreWorkspaceUserAccess](docs/sdks/workspaceusers/README.md#restoreworkspaceuseraccess) - Restores the specified user's access to the workspace + @@ -258,6 +294,27 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [`navigatorAgreementsDeleteAgreement`](docs/sdks/agreements/README.md#deleteagreement) - Delete a specific agreement - [`navigatorAgreementsGetAgreement`](docs/sdks/agreements/README.md#getagreement) - Retrieve detailed information about a specific agreement - [`navigatorAgreementsGetAgreementsList`](docs/sdks/agreements/README.md#getagreementslist) - Retrieve a list of agreements +- [`workspacesWorkspaceDocumentsDeleteWorkspaceDocument`](docs/sdks/workspacedocuments/README.md#deleteworkspacedocument) - Deletes a document in the workspace +- [`workspacesWorkspaceDocumentsGetWorkspaceDocument`](docs/sdks/workspacedocuments/README.md#getworkspacedocument) - Get information about the document +- [`workspacesWorkspaceDocumentsGetWorkspaceDocumentContents`](docs/sdks/workspacedocuments/README.md#getworkspacedocumentcontents) - Get the file contents of the document +- [`workspacesWorkspaceDocumentsGetWorkspaceDocuments`](docs/sdks/workspacedocuments/README.md#getworkspacedocuments) - Get documents in the workspace accessible to the calling user +- [`workspacesWorkspacesCreateWorkspace`](docs/sdks/workspaces2/README.md#createworkspace) - Creates a new workspace +- [`workspacesWorkspacesCreateWorkspaceEnvelope`](docs/sdks/workspaces2/README.md#createworkspaceenvelope) - Creates an envelope with the given documents. Returns the ID of the created envelope +- [`workspacesWorkspacesGetWorkspace`](docs/sdks/workspaces2/README.md#getworkspace) - Returns details about the workspace +- [`workspacesWorkspacesGetWorkspaceAssignableRoles`](docs/sdks/workspaces2/README.md#getworkspaceassignableroles) - Returns the roles the caller can assign to workspace users +- [`workspacesWorkspacesGetWorkspaceEnvelopes`](docs/sdks/workspaces2/README.md#getworkspaceenvelopes) - Returns the envelopes associated with the given workspace +- [`workspacesWorkspacesGetWorkspaces`](docs/sdks/workspaces2/README.md#getworkspaces) - Gets workspaces available to the calling user +- [`workspacesWorkspaceUploadRequestCompleteWorkspaceUploadRequest`](docs/sdks/workspaceuploadrequest/README.md#completeworkspaceuploadrequest) - Complete an upload request +- [`workspacesWorkspaceUploadRequestCreateWorkspaceUploadRequest`](docs/sdks/workspaceuploadrequest/README.md#createworkspaceuploadrequest) - Creates a new upload request within a workspace +- [`workspacesWorkspaceUploadRequestDeleteWorkspaceUploadRequest`](docs/sdks/workspaceuploadrequest/README.md#deleteworkspaceuploadrequest) - Deletes a specific upload request +- [`workspacesWorkspaceUploadRequestGetWorkspaceUploadRequest`](docs/sdks/workspaceuploadrequest/README.md#getworkspaceuploadrequest) - Gets details for a specific upload request +- [`workspacesWorkspaceUploadRequestGetWorkspaceUploadRequests`](docs/sdks/workspaceuploadrequest/README.md#getworkspaceuploadrequests) - Gets upload requests within a workspace +- [`workspacesWorkspaceUploadRequestUpdateWorkspaceUploadRequest`](docs/sdks/workspaceuploadrequest/README.md#updateworkspaceuploadrequest) - Updates a specific upload request +- [`workspacesWorkspaceUsersAddWorkspaceUser`](docs/sdks/workspaceusers/README.md#addworkspaceuser) - Adds a user to the workspace by email address +- [`workspacesWorkspaceUsersGetWorkspaceUsers`](docs/sdks/workspaceusers/README.md#getworkspaceusers) - Retrieves the list of users in the given workspace +- [`workspacesWorkspaceUsersRestoreWorkspaceUserAccess`](docs/sdks/workspaceusers/README.md#restoreworkspaceuseraccess) - Restores the specified user's access to the workspace +- [`workspacesWorkspaceUsersRevokeWorkspaceUserAccess`](docs/sdks/workspaceusers/README.md#revokeworkspaceuseraccess) - Revokes the specified user's access to the workspace +- [`workspacesWorkspaceUsersUpdateWorkspaceUser`](docs/sdks/workspaceusers/README.md#updateworkspaceuser) - Updates the specified user's role @@ -388,7 +445,7 @@ run(); **Primary error:** * [`IamClientError`](./src/models/errors/iamclienterror.ts): The base class for HTTP error responses. -
Less common errors (8) +
Less common errors (9)
@@ -401,8 +458,9 @@ run(); **Inherit from [`IamClientError`](./src/models/errors/iamclienterror.ts)**: -* [`ErrorT`](./src/models/errors/errort.ts): Bad Request - The request could not be understood or was missing required parameters. Applicable to 11 of 18 methods.* -* [`OAuthErrorResponse`](./src/models/errors/oautherrorresponse.ts): Status code `400`. Applicable to 5 of 18 methods.* +* [`ErrorDetails`](./src/models/errors/errordetails.ts): The error response object for the Workspaces API. Applicable to 21 of 39 methods.* +* [`ErrorT`](./src/models/errors/errort.ts): Bad Request - The request could not be understood or was missing required parameters. Applicable to 11 of 39 methods.* +* [`OAuthErrorResponse`](./src/models/errors/oautherrorresponse.ts): Status code `400`. Applicable to 5 of 39 methods.* * [`ResponseValidationError`](./src/models/errors/responsevalidationerror.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string.
diff --git a/RELEASES.md b/RELEASES.md index 2c3f180..d3a02b0 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -48,4 +48,14 @@ Based on: ### Generated - [typescript v1.0.0-beta.3] . ### Releases -- [NPM v1.0.0-beta.3] https://www.npmjs.com/package/@docusign/iam-sdk/v/1.0.0-beta.3 - . \ No newline at end of file +- [NPM v1.0.0-beta.3] https://www.npmjs.com/package/@docusign/iam-sdk/v/1.0.0-beta.3 - . + +## 2025-09-03 17:15:21 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.609.0 (2.692.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v1.0.0-beta.4] . +### Releases +- [NPM v1.0.0-beta.4] https://www.npmjs.com/package/@docusign/iam-sdk/v/1.0.0-beta.4 - . \ No newline at end of file diff --git a/docs/models/components/createworkspacebody.md b/docs/models/components/createworkspacebody.md new file mode 100644 index 0000000..d13adbd --- /dev/null +++ b/docs/models/components/createworkspacebody.md @@ -0,0 +1,18 @@ +# CreateWorkspaceBody + +## Example Usage + +```typescript +import { CreateWorkspaceBody } from "@docusign/iam-sdk/models/components"; + +let value: CreateWorkspaceBody = { + name: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_check_mark: | The name of the workspace | +| `brandId` | *string* | :heavy_minus_sign: | A GUID value that identifies a brand. For more information, see Branding | \ No newline at end of file diff --git a/docs/models/components/createworkspaceenveloperesponse.md b/docs/models/components/createworkspaceenveloperesponse.md new file mode 100644 index 0000000..3960aa7 --- /dev/null +++ b/docs/models/components/createworkspaceenveloperesponse.md @@ -0,0 +1,15 @@ +# CreateWorkspaceEnvelopeResponse + +## Example Usage + +```typescript +import { CreateWorkspaceEnvelopeResponse } from "@docusign/iam-sdk/models/components"; + +let value: CreateWorkspaceEnvelopeResponse = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `envelopeId` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/createworkspaceresponse.md b/docs/models/components/createworkspaceresponse.md new file mode 100644 index 0000000..1e82038 --- /dev/null +++ b/docs/models/components/createworkspaceresponse.md @@ -0,0 +1,19 @@ +# CreateWorkspaceResponse + +## Example Usage + +```typescript +import { CreateWorkspaceResponse } from "@docusign/iam-sdk/models/components"; + +let value: CreateWorkspaceResponse = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `workspaceId` | *string* | :heavy_minus_sign: | The ID of the workspace | +| `name` | *string* | :heavy_minus_sign: | The name of the workspace | +| `createdDate` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The date the workspace was created | +| `createdByUserId` | *string* | :heavy_minus_sign: | The ID of the user who created the workspace | +| `workspaceOwnerIds` | *string*[] | :heavy_minus_sign: | The list of user IDs of the workspace owners | \ No newline at end of file diff --git a/docs/models/components/createworkspaceuploadrequestassignment.md b/docs/models/components/createworkspaceuploadrequestassignment.md new file mode 100644 index 0000000..5c28f5c --- /dev/null +++ b/docs/models/components/createworkspaceuploadrequestassignment.md @@ -0,0 +1,21 @@ +# CreateWorkspaceUploadRequestAssignment + +## Example Usage + +```typescript +import { CreateWorkspaceUploadRequestAssignment } from "@docusign/iam-sdk/models/components"; + +let value: CreateWorkspaceUploadRequestAssignment = { + uploadRequestResponsibilityTypeId: "watcher", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `assigneeUserId` | *string* | :heavy_minus_sign: | The ID of the assigned user | +| `uploadRequestResponsibilityTypeId` | [components.WorkspaceUploadRequestResponsibilityType](../../models/components/workspaceuploadrequestresponsibilitytype.md) | :heavy_check_mark: | Enum representing the responsibility type for a workspace upload request assignment | +| `firstName` | *string* | :heavy_minus_sign: | The first name of the assignee | +| `lastName` | *string* | :heavy_minus_sign: | The last name of the assignee | +| `email` | *string* | :heavy_minus_sign: | The email of the assignee | \ No newline at end of file diff --git a/docs/models/components/createworkspaceuploadrequestbody.md b/docs/models/components/createworkspaceuploadrequestbody.md new file mode 100644 index 0000000..e2ccde9 --- /dev/null +++ b/docs/models/components/createworkspaceuploadrequestbody.md @@ -0,0 +1,25 @@ +# CreateWorkspaceUploadRequestBody + +## Example Usage + +```typescript +import { CreateWorkspaceUploadRequestBody } from "@docusign/iam-sdk/models/components"; + +let value: CreateWorkspaceUploadRequestBody = { + name: "", + description: "husband from than", + dueDate: new Date("2023-09-12T01:57:32.078Z"), + assignments: [], + status: "complete", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `name` | *string* | :heavy_check_mark: | The name of the upload request | +| `description` | *string* | :heavy_check_mark: | The description of the upload request | +| `dueDate` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | The due date for the upload request | +| `assignments` | [components.CreateWorkspaceUploadRequestAssignment](../../models/components/createworkspaceuploadrequestassignment.md)[] | :heavy_check_mark: | List of user assignments for the upload request | +| `status` | [components.WorkspaceUploadRequestStatus](../../models/components/workspaceuploadrequeststatus.md) | :heavy_check_mark: | Enum representing the status of a workspace upload request | \ No newline at end of file diff --git a/docs/models/components/createworkspaceuserresponse.md b/docs/models/components/createworkspaceuserresponse.md new file mode 100644 index 0000000..e2336c3 --- /dev/null +++ b/docs/models/components/createworkspaceuserresponse.md @@ -0,0 +1,20 @@ +# CreateWorkspaceUserResponse + +## Example Usage + +```typescript +import { CreateWorkspaceUserResponse } from "@docusign/iam-sdk/models/components"; + +let value: CreateWorkspaceUserResponse = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | +| `workspaceId` | *string* | :heavy_minus_sign: | The ID of the workspace | +| `userId` | *string* | :heavy_minus_sign: | The ID of the user | +| `roleId` | *string* | :heavy_minus_sign: | The ID of the role assigned to the user | +| `email` | *string* | :heavy_minus_sign: | The email of the user | +| `firstName` | *string* | :heavy_minus_sign: | The first name of the user | +| `lastName` | *string* | :heavy_minus_sign: | The last name of the user | \ No newline at end of file diff --git a/docs/models/components/getworkspaceassignablerolesresponse.md b/docs/models/components/getworkspaceassignablerolesresponse.md new file mode 100644 index 0000000..43373e1 --- /dev/null +++ b/docs/models/components/getworkspaceassignablerolesresponse.md @@ -0,0 +1,22 @@ +# GetWorkspaceAssignableRolesResponse + +## Example Usage + +```typescript +import { GetWorkspaceAssignableRolesResponse } from "@docusign/iam-sdk/models/components"; + +let value: GetWorkspaceAssignableRolesResponse = { + roles: [], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `roles` | [components.WorkspaceRoleSummary](../../models/components/workspacerolesummary.md)[] | :heavy_check_mark: | The list of roles that can be assigned to the workspace | +| `resultSetSize` | *number* | :heavy_minus_sign: | The number of roles returned in the response. Always equal or less than the `count` of the request | +| `startPosition` | *number* | :heavy_minus_sign: | Position of the first item in the total results | +| `endPosition` | *number* | :heavy_minus_sign: | Position of the last item in the total results | +| `totalRowCount` | *number* | :heavy_minus_sign: | The total number of roles applicable to the request regardless of pagination. It may not always be computed | +| `currentRoleId` | *string* | :heavy_minus_sign: | The optional ID of the current role. It may not always be computed | \ No newline at end of file diff --git a/docs/models/components/getworkspacedocumentresponse.md b/docs/models/components/getworkspacedocumentresponse.md new file mode 100644 index 0000000..e1c0338 --- /dev/null +++ b/docs/models/components/getworkspacedocumentresponse.md @@ -0,0 +1,24 @@ +# GetWorkspaceDocumentResponse + +## Example Usage + +```typescript +import { GetWorkspaceDocumentResponse } from "@docusign/iam-sdk/models/components"; + +let value: GetWorkspaceDocumentResponse = { + documentId: "42d653ad-f312-4b7f-9abd-3fb0c72cb02d", + name: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `workspaceId` | *string* | :heavy_minus_sign: | The ID of the workspace | +| `documentId` | *string* | :heavy_check_mark: | The ID of the document | +| `name` | *string* | :heavy_check_mark: | The name of the document | +| `ownerId` | *string* | :heavy_minus_sign: | The ID of the owner of the document | +| `size` | *number* | :heavy_minus_sign: | The size of the document in bytes | +| `createdDate` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The date the document was created | +| `contentType` | *string* | :heavy_minus_sign: | The document content type | \ No newline at end of file diff --git a/docs/models/components/getworkspacedocumentsresponse.md b/docs/models/components/getworkspacedocumentsresponse.md new file mode 100644 index 0000000..f070631 --- /dev/null +++ b/docs/models/components/getworkspacedocumentsresponse.md @@ -0,0 +1,19 @@ +# GetWorkspaceDocumentsResponse + +## Example Usage + +```typescript +import { GetWorkspaceDocumentsResponse } from "@docusign/iam-sdk/models/components"; + +let value: GetWorkspaceDocumentsResponse = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `documents` | [components.WorkspaceDocument](../../models/components/workspacedocument.md)[] | :heavy_minus_sign: | The document summary list. Includes the ID, name, and metadata | +| `resultSetSize` | *number* | :heavy_minus_sign: | The number of documents returned in the response. Always equal or less than the `count` of the request | +| `startPosition` | *number* | :heavy_minus_sign: | Position of the first item in the total results | +| `endPosition` | *number* | :heavy_minus_sign: | Position of the last item in the total results | +| `totalRowCount` | *number* | :heavy_minus_sign: | The total number of documents in the workspace applicable to the request regardless of pagination. It may not always be computed | \ No newline at end of file diff --git a/docs/models/components/getworkspaceenvelopesresponse.md b/docs/models/components/getworkspaceenvelopesresponse.md new file mode 100644 index 0000000..1c6cb4f --- /dev/null +++ b/docs/models/components/getworkspaceenvelopesresponse.md @@ -0,0 +1,22 @@ +# GetWorkspaceEnvelopesResponse + +## Example Usage + +```typescript +import { GetWorkspaceEnvelopesResponse } from "@docusign/iam-sdk/models/components"; + +let value: GetWorkspaceEnvelopesResponse = { + envelopes: [ + { + envelopeId: "", + status: "", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `envelopes` | [components.WorkspaceEnvelopeSummary](../../models/components/workspaceenvelopesummary.md)[] | :heavy_check_mark: | The summary list of envelopes associated with the workspace | \ No newline at end of file diff --git a/docs/models/components/getworkspaceresponse.md b/docs/models/components/getworkspaceresponse.md new file mode 100644 index 0000000..d4ac844 --- /dev/null +++ b/docs/models/components/getworkspaceresponse.md @@ -0,0 +1,23 @@ +# GetWorkspaceResponse + +The details of a single workspace + +## Example Usage + +```typescript +import { GetWorkspaceResponse } from "@docusign/iam-sdk/models/components"; + +let value: GetWorkspaceResponse = { + workspaceId: "aa15bb74-7a49-4fe8-a333-b8c420517a0c", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace | +| `name` | *string* | :heavy_minus_sign: | The name of the workspace | +| `createdDate` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The date the workspace was created | +| `createdByUserId` | *string* | :heavy_minus_sign: | The ID of the user who created the workspace | +| `workspaceOwnerIds` | *string*[] | :heavy_minus_sign: | The list of user IDs of the workspace owners | \ No newline at end of file diff --git a/docs/models/components/getworkspacesresponse.md b/docs/models/components/getworkspacesresponse.md new file mode 100644 index 0000000..722ecc1 --- /dev/null +++ b/docs/models/components/getworkspacesresponse.md @@ -0,0 +1,19 @@ +# GetWorkspacesResponse + +## Example Usage + +```typescript +import { GetWorkspacesResponse } from "@docusign/iam-sdk/models/components"; + +let value: GetWorkspacesResponse = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `workspaces` | [components.WorkspaceSummary](../../models/components/workspacesummary.md)[] | :heavy_minus_sign: | The workspace summary list. Includes the ID, name, and creation metadata | +| `resultSetSize` | *number* | :heavy_minus_sign: | The number of workspaces returned in the response. Always equal or less than the `count` of the request | +| `startPosition` | *number* | :heavy_minus_sign: | Position of the first item in the total results | +| `endPosition` | *number* | :heavy_minus_sign: | Position of the last item in the total results | +| `totalRowCount` | *number* | :heavy_minus_sign: | The total number of workspaces applicable to the request regardless of pagination. It may not always be computed | \ No newline at end of file diff --git a/docs/models/components/getworkspaceuploadrequestresponse.md b/docs/models/components/getworkspaceuploadrequestresponse.md new file mode 100644 index 0000000..c82c22f --- /dev/null +++ b/docs/models/components/getworkspaceuploadrequestresponse.md @@ -0,0 +1,47 @@ +# GetWorkspaceUploadRequestResponse + +Upload request details - single upload request response + +## Example Usage + +```typescript +import { GetWorkspaceUploadRequestResponse } from "@docusign/iam-sdk/models/components"; + +let value: GetWorkspaceUploadRequestResponse = { + uploadRequestId: "4c10a6e9-33d5-450a-bdab-d327cef29876", + workspaceId: "a4c7ac71-e8a2-472a-89c6-d7d4931c6fee", + name: "", + uploadRequestOwner: { + userId: "b2250a9f-5d21-4da1-b23d-5d0b88051483", + }, + status: "unknown", + documents: [], + assignments: null, + createdDate: new Date("2023-05-03T09:49:49.817Z"), + updatedDate: new Date("2025-01-27T12:20:15.711Z"), + canView: true, + canEdit: true, + canDelete: true, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `uploadRequestId` | *string* | :heavy_check_mark: | The ID of the upload request | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace | +| `name` | *string* | :heavy_check_mark: | The name of the upload request | +| `description` | *string* | :heavy_minus_sign: | The description of the upload request | +| `uploadRequestOwner` | [components.WorkspaceUploadRequestOwner](../../models/components/workspaceuploadrequestowner.md) | :heavy_check_mark: | N/A | +| `status` | [components.WorkspaceUploadRequestStatus](../../models/components/workspaceuploadrequeststatus.md) | :heavy_check_mark: | Enum representing the status of a workspace upload request | +| `documents` | [components.WorkspaceUploadRequestDocument](../../models/components/workspaceuploadrequestdocument.md)[] | :heavy_check_mark: | List of documents associated with the upload request | +| `assignments` | [components.WorkspaceUploadRequestAssignment](../../models/components/workspaceuploadrequestassignment.md)[] | :heavy_check_mark: | List of user assignments for the upload request | +| `createdDate` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | The date the upload request was created | +| `updatedDate` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | The date the upload request was last updated | +| `dueDate` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The due date for the upload request | +| `sentDate` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The date the upload request was sent | +| `completedDate` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The date the upload request was completed | +| `canView` | *boolean* | :heavy_check_mark: | Whether the current user can view the upload request | +| `canEdit` | *boolean* | :heavy_check_mark: | Whether the current user can edit the upload request | +| `canDelete` | *boolean* | :heavy_check_mark: | Whether the current user can delete the upload request | \ No newline at end of file diff --git a/docs/models/components/getworkspaceuploadrequestsresponse.md b/docs/models/components/getworkspaceuploadrequestsresponse.md new file mode 100644 index 0000000..455bfba --- /dev/null +++ b/docs/models/components/getworkspaceuploadrequestsresponse.md @@ -0,0 +1,19 @@ +# GetWorkspaceUploadRequestsResponse + +Response containing a list of upload requests + +## Example Usage + +```typescript +import { GetWorkspaceUploadRequestsResponse } from "@docusign/iam-sdk/models/components"; + +let value: GetWorkspaceUploadRequestsResponse = { + data: [], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `data` | [components.WorkspaceUploadRequest](../../models/components/workspaceuploadrequest.md)[] | :heavy_check_mark: | The upload request list | \ No newline at end of file diff --git a/docs/models/components/getworkspaceusersresponse.md b/docs/models/components/getworkspaceusersresponse.md new file mode 100644 index 0000000..3f2497b --- /dev/null +++ b/docs/models/components/getworkspaceusersresponse.md @@ -0,0 +1,21 @@ +# GetWorkspaceUsersResponse + +## Example Usage + +```typescript +import { GetWorkspaceUsersResponse } from "@docusign/iam-sdk/models/components"; + +let value: GetWorkspaceUsersResponse = { + users: [], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `users` | [components.WorkspaceUserSummary](../../models/components/workspaceusersummary.md)[] | :heavy_check_mark: | The user summary list. Includes the ID, name, and metadata such as the role ID and role name | +| `resultSetSize` | *number* | :heavy_minus_sign: | The number of users returned in the response. Always equal or less than the `count` of the request | +| `startPosition` | *number* | :heavy_minus_sign: | Position of the first item in the total results | +| `endPosition` | *number* | :heavy_minus_sign: | Position of the last item in the total results | +| `totalRowCount` | *number* | :heavy_minus_sign: | The total number of users in the workspace applicable to the request regardless of pagination. It may not always be computed | \ No newline at end of file diff --git a/docs/models/components/getworkspaceuserssortingoption.md b/docs/models/components/getworkspaceuserssortingoption.md new file mode 100644 index 0000000..a6c9cc2 --- /dev/null +++ b/docs/models/components/getworkspaceuserssortingoption.md @@ -0,0 +1,15 @@ +# GetWorkspaceUsersSortingOption + +## Example Usage + +```typescript +import { GetWorkspaceUsersSortingOption } from "@docusign/iam-sdk/models/components"; + +let value: GetWorkspaceUsersSortingOption = "last_name_desc"; +``` + +## Values + +```typescript +"first_name_asc" | "last_name_asc" | "email_asc" | "first_name_desc" | "last_name_desc" | "email_desc" +``` \ No newline at end of file diff --git a/docs/models/components/provisions.md b/docs/models/components/provisions.md index 6a48df0..47dadd6 100644 --- a/docs/models/components/provisions.md +++ b/docs/models/components/provisions.md @@ -52,7 +52,7 @@ let value: Provisions = { | `renewalNoticeDate` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Calculated field based on renewal notice period. (agreement expiration date - renewal notice period duration) | 2024-08-01T00:00:00+02:00 | | `autoRenewalTermLength` | *string* | :heavy_minus_sign: | N/A | P30D | | `renewalExtensionPeriod` | *string* | :heavy_minus_sign: | N/A | P30D | -| `renewalProcessOwner` | *string* | :heavy_minus_sign: | N/A | | +| `renewalProcessOwner` | *string* | :heavy_minus_sign: | The userId parameter | | | `renewalAdditionalInfo` | *string* | :heavy_minus_sign: | Additional information related to the renewal process. | | | `terminationPeriodForCause` | *string* | :heavy_minus_sign: | The specific duration that a party has to give notice before terminating the agreement due to a significant breach or violation of terms.
This period allows the other party to address the cause or prepare for termination.
| P6M | | `terminationPeriodForConvenience` | *string* | :heavy_minus_sign: | Specifies the required notice period that a party must provide before terminating the agreement for convenience, without cause, under the terms outlined in the contract. | P6M | diff --git a/docs/models/components/revokeworkspaceuserdetails.md b/docs/models/components/revokeworkspaceuserdetails.md new file mode 100644 index 0000000..e70794d --- /dev/null +++ b/docs/models/components/revokeworkspaceuserdetails.md @@ -0,0 +1,15 @@ +# RevokeWorkspaceUserDetails + +## Example Usage + +```typescript +import { RevokeWorkspaceUserDetails } from "@docusign/iam-sdk/models/components"; + +let value: RevokeWorkspaceUserDetails = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `revocationDate` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The optional date in the future to initiate the revocation. If not specified, the revocation will be immediate | \ No newline at end of file diff --git a/docs/models/components/updateworkspaceuploadrequestbody.md b/docs/models/components/updateworkspaceuploadrequestbody.md new file mode 100644 index 0000000..d8af26b --- /dev/null +++ b/docs/models/components/updateworkspaceuploadrequestbody.md @@ -0,0 +1,37 @@ +# UpdateWorkspaceUploadRequestBody + +Upload request details for update operations + +## Example Usage + +```typescript +import { UpdateWorkspaceUploadRequestBody } from "@docusign/iam-sdk/models/components"; + +let value: UpdateWorkspaceUploadRequestBody = { + name: "", + description: "sauerkraut upwardly appropriate", + status: "complete", + dueDate: null, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `uploadRequestId` | *string* | :heavy_minus_sign: | The ID of the upload request | +| `workspaceId` | *string* | :heavy_minus_sign: | The ID of the workspace | +| `name` | *string* | :heavy_check_mark: | The name of the upload request (editable) | +| `description` | *string* | :heavy_check_mark: | The description of the upload request (editable) | +| `uploadRequestOwner` | [components.WorkspaceUploadRequestOwner](../../models/components/workspaceuploadrequestowner.md) | :heavy_minus_sign: | N/A | +| `status` | [components.WorkspaceUploadRequestStatus](../../models/components/workspaceuploadrequeststatus.md) | :heavy_check_mark: | Enum representing the status of a workspace upload request | +| `documents` | [components.WorkspaceUploadRequestDocument](../../models/components/workspaceuploadrequestdocument.md)[] | :heavy_minus_sign: | List of documents associated with the upload request | +| `assignments` | [components.WorkspaceUploadRequestAssignment](../../models/components/workspaceuploadrequestassignment.md)[] | :heavy_minus_sign: | List of user assignments for the upload request | +| `createdDate` | *string* | :heavy_minus_sign: | The date the upload request was created | +| `updatedDate` | *string* | :heavy_minus_sign: | The date the upload request was last updated | +| `dueDate` | *string* | :heavy_check_mark: | The due date for the upload request (editable) | +| `sentDate` | *string* | :heavy_minus_sign: | The date the upload request was sent | +| `completedDate` | *string* | :heavy_minus_sign: | The date the upload request was completed | +| `canView` | *boolean* | :heavy_minus_sign: | Whether the current user can view the upload request | +| `canEdit` | *boolean* | :heavy_minus_sign: | Whether the current user can edit the upload request | +| `canDelete` | *boolean* | :heavy_minus_sign: | Whether the current user can delete the upload request | \ No newline at end of file diff --git a/docs/models/components/updateworkspaceuserresponse.md b/docs/models/components/updateworkspaceuserresponse.md new file mode 100644 index 0000000..e1b155e --- /dev/null +++ b/docs/models/components/updateworkspaceuserresponse.md @@ -0,0 +1,15 @@ +# UpdateWorkspaceUserResponse + +## Example Usage + +```typescript +import { UpdateWorkspaceUserResponse } from "@docusign/iam-sdk/models/components"; + +let value: UpdateWorkspaceUserResponse = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | +| `roleId` | *string* | :heavy_minus_sign: | The ID of the role assigned to the user | \ No newline at end of file diff --git a/docs/models/components/workspacedocument.md b/docs/models/components/workspacedocument.md new file mode 100644 index 0000000..40db796 --- /dev/null +++ b/docs/models/components/workspacedocument.md @@ -0,0 +1,23 @@ +# WorkspaceDocument + +## Example Usage + +```typescript +import { WorkspaceDocument } from "@docusign/iam-sdk/models/components"; + +let value: WorkspaceDocument = { + documentId: "4608ec9c-c55e-4923-abb5-b11f261ea5a9", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `documentId` | *string* | :heavy_check_mark: | The ID of the document | +| `name` | *string* | :heavy_minus_sign: | The name of the document | +| `ownerId` | *string* | :heavy_minus_sign: | The ID of the user who owns the document | +| `size` | *number* | :heavy_minus_sign: | The size of the document in bytes | +| `createdDate` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The date the document was created | +| `lastUpdatedDate` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The date the document was last updated | +| `owner` | [components.WorkspaceDocumentOwner](../../models/components/workspacedocumentowner.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/workspacedocumentowner.md b/docs/models/components/workspacedocumentowner.md new file mode 100644 index 0000000..c7f4644 --- /dev/null +++ b/docs/models/components/workspacedocumentowner.md @@ -0,0 +1,16 @@ +# WorkspaceDocumentOwner + +## Example Usage + +```typescript +import { WorkspaceDocumentOwner } from "@docusign/iam-sdk/models/components"; + +let value: WorkspaceDocumentOwner = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `firstName` | *string* | :heavy_minus_sign: | The first name of the document owner | +| `lastName` | *string* | :heavy_minus_sign: | The last name of the document owner | \ No newline at end of file diff --git a/docs/models/components/workspaceenvelopeforcreate.md b/docs/models/components/workspaceenvelopeforcreate.md new file mode 100644 index 0000000..667b091 --- /dev/null +++ b/docs/models/components/workspaceenvelopeforcreate.md @@ -0,0 +1,18 @@ +# WorkspaceEnvelopeForCreate + +## Example Usage + +```typescript +import { WorkspaceEnvelopeForCreate } from "@docusign/iam-sdk/models/components"; + +let value: WorkspaceEnvelopeForCreate = { + envelopeName: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `envelopeName` | *string* | :heavy_check_mark: | The name for the envelope | +| `documentIds` | *string*[] | :heavy_minus_sign: | The optional list of document IDs to be added to the envelope | \ No newline at end of file diff --git a/docs/models/components/workspaceenvelopesummary.md b/docs/models/components/workspaceenvelopesummary.md new file mode 100644 index 0000000..e5e4d06 --- /dev/null +++ b/docs/models/components/workspaceenvelopesummary.md @@ -0,0 +1,25 @@ +# WorkspaceEnvelopeSummary + +The summary of the envelope in the workspace + +## Example Usage + +```typescript +import { WorkspaceEnvelopeSummary } from "@docusign/iam-sdk/models/components"; + +let value: WorkspaceEnvelopeSummary = { + envelopeId: "", + status: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `envelopeId` | *string* | :heavy_check_mark: | The ID of the envelope | +| `status` | *string* | :heavy_check_mark: | The status of the envelope in the workspace | +| `name` | *string* | :heavy_minus_sign: | The envelope name | +| `subject` | *string* | :heavy_minus_sign: | The envelope subject | +| `createdDate` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The date the envelope was created | +| `lastUpdatedDate` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The date the envelope was last updated | \ No newline at end of file diff --git a/docs/models/components/workspacerolesummary.md b/docs/models/components/workspacerolesummary.md new file mode 100644 index 0000000..9f2dd2b --- /dev/null +++ b/docs/models/components/workspacerolesummary.md @@ -0,0 +1,18 @@ +# WorkspaceRoleSummary + +## Example Usage + +```typescript +import { WorkspaceRoleSummary } from "@docusign/iam-sdk/models/components"; + +let value: WorkspaceRoleSummary = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `roleId` | *string* | :heavy_minus_sign: | The ID of the role | +| `name` | *string* | :heavy_minus_sign: | The name of the role | +| `isExternal` | *boolean* | :heavy_minus_sign: | If this role is applicable to any participant of a workspace including those outside the account. If false, this role may only be assigned to internal users of the same account | +| `createdDate` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The date the role was created | \ No newline at end of file diff --git a/docs/models/components/workspacesummary.md b/docs/models/components/workspacesummary.md new file mode 100644 index 0000000..a4c3802 --- /dev/null +++ b/docs/models/components/workspacesummary.md @@ -0,0 +1,18 @@ +# WorkspaceSummary + +## Example Usage + +```typescript +import { WorkspaceSummary } from "@docusign/iam-sdk/models/components"; + +let value: WorkspaceSummary = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `workspaceId` | *string* | :heavy_minus_sign: | The ID of the workspace | +| `name` | *string* | :heavy_minus_sign: | The name of the workspace | +| `createdDate` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The date the workspace was created | +| `createdByUserId` | *string* | :heavy_minus_sign: | The ID of the user who created the workspace | \ No newline at end of file diff --git a/docs/models/components/workspaceuploadrequest.md b/docs/models/components/workspaceuploadrequest.md new file mode 100644 index 0000000..49b32a7 --- /dev/null +++ b/docs/models/components/workspaceuploadrequest.md @@ -0,0 +1,45 @@ +# WorkspaceUploadRequest + +## Example Usage + +```typescript +import { WorkspaceUploadRequest } from "@docusign/iam-sdk/models/components"; + +let value: WorkspaceUploadRequest = { + uploadRequestId: "813f6ba8-3250-44c6-bd7d-1fd81560ca4c", + workspaceId: "70c44852-ef19-4cff-804a-a2f128139364", + name: "", + uploadRequestOwner: { + userId: "b2250a9f-5d21-4da1-b23d-5d0b88051483", + }, + status: "overdue", + documents: [], + assignments: [], + createdDate: new Date("2023-01-02T04:54:12.774Z"), + updatedDate: new Date("2023-12-29T22:45:15.002Z"), + canView: true, + canEdit: false, + canDelete: false, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `uploadRequestId` | *string* | :heavy_check_mark: | The ID of the upload request | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace | +| `name` | *string* | :heavy_check_mark: | The name of the upload request | +| `description` | *string* | :heavy_minus_sign: | The description of the upload request | +| `uploadRequestOwner` | [components.WorkspaceUploadRequestOwner](../../models/components/workspaceuploadrequestowner.md) | :heavy_check_mark: | N/A | +| `status` | [components.WorkspaceUploadRequestStatus](../../models/components/workspaceuploadrequeststatus.md) | :heavy_check_mark: | Enum representing the status of a workspace upload request | +| `documents` | [components.WorkspaceUploadRequestDocument](../../models/components/workspaceuploadrequestdocument.md)[] | :heavy_check_mark: | List of documents associated with the upload request | +| `assignments` | [components.WorkspaceUploadRequestAssignment](../../models/components/workspaceuploadrequestassignment.md)[] | :heavy_check_mark: | List of user assignments for the upload request | +| `createdDate` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | The date the upload request was created | +| `updatedDate` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | The date the upload request was last updated | +| `dueDate` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The due date for the upload request | +| `sentDate` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The date the upload request was sent | +| `completedDate` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The date the upload request was completed | +| `canView` | *boolean* | :heavy_check_mark: | Whether the current user can view the upload request | +| `canEdit` | *boolean* | :heavy_check_mark: | Whether the current user can edit the upload request | +| `canDelete` | *boolean* | :heavy_check_mark: | Whether the current user can delete the upload request | \ No newline at end of file diff --git a/docs/models/components/workspaceuploadrequestassignment.md b/docs/models/components/workspaceuploadrequestassignment.md new file mode 100644 index 0000000..fe8e2f4 --- /dev/null +++ b/docs/models/components/workspaceuploadrequestassignment.md @@ -0,0 +1,18 @@ +# WorkspaceUploadRequestAssignment + +## Example Usage + +```typescript +import { WorkspaceUploadRequestAssignment } from "@docusign/iam-sdk/models/components"; + +let value: WorkspaceUploadRequestAssignment = { + assigneeUserId: "d539d201-9a25-420b-a459-707993bddfaf", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `assigneeUserId` | *string* | :heavy_check_mark: | The ID of the assigned user | +| `uploadRequestResponsibilityTypeId` | [components.WorkspaceUploadRequestResponsibilityType](../../models/components/workspaceuploadrequestresponsibilitytype.md) | :heavy_minus_sign: | Enum representing the responsibility type for a workspace upload request assignment | \ No newline at end of file diff --git a/docs/models/components/workspaceuploadrequestdocument.md b/docs/models/components/workspaceuploadrequestdocument.md new file mode 100644 index 0000000..03b1168 --- /dev/null +++ b/docs/models/components/workspaceuploadrequestdocument.md @@ -0,0 +1,16 @@ +# WorkspaceUploadRequestDocument + +## Example Usage + +```typescript +import { WorkspaceUploadRequestDocument } from "@docusign/iam-sdk/models/components"; + +let value: WorkspaceUploadRequestDocument = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `documentName` | *string* | :heavy_minus_sign: | The document name | +| `documentId` | *string* | :heavy_minus_sign: | The document ID | \ No newline at end of file diff --git a/docs/models/components/workspaceuploadrequestowner.md b/docs/models/components/workspaceuploadrequestowner.md new file mode 100644 index 0000000..013c9e3 --- /dev/null +++ b/docs/models/components/workspaceuploadrequestowner.md @@ -0,0 +1,17 @@ +# WorkspaceUploadRequestOwner + +## Example Usage + +```typescript +import { WorkspaceUploadRequestOwner } from "@docusign/iam-sdk/models/components"; + +let value: WorkspaceUploadRequestOwner = { + userId: "40f2de27-6e2e-44f9-86a2-43c8539ee8fe", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | +| `userId` | *string* | :heavy_check_mark: | The ID of the upload request owner | \ No newline at end of file diff --git a/docs/models/components/workspaceuploadrequestresponsibilitytype.md b/docs/models/components/workspaceuploadrequestresponsibilitytype.md new file mode 100644 index 0000000..8f34c50 --- /dev/null +++ b/docs/models/components/workspaceuploadrequestresponsibilitytype.md @@ -0,0 +1,17 @@ +# WorkspaceUploadRequestResponsibilityType + +Enum representing the responsibility type for a workspace upload request assignment + +## Example Usage + +```typescript +import { WorkspaceUploadRequestResponsibilityType } from "@docusign/iam-sdk/models/components"; + +let value: WorkspaceUploadRequestResponsibilityType = "assignee"; +``` + +## Values + +```typescript +"watcher" | "assignee" +``` \ No newline at end of file diff --git a/docs/models/components/workspaceuploadrequeststatus.md b/docs/models/components/workspaceuploadrequeststatus.md new file mode 100644 index 0000000..daed61f --- /dev/null +++ b/docs/models/components/workspaceuploadrequeststatus.md @@ -0,0 +1,17 @@ +# WorkspaceUploadRequestStatus + +Enum representing the status of a workspace upload request + +## Example Usage + +```typescript +import { WorkspaceUploadRequestStatus } from "@docusign/iam-sdk/models/components"; + +let value: WorkspaceUploadRequestStatus = "in_progress"; +``` + +## Values + +```typescript +"draft" | "in_progress" | "overdue" | "complete" | "unknown" +``` \ No newline at end of file diff --git a/docs/models/components/workspaceuserforcreate.md b/docs/models/components/workspaceuserforcreate.md new file mode 100644 index 0000000..93e0522 --- /dev/null +++ b/docs/models/components/workspaceuserforcreate.md @@ -0,0 +1,22 @@ +# WorkspaceUserForCreate + +## Example Usage + +```typescript +import { WorkspaceUserForCreate } from "@docusign/iam-sdk/models/components"; + +let value: WorkspaceUserForCreate = { + email: "Marcel_Bartoletti@yahoo.com", + firstName: "Herminio", + lastName: "DuBuque", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `email` | *string* | :heavy_check_mark: | The email address of the added user. May be an internal user to the account or an external user | +| `firstName` | *string* | :heavy_check_mark: | The first name of the added user | +| `lastName` | *string* | :heavy_check_mark: | The last name of the added user | +| `roleId` | *string* | :heavy_minus_sign: | The optional Role ID to assign to the user. Defaults to the "Participate" role | \ No newline at end of file diff --git a/docs/models/components/workspaceuserforupdate.md b/docs/models/components/workspaceuserforupdate.md new file mode 100644 index 0000000..b74c6eb --- /dev/null +++ b/docs/models/components/workspaceuserforupdate.md @@ -0,0 +1,15 @@ +# WorkspaceUserForUpdate + +## Example Usage + +```typescript +import { WorkspaceUserForUpdate } from "@docusign/iam-sdk/models/components"; + +let value: WorkspaceUserForUpdate = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `roleId` | *string* | :heavy_minus_sign: | The ID of the role to update to | \ No newline at end of file diff --git a/docs/models/components/workspaceusersummary.md b/docs/models/components/workspaceusersummary.md new file mode 100644 index 0000000..ce417a6 --- /dev/null +++ b/docs/models/components/workspaceusersummary.md @@ -0,0 +1,20 @@ +# WorkspaceUserSummary + +## Example Usage + +```typescript +import { WorkspaceUserSummary } from "@docusign/iam-sdk/models/components"; + +let value: WorkspaceUserSummary = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------- | --------------------------- | --------------------------- | --------------------------- | +| `userId` | *string* | :heavy_minus_sign: | The ID of the user | +| `email` | *string* | :heavy_minus_sign: | The email of the user | +| `firstName` | *string* | :heavy_minus_sign: | The first name of the user | +| `lastName` | *string* | :heavy_minus_sign: | The last name of the user | +| `roleId` | *string* | :heavy_minus_sign: | The ID of the users's role | +| `roleName` | *string* | :heavy_minus_sign: | The name of the user's role | \ No newline at end of file diff --git a/docs/models/errors/errordetails.md b/docs/models/errors/errordetails.md new file mode 100644 index 0000000..2beef5e --- /dev/null +++ b/docs/models/errors/errordetails.md @@ -0,0 +1,18 @@ +# ErrorDetails + +The error response object for the Workspaces API + +## Example Usage + +```typescript +import { ErrorDetails } from "@docusign/iam-sdk/models/errors"; + +// No examples available for this model +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `message` | *string* | :heavy_minus_sign: | A brief message describing the error condition | +| `errorCode` | *string* | :heavy_minus_sign: | A standardized code that generalizes the specific error | \ No newline at end of file diff --git a/docs/models/errors/errort.md b/docs/models/errors/errort.md index fa3b54d..03f5cb5 100644 --- a/docs/models/errors/errort.md +++ b/docs/models/errors/errort.md @@ -15,5 +15,5 @@ import { ErrorT } from "@docusign/iam-sdk/models/errors"; | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | | `error` | *string* | :heavy_minus_sign: | A message describing the error. | An unexpected error occurred on the server. | -| `code` | *number* | :heavy_minus_sign: | HTTP status code for the error. | 500 | +| `code` | *string* | :heavy_minus_sign: | HTTP status code for the error. | 500 | | `timestamp` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The timestamp when the error occurred. | 2023-01-01T12:00:00Z | \ No newline at end of file diff --git a/docs/models/operations/addworkspaceuserrequest.md b/docs/models/operations/addworkspaceuserrequest.md new file mode 100644 index 0000000..f1c9631 --- /dev/null +++ b/docs/models/operations/addworkspaceuserrequest.md @@ -0,0 +1,20 @@ +# AddWorkspaceUserRequest + +## Example Usage + +```typescript +import { AddWorkspaceUserRequest } from "@docusign/iam-sdk/models/operations"; + +let value: AddWorkspaceUserRequest = { + accountId: "ce041614-146a-4dbe-a79a-77dbe0391beb", + workspaceId: "b405a2ae-508c-4cf4-9e75-3feab9031e77", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `accountId` | *string* | :heavy_check_mark: | The ID of the account | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace | +| `workspaceUserForCreate` | [components.WorkspaceUserForCreate](../../models/components/workspaceuserforcreate.md) | :heavy_minus_sign: | The user details | \ No newline at end of file diff --git a/docs/models/operations/completeworkspaceuploadrequestrequest.md b/docs/models/operations/completeworkspaceuploadrequestrequest.md new file mode 100644 index 0000000..ce806c1 --- /dev/null +++ b/docs/models/operations/completeworkspaceuploadrequestrequest.md @@ -0,0 +1,21 @@ +# CompleteWorkspaceUploadRequestRequest + +## Example Usage + +```typescript +import { CompleteWorkspaceUploadRequestRequest } from "@docusign/iam-sdk/models/operations"; + +let value: CompleteWorkspaceUploadRequestRequest = { + accountId: "6d69acc7-45d6-43a3-a266-b0f255c8845b", + workspaceId: "3d93d648-4798-428b-8866-273a7121e622", + uploadRequestId: "6c7347fe-8036-42e8-b335-b18485266421", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `accountId` | *string* | :heavy_check_mark: | The ID of the account | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace | +| `uploadRequestId` | *string* | :heavy_check_mark: | The ID of the upload request to complete | \ No newline at end of file diff --git a/docs/models/operations/createworkspaceenveloperequest.md b/docs/models/operations/createworkspaceenveloperequest.md new file mode 100644 index 0000000..3b597c8 --- /dev/null +++ b/docs/models/operations/createworkspaceenveloperequest.md @@ -0,0 +1,23 @@ +# CreateWorkspaceEnvelopeRequest + +## Example Usage + +```typescript +import { CreateWorkspaceEnvelopeRequest } from "@docusign/iam-sdk/models/operations"; + +let value: CreateWorkspaceEnvelopeRequest = { + accountId: "3a07e441-9089-40de-aaab-a761f58fa09b", + workspaceId: "3b72c869-b976-48cf-909f-d5a130c9a91b", + workspaceEnvelopeForCreate: { + envelopeName: "", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `accountId` | *string* | :heavy_check_mark: | The ID of the account | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace | +| `workspaceEnvelopeForCreate` | [components.WorkspaceEnvelopeForCreate](../../models/components/workspaceenvelopeforcreate.md) | :heavy_check_mark: | The details of the envelope to be created including the list of document IDs to add to the envelope | \ No newline at end of file diff --git a/docs/models/operations/createworkspacerequest.md b/docs/models/operations/createworkspacerequest.md new file mode 100644 index 0000000..e58d5e8 --- /dev/null +++ b/docs/models/operations/createworkspacerequest.md @@ -0,0 +1,21 @@ +# CreateWorkspaceRequest + +## Example Usage + +```typescript +import { CreateWorkspaceRequest } from "@docusign/iam-sdk/models/operations"; + +let value: CreateWorkspaceRequest = { + accountId: "74bac16e-0f86-4791-abd4-3a41b935e0b7", + createWorkspaceBody: { + name: null, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `accountId` | *string* | :heavy_check_mark: | The ID of the account | +| `createWorkspaceBody` | [components.CreateWorkspaceBody](../../models/components/createworkspacebody.md) | :heavy_check_mark: | The details of the workspace to be created including the name | \ No newline at end of file diff --git a/docs/models/operations/createworkspaceuploadrequestrequest.md b/docs/models/operations/createworkspaceuploadrequestrequest.md new file mode 100644 index 0000000..b3f26bd --- /dev/null +++ b/docs/models/operations/createworkspaceuploadrequestrequest.md @@ -0,0 +1,32 @@ +# CreateWorkspaceUploadRequestRequest + +## Example Usage + +```typescript +import { CreateWorkspaceUploadRequestRequest } from "@docusign/iam-sdk/models/operations"; + +let value: CreateWorkspaceUploadRequestRequest = { + accountId: "5e0bbd72-477e-4ade-8a57-ed331ed36f77", + workspaceId: "65edddd3-fe2d-418b-9d92-4d72d4fe51d7", + createWorkspaceUploadRequestBody: { + name: null, + description: + "er heavenly phew chairperson gee sans randomize thoroughly for", + dueDate: new Date("2023-10-09T00:51:49.699Z"), + assignments: [ + { + uploadRequestResponsibilityTypeId: "assignee", + }, + ], + status: "in_progress", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `accountId` | *string* | :heavy_check_mark: | The ID of the account | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace | +| `createWorkspaceUploadRequestBody` | [components.CreateWorkspaceUploadRequestBody](../../models/components/createworkspaceuploadrequestbody.md) | :heavy_check_mark: | The upload request details including name, description, assignments, and status | \ No newline at end of file diff --git a/docs/models/operations/deleteworkspacedocumentrequest.md b/docs/models/operations/deleteworkspacedocumentrequest.md new file mode 100644 index 0000000..0848ecb --- /dev/null +++ b/docs/models/operations/deleteworkspacedocumentrequest.md @@ -0,0 +1,21 @@ +# DeleteWorkspaceDocumentRequest + +## Example Usage + +```typescript +import { DeleteWorkspaceDocumentRequest } from "@docusign/iam-sdk/models/operations"; + +let value: DeleteWorkspaceDocumentRequest = { + accountId: "14ac357f-51aa-4684-88f2-7e32537ef255", + workspaceId: "8f38623a-b6e5-4ff6-8b30-854808b6a494", + documentId: "4e90427f-bf37-40db-9fee-038c745f021c", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `accountId` | *string* | :heavy_check_mark: | The ID of the account | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace | +| `documentId` | *string* | :heavy_check_mark: | The ID of the document | \ No newline at end of file diff --git a/docs/models/operations/deleteworkspaceuploadrequestrequest.md b/docs/models/operations/deleteworkspaceuploadrequestrequest.md new file mode 100644 index 0000000..7991ba8 --- /dev/null +++ b/docs/models/operations/deleteworkspaceuploadrequestrequest.md @@ -0,0 +1,21 @@ +# DeleteWorkspaceUploadRequestRequest + +## Example Usage + +```typescript +import { DeleteWorkspaceUploadRequestRequest } from "@docusign/iam-sdk/models/operations"; + +let value: DeleteWorkspaceUploadRequestRequest = { + accountId: "19e2033f-3339-4513-8920-62d223b2f90f", + workspaceId: "85bc6241-c6d7-44ec-87ff-9c961caac3cf", + uploadRequestId: "eaa062c9-4ec2-4dca-aa86-ed67b69a95dc", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `accountId` | *string* | :heavy_check_mark: | The ID of the account | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace | +| `uploadRequestId` | *string* | :heavy_check_mark: | The ID of the upload request to delete | \ No newline at end of file diff --git a/docs/models/operations/getworkspaceassignablerolesrequest.md b/docs/models/operations/getworkspaceassignablerolesrequest.md new file mode 100644 index 0000000..a9b4dd1 --- /dev/null +++ b/docs/models/operations/getworkspaceassignablerolesrequest.md @@ -0,0 +1,22 @@ +# GetWorkspaceAssignableRolesRequest + +## Example Usage + +```typescript +import { GetWorkspaceAssignableRolesRequest } from "@docusign/iam-sdk/models/operations"; + +let value: GetWorkspaceAssignableRolesRequest = { + accountId: "a249ad95-6f4a-4210-b9d5-d1be00379bf1", + workspaceId: "a3aa2af3-7b1c-4ca5-8092-228dc208fff0", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `accountId` | *string* | :heavy_check_mark: | The ID of the account | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace | +| `filter` | *string* | :heavy_minus_sign: | A search filter that returns assignable roles by the beginning of the role name | +| `startPosition` | *number* | :heavy_minus_sign: | The index position within the total result set from which to start returning values. The default value is 0 | +| `count` | *number* | :heavy_minus_sign: | The number of results to return. This value must be a number between 1 and 100 (default) | \ No newline at end of file diff --git a/docs/models/operations/getworkspacedocumentcontentsrequest.md b/docs/models/operations/getworkspacedocumentcontentsrequest.md new file mode 100644 index 0000000..2690caa --- /dev/null +++ b/docs/models/operations/getworkspacedocumentcontentsrequest.md @@ -0,0 +1,21 @@ +# GetWorkspaceDocumentContentsRequest + +## Example Usage + +```typescript +import { GetWorkspaceDocumentContentsRequest } from "@docusign/iam-sdk/models/operations"; + +let value: GetWorkspaceDocumentContentsRequest = { + accountId: "7bae48fd-7673-4109-9cd0-ecb46782d38e", + workspaceId: "a5a7d432-70dd-48bd-a3ed-5d03b871f494", + documentId: "2907f017-739b-4386-94ee-3c82db69c3ea", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `accountId` | *string* | :heavy_check_mark: | The ID of the account | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace | +| `documentId` | *string* | :heavy_check_mark: | The ID of the document | \ No newline at end of file diff --git a/docs/models/operations/getworkspacedocumentrequest.md b/docs/models/operations/getworkspacedocumentrequest.md new file mode 100644 index 0000000..89a6e14 --- /dev/null +++ b/docs/models/operations/getworkspacedocumentrequest.md @@ -0,0 +1,21 @@ +# GetWorkspaceDocumentRequest + +## Example Usage + +```typescript +import { GetWorkspaceDocumentRequest } from "@docusign/iam-sdk/models/operations"; + +let value: GetWorkspaceDocumentRequest = { + accountId: "79268688-caab-4610-ae24-ea53f6cb6e29", + workspaceId: "2737d508-b664-4701-8af5-d7848a6cf0b9", + documentId: "71df82a8-966f-4947-bd35-9f0162c8289d", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `accountId` | *string* | :heavy_check_mark: | The ID of the account | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace | +| `documentId` | *string* | :heavy_check_mark: | The ID of the document | \ No newline at end of file diff --git a/docs/models/operations/getworkspacedocumentsrequest.md b/docs/models/operations/getworkspacedocumentsrequest.md new file mode 100644 index 0000000..c6d13fc --- /dev/null +++ b/docs/models/operations/getworkspacedocumentsrequest.md @@ -0,0 +1,22 @@ +# GetWorkspaceDocumentsRequest + +## Example Usage + +```typescript +import { GetWorkspaceDocumentsRequest } from "@docusign/iam-sdk/models/operations"; + +let value: GetWorkspaceDocumentsRequest = { + accountId: "660863c8-05fc-4675-82f3-d11cbdc26786", + workspaceId: "cc12c678-84f9-4d17-bfcb-90a0bc76d266", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `accountId` | *string* | :heavy_check_mark: | The ID of the account | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace | +| `count` | *number* | :heavy_minus_sign: | Number of documents to return. Defaults to the maximum which is 100 | +| `startPosition` | *number* | :heavy_minus_sign: | Position of the first item in the total results. Defaults to 0 | +| `nameFilter` | *string* | :heavy_minus_sign: | Filter documents where Name contains the filter. Defaults to null, to not filter | \ No newline at end of file diff --git a/docs/models/operations/getworkspaceenvelopesrequest.md b/docs/models/operations/getworkspaceenvelopesrequest.md new file mode 100644 index 0000000..921ffe5 --- /dev/null +++ b/docs/models/operations/getworkspaceenvelopesrequest.md @@ -0,0 +1,19 @@ +# GetWorkspaceEnvelopesRequest + +## Example Usage + +```typescript +import { GetWorkspaceEnvelopesRequest } from "@docusign/iam-sdk/models/operations"; + +let value: GetWorkspaceEnvelopesRequest = { + accountId: "cd465cdb-b106-4381-9efb-cb14e00970b3", + workspaceId: "a481b97c-ec1e-44ce-aba1-d53508b4fa8a", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `accountId` | *string* | :heavy_check_mark: | The ID of the account | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace | \ No newline at end of file diff --git a/docs/models/operations/getworkspacerequest.md b/docs/models/operations/getworkspacerequest.md new file mode 100644 index 0000000..e3128ea --- /dev/null +++ b/docs/models/operations/getworkspacerequest.md @@ -0,0 +1,19 @@ +# GetWorkspaceRequest + +## Example Usage + +```typescript +import { GetWorkspaceRequest } from "@docusign/iam-sdk/models/operations"; + +let value: GetWorkspaceRequest = { + accountId: "63c0cf03-530b-475b-b332-52f1cc011952", + workspaceId: "2b2a3355-6ed0-4759-8e5a-6b52716a86f4", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `accountId` | *string* | :heavy_check_mark: | The ID of the account | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace | \ No newline at end of file diff --git a/docs/models/operations/getworkspacesrequest.md b/docs/models/operations/getworkspacesrequest.md new file mode 100644 index 0000000..4fea749 --- /dev/null +++ b/docs/models/operations/getworkspacesrequest.md @@ -0,0 +1,19 @@ +# GetWorkspacesRequest + +## Example Usage + +```typescript +import { GetWorkspacesRequest } from "@docusign/iam-sdk/models/operations"; + +let value: GetWorkspacesRequest = { + accountId: "02462d95-1c68-4c38-ab8c-e789246d5619", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `accountId` | *string* | :heavy_check_mark: | The ID of the account | +| `count` | *number* | :heavy_minus_sign: | Number of workspaces to return. Defaults to the maximum which is 100 | +| `startPosition` | *number* | :heavy_minus_sign: | Position of the first item in the total results. Defaults to 0 | \ No newline at end of file diff --git a/docs/models/operations/getworkspaceuploadrequestrequest.md b/docs/models/operations/getworkspaceuploadrequestrequest.md new file mode 100644 index 0000000..8a75d2e --- /dev/null +++ b/docs/models/operations/getworkspaceuploadrequestrequest.md @@ -0,0 +1,21 @@ +# GetWorkspaceUploadRequestRequest + +## Example Usage + +```typescript +import { GetWorkspaceUploadRequestRequest } from "@docusign/iam-sdk/models/operations"; + +let value: GetWorkspaceUploadRequestRequest = { + accountId: "623bfa5b-292c-4105-84c6-82adc0ed69b1", + workspaceId: "2324bb31-7659-4815-804c-522e2d68f842", + uploadRequestId: "360e691c-7f28-40e8-b936-325d54da4db9", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `accountId` | *string* | :heavy_check_mark: | The ID of the account | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace | +| `uploadRequestId` | *string* | :heavy_check_mark: | The ID of the upload request | \ No newline at end of file diff --git a/docs/models/operations/getworkspaceuploadrequestsrequest.md b/docs/models/operations/getworkspaceuploadrequestsrequest.md new file mode 100644 index 0000000..ad5d8bd --- /dev/null +++ b/docs/models/operations/getworkspaceuploadrequestsrequest.md @@ -0,0 +1,19 @@ +# GetWorkspaceUploadRequestsRequest + +## Example Usage + +```typescript +import { GetWorkspaceUploadRequestsRequest } from "@docusign/iam-sdk/models/operations"; + +let value: GetWorkspaceUploadRequestsRequest = { + accountId: "d80705ef-e6d9-4251-b6c4-09d62906f0ce", + workspaceId: "501b85dd-229f-40ba-a2fd-4fbd691b65d6", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `accountId` | *string* | :heavy_check_mark: | The ID of the account | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace | \ No newline at end of file diff --git a/docs/models/operations/getworkspaceusersrequest.md b/docs/models/operations/getworkspaceusersrequest.md new file mode 100644 index 0000000..bbf2159 --- /dev/null +++ b/docs/models/operations/getworkspaceusersrequest.md @@ -0,0 +1,23 @@ +# GetWorkspaceUsersRequest + +## Example Usage + +```typescript +import { GetWorkspaceUsersRequest } from "@docusign/iam-sdk/models/operations"; + +let value: GetWorkspaceUsersRequest = { + accountId: "72b92018-be5e-43ca-ae4f-82015f0d3c96", + workspaceId: "9b4c8a1e-0e17-4d0f-bc2c-e7a02d3b604e", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountId` | *string* | :heavy_check_mark: | The ID of the account | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace | +| `count` | *number* | :heavy_minus_sign: | Number of workspace users to return. Defaults to the maximum which is 100. | +| `startPosition` | *number* | :heavy_minus_sign: | Position of the first item in the total results. Defaults to 0. | +| `filter` | *string* | :heavy_minus_sign: | Returns workspace users filtered by Name and Email | +| `sort` | [components.GetWorkspaceUsersSortingOption](../../models/components/getworkspaceuserssortingoption.md) | :heavy_minus_sign: | Sorts results. Options are `first_name_asc`, `first_name_desc`, `last_name_asc`, `last_name_desc`, `email_asc`, `email_desc`. Defaults to `last_name_desc` | \ No newline at end of file diff --git a/docs/models/operations/restoreworkspaceuseraccessrequest.md b/docs/models/operations/restoreworkspaceuseraccessrequest.md new file mode 100644 index 0000000..58ed239 --- /dev/null +++ b/docs/models/operations/restoreworkspaceuseraccessrequest.md @@ -0,0 +1,21 @@ +# RestoreWorkspaceUserAccessRequest + +## Example Usage + +```typescript +import { RestoreWorkspaceUserAccessRequest } from "@docusign/iam-sdk/models/operations"; + +let value: RestoreWorkspaceUserAccessRequest = { + accountId: "24bb2271-b669-426e-b8a0-8af0b5255b14", + workspaceId: "8707a2bb-f906-45c9-8326-01317d375b60", + userId: "af69e662-db97-43d8-9e26-f01521b6eabe", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `accountId` | *string* | :heavy_check_mark: | The ID of the account | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace to restore access | +| `userId` | *string* | :heavy_check_mark: | The ID of the user to be restored to the workspace | \ No newline at end of file diff --git a/docs/models/operations/revokeworkspaceuseraccessrequest.md b/docs/models/operations/revokeworkspaceuseraccessrequest.md new file mode 100644 index 0000000..1b08d65 --- /dev/null +++ b/docs/models/operations/revokeworkspaceuseraccessrequest.md @@ -0,0 +1,22 @@ +# RevokeWorkspaceUserAccessRequest + +## Example Usage + +```typescript +import { RevokeWorkspaceUserAccessRequest } from "@docusign/iam-sdk/models/operations"; + +let value: RevokeWorkspaceUserAccessRequest = { + accountId: "fa75bc1e-0a6a-45f0-bc95-683c6b51e146", + workspaceId: "83567d42-c48e-431d-b433-09cadff94c25", + userId: "1affc669-3c7b-478f-a739-c889c976e1f1", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `accountId` | *string* | :heavy_check_mark: | The ID of the account | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace to revoke access from | +| `userId` | *string* | :heavy_check_mark: | The ID of the user to be revoked from the workspace | +| `revokeWorkspaceUserDetails` | [components.RevokeWorkspaceUserDetails](../../models/components/revokeworkspaceuserdetails.md) | :heavy_minus_sign: | Optional details. Allows scheduling the revocation for the future | \ No newline at end of file diff --git a/docs/models/operations/triggerworkflowrequest.md b/docs/models/operations/triggerworkflowrequest.md index 03248be..cf45be0 100644 --- a/docs/models/operations/triggerworkflowrequest.md +++ b/docs/models/operations/triggerworkflowrequest.md @@ -8,6 +8,13 @@ import { TriggerWorkflowRequest } from "@docusign/iam-sdk/models/operations"; let value: TriggerWorkflowRequest = { accountId: "ae232f1f-8efc-4b8c-bb08-626847fad8bb", workflowId: "", + triggerWorkflow: { + instanceName: "My Instance", + triggerInputs: { + "name": "Jon Doe", + "email": "jdoe@example.com", + }, + }, }; ``` diff --git a/docs/models/operations/updateworkspaceuploadrequestrequest.md b/docs/models/operations/updateworkspaceuploadrequestrequest.md new file mode 100644 index 0000000..e87cfc6 --- /dev/null +++ b/docs/models/operations/updateworkspaceuploadrequestrequest.md @@ -0,0 +1,28 @@ +# UpdateWorkspaceUploadRequestRequest + +## Example Usage + +```typescript +import { UpdateWorkspaceUploadRequestRequest } from "@docusign/iam-sdk/models/operations"; + +let value: UpdateWorkspaceUploadRequestRequest = { + accountId: "c7445bac-c24e-44bf-8dd0-fa5292211a6e", + workspaceId: "6cf9d969-026a-431b-ac90-f47dcca4cc8a", + uploadRequestId: "b1fcb3a5-686a-473b-a8e2-062563c4e4e4", + updateWorkspaceUploadRequestBody: { + name: null, + description: "mid tired creamy bourgeoisie hmph dead", + status: "complete", + dueDate: "", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `accountId` | *string* | :heavy_check_mark: | The ID of the account | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace | +| `uploadRequestId` | *string* | :heavy_check_mark: | The ID of the upload request to update | +| `updateWorkspaceUploadRequestBody` | [components.UpdateWorkspaceUploadRequestBody](../../models/components/updateworkspaceuploadrequestbody.md) | :heavy_check_mark: | The upload request object with updated values | \ No newline at end of file diff --git a/docs/models/operations/updateworkspaceuserrequest.md b/docs/models/operations/updateworkspaceuserrequest.md new file mode 100644 index 0000000..8bcc4b9 --- /dev/null +++ b/docs/models/operations/updateworkspaceuserrequest.md @@ -0,0 +1,22 @@ +# UpdateWorkspaceUserRequest + +## Example Usage + +```typescript +import { UpdateWorkspaceUserRequest } from "@docusign/iam-sdk/models/operations"; + +let value: UpdateWorkspaceUserRequest = { + accountId: "1a092a9c-6b0a-459a-91d4-bbb601b78a07", + workspaceId: "59ced2ea-7ec2-4b65-8a1f-b606dcda811f", + userId: "e163751e-fd76-4e55-b3cf-7c1327174c9c", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `accountId` | *string* | :heavy_check_mark: | The ID of the account | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace | +| `userId` | *string* | :heavy_check_mark: | The ID of the user to update | +| `workspaceUserForUpdate` | [components.WorkspaceUserForUpdate](../../models/components/workspaceuserforupdate.md) | :heavy_minus_sign: | The user details to update to including the RoleId | \ No newline at end of file diff --git a/docs/sdks/agreements/README.md b/docs/sdks/agreements/README.md index ec1bf0e..2f90c09 100644 --- a/docs/sdks/agreements/README.md +++ b/docs/sdks/agreements/README.md @@ -35,6 +35,7 @@ The response also includes provisions that outline the key legal, financial, and ### Example Usage + ```typescript import { IamClient } from "@docusign/iam-sdk"; @@ -133,6 +134,7 @@ The operation is essential for retrieving the full context of an agreement, enab ### Example Usage + ```typescript import { IamClient } from "@docusign/iam-sdk"; @@ -210,6 +212,7 @@ This operation safely deletes an agreement. This action conforms to GDPR and CCP ### Example Usage + ```typescript import { IamClient } from "@docusign/iam-sdk"; @@ -293,6 +296,7 @@ Please refer to the original agreement for any legally binding information. ### Example Usage + ```typescript import { IamClient } from "@docusign/iam-sdk"; diff --git a/docs/sdks/auth/README.md b/docs/sdks/auth/README.md index b3e317c..700828c 100644 --- a/docs/sdks/auth/README.md +++ b/docs/sdks/auth/README.md @@ -20,6 +20,7 @@ You do not need an integration key to obtain an access token. ### Example Usage + ```typescript import { IamClient } from "@docusign/iam-sdk"; @@ -100,6 +101,7 @@ You do not need an integration key to obtain an access token. ### Example Usage + ```typescript import { IamClient } from "@docusign/iam-sdk"; @@ -185,6 +187,7 @@ You do not need an integration key to obtain an access token. ### Example Usage + ```typescript import { IamClient } from "@docusign/iam-sdk"; @@ -263,6 +266,7 @@ You do not need an integration key to obtain an access token. ### Example Usage + ```typescript import { IamClient } from "@docusign/iam-sdk"; @@ -338,6 +342,7 @@ For the production environment, the URI is https://account.docusign.com/oauth/us ### Example Usage + ```typescript import { IamClient } from "@docusign/iam-sdk"; diff --git a/docs/sdks/tabinfo/README.md b/docs/sdks/tabinfo/README.md index 3698a21..bfa0d60 100644 --- a/docs/sdks/tabinfo/README.md +++ b/docs/sdks/tabinfo/README.md @@ -15,6 +15,7 @@ Returns all tabs associated with the given account. ### Example Usage + ```typescript import { IamClient } from "@docusign/iam-sdk"; diff --git a/docs/sdks/workflowinstancemanagement/README.md b/docs/sdks/workflowinstancemanagement/README.md index 6287c53..7f4b343 100644 --- a/docs/sdks/workflowinstancemanagement/README.md +++ b/docs/sdks/workflowinstancemanagement/README.md @@ -59,6 +59,7 @@ as who started it, when it was last modified, and how many steps have been compl ### Example Usage + ```typescript import { IamClient } from "@docusign/iam-sdk"; @@ -151,6 +152,7 @@ auditing and reporting within the system. ### Example Usage + ```typescript import { IamClient } from "@docusign/iam-sdk"; @@ -239,6 +241,7 @@ Once canceled, the workflow instance will no longer continue executing any remai ### Example Usage + ```typescript import { IamClient } from "@docusign/iam-sdk"; diff --git a/docs/sdks/workflows/README.md b/docs/sdks/workflows/README.md index d0ac145..c0aa4ec 100644 --- a/docs/sdks/workflows/README.md +++ b/docs/sdks/workflows/README.md @@ -75,6 +75,7 @@ be triggered. ### Example Usage + ```typescript import { IamClient } from "@docusign/iam-sdk"; @@ -196,6 +197,7 @@ the workflow instance, ensuring seamless execution and compliance with workflow ### Example Usage + ```typescript import { IamClient } from "@docusign/iam-sdk"; @@ -325,6 +327,7 @@ interact with or track the running instance. ### Example Usage + ```typescript import { IamClient } from "@docusign/iam-sdk"; @@ -416,6 +419,7 @@ This operation pauses new workflow instances from being created. Any running wor ### Example Usage + ```typescript import { IamClient } from "@docusign/iam-sdk"; @@ -493,6 +497,7 @@ This operation enables new workflow instances to be created ### Example Usage + ```typescript import { IamClient } from "@docusign/iam-sdk"; diff --git a/docs/sdks/workspacedocuments/README.md b/docs/sdks/workspacedocuments/README.md new file mode 100644 index 0000000..0d07f96 --- /dev/null +++ b/docs/sdks/workspacedocuments/README.md @@ -0,0 +1,327 @@ +# WorkspaceDocuments +(*workspaces.workspaceDocuments*) + +## Overview + +### Available Operations + +* [getWorkspaceDocuments](#getworkspacedocuments) - Get documents in the workspace accessible to the calling user +* [getWorkspaceDocument](#getworkspacedocument) - Get information about the document +* [deleteWorkspaceDocument](#deleteworkspacedocument) - Deletes a document in the workspace +* [getWorkspaceDocumentContents](#getworkspacedocumentcontents) - Get the file contents of the document + +## getWorkspaceDocuments + +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. + +### Example Usage + + +```typescript +import { IamClient } from "@docusign/iam-sdk"; + +const iamClient = new IamClient({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const result = await iamClient.workspaces.workspaceDocuments.getWorkspaceDocuments({ + accountId: "61364114-072d-477f-a9fc-f9af7aea7896", + workspaceId: "d44e8655-55a3-498e-bfc3-e23027c5c36a", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { IamClientCore } from "@docusign/iam-sdk/core.js"; +import { workspacesWorkspaceDocumentsGetWorkspaceDocuments } from "@docusign/iam-sdk/funcs/workspacesWorkspaceDocumentsGetWorkspaceDocuments.js"; + +// Use `IamClientCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const iamClient = new IamClientCore({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const res = await workspacesWorkspaceDocumentsGetWorkspaceDocuments(iamClient, { + accountId: "61364114-072d-477f-a9fc-f9af7aea7896", + workspaceId: "d44e8655-55a3-498e-bfc3-e23027c5c36a", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("workspacesWorkspaceDocumentsGetWorkspaceDocuments failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetWorkspaceDocumentsRequest](../../models/operations/getworkspacedocumentsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.GetWorkspaceDocumentsResponse](../../models/components/getworkspacedocumentsresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorDetails | 400, 401 | application/json | +| errors.ErrorDetails | 500 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## getWorkspaceDocument + +This operation retrieves information about the document. The response includes the document ID, name, and metadata. + +### Example Usage + + +```typescript +import { IamClient } from "@docusign/iam-sdk"; + +const iamClient = new IamClient({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const result = await iamClient.workspaces.workspaceDocuments.getWorkspaceDocument({ + accountId: "92293164-1793-41a1-8cb1-d6fdf0660804", + workspaceId: "dfef9b70-860f-4798-889d-2f28cf5df5f4", + documentId: "b9ed137b-5b0a-4abf-abac-ab9720001190", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { IamClientCore } from "@docusign/iam-sdk/core.js"; +import { workspacesWorkspaceDocumentsGetWorkspaceDocument } from "@docusign/iam-sdk/funcs/workspacesWorkspaceDocumentsGetWorkspaceDocument.js"; + +// Use `IamClientCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const iamClient = new IamClientCore({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const res = await workspacesWorkspaceDocumentsGetWorkspaceDocument(iamClient, { + accountId: "92293164-1793-41a1-8cb1-d6fdf0660804", + workspaceId: "dfef9b70-860f-4798-889d-2f28cf5df5f4", + documentId: "b9ed137b-5b0a-4abf-abac-ab9720001190", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("workspacesWorkspaceDocumentsGetWorkspaceDocument failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetWorkspaceDocumentRequest](../../models/operations/getworkspacedocumentrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.GetWorkspaceDocumentResponse](../../models/components/getworkspacedocumentresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorDetails | 400, 401 | application/json | +| errors.ErrorDetails | 500 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## deleteWorkspaceDocument + +This operation permanently deletes a document by ID. + +### Example Usage + + +```typescript +import { IamClient } from "@docusign/iam-sdk"; + +const iamClient = new IamClient({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + await iamClient.workspaces.workspaceDocuments.deleteWorkspaceDocument({ + accountId: "2e37a9af-e272-4059-96ff-0bfcf9620437", + workspaceId: "0013f129-d585-40d0-a299-1141daa04cf3", + documentId: "20dad844-6281-4b04-834a-b5979c0329b7", + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { IamClientCore } from "@docusign/iam-sdk/core.js"; +import { workspacesWorkspaceDocumentsDeleteWorkspaceDocument } from "@docusign/iam-sdk/funcs/workspacesWorkspaceDocumentsDeleteWorkspaceDocument.js"; + +// Use `IamClientCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const iamClient = new IamClientCore({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const res = await workspacesWorkspaceDocumentsDeleteWorkspaceDocument(iamClient, { + accountId: "2e37a9af-e272-4059-96ff-0bfcf9620437", + workspaceId: "0013f129-d585-40d0-a299-1141daa04cf3", + documentId: "20dad844-6281-4b04-834a-b5979c0329b7", + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("workspacesWorkspaceDocumentsDeleteWorkspaceDocument failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.DeleteWorkspaceDocumentRequest](../../models/operations/deleteworkspacedocumentrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorDetails | 400, 401 | application/json | +| errors.ErrorDetails | 500 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## getWorkspaceDocumentContents + +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`. + +### Example Usage + + +```typescript +import { IamClient } from "@docusign/iam-sdk"; + +const iamClient = new IamClient({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const result = await iamClient.workspaces.workspaceDocuments.getWorkspaceDocumentContents({ + accountId: "4bc13f41-0697-41ee-8a11-d96266a80841", + workspaceId: "4a268145-6144-48d9-b009-283af8fd83e8", + documentId: "b62fd488-5ecf-4b73-878f-72550a413ac3", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { IamClientCore } from "@docusign/iam-sdk/core.js"; +import { workspacesWorkspaceDocumentsGetWorkspaceDocumentContents } from "@docusign/iam-sdk/funcs/workspacesWorkspaceDocumentsGetWorkspaceDocumentContents.js"; + +// Use `IamClientCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const iamClient = new IamClientCore({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const res = await workspacesWorkspaceDocumentsGetWorkspaceDocumentContents(iamClient, { + accountId: "4bc13f41-0697-41ee-8a11-d96266a80841", + workspaceId: "4a268145-6144-48d9-b009-283af8fd83e8", + documentId: "b62fd488-5ecf-4b73-878f-72550a413ac3", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("workspacesWorkspaceDocumentsGetWorkspaceDocumentContents failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetWorkspaceDocumentContentsRequest](../../models/operations/getworkspacedocumentcontentsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[ReadableStream](../../models/.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorDetails | 400, 401 | application/json | +| errors.ErrorDetails | 500 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/workspaces1/README.md b/docs/sdks/workspaces1/README.md new file mode 100644 index 0000000..f422dae --- /dev/null +++ b/docs/sdks/workspaces1/README.md @@ -0,0 +1,6 @@ +# Workspaces1 +(*workspaces*) + +## Overview + +### Available Operations diff --git a/docs/sdks/workspaces2/README.md b/docs/sdks/workspaces2/README.md new file mode 100644 index 0000000..d6f3184 --- /dev/null +++ b/docs/sdks/workspaces2/README.md @@ -0,0 +1,501 @@ +# Workspaces2 +(*workspaces.workspaces*) + +## Overview + +### Available Operations + +* [getWorkspaces](#getworkspaces) - Gets workspaces available to the calling user +* [createWorkspace](#createworkspace) - Creates a new workspace +* [getWorkspace](#getworkspace) - Returns details about the workspace +* [getWorkspaceAssignableRoles](#getworkspaceassignableroles) - Returns the roles the caller can assign to workspace users +* [createWorkspaceEnvelope](#createworkspaceenvelope) - Creates an envelope with the given documents. Returns the ID of the created envelope +* [getWorkspaceEnvelopes](#getworkspaceenvelopes) - Returns the envelopes associated with the given workspace + +## getWorkspaces + +This operation retrieves a list of workspaces available to the calling user. It returns basic information about each workspace, including its unique identifier (ID), name, and metadata such as when it was created and by whom. + +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. + +### Example Usage + + +```typescript +import { IamClient } from "@docusign/iam-sdk"; + +const iamClient = new IamClient({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const result = await iamClient.workspaces.workspaces.getWorkspaces({ + accountId: "c0aa779c-d467-40d4-863c-49bc82f11d0f", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { IamClientCore } from "@docusign/iam-sdk/core.js"; +import { workspacesWorkspacesGetWorkspaces } from "@docusign/iam-sdk/funcs/workspacesWorkspacesGetWorkspaces.js"; + +// Use `IamClientCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const iamClient = new IamClientCore({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const res = await workspacesWorkspacesGetWorkspaces(iamClient, { + accountId: "c0aa779c-d467-40d4-863c-49bc82f11d0f", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("workspacesWorkspacesGetWorkspaces failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetWorkspacesRequest](../../models/operations/getworkspacesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.GetWorkspacesResponse](../../models/components/getworkspacesresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorDetails | 400, 401 | application/json | +| errors.ErrorDetails | 500 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## createWorkspace + +This operation creates a new workspace. The calling user is automatically added as a member of the workspace with the role of Manage. + +Once created, the `workspace_id` is utilized to associate tasks such as envelopes. Participants on tasks will automatically be added to the workspace with the Participate role. + +### Example Usage + + +```typescript +import { IamClient } from "@docusign/iam-sdk"; + +const iamClient = new IamClient({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const result = await iamClient.workspaces.workspaces.createWorkspace({ + accountId: "a112e56c-a7e3-42a4-841a-04ccff785253", + createWorkspaceBody: { + name: "", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { IamClientCore } from "@docusign/iam-sdk/core.js"; +import { workspacesWorkspacesCreateWorkspace } from "@docusign/iam-sdk/funcs/workspacesWorkspacesCreateWorkspace.js"; + +// Use `IamClientCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const iamClient = new IamClientCore({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const res = await workspacesWorkspacesCreateWorkspace(iamClient, { + accountId: "a112e56c-a7e3-42a4-841a-04ccff785253", + createWorkspaceBody: { + name: "", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("workspacesWorkspacesCreateWorkspace failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateWorkspaceRequest](../../models/operations/createworkspacerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.CreateWorkspaceResponse](../../models/components/createworkspaceresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorDetails | 400, 401 | application/json | +| errors.ErrorDetails | 500 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## getWorkspace + +This operation retrieves details about a specific workspace. It returns the workspace's unique identifier (ID), name, and metadata such as when it was created and by whom. + +### Example Usage + + +```typescript +import { IamClient } from "@docusign/iam-sdk"; + +const iamClient = new IamClient({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const result = await iamClient.workspaces.workspaces.getWorkspace({ + accountId: "ad230bf6-0f5f-4b96-87ed-f1dfb60c2369", + workspaceId: "55f7d452-cda5-4e74-a1a9-d0a5073bb942", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { IamClientCore } from "@docusign/iam-sdk/core.js"; +import { workspacesWorkspacesGetWorkspace } from "@docusign/iam-sdk/funcs/workspacesWorkspacesGetWorkspace.js"; + +// Use `IamClientCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const iamClient = new IamClientCore({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const res = await workspacesWorkspacesGetWorkspace(iamClient, { + accountId: "ad230bf6-0f5f-4b96-87ed-f1dfb60c2369", + workspaceId: "55f7d452-cda5-4e74-a1a9-d0a5073bb942", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("workspacesWorkspacesGetWorkspace failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetWorkspaceRequest](../../models/operations/getworkspacerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.GetWorkspaceResponse](../../models/components/getworkspaceresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorDetails | 400, 401 | application/json | +| errors.ErrorDetails | 500 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## getWorkspaceAssignableRoles + +This operation returns roles that are assignable to users in the workspace based on the caller's role in the workspace. Roles available include Manage (internal) and Participate (external). Participate is the default role. + +Users within the account are considered "Internal" and may be assigned any role. Users outside the account are considered "External" and may only be assigned "External" roles. + +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. + +### Example Usage + + +```typescript +import { IamClient } from "@docusign/iam-sdk"; + +const iamClient = new IamClient({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const result = await iamClient.workspaces.workspaces.getWorkspaceAssignableRoles({ + accountId: "541b0318-7597-4668-b774-ac66de5ddf28", + workspaceId: "62ce984d-c201-4336-9e9f-8cf191c29d9c", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { IamClientCore } from "@docusign/iam-sdk/core.js"; +import { workspacesWorkspacesGetWorkspaceAssignableRoles } from "@docusign/iam-sdk/funcs/workspacesWorkspacesGetWorkspaceAssignableRoles.js"; + +// Use `IamClientCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const iamClient = new IamClientCore({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const res = await workspacesWorkspacesGetWorkspaceAssignableRoles(iamClient, { + accountId: "541b0318-7597-4668-b774-ac66de5ddf28", + workspaceId: "62ce984d-c201-4336-9e9f-8cf191c29d9c", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("workspacesWorkspacesGetWorkspaceAssignableRoles failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetWorkspaceAssignableRolesRequest](../../models/operations/getworkspaceassignablerolesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.GetWorkspaceAssignableRolesResponse](../../models/components/getworkspaceassignablerolesresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorDetails | 400, 401 | application/json | +| errors.ErrorDetails | 500 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## createWorkspaceEnvelope + +This operation creates an envelope associated with the workspace. Using the `envelope_id` from the response, the [eSignature API](https://developers.docusign.com/docs/esign-rest-api/) may be utilized to modify the envelope and ultimately send it. + +Envelope recipients will automatically be granted Participate access to the workspace. Envelope recipients will receive consolidated notifications from Docusign Workspaces rather than standard individual envelope notifications. + +Docusign Connect events may be utilized to receive updates to individual envelope events. + +The `envelopes` operation on the workspace may be utilized to query the status of all the envelopes in the workspace. + +When `document_ids` is empty or excluded, the envelope is created without any documents from the workspace. eSignature API calls, including adding documents and templates, may be utilized to modify the envelope before it is sent. The eSignature API must be utilized to send the envelope. + +### Example Usage + + +```typescript +import { IamClient } from "@docusign/iam-sdk"; + +const iamClient = new IamClient({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const result = await iamClient.workspaces.workspaces.createWorkspaceEnvelope({ + accountId: "d2da53cf-e564-4282-bb1d-8cdaa0948abe", + workspaceId: "69b8ec97-5be8-40a3-ae01-fbff4ba7a447", + workspaceEnvelopeForCreate: { + envelopeName: "", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { IamClientCore } from "@docusign/iam-sdk/core.js"; +import { workspacesWorkspacesCreateWorkspaceEnvelope } from "@docusign/iam-sdk/funcs/workspacesWorkspacesCreateWorkspaceEnvelope.js"; + +// Use `IamClientCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const iamClient = new IamClientCore({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const res = await workspacesWorkspacesCreateWorkspaceEnvelope(iamClient, { + accountId: "d2da53cf-e564-4282-bb1d-8cdaa0948abe", + workspaceId: "69b8ec97-5be8-40a3-ae01-fbff4ba7a447", + workspaceEnvelopeForCreate: { + envelopeName: "", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("workspacesWorkspacesCreateWorkspaceEnvelope failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateWorkspaceEnvelopeRequest](../../models/operations/createworkspaceenveloperequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.CreateWorkspaceEnvelopeResponse](../../models/components/createworkspaceenveloperesponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorDetails | 400, 401 | application/json | +| errors.ErrorDetails | 500 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## getWorkspaceEnvelopes + +This operation retrieves a list of all associated workspace envelopes. The [`status`](https://support.docusign.com/s/document-item?bundleId=oeq1643226594604&topicId=wdm1578456348227.html) on each envelope can be used to track envelope progress. Statuses are formatted as ProperCase. e.g. `Sent`, `WaitingForOthers`, `Completed`, etc. + +Based on the permissions of the caller, additional envelope details may be retrieved from the [eSignature API](https://developers.docusign.com/docs/esign-rest-api/) using the `envelope_id`. + +### Example Usage + + +```typescript +import { IamClient } from "@docusign/iam-sdk"; + +const iamClient = new IamClient({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const result = await iamClient.workspaces.workspaces.getWorkspaceEnvelopes({ + accountId: "6582b4dd-d705-43f5-8bd2-cebfd9049aa8", + workspaceId: "c80f66a9-e39c-4ab6-818e-cf6b04f77d1a", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { IamClientCore } from "@docusign/iam-sdk/core.js"; +import { workspacesWorkspacesGetWorkspaceEnvelopes } from "@docusign/iam-sdk/funcs/workspacesWorkspacesGetWorkspaceEnvelopes.js"; + +// Use `IamClientCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const iamClient = new IamClientCore({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const res = await workspacesWorkspacesGetWorkspaceEnvelopes(iamClient, { + accountId: "6582b4dd-d705-43f5-8bd2-cebfd9049aa8", + workspaceId: "c80f66a9-e39c-4ab6-818e-cf6b04f77d1a", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("workspacesWorkspacesGetWorkspaceEnvelopes failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetWorkspaceEnvelopesRequest](../../models/operations/getworkspaceenvelopesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.GetWorkspaceEnvelopesResponse](../../models/components/getworkspaceenvelopesresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorDetails | 400, 401 | application/json | +| errors.ErrorDetails | 500 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/workspaceuploadrequest/README.md b/docs/sdks/workspaceuploadrequest/README.md new file mode 100644 index 0000000..4f3a3d5 --- /dev/null +++ b/docs/sdks/workspaceuploadrequest/README.md @@ -0,0 +1,517 @@ +# WorkspaceUploadRequest +(*workspaces.workspaceUploadRequest*) + +## Overview + +### Available Operations + +* [createWorkspaceUploadRequest](#createworkspaceuploadrequest) - Creates a new upload request within a workspace +* [getWorkspaceUploadRequests](#getworkspaceuploadrequests) - Gets upload requests within a workspace +* [getWorkspaceUploadRequest](#getworkspaceuploadrequest) - Gets details for a specific upload request +* [updateWorkspaceUploadRequest](#updateworkspaceuploadrequest) - Updates a specific upload request +* [deleteWorkspaceUploadRequest](#deleteworkspaceuploadrequest) - Deletes a specific upload request +* [completeWorkspaceUploadRequest](#completeworkspaceuploadrequest) - Complete an upload request + +## createWorkspaceUploadRequest + +This operation creates a new upload request within a workspace. The upload request includes name, description, due date, and user assignments. Upload requests can be created as drafts or sent immediately based on the status field. + +### Example Usage + + +```typescript +import { IamClient } from "@docusign/iam-sdk"; + +const iamClient = new IamClient({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const result = await iamClient.workspaces.workspaceUploadRequest.createWorkspaceUploadRequest({ + accountId: "1cbbee87-a846-4a71-86d2-26b7972bb7c4", + workspaceId: "c2ab6f98-e507-43b1-8c9d-43f1db751c40", + createWorkspaceUploadRequestBody: { + name: "", + description: "what than unique limply quaintly tattered grown", + dueDate: new Date("2024-04-25T08:01:44.605Z"), + assignments: [ + { + uploadRequestResponsibilityTypeId: "assignee", + }, + ], + status: "draft", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { IamClientCore } from "@docusign/iam-sdk/core.js"; +import { workspacesWorkspaceUploadRequestCreateWorkspaceUploadRequest } from "@docusign/iam-sdk/funcs/workspacesWorkspaceUploadRequestCreateWorkspaceUploadRequest.js"; + +// Use `IamClientCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const iamClient = new IamClientCore({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const res = await workspacesWorkspaceUploadRequestCreateWorkspaceUploadRequest(iamClient, { + accountId: "1cbbee87-a846-4a71-86d2-26b7972bb7c4", + workspaceId: "c2ab6f98-e507-43b1-8c9d-43f1db751c40", + createWorkspaceUploadRequestBody: { + name: "", + description: "what than unique limply quaintly tattered grown", + dueDate: new Date("2024-04-25T08:01:44.605Z"), + assignments: [ + { + uploadRequestResponsibilityTypeId: "assignee", + }, + ], + status: "draft", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("workspacesWorkspaceUploadRequestCreateWorkspaceUploadRequest failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateWorkspaceUploadRequestRequest](../../models/operations/createworkspaceuploadrequestrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.GetWorkspaceUploadRequestResponse](../../models/components/getworkspaceuploadrequestresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorDetails | 400, 401 | application/json | +| errors.ErrorDetails | 500 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## getWorkspaceUploadRequests + +This operation retrieves a list of upload requests within a workspace. Each upload request includes details such as ID, name, description, status, owner information, associated documents, assignments, and various dates. + +### Example Usage + + +```typescript +import { IamClient } from "@docusign/iam-sdk"; + +const iamClient = new IamClient({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const result = await iamClient.workspaces.workspaceUploadRequest.getWorkspaceUploadRequests({ + accountId: "5be78df1-c1f7-4e27-8b93-b0613a620dce", + workspaceId: "b6719b00-fae9-4c7d-afce-b03f5e783434", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { IamClientCore } from "@docusign/iam-sdk/core.js"; +import { workspacesWorkspaceUploadRequestGetWorkspaceUploadRequests } from "@docusign/iam-sdk/funcs/workspacesWorkspaceUploadRequestGetWorkspaceUploadRequests.js"; + +// Use `IamClientCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const iamClient = new IamClientCore({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const res = await workspacesWorkspaceUploadRequestGetWorkspaceUploadRequests(iamClient, { + accountId: "5be78df1-c1f7-4e27-8b93-b0613a620dce", + workspaceId: "b6719b00-fae9-4c7d-afce-b03f5e783434", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("workspacesWorkspaceUploadRequestGetWorkspaceUploadRequests failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetWorkspaceUploadRequestsRequest](../../models/operations/getworkspaceuploadrequestsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.GetWorkspaceUploadRequestsResponse](../../models/components/getworkspaceuploadrequestsresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorDetails | 400, 401 | application/json | +| errors.ErrorDetails | 500 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## getWorkspaceUploadRequest + +This operation retrieves details about a specific upload request within a workspace. The response includes comprehensive information about the upload request including status, assigned users, associated documents, owner details, and various dates. + +### Example Usage + + +```typescript +import { IamClient } from "@docusign/iam-sdk"; + +const iamClient = new IamClient({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const result = await iamClient.workspaces.workspaceUploadRequest.getWorkspaceUploadRequest({ + accountId: "7c24b49f-1dcd-49f1-be71-5b7d65118ca4", + workspaceId: "0d068551-32a6-491f-8107-a554d3760bc6", + uploadRequestId: "291c9759-17f1-4e96-8db4-c006050dc1c8", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { IamClientCore } from "@docusign/iam-sdk/core.js"; +import { workspacesWorkspaceUploadRequestGetWorkspaceUploadRequest } from "@docusign/iam-sdk/funcs/workspacesWorkspaceUploadRequestGetWorkspaceUploadRequest.js"; + +// Use `IamClientCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const iamClient = new IamClientCore({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const res = await workspacesWorkspaceUploadRequestGetWorkspaceUploadRequest(iamClient, { + accountId: "7c24b49f-1dcd-49f1-be71-5b7d65118ca4", + workspaceId: "0d068551-32a6-491f-8107-a554d3760bc6", + uploadRequestId: "291c9759-17f1-4e96-8db4-c006050dc1c8", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("workspacesWorkspaceUploadRequestGetWorkspaceUploadRequest failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetWorkspaceUploadRequestRequest](../../models/operations/getworkspaceuploadrequestrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.GetWorkspaceUploadRequestResponse](../../models/components/getworkspaceuploadrequestresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorDetails | 400, 401 | application/json | +| errors.ErrorDetails | 500 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## updateWorkspaceUploadRequest + +This operation updates a specific upload request within a workspace. Only draft upload requests can be edited. The editable fields are name, description, due date, and status. Status changes are restricted - only transitions from draft to in_progress are allowed. Attempting to update a non-draft upload request will result in an INVALID_STATUS error. Attempting an invalid status change will result in an INVALID_STATUS_CHANGE error. + +### Example Usage + + +```typescript +import { IamClient } from "@docusign/iam-sdk"; + +const iamClient = new IamClient({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const result = await iamClient.workspaces.workspaceUploadRequest.updateWorkspaceUploadRequest({ + accountId: "caf60771-df4b-4068-9ca5-0e088e4b6ebc", + workspaceId: "da4b7335-e975-49b8-9307-923a86c3b10f", + uploadRequestId: "5d8c2cfe-7346-46e3-a188-681b6aadfcc3", + updateWorkspaceUploadRequestBody: { + name: "", + description: "at providence phew furthermore save digitize than how circa never", + status: "overdue", + dueDate: "", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { IamClientCore } from "@docusign/iam-sdk/core.js"; +import { workspacesWorkspaceUploadRequestUpdateWorkspaceUploadRequest } from "@docusign/iam-sdk/funcs/workspacesWorkspaceUploadRequestUpdateWorkspaceUploadRequest.js"; + +// Use `IamClientCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const iamClient = new IamClientCore({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const res = await workspacesWorkspaceUploadRequestUpdateWorkspaceUploadRequest(iamClient, { + accountId: "caf60771-df4b-4068-9ca5-0e088e4b6ebc", + workspaceId: "da4b7335-e975-49b8-9307-923a86c3b10f", + uploadRequestId: "5d8c2cfe-7346-46e3-a188-681b6aadfcc3", + updateWorkspaceUploadRequestBody: { + name: "", + description: "at providence phew furthermore save digitize than how circa never", + status: "overdue", + dueDate: "", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("workspacesWorkspaceUploadRequestUpdateWorkspaceUploadRequest failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UpdateWorkspaceUploadRequestRequest](../../models/operations/updateworkspaceuploadrequestrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.GetWorkspaceUploadRequestResponse](../../models/components/getworkspaceuploadrequestresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorDetails | 400, 401 | application/json | +| errors.ErrorDetails | 500 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## deleteWorkspaceUploadRequest + +This operation deletes a specific upload request within a workspace. Upload requests cannot be deleted if they are complete or have associated documents. + +### Example Usage + + +```typescript +import { IamClient } from "@docusign/iam-sdk"; + +const iamClient = new IamClient({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + await iamClient.workspaces.workspaceUploadRequest.deleteWorkspaceUploadRequest({ + accountId: "4911c672-2369-401a-b334-65cc19aa9316", + workspaceId: "1886fee0-c032-4423-a512-78c15992cb4d", + uploadRequestId: "81d3b642-96bd-4b5e-822b-5a5ebc552ab2", + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { IamClientCore } from "@docusign/iam-sdk/core.js"; +import { workspacesWorkspaceUploadRequestDeleteWorkspaceUploadRequest } from "@docusign/iam-sdk/funcs/workspacesWorkspaceUploadRequestDeleteWorkspaceUploadRequest.js"; + +// Use `IamClientCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const iamClient = new IamClientCore({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const res = await workspacesWorkspaceUploadRequestDeleteWorkspaceUploadRequest(iamClient, { + accountId: "4911c672-2369-401a-b334-65cc19aa9316", + workspaceId: "1886fee0-c032-4423-a512-78c15992cb4d", + uploadRequestId: "81d3b642-96bd-4b5e-822b-5a5ebc552ab2", + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("workspacesWorkspaceUploadRequestDeleteWorkspaceUploadRequest failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.DeleteWorkspaceUploadRequestRequest](../../models/operations/deleteworkspaceuploadrequestrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorDetails | 400, 401 | application/json | +| errors.ErrorDetails | 500 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## completeWorkspaceUploadRequest + +This operation completes a specific upload request within a workspace and is intended to be called by the user completing the upload request. Only upload requests that are in progress can be completed. + +### Example Usage + + +```typescript +import { IamClient } from "@docusign/iam-sdk"; + +const iamClient = new IamClient({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + await iamClient.workspaces.workspaceUploadRequest.completeWorkspaceUploadRequest({ + accountId: "66e3adbf-237a-4dc6-a239-f5b562487126", + workspaceId: "d44b9cea-0e4e-45ec-8c2f-4e0ce9729584", + uploadRequestId: "ecdb900d-7e60-4a2c-8e83-0252dc622fcb", + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { IamClientCore } from "@docusign/iam-sdk/core.js"; +import { workspacesWorkspaceUploadRequestCompleteWorkspaceUploadRequest } from "@docusign/iam-sdk/funcs/workspacesWorkspaceUploadRequestCompleteWorkspaceUploadRequest.js"; + +// Use `IamClientCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const iamClient = new IamClientCore({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const res = await workspacesWorkspaceUploadRequestCompleteWorkspaceUploadRequest(iamClient, { + accountId: "66e3adbf-237a-4dc6-a239-f5b562487126", + workspaceId: "d44b9cea-0e4e-45ec-8c2f-4e0ce9729584", + uploadRequestId: "ecdb900d-7e60-4a2c-8e83-0252dc622fcb", + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("workspacesWorkspaceUploadRequestCompleteWorkspaceUploadRequest failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CompleteWorkspaceUploadRequestRequest](../../models/operations/completeworkspaceuploadrequestrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorDetails | 400, 401 | application/json | +| errors.ErrorDetails | 500 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/workspaceusers/README.md b/docs/sdks/workspaceusers/README.md new file mode 100644 index 0000000..4d9ac35 --- /dev/null +++ b/docs/sdks/workspaceusers/README.md @@ -0,0 +1,407 @@ +# WorkspaceUsers +(*workspaces.workspaceUsers*) + +## Overview + +### Available Operations + +* [getWorkspaceUsers](#getworkspaceusers) - Retrieves the list of users in the given workspace +* [addWorkspaceUser](#addworkspaceuser) - Adds a user to the workspace by email address +* [updateWorkspaceUser](#updateworkspaceuser) - Updates the specified user's role +* [revokeWorkspaceUserAccess](#revokeworkspaceuseraccess) - Revokes the specified user's access to the workspace +* [restoreWorkspaceUserAccess](#restoreworkspaceuseraccess) - Restores the specified user's access to the workspace + +## getWorkspaceUsers + +This operations retrieves the users in a workspace. Users sent envelopes or assigned tasks will automatically be added to the workspace with the Participate role. + +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. + +### Example Usage + + +```typescript +import { IamClient } from "@docusign/iam-sdk"; + +const iamClient = new IamClient({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const result = await iamClient.workspaces.workspaceUsers.getWorkspaceUsers({ + accountId: "9ae55a64-d2c4-4631-8668-7f4264e89a7c", + workspaceId: "0a03290d-af53-43c0-81a3-aa5e7db57ccc", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { IamClientCore } from "@docusign/iam-sdk/core.js"; +import { workspacesWorkspaceUsersGetWorkspaceUsers } from "@docusign/iam-sdk/funcs/workspacesWorkspaceUsersGetWorkspaceUsers.js"; + +// Use `IamClientCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const iamClient = new IamClientCore({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const res = await workspacesWorkspaceUsersGetWorkspaceUsers(iamClient, { + accountId: "9ae55a64-d2c4-4631-8668-7f4264e89a7c", + workspaceId: "0a03290d-af53-43c0-81a3-aa5e7db57ccc", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("workspacesWorkspaceUsersGetWorkspaceUsers failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetWorkspaceUsersRequest](../../models/operations/getworkspaceusersrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.GetWorkspaceUsersResponse](../../models/components/getworkspaceusersresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorDetails | 400, 401 | application/json | +| errors.ErrorDetails | 500 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## addWorkspaceUser + +This operation manually adds an internal or external user to a specific workspace by email address. Users within the account are considered "Internal" and may be assigned any role. Users outside the account are considered "External" and may only be assigned the Participate role. This operation is not typically needed for adding external participants to a Workspace as they will be automatically added as tasks are assigned. + +Available role IDs can be retrieved via the Assignable Roles operation on a workspace. If the `role_id` is not passed, the user is added with the Participate role. + +### Example Usage + + +```typescript +import { IamClient } from "@docusign/iam-sdk"; + +const iamClient = new IamClient({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const result = await iamClient.workspaces.workspaceUsers.addWorkspaceUser({ + accountId: "55ecbf41-d3bb-4ed0-bb6e-019d84813dfb", + workspaceId: "ac4a8865-6e92-436b-8c1c-596b9bc19344", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { IamClientCore } from "@docusign/iam-sdk/core.js"; +import { workspacesWorkspaceUsersAddWorkspaceUser } from "@docusign/iam-sdk/funcs/workspacesWorkspaceUsersAddWorkspaceUser.js"; + +// Use `IamClientCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const iamClient = new IamClientCore({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const res = await workspacesWorkspaceUsersAddWorkspaceUser(iamClient, { + accountId: "55ecbf41-d3bb-4ed0-bb6e-019d84813dfb", + workspaceId: "ac4a8865-6e92-436b-8c1c-596b9bc19344", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("workspacesWorkspaceUsersAddWorkspaceUser failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.AddWorkspaceUserRequest](../../models/operations/addworkspaceuserrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.CreateWorkspaceUserResponse](../../models/components/createworkspaceuserresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorDetails | 400, 401 | application/json | +| errors.ErrorDetails | 500 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## updateWorkspaceUser + +This operation updates the specified user's role in the workspace. Users within the account are considered "Internal" and may be assigned any role. Users outside the account are considered "External" and may only be assigned "External" roles. + +### Example Usage + + +```typescript +import { IamClient } from "@docusign/iam-sdk"; + +const iamClient = new IamClient({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const result = await iamClient.workspaces.workspaceUsers.updateWorkspaceUser({ + accountId: "9c21c871-31a0-41bd-b7d0-c4bc7d7e7770", + workspaceId: "f2cc2db5-2b59-4c1d-9b36-ec191a110bd5", + userId: "3f0ec84d-ca81-4e4e-a476-bb1a630dde86", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { IamClientCore } from "@docusign/iam-sdk/core.js"; +import { workspacesWorkspaceUsersUpdateWorkspaceUser } from "@docusign/iam-sdk/funcs/workspacesWorkspaceUsersUpdateWorkspaceUser.js"; + +// Use `IamClientCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const iamClient = new IamClientCore({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const res = await workspacesWorkspaceUsersUpdateWorkspaceUser(iamClient, { + accountId: "9c21c871-31a0-41bd-b7d0-c4bc7d7e7770", + workspaceId: "f2cc2db5-2b59-4c1d-9b36-ec191a110bd5", + userId: "3f0ec84d-ca81-4e4e-a476-bb1a630dde86", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("workspacesWorkspaceUsersUpdateWorkspaceUser failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UpdateWorkspaceUserRequest](../../models/operations/updateworkspaceuserrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.UpdateWorkspaceUserResponse](../../models/components/updateworkspaceuserresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorDetails | 400, 401 | application/json | +| errors.ErrorDetails | 500 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## revokeWorkspaceUserAccess + +This operation revokes the specified user's access to the workspace. The optional `revocation_date` may be set to schedule revocation in the future. If not specified, the revocation will be immediate. + +### Example Usage + + +```typescript +import { IamClient } from "@docusign/iam-sdk"; + +const iamClient = new IamClient({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + await iamClient.workspaces.workspaceUsers.revokeWorkspaceUserAccess({ + accountId: "4b457d23-e0cf-41d6-ab4b-a1cc9d2746e9", + workspaceId: "7d48c40f-5efb-4c83-8568-002406476a59", + userId: "6307406e-ab4b-4d4b-b2c0-d2428dc6f8d4", + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { IamClientCore } from "@docusign/iam-sdk/core.js"; +import { workspacesWorkspaceUsersRevokeWorkspaceUserAccess } from "@docusign/iam-sdk/funcs/workspacesWorkspaceUsersRevokeWorkspaceUserAccess.js"; + +// Use `IamClientCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const iamClient = new IamClientCore({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const res = await workspacesWorkspaceUsersRevokeWorkspaceUserAccess(iamClient, { + accountId: "4b457d23-e0cf-41d6-ab4b-a1cc9d2746e9", + workspaceId: "7d48c40f-5efb-4c83-8568-002406476a59", + userId: "6307406e-ab4b-4d4b-b2c0-d2428dc6f8d4", + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("workspacesWorkspaceUsersRevokeWorkspaceUserAccess failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.RevokeWorkspaceUserAccessRequest](../../models/operations/revokeworkspaceuseraccessrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorDetails | 400, 401 | application/json | +| errors.ErrorDetails | 500 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## restoreWorkspaceUserAccess + +This operation restores the specified user's access to the workspace. The user must have been previously revoked from the workspace. The access is immediately restored. + +### Example Usage + + +```typescript +import { IamClient } from "@docusign/iam-sdk"; + +const iamClient = new IamClient({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + await iamClient.workspaces.workspaceUsers.restoreWorkspaceUserAccess({ + accountId: "03055c38-466e-4bf1-91d0-c49ecbc09b8f", + workspaceId: "0c281df3-a315-4c3f-9f07-6b0a3b953797", + userId: "cf3df2ba-fa4b-4787-b8ad-9932a4d5f94b", + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { IamClientCore } from "@docusign/iam-sdk/core.js"; +import { workspacesWorkspaceUsersRestoreWorkspaceUserAccess } from "@docusign/iam-sdk/funcs/workspacesWorkspaceUsersRestoreWorkspaceUserAccess.js"; + +// Use `IamClientCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const iamClient = new IamClientCore({ + accessToken: process.env["DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN"] ?? "", +}); + +async function run() { + const res = await workspacesWorkspaceUsersRestoreWorkspaceUserAccess(iamClient, { + accountId: "03055c38-466e-4bf1-91d0-c49ecbc09b8f", + workspaceId: "0c281df3-a315-4c3f-9f07-6b0a3b953797", + userId: "cf3df2ba-fa4b-4787-b8ad-9932a4d5f94b", + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("workspacesWorkspaceUsersRestoreWorkspaceUserAccess failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.RestoreWorkspaceUserAccessRequest](../../models/operations/restoreworkspaceuseraccessrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| errors.ErrorDetails | 400, 401 | application/json | +| errors.ErrorDetails | 500 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/examples/.env.template b/examples/.env.template index 1833d93..d68e7c6 100644 --- a/examples/.env.template +++ b/examples/.env.template @@ -6,11 +6,9 @@ # The SDK supports loading security credentials from environment variables # with the prefix: DOCUSIGN_IAM_CLIENT_ # -# Example security environment variables: -# DOCUSIGN_IAM_CLIENT_API_KEY=your_api_key_here -# DOCUSIGN_IAM_CLIENT_BEARER_TOKEN=your_bearer_token_here -# DOCUSIGN_IAM_CLIENT_USERNAME=your_username_here -# DOCUSIGN_IAM_CLIENT_PASSWORD=your_password_here -# -# Check the SDK documentation for the exact environment variable names -# required for your specific authentication method. +# Security environment variables: +DOCUSIGN_IAM_CLIENT_ACCESS_TOKEN=your_accesstoken_here + +# Debug Configuration +# Enable HTTP request/response logging for debugging +DOCUSIGN_IAM_CLIENT_DEBUG=false diff --git a/examples/README.md b/examples/README.md index 8d0edcc..15247ac 100644 --- a/examples/README.md +++ b/examples/README.md @@ -24,3 +24,8 @@ To run an example file from the examples directory: npm run build && npx tsx example.ts ``` +## Creating new examples + +Duplicate an existing example file, they won't be overwritten by the generation process. + + diff --git a/examples/authGetUserInfo.example.ts b/examples/authGetUserInfo.example.ts index 9661c1a..0e77687 100644 --- a/examples/authGetUserInfo.example.ts +++ b/examples/authGetUserInfo.example.ts @@ -2,11 +2,13 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ +import dotenv from "dotenv"; +dotenv.config(); /** * Example usage of the @docusign/iam-sdk SDK * * To run this example from the examples directory: - * npm run build && npx tsx authGetUserInfo.ts + * npm run build && npx tsx authGetUserInfo.example.ts */ import { IamClient } from "@docusign/iam-sdk"; diff --git a/examples/package-lock.json b/examples/package-lock.json index 9b39e54..5be9ed3 100644 --- a/examples/package-lock.json +++ b/examples/package-lock.json @@ -18,20 +18,19 @@ }, "..": { "name": "@docusign/iam-sdk", - "version": "1.0.0-beta.3", + "version": "1.0.0-beta.4", + "dependencies": { + "zod": "^3.20.0" + }, "devDependencies": { "@eslint/js": "^9.19.0", "@types/node": "^22.15.28", "eslint": "^9.19.0", "globals": "^15.14.0", "tshy": "^2.0.0", - "typescript": "^5.4.5", - "typescript-eslint": "^8.22.0", - "vitest": "^3.1.1", - "zod": "^3.25.17" - }, - "peerDependencies": { - "zod": ">= 3" + "typescript": "~5.8.3", + "typescript-eslint": "^8.26.0", + "vitest": "^3.1.1" } }, "node_modules/@docusign/iam-sdk": { diff --git a/jsr.json b/jsr.json index 35ce7bf..cbbbed2 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@docusign/iam-sdk", - "version": "1.0.0-beta.3", + "version": "1.0.0-beta.4", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index b39daf1..7c201bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,25 +1,24 @@ { "name": "@docusign/iam-sdk", - "version": "1.0.0-beta.3", + "version": "1.0.0-beta.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@docusign/iam-sdk", - "version": "1.0.0-beta.3", + "version": "1.0.0-beta.4", + "dependencies": { + "zod": "^3.20.0" + }, "devDependencies": { "@eslint/js": "^9.19.0", "@types/node": "^22.15.28", "eslint": "^9.19.0", "globals": "^15.14.0", "tshy": "^2.0.0", - "typescript": "^5.4.5", - "typescript-eslint": "^8.22.0", - "vitest": "^3.1.1", - "zod": "^3.25.17" - }, - "peerDependencies": { - "zod": ">= 3" + "typescript": "~5.8.3", + "typescript-eslint": "^8.26.0", + "vitest": "^3.1.1" } }, "node_modules/@esbuild/aix-ppc64": { @@ -3755,7 +3754,6 @@ "version": "3.25.42", "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.42.tgz", "integrity": "sha512-PcALTLskaucbeHc41tU/xfjfhcz8z0GdhhDcSgrCTmSazUuqnYqiXO63M0QUBVwpBlsLsNVn5qHSC5Dw3KZvaQ==", - "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" diff --git a/package.json b/package.json index eb1719a..7e02af0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@docusign/iam-sdk", - "version": "1.0.0-beta.3", + "version": "1.0.0-beta.4", "author": "Docusign", "keywords": [ "Docusign", @@ -42,21 +42,20 @@ "build": "tshy", "prepublishOnly": "npm run build" }, - "peerDependencies": { - "zod": ">= 3" - }, + "peerDependencies": {}, "devDependencies": { "@eslint/js": "^9.19.0", "@types/node": "^22.15.28", "eslint": "^9.19.0", "globals": "^15.14.0", "tshy": "^2.0.0", - "typescript": "^5.4.5", - "typescript-eslint": "^8.22.0", - "vitest": "^3.1.1", - "zod": "^3.25.17" + "typescript": "~5.8.3", + "typescript-eslint": "^8.26.0", + "vitest": "^3.1.1" + }, + "dependencies": { + "zod": "^3.20.0" }, - "dependencies": {}, "exports": { ".": { "import": { diff --git a/src/funcs/workspacesWorkspaceDocumentsDeleteWorkspaceDocument.ts b/src/funcs/workspacesWorkspaceDocumentsDeleteWorkspaceDocument.ts new file mode 100644 index 0000000..b796415 --- /dev/null +++ b/src/funcs/workspacesWorkspaceDocumentsDeleteWorkspaceDocument.ts @@ -0,0 +1,198 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { IamClientCore } from "../core.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { IamClientError } from "../models/errors/iamclienterror.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Deletes a document in the workspace + * + * @remarks + * This operation permanently deletes a document by ID. + */ +export function workspacesWorkspaceDocumentsDeleteWorkspaceDocument( + client: IamClientCore, + request: operations.DeleteWorkspaceDocumentRequest, + options?: RequestOptions, +): APIPromise< + Result< + void, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: IamClientCore, + request: operations.DeleteWorkspaceDocumentRequest, + options?: RequestOptions, +): Promise< + [ + Result< + void, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.DeleteWorkspaceDocumentRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + accountId: encodeSimple("accountId", payload.accountId, { + explode: false, + charEncoding: "percent", + }), + documentId: encodeSimple("documentId", payload.documentId, { + explode: false, + charEncoding: "percent", + }), + workspaceId: encodeSimple("workspaceId", payload.workspaceId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc( + "/v1/accounts/{accountId}/workspaces/{workspaceId}/documents/{documentId}", + )(pathParams); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "deleteWorkspaceDocument", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 5000, + exponent: 1.5, + maxElapsedTime: 30000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX", "429"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "DELETE", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + void, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.nil(204, z.void()), + M.jsonErr([400, 401], errors.ErrorDetails$inboundSchema), + M.jsonErr(500, errors.ErrorDetails$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/workspacesWorkspaceDocumentsGetWorkspaceDocument.ts b/src/funcs/workspacesWorkspaceDocumentsGetWorkspaceDocument.ts new file mode 100644 index 0000000..f65a8f9 --- /dev/null +++ b/src/funcs/workspacesWorkspaceDocumentsGetWorkspaceDocument.ts @@ -0,0 +1,198 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { IamClientCore } from "../core.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { IamClientError } from "../models/errors/iamclienterror.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Get information about the document + * + * @remarks + * This operation retrieves information about the document. The response includes the document ID, name, and metadata. + */ +export function workspacesWorkspaceDocumentsGetWorkspaceDocument( + client: IamClientCore, + request: operations.GetWorkspaceDocumentRequest, + options?: RequestOptions, +): APIPromise< + Result< + components.GetWorkspaceDocumentResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: IamClientCore, + request: operations.GetWorkspaceDocumentRequest, + options?: RequestOptions, +): Promise< + [ + Result< + components.GetWorkspaceDocumentResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.GetWorkspaceDocumentRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + accountId: encodeSimple("accountId", payload.accountId, { + explode: false, + charEncoding: "percent", + }), + documentId: encodeSimple("documentId", payload.documentId, { + explode: false, + charEncoding: "percent", + }), + workspaceId: encodeSimple("workspaceId", payload.workspaceId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc( + "/v1/accounts/{accountId}/workspaces/{workspaceId}/documents/{documentId}", + )(pathParams); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "getWorkspaceDocument", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 5000, + exponent: 1.5, + maxElapsedTime: 30000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX", "429"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + components.GetWorkspaceDocumentResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.GetWorkspaceDocumentResponse$inboundSchema), + M.jsonErr([400, 401], errors.ErrorDetails$inboundSchema), + M.jsonErr(500, errors.ErrorDetails$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/workspacesWorkspaceDocumentsGetWorkspaceDocumentContents.ts b/src/funcs/workspacesWorkspaceDocumentsGetWorkspaceDocumentContents.ts new file mode 100644 index 0000000..47798b5 --- /dev/null +++ b/src/funcs/workspacesWorkspaceDocumentsGetWorkspaceDocumentContents.ts @@ -0,0 +1,200 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { IamClientCore } from "../core.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { IamClientError } from "../models/errors/iamclienterror.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * 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`. + */ +export function workspacesWorkspaceDocumentsGetWorkspaceDocumentContents( + client: IamClientCore, + request: operations.GetWorkspaceDocumentContentsRequest, + options?: RequestOptions, +): APIPromise< + Result< + ReadableStream, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: IamClientCore, + request: operations.GetWorkspaceDocumentContentsRequest, + options?: RequestOptions, +): Promise< + [ + Result< + ReadableStream, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.GetWorkspaceDocumentContentsRequest$outboundSchema.parse( + value, + ), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + accountId: encodeSimple("accountId", payload.accountId, { + explode: false, + charEncoding: "percent", + }), + documentId: encodeSimple("documentId", payload.documentId, { + explode: false, + charEncoding: "percent", + }), + workspaceId: encodeSimple("workspaceId", payload.workspaceId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc( + "/v1/accounts/{accountId}/workspaces/{workspaceId}/documents/{documentId}/contents", + )(pathParams); + + const headers = new Headers(compactMap({ + Accept: "application/octet-stream", + })); + + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "getWorkspaceDocumentContents", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 5000, + exponent: 1.5, + maxElapsedTime: 30000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX", "429"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + ReadableStream, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.stream(200, z.instanceof(ReadableStream)), + M.jsonErr([400, 401], errors.ErrorDetails$inboundSchema), + M.jsonErr(500, errors.ErrorDetails$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/workspacesWorkspaceDocumentsGetWorkspaceDocuments.ts b/src/funcs/workspacesWorkspaceDocumentsGetWorkspaceDocuments.ts new file mode 100644 index 0000000..6d7915d --- /dev/null +++ b/src/funcs/workspacesWorkspaceDocumentsGetWorkspaceDocuments.ts @@ -0,0 +1,203 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { IamClientCore } from "../core.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { IamClientError } from "../models/errors/iamclienterror.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * 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. + */ +export function workspacesWorkspaceDocumentsGetWorkspaceDocuments( + client: IamClientCore, + request: operations.GetWorkspaceDocumentsRequest, + options?: RequestOptions, +): APIPromise< + Result< + components.GetWorkspaceDocumentsResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: IamClientCore, + request: operations.GetWorkspaceDocumentsRequest, + options?: RequestOptions, +): Promise< + [ + Result< + components.GetWorkspaceDocumentsResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.GetWorkspaceDocumentsRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + accountId: encodeSimple("accountId", payload.accountId, { + explode: false, + charEncoding: "percent", + }), + workspaceId: encodeSimple("workspaceId", payload.workspaceId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc( + "/v1/accounts/{accountId}/workspaces/{workspaceId}/documents", + )(pathParams); + + const query = encodeFormQuery({ + "count": payload.count, + "name_filter": payload.name_filter, + "start_position": payload.start_position, + }); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "getWorkspaceDocuments", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 5000, + exponent: 1.5, + maxElapsedTime: 30000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX", "429"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + components.GetWorkspaceDocumentsResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.GetWorkspaceDocumentsResponse$inboundSchema), + M.jsonErr([400, 401], errors.ErrorDetails$inboundSchema), + M.jsonErr(500, errors.ErrorDetails$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/workspacesWorkspaceUploadRequestCompleteWorkspaceUploadRequest.ts b/src/funcs/workspacesWorkspaceUploadRequestCompleteWorkspaceUploadRequest.ts new file mode 100644 index 0000000..1f5a97d --- /dev/null +++ b/src/funcs/workspacesWorkspaceUploadRequestCompleteWorkspaceUploadRequest.ts @@ -0,0 +1,200 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { IamClientCore } from "../core.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { IamClientError } from "../models/errors/iamclienterror.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Complete an upload request + * + * @remarks + * This operation completes a specific upload request within a workspace and is intended to be called by the user completing the upload request. Only upload requests that are in progress can be completed. + */ +export function workspacesWorkspaceUploadRequestCompleteWorkspaceUploadRequest( + client: IamClientCore, + request: operations.CompleteWorkspaceUploadRequestRequest, + options?: RequestOptions, +): APIPromise< + Result< + void, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: IamClientCore, + request: operations.CompleteWorkspaceUploadRequestRequest, + options?: RequestOptions, +): Promise< + [ + Result< + void, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.CompleteWorkspaceUploadRequestRequest$outboundSchema.parse( + value, + ), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + accountId: encodeSimple("accountId", payload.accountId, { + explode: false, + charEncoding: "percent", + }), + uploadRequestId: encodeSimple("uploadRequestId", payload.uploadRequestId, { + explode: false, + charEncoding: "percent", + }), + workspaceId: encodeSimple("workspaceId", payload.workspaceId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc( + "/v1/accounts/{accountId}/workspaces/{workspaceId}/upload-requests/{uploadRequestId}/actions/complete", + )(pathParams); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "completeWorkspaceUploadRequest", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 5000, + exponent: 1.5, + maxElapsedTime: 30000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX", "429"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "POST", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + void, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.nil(204, z.void()), + M.jsonErr([400, 401], errors.ErrorDetails$inboundSchema), + M.jsonErr(500, errors.ErrorDetails$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/workspacesWorkspaceUploadRequestCreateWorkspaceUploadRequest.ts b/src/funcs/workspacesWorkspaceUploadRequestCreateWorkspaceUploadRequest.ts new file mode 100644 index 0000000..0c6ca1c --- /dev/null +++ b/src/funcs/workspacesWorkspaceUploadRequestCreateWorkspaceUploadRequest.ts @@ -0,0 +1,199 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { IamClientCore } from "../core.js"; +import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { IamClientError } from "../models/errors/iamclienterror.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Creates a new upload request within a workspace + * + * @remarks + * This operation creates a new upload request within a workspace. The upload request includes name, description, due date, and user assignments. Upload requests can be created as drafts or sent immediately based on the status field. + */ +export function workspacesWorkspaceUploadRequestCreateWorkspaceUploadRequest( + client: IamClientCore, + request: operations.CreateWorkspaceUploadRequestRequest, + options?: RequestOptions, +): APIPromise< + Result< + components.GetWorkspaceUploadRequestResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: IamClientCore, + request: operations.CreateWorkspaceUploadRequestRequest, + options?: RequestOptions, +): Promise< + [ + Result< + components.GetWorkspaceUploadRequestResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.CreateWorkspaceUploadRequestRequest$outboundSchema.parse( + value, + ), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = encodeJSON("body", payload.CreateWorkspaceUploadRequestBody, { + explode: true, + }); + + const pathParams = { + accountId: encodeSimple("accountId", payload.accountId, { + explode: false, + charEncoding: "percent", + }), + workspaceId: encodeSimple("workspaceId", payload.workspaceId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc( + "/v1/accounts/{accountId}/workspaces/{workspaceId}/upload-requests", + )(pathParams); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "createWorkspaceUploadRequest", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 5000, + exponent: 1.5, + maxElapsedTime: 30000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX", "429"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "POST", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + components.GetWorkspaceUploadRequestResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(201, components.GetWorkspaceUploadRequestResponse$inboundSchema), + M.jsonErr([400, 401], errors.ErrorDetails$inboundSchema), + M.jsonErr(500, errors.ErrorDetails$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/workspacesWorkspaceUploadRequestDeleteWorkspaceUploadRequest.ts b/src/funcs/workspacesWorkspaceUploadRequestDeleteWorkspaceUploadRequest.ts new file mode 100644 index 0000000..97be11f --- /dev/null +++ b/src/funcs/workspacesWorkspaceUploadRequestDeleteWorkspaceUploadRequest.ts @@ -0,0 +1,200 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { IamClientCore } from "../core.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { IamClientError } from "../models/errors/iamclienterror.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Deletes a specific upload request + * + * @remarks + * This operation deletes a specific upload request within a workspace. Upload requests cannot be deleted if they are complete or have associated documents. + */ +export function workspacesWorkspaceUploadRequestDeleteWorkspaceUploadRequest( + client: IamClientCore, + request: operations.DeleteWorkspaceUploadRequestRequest, + options?: RequestOptions, +): APIPromise< + Result< + void, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: IamClientCore, + request: operations.DeleteWorkspaceUploadRequestRequest, + options?: RequestOptions, +): Promise< + [ + Result< + void, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.DeleteWorkspaceUploadRequestRequest$outboundSchema.parse( + value, + ), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + accountId: encodeSimple("accountId", payload.accountId, { + explode: false, + charEncoding: "percent", + }), + uploadRequestId: encodeSimple("uploadRequestId", payload.uploadRequestId, { + explode: false, + charEncoding: "percent", + }), + workspaceId: encodeSimple("workspaceId", payload.workspaceId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc( + "/v1/accounts/{accountId}/workspaces/{workspaceId}/upload-requests/{uploadRequestId}", + )(pathParams); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "deleteWorkspaceUploadRequest", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 5000, + exponent: 1.5, + maxElapsedTime: 30000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX", "429"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "DELETE", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + void, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.nil(204, z.void()), + M.jsonErr([400, 401], errors.ErrorDetails$inboundSchema), + M.jsonErr(500, errors.ErrorDetails$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/workspacesWorkspaceUploadRequestGetWorkspaceUploadRequest.ts b/src/funcs/workspacesWorkspaceUploadRequestGetWorkspaceUploadRequest.ts new file mode 100644 index 0000000..1f8a3cc --- /dev/null +++ b/src/funcs/workspacesWorkspaceUploadRequestGetWorkspaceUploadRequest.ts @@ -0,0 +1,198 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { IamClientCore } from "../core.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { IamClientError } from "../models/errors/iamclienterror.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Gets details for a specific upload request + * + * @remarks + * This operation retrieves details about a specific upload request within a workspace. The response includes comprehensive information about the upload request including status, assigned users, associated documents, owner details, and various dates. + */ +export function workspacesWorkspaceUploadRequestGetWorkspaceUploadRequest( + client: IamClientCore, + request: operations.GetWorkspaceUploadRequestRequest, + options?: RequestOptions, +): APIPromise< + Result< + components.GetWorkspaceUploadRequestResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: IamClientCore, + request: operations.GetWorkspaceUploadRequestRequest, + options?: RequestOptions, +): Promise< + [ + Result< + components.GetWorkspaceUploadRequestResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.GetWorkspaceUploadRequestRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + accountId: encodeSimple("accountId", payload.accountId, { + explode: false, + charEncoding: "percent", + }), + uploadRequestId: encodeSimple("uploadRequestId", payload.uploadRequestId, { + explode: false, + charEncoding: "percent", + }), + workspaceId: encodeSimple("workspaceId", payload.workspaceId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc( + "/v1/accounts/{accountId}/workspaces/{workspaceId}/upload-requests/{uploadRequestId}", + )(pathParams); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "getWorkspaceUploadRequest", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 5000, + exponent: 1.5, + maxElapsedTime: 30000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX", "429"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + components.GetWorkspaceUploadRequestResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.GetWorkspaceUploadRequestResponse$inboundSchema), + M.jsonErr([400, 401], errors.ErrorDetails$inboundSchema), + M.jsonErr(500, errors.ErrorDetails$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/workspacesWorkspaceUploadRequestGetWorkspaceUploadRequests.ts b/src/funcs/workspacesWorkspaceUploadRequestGetWorkspaceUploadRequests.ts new file mode 100644 index 0000000..d00d5a0 --- /dev/null +++ b/src/funcs/workspacesWorkspaceUploadRequestGetWorkspaceUploadRequests.ts @@ -0,0 +1,194 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { IamClientCore } from "../core.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { IamClientError } from "../models/errors/iamclienterror.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Gets upload requests within a workspace + * + * @remarks + * This operation retrieves a list of upload requests within a workspace. Each upload request includes details such as ID, name, description, status, owner information, associated documents, assignments, and various dates. + */ +export function workspacesWorkspaceUploadRequestGetWorkspaceUploadRequests( + client: IamClientCore, + request: operations.GetWorkspaceUploadRequestsRequest, + options?: RequestOptions, +): APIPromise< + Result< + components.GetWorkspaceUploadRequestsResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: IamClientCore, + request: operations.GetWorkspaceUploadRequestsRequest, + options?: RequestOptions, +): Promise< + [ + Result< + components.GetWorkspaceUploadRequestsResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.GetWorkspaceUploadRequestsRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + accountId: encodeSimple("accountId", payload.accountId, { + explode: false, + charEncoding: "percent", + }), + workspaceId: encodeSimple("workspaceId", payload.workspaceId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc( + "/v1/accounts/{accountId}/workspaces/{workspaceId}/upload-requests", + )(pathParams); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "getWorkspaceUploadRequests", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 5000, + exponent: 1.5, + maxElapsedTime: 30000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX", "429"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + components.GetWorkspaceUploadRequestsResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.GetWorkspaceUploadRequestsResponse$inboundSchema), + M.jsonErr([400, 401], errors.ErrorDetails$inboundSchema), + M.jsonErr(500, errors.ErrorDetails$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/workspacesWorkspaceUploadRequestUpdateWorkspaceUploadRequest.ts b/src/funcs/workspacesWorkspaceUploadRequestUpdateWorkspaceUploadRequest.ts new file mode 100644 index 0000000..7103a15 --- /dev/null +++ b/src/funcs/workspacesWorkspaceUploadRequestUpdateWorkspaceUploadRequest.ts @@ -0,0 +1,203 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { IamClientCore } from "../core.js"; +import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { IamClientError } from "../models/errors/iamclienterror.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Updates a specific upload request + * + * @remarks + * This operation updates a specific upload request within a workspace. Only draft upload requests can be edited. The editable fields are name, description, due date, and status. Status changes are restricted - only transitions from draft to in_progress are allowed. Attempting to update a non-draft upload request will result in an INVALID_STATUS error. Attempting an invalid status change will result in an INVALID_STATUS_CHANGE error. + */ +export function workspacesWorkspaceUploadRequestUpdateWorkspaceUploadRequest( + client: IamClientCore, + request: operations.UpdateWorkspaceUploadRequestRequest, + options?: RequestOptions, +): APIPromise< + Result< + components.GetWorkspaceUploadRequestResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: IamClientCore, + request: operations.UpdateWorkspaceUploadRequestRequest, + options?: RequestOptions, +): Promise< + [ + Result< + components.GetWorkspaceUploadRequestResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.UpdateWorkspaceUploadRequestRequest$outboundSchema.parse( + value, + ), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = encodeJSON("body", payload.UpdateWorkspaceUploadRequestBody, { + explode: true, + }); + + const pathParams = { + accountId: encodeSimple("accountId", payload.accountId, { + explode: false, + charEncoding: "percent", + }), + uploadRequestId: encodeSimple("uploadRequestId", payload.uploadRequestId, { + explode: false, + charEncoding: "percent", + }), + workspaceId: encodeSimple("workspaceId", payload.workspaceId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc( + "/v1/accounts/{accountId}/workspaces/{workspaceId}/upload-requests/{uploadRequestId}", + )(pathParams); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "updateWorkspaceUploadRequest", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 5000, + exponent: 1.5, + maxElapsedTime: 30000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX", "429"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "PUT", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + components.GetWorkspaceUploadRequestResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.GetWorkspaceUploadRequestResponse$inboundSchema), + M.jsonErr([400, 401], errors.ErrorDetails$inboundSchema), + M.jsonErr(500, errors.ErrorDetails$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/workspacesWorkspaceUsersAddWorkspaceUser.ts b/src/funcs/workspacesWorkspaceUsersAddWorkspaceUser.ts new file mode 100644 index 0000000..97dd4ba --- /dev/null +++ b/src/funcs/workspacesWorkspaceUsersAddWorkspaceUser.ts @@ -0,0 +1,198 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { IamClientCore } from "../core.js"; +import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { IamClientError } from "../models/errors/iamclienterror.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Adds a user to the workspace by email address + * + * @remarks + * This operation manually adds an internal or external user to a specific workspace by email address. Users within the account are considered "Internal" and may be assigned any role. Users outside the account are considered "External" and may only be assigned the Participate role. This operation is not typically needed for adding external participants to a Workspace as they will be automatically added as tasks are assigned. + * + * Available role IDs can be retrieved via the Assignable Roles operation on a workspace. If the `role_id` is not passed, the user is added with the Participate role. + */ +export function workspacesWorkspaceUsersAddWorkspaceUser( + client: IamClientCore, + request: operations.AddWorkspaceUserRequest, + options?: RequestOptions, +): APIPromise< + Result< + components.CreateWorkspaceUserResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: IamClientCore, + request: operations.AddWorkspaceUserRequest, + options?: RequestOptions, +): Promise< + [ + Result< + components.CreateWorkspaceUserResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => operations.AddWorkspaceUserRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = encodeJSON("body", payload.WorkspaceUserForCreate, { + explode: true, + }); + + const pathParams = { + accountId: encodeSimple("accountId", payload.accountId, { + explode: false, + charEncoding: "percent", + }), + workspaceId: encodeSimple("workspaceId", payload.workspaceId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc( + "/v1/accounts/{accountId}/workspaces/{workspaceId}/users", + )(pathParams); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "addWorkspaceUser", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 5000, + exponent: 1.5, + maxElapsedTime: 30000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX", "429"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "POST", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + components.CreateWorkspaceUserResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(201, components.CreateWorkspaceUserResponse$inboundSchema), + M.jsonErr([400, 401], errors.ErrorDetails$inboundSchema), + M.jsonErr(500, errors.ErrorDetails$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/workspacesWorkspaceUsersGetWorkspaceUsers.ts b/src/funcs/workspacesWorkspaceUsersGetWorkspaceUsers.ts new file mode 100644 index 0000000..c72a93e --- /dev/null +++ b/src/funcs/workspacesWorkspaceUsersGetWorkspaceUsers.ts @@ -0,0 +1,203 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { IamClientCore } from "../core.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { IamClientError } from "../models/errors/iamclienterror.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Retrieves the list of users in the given workspace + * + * @remarks + * This operations retrieves the users in a workspace. Users sent envelopes or assigned tasks will automatically be added to the workspace with the Participate role. + * + * 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. + */ +export function workspacesWorkspaceUsersGetWorkspaceUsers( + client: IamClientCore, + request: operations.GetWorkspaceUsersRequest, + options?: RequestOptions, +): APIPromise< + Result< + components.GetWorkspaceUsersResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: IamClientCore, + request: operations.GetWorkspaceUsersRequest, + options?: RequestOptions, +): Promise< + [ + Result< + components.GetWorkspaceUsersResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => operations.GetWorkspaceUsersRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + accountId: encodeSimple("accountId", payload.accountId, { + explode: false, + charEncoding: "percent", + }), + workspaceId: encodeSimple("workspaceId", payload.workspaceId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc( + "/v1/accounts/{accountId}/workspaces/{workspaceId}/users", + )(pathParams); + + const query = encodeFormQuery({ + "count": payload.count, + "filter": payload.filter, + "sort": payload.sort, + "start_position": payload.start_position, + }); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "getWorkspaceUsers", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 5000, + exponent: 1.5, + maxElapsedTime: 30000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX", "429"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "404", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + components.GetWorkspaceUsersResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.GetWorkspaceUsersResponse$inboundSchema), + M.jsonErr([400, 401], errors.ErrorDetails$inboundSchema), + M.jsonErr(500, errors.ErrorDetails$inboundSchema), + M.fail([404, "4XX"]), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/workspacesWorkspaceUsersRestoreWorkspaceUserAccess.ts b/src/funcs/workspacesWorkspaceUsersRestoreWorkspaceUserAccess.ts new file mode 100644 index 0000000..45ef6ff --- /dev/null +++ b/src/funcs/workspacesWorkspaceUsersRestoreWorkspaceUserAccess.ts @@ -0,0 +1,198 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { IamClientCore } from "../core.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { IamClientError } from "../models/errors/iamclienterror.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Restores the specified user's access to the workspace + * + * @remarks + * This operation restores the specified user's access to the workspace. The user must have been previously revoked from the workspace. The access is immediately restored. + */ +export function workspacesWorkspaceUsersRestoreWorkspaceUserAccess( + client: IamClientCore, + request: operations.RestoreWorkspaceUserAccessRequest, + options?: RequestOptions, +): APIPromise< + Result< + void, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: IamClientCore, + request: operations.RestoreWorkspaceUserAccessRequest, + options?: RequestOptions, +): Promise< + [ + Result< + void, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.RestoreWorkspaceUserAccessRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + accountId: encodeSimple("accountId", payload.accountId, { + explode: false, + charEncoding: "percent", + }), + userId: encodeSimple("userId", payload.userId, { + explode: false, + charEncoding: "percent", + }), + workspaceId: encodeSimple("workspaceId", payload.workspaceId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc( + "/v1/accounts/{accountId}/workspaces/{workspaceId}/users/{userId}/actions/restore-access", + )(pathParams); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "restoreWorkspaceUserAccess", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 5000, + exponent: 1.5, + maxElapsedTime: 30000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX", "429"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "POST", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + void, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.nil(204, z.void()), + M.jsonErr([400, 401], errors.ErrorDetails$inboundSchema), + M.jsonErr(500, errors.ErrorDetails$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/workspacesWorkspaceUsersRevokeWorkspaceUserAccess.ts b/src/funcs/workspacesWorkspaceUsersRevokeWorkspaceUserAccess.ts new file mode 100644 index 0000000..1ba244b --- /dev/null +++ b/src/funcs/workspacesWorkspaceUsersRevokeWorkspaceUserAccess.ts @@ -0,0 +1,201 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { IamClientCore } from "../core.js"; +import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { IamClientError } from "../models/errors/iamclienterror.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Revokes the specified user's access to the workspace + * + * @remarks + * This operation revokes the specified user's access to the workspace. The optional `revocation_date` may be set to schedule revocation in the future. If not specified, the revocation will be immediate. + */ +export function workspacesWorkspaceUsersRevokeWorkspaceUserAccess( + client: IamClientCore, + request: operations.RevokeWorkspaceUserAccessRequest, + options?: RequestOptions, +): APIPromise< + Result< + void, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: IamClientCore, + request: operations.RevokeWorkspaceUserAccessRequest, + options?: RequestOptions, +): Promise< + [ + Result< + void, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.RevokeWorkspaceUserAccessRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = encodeJSON("body", payload.RevokeWorkspaceUserDetails, { + explode: true, + }); + + const pathParams = { + accountId: encodeSimple("accountId", payload.accountId, { + explode: false, + charEncoding: "percent", + }), + userId: encodeSimple("userId", payload.userId, { + explode: false, + charEncoding: "percent", + }), + workspaceId: encodeSimple("workspaceId", payload.workspaceId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc( + "/v1/accounts/{accountId}/workspaces/{workspaceId}/users/{userId}/actions/revoke-access", + )(pathParams); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "revokeWorkspaceUserAccess", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 5000, + exponent: 1.5, + maxElapsedTime: 30000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX", "429"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "POST", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + void, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.nil(204, z.void()), + M.jsonErr([400, 401], errors.ErrorDetails$inboundSchema), + M.jsonErr(500, errors.ErrorDetails$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/workspacesWorkspaceUsersUpdateWorkspaceUser.ts b/src/funcs/workspacesWorkspaceUsersUpdateWorkspaceUser.ts new file mode 100644 index 0000000..86d40ea --- /dev/null +++ b/src/funcs/workspacesWorkspaceUsersUpdateWorkspaceUser.ts @@ -0,0 +1,201 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { IamClientCore } from "../core.js"; +import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { IamClientError } from "../models/errors/iamclienterror.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Updates the specified user's role + * + * @remarks + * This operation updates the specified user's role in the workspace. Users within the account are considered "Internal" and may be assigned any role. Users outside the account are considered "External" and may only be assigned "External" roles. + */ +export function workspacesWorkspaceUsersUpdateWorkspaceUser( + client: IamClientCore, + request: operations.UpdateWorkspaceUserRequest, + options?: RequestOptions, +): APIPromise< + Result< + components.UpdateWorkspaceUserResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: IamClientCore, + request: operations.UpdateWorkspaceUserRequest, + options?: RequestOptions, +): Promise< + [ + Result< + components.UpdateWorkspaceUserResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.UpdateWorkspaceUserRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = encodeJSON("body", payload.WorkspaceUserForUpdate, { + explode: true, + }); + + const pathParams = { + accountId: encodeSimple("accountId", payload.accountId, { + explode: false, + charEncoding: "percent", + }), + userId: encodeSimple("userId", payload.userId, { + explode: false, + charEncoding: "percent", + }), + workspaceId: encodeSimple("workspaceId", payload.workspaceId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc( + "/v1/accounts/{accountId}/workspaces/{workspaceId}/users/{userId}", + )(pathParams); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "updateWorkspaceUser", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 5000, + exponent: 1.5, + maxElapsedTime: 30000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX", "429"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "PUT", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + components.UpdateWorkspaceUserResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.UpdateWorkspaceUserResponse$inboundSchema), + M.jsonErr([400, 401], errors.ErrorDetails$inboundSchema), + M.jsonErr(500, errors.ErrorDetails$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/workspacesWorkspacesCreateWorkspace.ts b/src/funcs/workspacesWorkspacesCreateWorkspace.ts new file mode 100644 index 0000000..5e9b524 --- /dev/null +++ b/src/funcs/workspacesWorkspacesCreateWorkspace.ts @@ -0,0 +1,192 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { IamClientCore } from "../core.js"; +import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { IamClientError } from "../models/errors/iamclienterror.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Creates a new workspace + * + * @remarks + * This operation creates a new workspace. The calling user is automatically added as a member of the workspace with the role of Manage. + * + * Once created, the `workspace_id` is utilized to associate tasks such as envelopes. Participants on tasks will automatically be added to the workspace with the Participate role. + */ +export function workspacesWorkspacesCreateWorkspace( + client: IamClientCore, + request: operations.CreateWorkspaceRequest, + options?: RequestOptions, +): APIPromise< + Result< + components.CreateWorkspaceResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: IamClientCore, + request: operations.CreateWorkspaceRequest, + options?: RequestOptions, +): Promise< + [ + Result< + components.CreateWorkspaceResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => operations.CreateWorkspaceRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = encodeJSON("body", payload.CreateWorkspaceBody, { + explode: true, + }); + + const pathParams = { + accountId: encodeSimple("accountId", payload.accountId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc("/v1/accounts/{accountId}/workspaces")(pathParams); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "createWorkspace", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 5000, + exponent: 1.5, + maxElapsedTime: 30000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX", "429"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "POST", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + components.CreateWorkspaceResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(201, components.CreateWorkspaceResponse$inboundSchema), + M.jsonErr([400, 401], errors.ErrorDetails$inboundSchema), + M.jsonErr(500, errors.ErrorDetails$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/workspacesWorkspacesCreateWorkspaceEnvelope.ts b/src/funcs/workspacesWorkspacesCreateWorkspaceEnvelope.ts new file mode 100644 index 0000000..0f1f4a2 --- /dev/null +++ b/src/funcs/workspacesWorkspacesCreateWorkspaceEnvelope.ts @@ -0,0 +1,205 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { IamClientCore } from "../core.js"; +import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { IamClientError } from "../models/errors/iamclienterror.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Creates an envelope with the given documents. Returns the ID of the created envelope + * + * @remarks + * This operation creates an envelope associated with the workspace. Using the `envelope_id` from the response, the [eSignature API](https://developers.docusign.com/docs/esign-rest-api/) may be utilized to modify the envelope and ultimately send it. + * + * Envelope recipients will automatically be granted Participate access to the workspace. Envelope recipients will receive consolidated notifications from Docusign Workspaces rather than standard individual envelope notifications. + * + * Docusign Connect events may be utilized to receive updates to individual envelope events. + * + * The `envelopes` operation on the workspace may be utilized to query the status of all the envelopes in the workspace. + * + * When `document_ids` is empty or excluded, the envelope is created without any documents from the workspace. eSignature API calls, including adding documents and templates, may be utilized to modify the envelope before it is sent. The eSignature API must be utilized to send the envelope. + */ +export function workspacesWorkspacesCreateWorkspaceEnvelope( + client: IamClientCore, + request: operations.CreateWorkspaceEnvelopeRequest, + options?: RequestOptions, +): APIPromise< + Result< + components.CreateWorkspaceEnvelopeResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: IamClientCore, + request: operations.CreateWorkspaceEnvelopeRequest, + options?: RequestOptions, +): Promise< + [ + Result< + components.CreateWorkspaceEnvelopeResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.CreateWorkspaceEnvelopeRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = encodeJSON("body", payload.WorkspaceEnvelopeForCreate, { + explode: true, + }); + + const pathParams = { + accountId: encodeSimple("accountId", payload.accountId, { + explode: false, + charEncoding: "percent", + }), + workspaceId: encodeSimple("workspaceId", payload.workspaceId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc( + "/v1/accounts/{accountId}/workspaces/{workspaceId}/envelopes", + )(pathParams); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "createWorkspaceEnvelope", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 5000, + exponent: 1.5, + maxElapsedTime: 30000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX", "429"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "POST", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + components.CreateWorkspaceEnvelopeResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(201, components.CreateWorkspaceEnvelopeResponse$inboundSchema), + M.jsonErr([400, 401], errors.ErrorDetails$inboundSchema), + M.jsonErr(500, errors.ErrorDetails$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/workspacesWorkspacesGetWorkspace.ts b/src/funcs/workspacesWorkspacesGetWorkspace.ts new file mode 100644 index 0000000..e2674e2 --- /dev/null +++ b/src/funcs/workspacesWorkspacesGetWorkspace.ts @@ -0,0 +1,193 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { IamClientCore } from "../core.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { IamClientError } from "../models/errors/iamclienterror.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Returns details about the workspace + * + * @remarks + * This operation retrieves details about a specific workspace. It returns the workspace's unique identifier (ID), name, and metadata such as when it was created and by whom. + */ +export function workspacesWorkspacesGetWorkspace( + client: IamClientCore, + request: operations.GetWorkspaceRequest, + options?: RequestOptions, +): APIPromise< + Result< + components.GetWorkspaceResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: IamClientCore, + request: operations.GetWorkspaceRequest, + options?: RequestOptions, +): Promise< + [ + Result< + components.GetWorkspaceResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => operations.GetWorkspaceRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + accountId: encodeSimple("accountId", payload.accountId, { + explode: false, + charEncoding: "percent", + }), + workspaceId: encodeSimple("workspaceId", payload.workspaceId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc("/v1/accounts/{accountId}/workspaces/{workspaceId}")( + pathParams, + ); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "getWorkspace", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 5000, + exponent: 1.5, + maxElapsedTime: 30000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX", "429"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + components.GetWorkspaceResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.GetWorkspaceResponse$inboundSchema), + M.jsonErr([400, 401], errors.ErrorDetails$inboundSchema), + M.jsonErr(500, errors.ErrorDetails$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/workspacesWorkspacesGetWorkspaceAssignableRoles.ts b/src/funcs/workspacesWorkspacesGetWorkspaceAssignableRoles.ts new file mode 100644 index 0000000..199be4d --- /dev/null +++ b/src/funcs/workspacesWorkspacesGetWorkspaceAssignableRoles.ts @@ -0,0 +1,205 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { IamClientCore } from "../core.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { IamClientError } from "../models/errors/iamclienterror.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Returns the roles the caller can assign to workspace users + * + * @remarks + * This operation returns roles that are assignable to users in the workspace based on the caller's role in the workspace. Roles available include Manage (internal) and Participate (external). Participate is the default role. + * + * Users within the account are considered "Internal" and may be assigned any role. Users outside the account are considered "External" and may only be assigned "External" roles. + * + * 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. + */ +export function workspacesWorkspacesGetWorkspaceAssignableRoles( + client: IamClientCore, + request: operations.GetWorkspaceAssignableRolesRequest, + options?: RequestOptions, +): APIPromise< + Result< + components.GetWorkspaceAssignableRolesResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: IamClientCore, + request: operations.GetWorkspaceAssignableRolesRequest, + options?: RequestOptions, +): Promise< + [ + Result< + components.GetWorkspaceAssignableRolesResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.GetWorkspaceAssignableRolesRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + accountId: encodeSimple("accountId", payload.accountId, { + explode: false, + charEncoding: "percent", + }), + workspaceId: encodeSimple("workspaceId", payload.workspaceId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc( + "/v1/accounts/{accountId}/workspaces/{workspaceId}/assignable-roles", + )(pathParams); + + const query = encodeFormQuery({ + "count": payload.count, + "filter": payload.filter, + "start_position": payload.start_position, + }); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "getWorkspaceAssignableRoles", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 5000, + exponent: 1.5, + maxElapsedTime: 30000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX", "429"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + components.GetWorkspaceAssignableRolesResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.GetWorkspaceAssignableRolesResponse$inboundSchema), + M.jsonErr([400, 401], errors.ErrorDetails$inboundSchema), + M.jsonErr(500, errors.ErrorDetails$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/workspacesWorkspacesGetWorkspaceEnvelopes.ts b/src/funcs/workspacesWorkspacesGetWorkspaceEnvelopes.ts new file mode 100644 index 0000000..c1954c2 --- /dev/null +++ b/src/funcs/workspacesWorkspacesGetWorkspaceEnvelopes.ts @@ -0,0 +1,196 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { IamClientCore } from "../core.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { IamClientError } from "../models/errors/iamclienterror.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Returns the envelopes associated with the given workspace + * + * @remarks + * This operation retrieves a list of all associated workspace envelopes. The [`status`](https://support.docusign.com/s/document-item?bundleId=oeq1643226594604&topicId=wdm1578456348227.html) on each envelope can be used to track envelope progress. Statuses are formatted as ProperCase. e.g. `Sent`, `WaitingForOthers`, `Completed`, etc. + * + * Based on the permissions of the caller, additional envelope details may be retrieved from the [eSignature API](https://developers.docusign.com/docs/esign-rest-api/) using the `envelope_id`. + */ +export function workspacesWorkspacesGetWorkspaceEnvelopes( + client: IamClientCore, + request: operations.GetWorkspaceEnvelopesRequest, + options?: RequestOptions, +): APIPromise< + Result< + components.GetWorkspaceEnvelopesResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: IamClientCore, + request: operations.GetWorkspaceEnvelopesRequest, + options?: RequestOptions, +): Promise< + [ + Result< + components.GetWorkspaceEnvelopesResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.GetWorkspaceEnvelopesRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + accountId: encodeSimple("accountId", payload.accountId, { + explode: false, + charEncoding: "percent", + }), + workspaceId: encodeSimple("workspaceId", payload.workspaceId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc( + "/v1/accounts/{accountId}/workspaces/{workspaceId}/envelopes", + )(pathParams); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "getWorkspaceEnvelopes", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 5000, + exponent: 1.5, + maxElapsedTime: 30000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX", "429"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + components.GetWorkspaceEnvelopesResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.GetWorkspaceEnvelopesResponse$inboundSchema), + M.jsonErr([400, 401], errors.ErrorDetails$inboundSchema), + M.jsonErr(500, errors.ErrorDetails$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/workspacesWorkspacesGetWorkspaces.ts b/src/funcs/workspacesWorkspacesGetWorkspaces.ts new file mode 100644 index 0000000..86efc08 --- /dev/null +++ b/src/funcs/workspacesWorkspacesGetWorkspaces.ts @@ -0,0 +1,195 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { IamClientCore } from "../core.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { IamClientError } from "../models/errors/iamclienterror.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Gets workspaces available to the calling user + * + * @remarks + * This operation retrieves a list of workspaces available to the calling user. It returns basic information about each workspace, including its unique identifier (ID), name, and metadata such as when it was created and by whom. + * + * 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. + */ +export function workspacesWorkspacesGetWorkspaces( + client: IamClientCore, + request: operations.GetWorkspacesRequest, + options?: RequestOptions, +): APIPromise< + Result< + components.GetWorkspacesResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: IamClientCore, + request: operations.GetWorkspacesRequest, + options?: RequestOptions, +): Promise< + [ + Result< + components.GetWorkspacesResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => operations.GetWorkspacesRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + accountId: encodeSimple("accountId", payload.accountId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc("/v1/accounts/{accountId}/workspaces")(pathParams); + + const query = encodeFormQuery({ + "count": payload.count, + "start_position": payload.start_position, + }); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "getWorkspaces", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 5000, + exponent: 1.5, + maxElapsedTime: 30000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["5XX", "429"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + components.GetWorkspacesResponse, + | errors.ErrorDetails + | IamClientError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.GetWorkspacesResponse$inboundSchema), + M.jsonErr([400, 401], errors.ErrorDetails$inboundSchema), + M.jsonErr(500, errors.ErrorDetails$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/lib/config.ts b/src/lib/config.ts index c638942..b79c689 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -64,8 +64,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "v1", - sdkVersion: "1.0.0-beta.3", - genVersion: "2.651.2", + sdkVersion: "1.0.0-beta.4", + genVersion: "2.692.0", userAgent: - "speakeasy-sdk/typescript 1.0.0-beta.3 2.651.2 v1 @docusign/iam-sdk", + "speakeasy-sdk/typescript 1.0.0-beta.4 2.692.0 v1 @docusign/iam-sdk", } as const; diff --git a/src/lib/security.ts b/src/lib/security.ts index 5cc7202..b09126f 100644 --- a/src/lib/security.ts +++ b/src/lib/security.ts @@ -84,7 +84,10 @@ type SecurityInputOAuth2 = { type SecurityInputOAuth2ClientCredentials = { type: "oauth2:client_credentials"; value: - | { clientID?: string | undefined; clientSecret?: string | undefined } + | { + clientID?: string | undefined; + clientSecret?: string | undefined; + } | null | string | undefined; diff --git a/src/models/components/agreement.ts b/src/models/components/agreement.ts index a8ec3de..7b109da 100644 --- a/src/models/components/agreement.ts +++ b/src/models/components/agreement.ts @@ -152,6 +152,9 @@ export type Provisions = { renewalNoticeDate?: Date | null | undefined; autoRenewalTermLength?: string | null | undefined; renewalExtensionPeriod?: string | null | undefined; + /** + * The userId parameter + */ renewalProcessOwner?: string | undefined; /** * Additional information related to the renewal process. diff --git a/src/models/components/createworkspacebody.ts b/src/models/components/createworkspacebody.ts new file mode 100644 index 0000000..17b2784 --- /dev/null +++ b/src/models/components/createworkspacebody.ts @@ -0,0 +1,85 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type CreateWorkspaceBody = { + /** + * The name of the workspace + */ + name: string | null; + /** + * A GUID value that identifies a brand. For more information, see Branding + */ + brandId?: string | null | undefined; +}; + +/** @internal */ +export const CreateWorkspaceBody$inboundSchema: z.ZodType< + CreateWorkspaceBody, + z.ZodTypeDef, + unknown +> = z.object({ + name: z.nullable(z.string()), + brand_id: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + "brand_id": "brandId", + }); +}); + +/** @internal */ +export type CreateWorkspaceBody$Outbound = { + name: string | null; + brand_id?: string | null | undefined; +}; + +/** @internal */ +export const CreateWorkspaceBody$outboundSchema: z.ZodType< + CreateWorkspaceBody$Outbound, + z.ZodTypeDef, + CreateWorkspaceBody +> = z.object({ + name: z.nullable(z.string()), + brandId: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + brandId: "brand_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateWorkspaceBody$ { + /** @deprecated use `CreateWorkspaceBody$inboundSchema` instead. */ + export const inboundSchema = CreateWorkspaceBody$inboundSchema; + /** @deprecated use `CreateWorkspaceBody$outboundSchema` instead. */ + export const outboundSchema = CreateWorkspaceBody$outboundSchema; + /** @deprecated use `CreateWorkspaceBody$Outbound` instead. */ + export type Outbound = CreateWorkspaceBody$Outbound; +} + +export function createWorkspaceBodyToJSON( + createWorkspaceBody: CreateWorkspaceBody, +): string { + return JSON.stringify( + CreateWorkspaceBody$outboundSchema.parse(createWorkspaceBody), + ); +} + +export function createWorkspaceBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreateWorkspaceBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreateWorkspaceBody' from JSON`, + ); +} diff --git a/src/models/components/createworkspaceenveloperesponse.ts b/src/models/components/createworkspaceenveloperesponse.ts new file mode 100644 index 0000000..ac4ae3b --- /dev/null +++ b/src/models/components/createworkspaceenveloperesponse.ts @@ -0,0 +1,77 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type CreateWorkspaceEnvelopeResponse = { + envelopeId?: string | null | undefined; +}; + +/** @internal */ +export const CreateWorkspaceEnvelopeResponse$inboundSchema: z.ZodType< + CreateWorkspaceEnvelopeResponse, + z.ZodTypeDef, + unknown +> = z.object({ + envelope_id: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + "envelope_id": "envelopeId", + }); +}); + +/** @internal */ +export type CreateWorkspaceEnvelopeResponse$Outbound = { + envelope_id?: string | null | undefined; +}; + +/** @internal */ +export const CreateWorkspaceEnvelopeResponse$outboundSchema: z.ZodType< + CreateWorkspaceEnvelopeResponse$Outbound, + z.ZodTypeDef, + CreateWorkspaceEnvelopeResponse +> = z.object({ + envelopeId: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + envelopeId: "envelope_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateWorkspaceEnvelopeResponse$ { + /** @deprecated use `CreateWorkspaceEnvelopeResponse$inboundSchema` instead. */ + export const inboundSchema = CreateWorkspaceEnvelopeResponse$inboundSchema; + /** @deprecated use `CreateWorkspaceEnvelopeResponse$outboundSchema` instead. */ + export const outboundSchema = CreateWorkspaceEnvelopeResponse$outboundSchema; + /** @deprecated use `CreateWorkspaceEnvelopeResponse$Outbound` instead. */ + export type Outbound = CreateWorkspaceEnvelopeResponse$Outbound; +} + +export function createWorkspaceEnvelopeResponseToJSON( + createWorkspaceEnvelopeResponse: CreateWorkspaceEnvelopeResponse, +): string { + return JSON.stringify( + CreateWorkspaceEnvelopeResponse$outboundSchema.parse( + createWorkspaceEnvelopeResponse, + ), + ); +} + +export function createWorkspaceEnvelopeResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreateWorkspaceEnvelopeResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreateWorkspaceEnvelopeResponse' from JSON`, + ); +} diff --git a/src/models/components/createworkspaceresponse.ts b/src/models/components/createworkspaceresponse.ts new file mode 100644 index 0000000..ab99d3f --- /dev/null +++ b/src/models/components/createworkspaceresponse.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type CreateWorkspaceResponse = { + /** + * The ID of the workspace + */ + workspaceId?: string | undefined; + /** + * The name of the workspace + */ + name?: string | null | undefined; + /** + * The date the workspace was created + */ + createdDate?: Date | null | undefined; + /** + * The ID of the user who created the workspace + */ + createdByUserId?: string | null | undefined; + /** + * The list of user IDs of the workspace owners + */ + workspaceOwnerIds?: Array | null | undefined; +}; + +/** @internal */ +export const CreateWorkspaceResponse$inboundSchema: z.ZodType< + CreateWorkspaceResponse, + z.ZodTypeDef, + unknown +> = z.object({ + workspace_id: z.string().optional(), + name: z.nullable(z.string()).optional(), + created_date: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), + created_by_user_id: z.nullable(z.string()).optional(), + workspace_owner_ids: z.nullable(z.array(z.string())).optional(), +}).transform((v) => { + return remap$(v, { + "workspace_id": "workspaceId", + "created_date": "createdDate", + "created_by_user_id": "createdByUserId", + "workspace_owner_ids": "workspaceOwnerIds", + }); +}); + +/** @internal */ +export type CreateWorkspaceResponse$Outbound = { + workspace_id?: string | undefined; + name?: string | null | undefined; + created_date?: string | null | undefined; + created_by_user_id?: string | null | undefined; + workspace_owner_ids?: Array | null | undefined; +}; + +/** @internal */ +export const CreateWorkspaceResponse$outboundSchema: z.ZodType< + CreateWorkspaceResponse$Outbound, + z.ZodTypeDef, + CreateWorkspaceResponse +> = z.object({ + workspaceId: z.string().optional(), + name: z.nullable(z.string()).optional(), + createdDate: z.nullable(z.date().transform(v => v.toISOString())).optional(), + createdByUserId: z.nullable(z.string()).optional(), + workspaceOwnerIds: z.nullable(z.array(z.string())).optional(), +}).transform((v) => { + return remap$(v, { + workspaceId: "workspace_id", + createdDate: "created_date", + createdByUserId: "created_by_user_id", + workspaceOwnerIds: "workspace_owner_ids", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateWorkspaceResponse$ { + /** @deprecated use `CreateWorkspaceResponse$inboundSchema` instead. */ + export const inboundSchema = CreateWorkspaceResponse$inboundSchema; + /** @deprecated use `CreateWorkspaceResponse$outboundSchema` instead. */ + export const outboundSchema = CreateWorkspaceResponse$outboundSchema; + /** @deprecated use `CreateWorkspaceResponse$Outbound` instead. */ + export type Outbound = CreateWorkspaceResponse$Outbound; +} + +export function createWorkspaceResponseToJSON( + createWorkspaceResponse: CreateWorkspaceResponse, +): string { + return JSON.stringify( + CreateWorkspaceResponse$outboundSchema.parse(createWorkspaceResponse), + ); +} + +export function createWorkspaceResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreateWorkspaceResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreateWorkspaceResponse' from JSON`, + ); +} diff --git a/src/models/components/createworkspaceuploadrequestassignment.ts b/src/models/components/createworkspaceuploadrequestassignment.ts new file mode 100644 index 0000000..56756e9 --- /dev/null +++ b/src/models/components/createworkspaceuploadrequestassignment.ts @@ -0,0 +1,126 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + WorkspaceUploadRequestResponsibilityType, + WorkspaceUploadRequestResponsibilityType$inboundSchema, + WorkspaceUploadRequestResponsibilityType$outboundSchema, +} from "./workspaceuploadrequestresponsibilitytype.js"; + +export type CreateWorkspaceUploadRequestAssignment = { + /** + * The ID of the assigned user + */ + assigneeUserId?: string | null | undefined; + /** + * Enum representing the responsibility type for a workspace upload request assignment + */ + uploadRequestResponsibilityTypeId: WorkspaceUploadRequestResponsibilityType; + /** + * The first name of the assignee + */ + firstName?: string | null | undefined; + /** + * The last name of the assignee + */ + lastName?: string | null | undefined; + /** + * The email of the assignee + */ + email?: string | null | undefined; +}; + +/** @internal */ +export const CreateWorkspaceUploadRequestAssignment$inboundSchema: z.ZodType< + CreateWorkspaceUploadRequestAssignment, + z.ZodTypeDef, + unknown +> = z.object({ + assignee_user_id: z.nullable(z.string()).optional(), + upload_request_responsibility_type_id: + WorkspaceUploadRequestResponsibilityType$inboundSchema, + first_name: z.nullable(z.string()).optional(), + last_name: z.nullable(z.string()).optional(), + email: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + "assignee_user_id": "assigneeUserId", + "upload_request_responsibility_type_id": + "uploadRequestResponsibilityTypeId", + "first_name": "firstName", + "last_name": "lastName", + }); +}); + +/** @internal */ +export type CreateWorkspaceUploadRequestAssignment$Outbound = { + assignee_user_id?: string | null | undefined; + upload_request_responsibility_type_id: string; + first_name?: string | null | undefined; + last_name?: string | null | undefined; + email?: string | null | undefined; +}; + +/** @internal */ +export const CreateWorkspaceUploadRequestAssignment$outboundSchema: z.ZodType< + CreateWorkspaceUploadRequestAssignment$Outbound, + z.ZodTypeDef, + CreateWorkspaceUploadRequestAssignment +> = z.object({ + assigneeUserId: z.nullable(z.string()).optional(), + uploadRequestResponsibilityTypeId: + WorkspaceUploadRequestResponsibilityType$outboundSchema, + firstName: z.nullable(z.string()).optional(), + lastName: z.nullable(z.string()).optional(), + email: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + assigneeUserId: "assignee_user_id", + uploadRequestResponsibilityTypeId: "upload_request_responsibility_type_id", + firstName: "first_name", + lastName: "last_name", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateWorkspaceUploadRequestAssignment$ { + /** @deprecated use `CreateWorkspaceUploadRequestAssignment$inboundSchema` instead. */ + export const inboundSchema = + CreateWorkspaceUploadRequestAssignment$inboundSchema; + /** @deprecated use `CreateWorkspaceUploadRequestAssignment$outboundSchema` instead. */ + export const outboundSchema = + CreateWorkspaceUploadRequestAssignment$outboundSchema; + /** @deprecated use `CreateWorkspaceUploadRequestAssignment$Outbound` instead. */ + export type Outbound = CreateWorkspaceUploadRequestAssignment$Outbound; +} + +export function createWorkspaceUploadRequestAssignmentToJSON( + createWorkspaceUploadRequestAssignment: + CreateWorkspaceUploadRequestAssignment, +): string { + return JSON.stringify( + CreateWorkspaceUploadRequestAssignment$outboundSchema.parse( + createWorkspaceUploadRequestAssignment, + ), + ); +} + +export function createWorkspaceUploadRequestAssignmentFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + CreateWorkspaceUploadRequestAssignment$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreateWorkspaceUploadRequestAssignment' from JSON`, + ); +} diff --git a/src/models/components/createworkspaceuploadrequestbody.ts b/src/models/components/createworkspaceuploadrequestbody.ts new file mode 100644 index 0000000..b3e0b9a --- /dev/null +++ b/src/models/components/createworkspaceuploadrequestbody.ts @@ -0,0 +1,123 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + CreateWorkspaceUploadRequestAssignment, + CreateWorkspaceUploadRequestAssignment$inboundSchema, + CreateWorkspaceUploadRequestAssignment$Outbound, + CreateWorkspaceUploadRequestAssignment$outboundSchema, +} from "./createworkspaceuploadrequestassignment.js"; +import { + WorkspaceUploadRequestStatus, + WorkspaceUploadRequestStatus$inboundSchema, + WorkspaceUploadRequestStatus$outboundSchema, +} from "./workspaceuploadrequeststatus.js"; + +export type CreateWorkspaceUploadRequestBody = { + /** + * The name of the upload request + */ + name: string | null; + /** + * The description of the upload request + */ + description: string | null; + /** + * The due date for the upload request + */ + dueDate: Date; + /** + * List of user assignments for the upload request + */ + assignments: Array | null; + /** + * Enum representing the status of a workspace upload request + */ + status: WorkspaceUploadRequestStatus; +}; + +/** @internal */ +export const CreateWorkspaceUploadRequestBody$inboundSchema: z.ZodType< + CreateWorkspaceUploadRequestBody, + z.ZodTypeDef, + unknown +> = z.object({ + name: z.nullable(z.string()), + description: z.nullable(z.string()), + due_date: z.string().datetime({ offset: true }).transform(v => new Date(v)), + assignments: z.nullable( + z.array(CreateWorkspaceUploadRequestAssignment$inboundSchema), + ), + status: WorkspaceUploadRequestStatus$inboundSchema, +}).transform((v) => { + return remap$(v, { + "due_date": "dueDate", + }); +}); + +/** @internal */ +export type CreateWorkspaceUploadRequestBody$Outbound = { + name: string | null; + description: string | null; + due_date: string; + assignments: Array | null; + status: string; +}; + +/** @internal */ +export const CreateWorkspaceUploadRequestBody$outboundSchema: z.ZodType< + CreateWorkspaceUploadRequestBody$Outbound, + z.ZodTypeDef, + CreateWorkspaceUploadRequestBody +> = z.object({ + name: z.nullable(z.string()), + description: z.nullable(z.string()), + dueDate: z.date().transform(v => v.toISOString()), + assignments: z.nullable( + z.array(CreateWorkspaceUploadRequestAssignment$outboundSchema), + ), + status: WorkspaceUploadRequestStatus$outboundSchema, +}).transform((v) => { + return remap$(v, { + dueDate: "due_date", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateWorkspaceUploadRequestBody$ { + /** @deprecated use `CreateWorkspaceUploadRequestBody$inboundSchema` instead. */ + export const inboundSchema = CreateWorkspaceUploadRequestBody$inboundSchema; + /** @deprecated use `CreateWorkspaceUploadRequestBody$outboundSchema` instead. */ + export const outboundSchema = CreateWorkspaceUploadRequestBody$outboundSchema; + /** @deprecated use `CreateWorkspaceUploadRequestBody$Outbound` instead. */ + export type Outbound = CreateWorkspaceUploadRequestBody$Outbound; +} + +export function createWorkspaceUploadRequestBodyToJSON( + createWorkspaceUploadRequestBody: CreateWorkspaceUploadRequestBody, +): string { + return JSON.stringify( + CreateWorkspaceUploadRequestBody$outboundSchema.parse( + createWorkspaceUploadRequestBody, + ), + ); +} + +export function createWorkspaceUploadRequestBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreateWorkspaceUploadRequestBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreateWorkspaceUploadRequestBody' from JSON`, + ); +} diff --git a/src/models/components/createworkspaceuserresponse.ts b/src/models/components/createworkspaceuserresponse.ts new file mode 100644 index 0000000..cffbe20 --- /dev/null +++ b/src/models/components/createworkspaceuserresponse.ts @@ -0,0 +1,123 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type CreateWorkspaceUserResponse = { + /** + * The ID of the workspace + */ + workspaceId?: string | undefined; + /** + * The ID of the user + */ + userId?: string | undefined; + /** + * The ID of the role assigned to the user + */ + roleId?: string | undefined; + /** + * The email of the user + */ + email?: string | null | undefined; + /** + * The first name of the user + */ + firstName?: string | null | undefined; + /** + * The last name of the user + */ + lastName?: string | null | undefined; +}; + +/** @internal */ +export const CreateWorkspaceUserResponse$inboundSchema: z.ZodType< + CreateWorkspaceUserResponse, + z.ZodTypeDef, + unknown +> = z.object({ + workspace_id: z.string().optional(), + user_id: z.string().optional(), + role_id: z.string().optional(), + email: z.nullable(z.string()).optional(), + first_name: z.nullable(z.string()).optional(), + last_name: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + "workspace_id": "workspaceId", + "user_id": "userId", + "role_id": "roleId", + "first_name": "firstName", + "last_name": "lastName", + }); +}); + +/** @internal */ +export type CreateWorkspaceUserResponse$Outbound = { + workspace_id?: string | undefined; + user_id?: string | undefined; + role_id?: string | undefined; + email?: string | null | undefined; + first_name?: string | null | undefined; + last_name?: string | null | undefined; +}; + +/** @internal */ +export const CreateWorkspaceUserResponse$outboundSchema: z.ZodType< + CreateWorkspaceUserResponse$Outbound, + z.ZodTypeDef, + CreateWorkspaceUserResponse +> = z.object({ + workspaceId: z.string().optional(), + userId: z.string().optional(), + roleId: z.string().optional(), + email: z.nullable(z.string()).optional(), + firstName: z.nullable(z.string()).optional(), + lastName: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + workspaceId: "workspace_id", + userId: "user_id", + roleId: "role_id", + firstName: "first_name", + lastName: "last_name", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateWorkspaceUserResponse$ { + /** @deprecated use `CreateWorkspaceUserResponse$inboundSchema` instead. */ + export const inboundSchema = CreateWorkspaceUserResponse$inboundSchema; + /** @deprecated use `CreateWorkspaceUserResponse$outboundSchema` instead. */ + export const outboundSchema = CreateWorkspaceUserResponse$outboundSchema; + /** @deprecated use `CreateWorkspaceUserResponse$Outbound` instead. */ + export type Outbound = CreateWorkspaceUserResponse$Outbound; +} + +export function createWorkspaceUserResponseToJSON( + createWorkspaceUserResponse: CreateWorkspaceUserResponse, +): string { + return JSON.stringify( + CreateWorkspaceUserResponse$outboundSchema.parse( + createWorkspaceUserResponse, + ), + ); +} + +export function createWorkspaceUserResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreateWorkspaceUserResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreateWorkspaceUserResponse' from JSON`, + ); +} diff --git a/src/models/components/getworkspaceassignablerolesresponse.ts b/src/models/components/getworkspaceassignablerolesresponse.ts new file mode 100644 index 0000000..0e6f3f2 --- /dev/null +++ b/src/models/components/getworkspaceassignablerolesresponse.ts @@ -0,0 +1,132 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + WorkspaceRoleSummary, + WorkspaceRoleSummary$inboundSchema, + WorkspaceRoleSummary$Outbound, + WorkspaceRoleSummary$outboundSchema, +} from "./workspacerolesummary.js"; + +export type GetWorkspaceAssignableRolesResponse = { + /** + * The list of roles that can be assigned to the workspace + */ + roles: Array | null; + /** + * The number of roles returned in the response. Always equal or less than the `count` of the request + */ + resultSetSize?: number | null | undefined; + /** + * Position of the first item in the total results + */ + startPosition?: number | null | undefined; + /** + * Position of the last item in the total results + */ + endPosition?: number | null | undefined; + /** + * The total number of roles applicable to the request regardless of pagination. It may not always be computed + */ + totalRowCount?: number | null | undefined; + /** + * The optional ID of the current role. It may not always be computed + */ + currentRoleId?: string | null | undefined; +}; + +/** @internal */ +export const GetWorkspaceAssignableRolesResponse$inboundSchema: z.ZodType< + GetWorkspaceAssignableRolesResponse, + z.ZodTypeDef, + unknown +> = z.object({ + roles: z.nullable(z.array(WorkspaceRoleSummary$inboundSchema)), + result_set_size: z.nullable(z.number().int()).optional(), + start_position: z.nullable(z.number().int()).optional(), + end_position: z.nullable(z.number().int()).optional(), + total_row_count: z.nullable(z.number().int()).optional(), + current_role_id: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + "result_set_size": "resultSetSize", + "start_position": "startPosition", + "end_position": "endPosition", + "total_row_count": "totalRowCount", + "current_role_id": "currentRoleId", + }); +}); + +/** @internal */ +export type GetWorkspaceAssignableRolesResponse$Outbound = { + roles: Array | null; + result_set_size?: number | null | undefined; + start_position?: number | null | undefined; + end_position?: number | null | undefined; + total_row_count?: number | null | undefined; + current_role_id?: string | null | undefined; +}; + +/** @internal */ +export const GetWorkspaceAssignableRolesResponse$outboundSchema: z.ZodType< + GetWorkspaceAssignableRolesResponse$Outbound, + z.ZodTypeDef, + GetWorkspaceAssignableRolesResponse +> = z.object({ + roles: z.nullable(z.array(WorkspaceRoleSummary$outboundSchema)), + resultSetSize: z.nullable(z.number().int()).optional(), + startPosition: z.nullable(z.number().int()).optional(), + endPosition: z.nullable(z.number().int()).optional(), + totalRowCount: z.nullable(z.number().int()).optional(), + currentRoleId: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + resultSetSize: "result_set_size", + startPosition: "start_position", + endPosition: "end_position", + totalRowCount: "total_row_count", + currentRoleId: "current_role_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspaceAssignableRolesResponse$ { + /** @deprecated use `GetWorkspaceAssignableRolesResponse$inboundSchema` instead. */ + export const inboundSchema = + GetWorkspaceAssignableRolesResponse$inboundSchema; + /** @deprecated use `GetWorkspaceAssignableRolesResponse$outboundSchema` instead. */ + export const outboundSchema = + GetWorkspaceAssignableRolesResponse$outboundSchema; + /** @deprecated use `GetWorkspaceAssignableRolesResponse$Outbound` instead. */ + export type Outbound = GetWorkspaceAssignableRolesResponse$Outbound; +} + +export function getWorkspaceAssignableRolesResponseToJSON( + getWorkspaceAssignableRolesResponse: GetWorkspaceAssignableRolesResponse, +): string { + return JSON.stringify( + GetWorkspaceAssignableRolesResponse$outboundSchema.parse( + getWorkspaceAssignableRolesResponse, + ), + ); +} + +export function getWorkspaceAssignableRolesResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetWorkspaceAssignableRolesResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceAssignableRolesResponse' from JSON`, + ); +} diff --git a/src/models/components/getworkspacedocumentresponse.ts b/src/models/components/getworkspacedocumentresponse.ts new file mode 100644 index 0000000..1e827cd --- /dev/null +++ b/src/models/components/getworkspacedocumentresponse.ts @@ -0,0 +1,132 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type GetWorkspaceDocumentResponse = { + /** + * The ID of the workspace + */ + workspaceId?: string | null | undefined; + /** + * The ID of the document + */ + documentId: string; + /** + * The name of the document + */ + name: string; + /** + * The ID of the owner of the document + */ + ownerId?: string | null | undefined; + /** + * The size of the document in bytes + */ + size?: number | null | undefined; + /** + * The date the document was created + */ + createdDate?: Date | null | undefined; + /** + * The document content type + */ + contentType?: string | null | undefined; +}; + +/** @internal */ +export const GetWorkspaceDocumentResponse$inboundSchema: z.ZodType< + GetWorkspaceDocumentResponse, + z.ZodTypeDef, + unknown +> = z.object({ + workspace_id: z.nullable(z.string()).optional(), + document_id: z.string(), + name: z.string(), + owner_id: z.nullable(z.string()).optional(), + size: z.nullable(z.number().int()).optional(), + created_date: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), + content_type: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + "workspace_id": "workspaceId", + "document_id": "documentId", + "owner_id": "ownerId", + "created_date": "createdDate", + "content_type": "contentType", + }); +}); + +/** @internal */ +export type GetWorkspaceDocumentResponse$Outbound = { + workspace_id?: string | null | undefined; + document_id: string; + name: string; + owner_id?: string | null | undefined; + size?: number | null | undefined; + created_date?: string | null | undefined; + content_type?: string | null | undefined; +}; + +/** @internal */ +export const GetWorkspaceDocumentResponse$outboundSchema: z.ZodType< + GetWorkspaceDocumentResponse$Outbound, + z.ZodTypeDef, + GetWorkspaceDocumentResponse +> = z.object({ + workspaceId: z.nullable(z.string()).optional(), + documentId: z.string(), + name: z.string(), + ownerId: z.nullable(z.string()).optional(), + size: z.nullable(z.number().int()).optional(), + createdDate: z.nullable(z.date().transform(v => v.toISOString())).optional(), + contentType: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + workspaceId: "workspace_id", + documentId: "document_id", + ownerId: "owner_id", + createdDate: "created_date", + contentType: "content_type", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspaceDocumentResponse$ { + /** @deprecated use `GetWorkspaceDocumentResponse$inboundSchema` instead. */ + export const inboundSchema = GetWorkspaceDocumentResponse$inboundSchema; + /** @deprecated use `GetWorkspaceDocumentResponse$outboundSchema` instead. */ + export const outboundSchema = GetWorkspaceDocumentResponse$outboundSchema; + /** @deprecated use `GetWorkspaceDocumentResponse$Outbound` instead. */ + export type Outbound = GetWorkspaceDocumentResponse$Outbound; +} + +export function getWorkspaceDocumentResponseToJSON( + getWorkspaceDocumentResponse: GetWorkspaceDocumentResponse, +): string { + return JSON.stringify( + GetWorkspaceDocumentResponse$outboundSchema.parse( + getWorkspaceDocumentResponse, + ), + ); +} + +export function getWorkspaceDocumentResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceDocumentResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceDocumentResponse' from JSON`, + ); +} diff --git a/src/models/components/getworkspacedocumentsresponse.ts b/src/models/components/getworkspacedocumentsresponse.ts new file mode 100644 index 0000000..7cdd18e --- /dev/null +++ b/src/models/components/getworkspacedocumentsresponse.ts @@ -0,0 +1,120 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + WorkspaceDocument, + WorkspaceDocument$inboundSchema, + WorkspaceDocument$Outbound, + WorkspaceDocument$outboundSchema, +} from "./workspacedocument.js"; + +export type GetWorkspaceDocumentsResponse = { + /** + * The document summary list. Includes the ID, name, and metadata + */ + documents?: Array | null | undefined; + /** + * The number of documents returned in the response. Always equal or less than the `count` of the request + */ + resultSetSize?: number | null | undefined; + /** + * Position of the first item in the total results + */ + startPosition?: number | null | undefined; + /** + * Position of the last item in the total results + */ + endPosition?: number | null | undefined; + /** + * The total number of documents in the workspace applicable to the request regardless of pagination. It may not always be computed + */ + totalRowCount?: number | null | undefined; +}; + +/** @internal */ +export const GetWorkspaceDocumentsResponse$inboundSchema: z.ZodType< + GetWorkspaceDocumentsResponse, + z.ZodTypeDef, + unknown +> = z.object({ + documents: z.nullable(z.array(WorkspaceDocument$inboundSchema)).optional(), + result_set_size: z.nullable(z.number().int()).optional(), + start_position: z.nullable(z.number().int()).optional(), + end_position: z.nullable(z.number().int()).optional(), + total_row_count: z.nullable(z.number().int()).optional(), +}).transform((v) => { + return remap$(v, { + "result_set_size": "resultSetSize", + "start_position": "startPosition", + "end_position": "endPosition", + "total_row_count": "totalRowCount", + }); +}); + +/** @internal */ +export type GetWorkspaceDocumentsResponse$Outbound = { + documents?: Array | null | undefined; + result_set_size?: number | null | undefined; + start_position?: number | null | undefined; + end_position?: number | null | undefined; + total_row_count?: number | null | undefined; +}; + +/** @internal */ +export const GetWorkspaceDocumentsResponse$outboundSchema: z.ZodType< + GetWorkspaceDocumentsResponse$Outbound, + z.ZodTypeDef, + GetWorkspaceDocumentsResponse +> = z.object({ + documents: z.nullable(z.array(WorkspaceDocument$outboundSchema)).optional(), + resultSetSize: z.nullable(z.number().int()).optional(), + startPosition: z.nullable(z.number().int()).optional(), + endPosition: z.nullable(z.number().int()).optional(), + totalRowCount: z.nullable(z.number().int()).optional(), +}).transform((v) => { + return remap$(v, { + resultSetSize: "result_set_size", + startPosition: "start_position", + endPosition: "end_position", + totalRowCount: "total_row_count", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspaceDocumentsResponse$ { + /** @deprecated use `GetWorkspaceDocumentsResponse$inboundSchema` instead. */ + export const inboundSchema = GetWorkspaceDocumentsResponse$inboundSchema; + /** @deprecated use `GetWorkspaceDocumentsResponse$outboundSchema` instead. */ + export const outboundSchema = GetWorkspaceDocumentsResponse$outboundSchema; + /** @deprecated use `GetWorkspaceDocumentsResponse$Outbound` instead. */ + export type Outbound = GetWorkspaceDocumentsResponse$Outbound; +} + +export function getWorkspaceDocumentsResponseToJSON( + getWorkspaceDocumentsResponse: GetWorkspaceDocumentsResponse, +): string { + return JSON.stringify( + GetWorkspaceDocumentsResponse$outboundSchema.parse( + getWorkspaceDocumentsResponse, + ), + ); +} + +export function getWorkspaceDocumentsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceDocumentsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceDocumentsResponse' from JSON`, + ); +} diff --git a/src/models/components/getworkspaceenvelopesresponse.ts b/src/models/components/getworkspaceenvelopesresponse.ts new file mode 100644 index 0000000..8cb6f63 --- /dev/null +++ b/src/models/components/getworkspaceenvelopesresponse.ts @@ -0,0 +1,77 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + WorkspaceEnvelopeSummary, + WorkspaceEnvelopeSummary$inboundSchema, + WorkspaceEnvelopeSummary$Outbound, + WorkspaceEnvelopeSummary$outboundSchema, +} from "./workspaceenvelopesummary.js"; + +export type GetWorkspaceEnvelopesResponse = { + /** + * The summary list of envelopes associated with the workspace + */ + envelopes: Array | null; +}; + +/** @internal */ +export const GetWorkspaceEnvelopesResponse$inboundSchema: z.ZodType< + GetWorkspaceEnvelopesResponse, + z.ZodTypeDef, + unknown +> = z.object({ + envelopes: z.nullable(z.array(WorkspaceEnvelopeSummary$inboundSchema)), +}); + +/** @internal */ +export type GetWorkspaceEnvelopesResponse$Outbound = { + envelopes: Array | null; +}; + +/** @internal */ +export const GetWorkspaceEnvelopesResponse$outboundSchema: z.ZodType< + GetWorkspaceEnvelopesResponse$Outbound, + z.ZodTypeDef, + GetWorkspaceEnvelopesResponse +> = z.object({ + envelopes: z.nullable(z.array(WorkspaceEnvelopeSummary$outboundSchema)), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspaceEnvelopesResponse$ { + /** @deprecated use `GetWorkspaceEnvelopesResponse$inboundSchema` instead. */ + export const inboundSchema = GetWorkspaceEnvelopesResponse$inboundSchema; + /** @deprecated use `GetWorkspaceEnvelopesResponse$outboundSchema` instead. */ + export const outboundSchema = GetWorkspaceEnvelopesResponse$outboundSchema; + /** @deprecated use `GetWorkspaceEnvelopesResponse$Outbound` instead. */ + export type Outbound = GetWorkspaceEnvelopesResponse$Outbound; +} + +export function getWorkspaceEnvelopesResponseToJSON( + getWorkspaceEnvelopesResponse: GetWorkspaceEnvelopesResponse, +): string { + return JSON.stringify( + GetWorkspaceEnvelopesResponse$outboundSchema.parse( + getWorkspaceEnvelopesResponse, + ), + ); +} + +export function getWorkspaceEnvelopesResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceEnvelopesResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceEnvelopesResponse' from JSON`, + ); +} diff --git a/src/models/components/getworkspaceresponse.ts b/src/models/components/getworkspaceresponse.ts new file mode 100644 index 0000000..10d0250 --- /dev/null +++ b/src/models/components/getworkspaceresponse.ts @@ -0,0 +1,117 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +/** + * The details of a single workspace + */ +export type GetWorkspaceResponse = { + /** + * The ID of the workspace + */ + workspaceId: string; + /** + * The name of the workspace + */ + name?: string | null | undefined; + /** + * The date the workspace was created + */ + createdDate?: Date | null | undefined; + /** + * The ID of the user who created the workspace + */ + createdByUserId?: string | null | undefined; + /** + * The list of user IDs of the workspace owners + */ + workspaceOwnerIds?: Array | null | undefined; +}; + +/** @internal */ +export const GetWorkspaceResponse$inboundSchema: z.ZodType< + GetWorkspaceResponse, + z.ZodTypeDef, + unknown +> = z.object({ + workspace_id: z.string(), + name: z.nullable(z.string()).optional(), + created_date: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), + created_by_user_id: z.nullable(z.string()).optional(), + workspace_owner_ids: z.nullable(z.array(z.string())).optional(), +}).transform((v) => { + return remap$(v, { + "workspace_id": "workspaceId", + "created_date": "createdDate", + "created_by_user_id": "createdByUserId", + "workspace_owner_ids": "workspaceOwnerIds", + }); +}); + +/** @internal */ +export type GetWorkspaceResponse$Outbound = { + workspace_id: string; + name?: string | null | undefined; + created_date?: string | null | undefined; + created_by_user_id?: string | null | undefined; + workspace_owner_ids?: Array | null | undefined; +}; + +/** @internal */ +export const GetWorkspaceResponse$outboundSchema: z.ZodType< + GetWorkspaceResponse$Outbound, + z.ZodTypeDef, + GetWorkspaceResponse +> = z.object({ + workspaceId: z.string(), + name: z.nullable(z.string()).optional(), + createdDate: z.nullable(z.date().transform(v => v.toISOString())).optional(), + createdByUserId: z.nullable(z.string()).optional(), + workspaceOwnerIds: z.nullable(z.array(z.string())).optional(), +}).transform((v) => { + return remap$(v, { + workspaceId: "workspace_id", + createdDate: "created_date", + createdByUserId: "created_by_user_id", + workspaceOwnerIds: "workspace_owner_ids", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspaceResponse$ { + /** @deprecated use `GetWorkspaceResponse$inboundSchema` instead. */ + export const inboundSchema = GetWorkspaceResponse$inboundSchema; + /** @deprecated use `GetWorkspaceResponse$outboundSchema` instead. */ + export const outboundSchema = GetWorkspaceResponse$outboundSchema; + /** @deprecated use `GetWorkspaceResponse$Outbound` instead. */ + export type Outbound = GetWorkspaceResponse$Outbound; +} + +export function getWorkspaceResponseToJSON( + getWorkspaceResponse: GetWorkspaceResponse, +): string { + return JSON.stringify( + GetWorkspaceResponse$outboundSchema.parse(getWorkspaceResponse), + ); +} + +export function getWorkspaceResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceResponse' from JSON`, + ); +} diff --git a/src/models/components/getworkspacesresponse.ts b/src/models/components/getworkspacesresponse.ts new file mode 100644 index 0000000..cb63de6 --- /dev/null +++ b/src/models/components/getworkspacesresponse.ts @@ -0,0 +1,118 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + WorkspaceSummary, + WorkspaceSummary$inboundSchema, + WorkspaceSummary$Outbound, + WorkspaceSummary$outboundSchema, +} from "./workspacesummary.js"; + +export type GetWorkspacesResponse = { + /** + * The workspace summary list. Includes the ID, name, and creation metadata + */ + workspaces?: Array | null | undefined; + /** + * The number of workspaces returned in the response. Always equal or less than the `count` of the request + */ + resultSetSize?: number | null | undefined; + /** + * Position of the first item in the total results + */ + startPosition?: number | null | undefined; + /** + * Position of the last item in the total results + */ + endPosition?: number | null | undefined; + /** + * The total number of workspaces applicable to the request regardless of pagination. It may not always be computed + */ + totalRowCount?: number | null | undefined; +}; + +/** @internal */ +export const GetWorkspacesResponse$inboundSchema: z.ZodType< + GetWorkspacesResponse, + z.ZodTypeDef, + unknown +> = z.object({ + workspaces: z.nullable(z.array(WorkspaceSummary$inboundSchema)).optional(), + result_set_size: z.nullable(z.number().int()).optional(), + start_position: z.nullable(z.number().int()).optional(), + end_position: z.nullable(z.number().int()).optional(), + total_row_count: z.nullable(z.number().int()).optional(), +}).transform((v) => { + return remap$(v, { + "result_set_size": "resultSetSize", + "start_position": "startPosition", + "end_position": "endPosition", + "total_row_count": "totalRowCount", + }); +}); + +/** @internal */ +export type GetWorkspacesResponse$Outbound = { + workspaces?: Array | null | undefined; + result_set_size?: number | null | undefined; + start_position?: number | null | undefined; + end_position?: number | null | undefined; + total_row_count?: number | null | undefined; +}; + +/** @internal */ +export const GetWorkspacesResponse$outboundSchema: z.ZodType< + GetWorkspacesResponse$Outbound, + z.ZodTypeDef, + GetWorkspacesResponse +> = z.object({ + workspaces: z.nullable(z.array(WorkspaceSummary$outboundSchema)).optional(), + resultSetSize: z.nullable(z.number().int()).optional(), + startPosition: z.nullable(z.number().int()).optional(), + endPosition: z.nullable(z.number().int()).optional(), + totalRowCount: z.nullable(z.number().int()).optional(), +}).transform((v) => { + return remap$(v, { + resultSetSize: "result_set_size", + startPosition: "start_position", + endPosition: "end_position", + totalRowCount: "total_row_count", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspacesResponse$ { + /** @deprecated use `GetWorkspacesResponse$inboundSchema` instead. */ + export const inboundSchema = GetWorkspacesResponse$inboundSchema; + /** @deprecated use `GetWorkspacesResponse$outboundSchema` instead. */ + export const outboundSchema = GetWorkspacesResponse$outboundSchema; + /** @deprecated use `GetWorkspacesResponse$Outbound` instead. */ + export type Outbound = GetWorkspacesResponse$Outbound; +} + +export function getWorkspacesResponseToJSON( + getWorkspacesResponse: GetWorkspacesResponse, +): string { + return JSON.stringify( + GetWorkspacesResponse$outboundSchema.parse(getWorkspacesResponse), + ); +} + +export function getWorkspacesResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspacesResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspacesResponse' from JSON`, + ); +} diff --git a/src/models/components/getworkspaceuploadrequestresponse.ts b/src/models/components/getworkspaceuploadrequestresponse.ts new file mode 100644 index 0000000..fbf1881 --- /dev/null +++ b/src/models/components/getworkspaceuploadrequestresponse.ts @@ -0,0 +1,244 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + WorkspaceUploadRequestAssignment, + WorkspaceUploadRequestAssignment$inboundSchema, + WorkspaceUploadRequestAssignment$Outbound, + WorkspaceUploadRequestAssignment$outboundSchema, +} from "./workspaceuploadrequestassignment.js"; +import { + WorkspaceUploadRequestDocument, + WorkspaceUploadRequestDocument$inboundSchema, + WorkspaceUploadRequestDocument$Outbound, + WorkspaceUploadRequestDocument$outboundSchema, +} from "./workspaceuploadrequestdocument.js"; +import { + WorkspaceUploadRequestOwner, + WorkspaceUploadRequestOwner$inboundSchema, + WorkspaceUploadRequestOwner$Outbound, + WorkspaceUploadRequestOwner$outboundSchema, +} from "./workspaceuploadrequestowner.js"; +import { + WorkspaceUploadRequestStatus, + WorkspaceUploadRequestStatus$inboundSchema, + WorkspaceUploadRequestStatus$outboundSchema, +} from "./workspaceuploadrequeststatus.js"; + +/** + * Upload request details - single upload request response + */ +export type GetWorkspaceUploadRequestResponse = { + /** + * The ID of the upload request + */ + uploadRequestId: string; + /** + * The ID of the workspace + */ + workspaceId: string; + /** + * The name of the upload request + */ + name: string | null; + /** + * The description of the upload request + */ + description?: string | null | undefined; + uploadRequestOwner: WorkspaceUploadRequestOwner; + /** + * Enum representing the status of a workspace upload request + */ + status: WorkspaceUploadRequestStatus; + /** + * List of documents associated with the upload request + */ + documents: Array | null; + /** + * List of user assignments for the upload request + */ + assignments: Array | null; + /** + * The date the upload request was created + */ + createdDate: Date; + /** + * The date the upload request was last updated + */ + updatedDate: Date; + /** + * The due date for the upload request + */ + dueDate?: Date | null | undefined; + /** + * The date the upload request was sent + */ + sentDate?: Date | null | undefined; + /** + * The date the upload request was completed + */ + completedDate?: Date | null | undefined; + /** + * Whether the current user can view the upload request + */ + canView: boolean; + /** + * Whether the current user can edit the upload request + */ + canEdit: boolean; + /** + * Whether the current user can delete the upload request + */ + canDelete: boolean; +}; + +/** @internal */ +export const GetWorkspaceUploadRequestResponse$inboundSchema: z.ZodType< + GetWorkspaceUploadRequestResponse, + z.ZodTypeDef, + unknown +> = z.object({ + upload_request_id: z.string(), + workspace_id: z.string(), + name: z.nullable(z.string()), + description: z.nullable(z.string()).optional(), + upload_request_owner: WorkspaceUploadRequestOwner$inboundSchema, + status: WorkspaceUploadRequestStatus$inboundSchema, + documents: z.nullable(z.array(WorkspaceUploadRequestDocument$inboundSchema)), + assignments: z.nullable( + z.array(WorkspaceUploadRequestAssignment$inboundSchema), + ), + created_date: z.string().datetime({ offset: true }).transform(v => + new Date(v) + ), + updated_date: z.string().datetime({ offset: true }).transform(v => + new Date(v) + ), + due_date: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), + sent_date: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), + completed_date: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), + can_view: z.boolean(), + can_edit: z.boolean(), + can_delete: z.boolean(), +}).transform((v) => { + return remap$(v, { + "upload_request_id": "uploadRequestId", + "workspace_id": "workspaceId", + "upload_request_owner": "uploadRequestOwner", + "created_date": "createdDate", + "updated_date": "updatedDate", + "due_date": "dueDate", + "sent_date": "sentDate", + "completed_date": "completedDate", + "can_view": "canView", + "can_edit": "canEdit", + "can_delete": "canDelete", + }); +}); + +/** @internal */ +export type GetWorkspaceUploadRequestResponse$Outbound = { + upload_request_id: string; + workspace_id: string; + name: string | null; + description?: string | null | undefined; + upload_request_owner: WorkspaceUploadRequestOwner$Outbound; + status: string; + documents: Array | null; + assignments: Array | null; + created_date: string; + updated_date: string; + due_date?: string | null | undefined; + sent_date?: string | null | undefined; + completed_date?: string | null | undefined; + can_view: boolean; + can_edit: boolean; + can_delete: boolean; +}; + +/** @internal */ +export const GetWorkspaceUploadRequestResponse$outboundSchema: z.ZodType< + GetWorkspaceUploadRequestResponse$Outbound, + z.ZodTypeDef, + GetWorkspaceUploadRequestResponse +> = z.object({ + uploadRequestId: z.string(), + workspaceId: z.string(), + name: z.nullable(z.string()), + description: z.nullable(z.string()).optional(), + uploadRequestOwner: WorkspaceUploadRequestOwner$outboundSchema, + status: WorkspaceUploadRequestStatus$outboundSchema, + documents: z.nullable(z.array(WorkspaceUploadRequestDocument$outboundSchema)), + assignments: z.nullable( + z.array(WorkspaceUploadRequestAssignment$outboundSchema), + ), + createdDate: z.date().transform(v => v.toISOString()), + updatedDate: z.date().transform(v => v.toISOString()), + dueDate: z.nullable(z.date().transform(v => v.toISOString())).optional(), + sentDate: z.nullable(z.date().transform(v => v.toISOString())).optional(), + completedDate: z.nullable(z.date().transform(v => v.toISOString())) + .optional(), + canView: z.boolean(), + canEdit: z.boolean(), + canDelete: z.boolean(), +}).transform((v) => { + return remap$(v, { + uploadRequestId: "upload_request_id", + workspaceId: "workspace_id", + uploadRequestOwner: "upload_request_owner", + createdDate: "created_date", + updatedDate: "updated_date", + dueDate: "due_date", + sentDate: "sent_date", + completedDate: "completed_date", + canView: "can_view", + canEdit: "can_edit", + canDelete: "can_delete", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspaceUploadRequestResponse$ { + /** @deprecated use `GetWorkspaceUploadRequestResponse$inboundSchema` instead. */ + export const inboundSchema = GetWorkspaceUploadRequestResponse$inboundSchema; + /** @deprecated use `GetWorkspaceUploadRequestResponse$outboundSchema` instead. */ + export const outboundSchema = + GetWorkspaceUploadRequestResponse$outboundSchema; + /** @deprecated use `GetWorkspaceUploadRequestResponse$Outbound` instead. */ + export type Outbound = GetWorkspaceUploadRequestResponse$Outbound; +} + +export function getWorkspaceUploadRequestResponseToJSON( + getWorkspaceUploadRequestResponse: GetWorkspaceUploadRequestResponse, +): string { + return JSON.stringify( + GetWorkspaceUploadRequestResponse$outboundSchema.parse( + getWorkspaceUploadRequestResponse, + ), + ); +} + +export function getWorkspaceUploadRequestResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceUploadRequestResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceUploadRequestResponse' from JSON`, + ); +} diff --git a/src/models/components/getworkspaceuploadrequestsresponse.ts b/src/models/components/getworkspaceuploadrequestsresponse.ts new file mode 100644 index 0000000..ea1577c --- /dev/null +++ b/src/models/components/getworkspaceuploadrequestsresponse.ts @@ -0,0 +1,82 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + WorkspaceUploadRequest, + WorkspaceUploadRequest$inboundSchema, + WorkspaceUploadRequest$Outbound, + WorkspaceUploadRequest$outboundSchema, +} from "./workspaceuploadrequest.js"; + +/** + * Response containing a list of upload requests + */ +export type GetWorkspaceUploadRequestsResponse = { + /** + * The upload request list + */ + data: Array | null; +}; + +/** @internal */ +export const GetWorkspaceUploadRequestsResponse$inboundSchema: z.ZodType< + GetWorkspaceUploadRequestsResponse, + z.ZodTypeDef, + unknown +> = z.object({ + data: z.nullable(z.array(WorkspaceUploadRequest$inboundSchema)), +}); + +/** @internal */ +export type GetWorkspaceUploadRequestsResponse$Outbound = { + data: Array | null; +}; + +/** @internal */ +export const GetWorkspaceUploadRequestsResponse$outboundSchema: z.ZodType< + GetWorkspaceUploadRequestsResponse$Outbound, + z.ZodTypeDef, + GetWorkspaceUploadRequestsResponse +> = z.object({ + data: z.nullable(z.array(WorkspaceUploadRequest$outboundSchema)), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspaceUploadRequestsResponse$ { + /** @deprecated use `GetWorkspaceUploadRequestsResponse$inboundSchema` instead. */ + export const inboundSchema = GetWorkspaceUploadRequestsResponse$inboundSchema; + /** @deprecated use `GetWorkspaceUploadRequestsResponse$outboundSchema` instead. */ + export const outboundSchema = + GetWorkspaceUploadRequestsResponse$outboundSchema; + /** @deprecated use `GetWorkspaceUploadRequestsResponse$Outbound` instead. */ + export type Outbound = GetWorkspaceUploadRequestsResponse$Outbound; +} + +export function getWorkspaceUploadRequestsResponseToJSON( + getWorkspaceUploadRequestsResponse: GetWorkspaceUploadRequestsResponse, +): string { + return JSON.stringify( + GetWorkspaceUploadRequestsResponse$outboundSchema.parse( + getWorkspaceUploadRequestsResponse, + ), + ); +} + +export function getWorkspaceUploadRequestsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetWorkspaceUploadRequestsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceUploadRequestsResponse' from JSON`, + ); +} diff --git a/src/models/components/getworkspaceusersresponse.ts b/src/models/components/getworkspaceusersresponse.ts new file mode 100644 index 0000000..cf42c89 --- /dev/null +++ b/src/models/components/getworkspaceusersresponse.ts @@ -0,0 +1,118 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + WorkspaceUserSummary, + WorkspaceUserSummary$inboundSchema, + WorkspaceUserSummary$Outbound, + WorkspaceUserSummary$outboundSchema, +} from "./workspaceusersummary.js"; + +export type GetWorkspaceUsersResponse = { + /** + * The user summary list. Includes the ID, name, and metadata such as the role ID and role name + */ + users: Array | null; + /** + * The number of users returned in the response. Always equal or less than the `count` of the request + */ + resultSetSize?: number | null | undefined; + /** + * Position of the first item in the total results + */ + startPosition?: number | null | undefined; + /** + * Position of the last item in the total results + */ + endPosition?: number | null | undefined; + /** + * The total number of users in the workspace applicable to the request regardless of pagination. It may not always be computed + */ + totalRowCount?: number | null | undefined; +}; + +/** @internal */ +export const GetWorkspaceUsersResponse$inboundSchema: z.ZodType< + GetWorkspaceUsersResponse, + z.ZodTypeDef, + unknown +> = z.object({ + users: z.nullable(z.array(WorkspaceUserSummary$inboundSchema)), + result_set_size: z.nullable(z.number().int()).optional(), + start_position: z.nullable(z.number().int()).optional(), + end_position: z.nullable(z.number().int()).optional(), + total_row_count: z.nullable(z.number().int()).optional(), +}).transform((v) => { + return remap$(v, { + "result_set_size": "resultSetSize", + "start_position": "startPosition", + "end_position": "endPosition", + "total_row_count": "totalRowCount", + }); +}); + +/** @internal */ +export type GetWorkspaceUsersResponse$Outbound = { + users: Array | null; + result_set_size?: number | null | undefined; + start_position?: number | null | undefined; + end_position?: number | null | undefined; + total_row_count?: number | null | undefined; +}; + +/** @internal */ +export const GetWorkspaceUsersResponse$outboundSchema: z.ZodType< + GetWorkspaceUsersResponse$Outbound, + z.ZodTypeDef, + GetWorkspaceUsersResponse +> = z.object({ + users: z.nullable(z.array(WorkspaceUserSummary$outboundSchema)), + resultSetSize: z.nullable(z.number().int()).optional(), + startPosition: z.nullable(z.number().int()).optional(), + endPosition: z.nullable(z.number().int()).optional(), + totalRowCount: z.nullable(z.number().int()).optional(), +}).transform((v) => { + return remap$(v, { + resultSetSize: "result_set_size", + startPosition: "start_position", + endPosition: "end_position", + totalRowCount: "total_row_count", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspaceUsersResponse$ { + /** @deprecated use `GetWorkspaceUsersResponse$inboundSchema` instead. */ + export const inboundSchema = GetWorkspaceUsersResponse$inboundSchema; + /** @deprecated use `GetWorkspaceUsersResponse$outboundSchema` instead. */ + export const outboundSchema = GetWorkspaceUsersResponse$outboundSchema; + /** @deprecated use `GetWorkspaceUsersResponse$Outbound` instead. */ + export type Outbound = GetWorkspaceUsersResponse$Outbound; +} + +export function getWorkspaceUsersResponseToJSON( + getWorkspaceUsersResponse: GetWorkspaceUsersResponse, +): string { + return JSON.stringify( + GetWorkspaceUsersResponse$outboundSchema.parse(getWorkspaceUsersResponse), + ); +} + +export function getWorkspaceUsersResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceUsersResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceUsersResponse' from JSON`, + ); +} diff --git a/src/models/components/getworkspaceuserssortingoption.ts b/src/models/components/getworkspaceuserssortingoption.ts new file mode 100644 index 0000000..84deede --- /dev/null +++ b/src/models/components/getworkspaceuserssortingoption.ts @@ -0,0 +1,39 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { ClosedEnum } from "../../types/enums.js"; + +export const GetWorkspaceUsersSortingOption = { + FirstNameAsc: "first_name_asc", + LastNameAsc: "last_name_asc", + EmailAsc: "email_asc", + FirstNameDesc: "first_name_desc", + LastNameDesc: "last_name_desc", + EmailDesc: "email_desc", +} as const; +export type GetWorkspaceUsersSortingOption = ClosedEnum< + typeof GetWorkspaceUsersSortingOption +>; + +/** @internal */ +export const GetWorkspaceUsersSortingOption$inboundSchema: z.ZodNativeEnum< + typeof GetWorkspaceUsersSortingOption +> = z.nativeEnum(GetWorkspaceUsersSortingOption); + +/** @internal */ +export const GetWorkspaceUsersSortingOption$outboundSchema: z.ZodNativeEnum< + typeof GetWorkspaceUsersSortingOption +> = GetWorkspaceUsersSortingOption$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspaceUsersSortingOption$ { + /** @deprecated use `GetWorkspaceUsersSortingOption$inboundSchema` instead. */ + export const inboundSchema = GetWorkspaceUsersSortingOption$inboundSchema; + /** @deprecated use `GetWorkspaceUsersSortingOption$outboundSchema` instead. */ + export const outboundSchema = GetWorkspaceUsersSortingOption$outboundSchema; +} diff --git a/src/models/components/index.ts b/src/models/components/index.ts index 4139acf..711c4e2 100644 --- a/src/models/components/index.ts +++ b/src/models/components/index.ts @@ -8,8 +8,24 @@ export * from "./agreementsummary.js"; export * from "./authorizationcodegrantresponse.js"; export * from "./cancelworkflowinstanceresponse.js"; export * from "./confidentialauthcodegrantrequestbody.js"; +export * from "./createworkspacebody.js"; +export * from "./createworkspaceenveloperesponse.js"; +export * from "./createworkspaceresponse.js"; +export * from "./createworkspaceuploadrequestassignment.js"; +export * from "./createworkspaceuploadrequestbody.js"; +export * from "./createworkspaceuserresponse.js"; export * from "./currencycode.js"; export * from "./customproperty.js"; +export * from "./getworkspaceassignablerolesresponse.js"; +export * from "./getworkspacedocumentresponse.js"; +export * from "./getworkspacedocumentsresponse.js"; +export * from "./getworkspaceenvelopesresponse.js"; +export * from "./getworkspaceresponse.js"; +export * from "./getworkspacesresponse.js"; +export * from "./getworkspaceuploadrequestresponse.js"; +export * from "./getworkspaceuploadrequestsresponse.js"; +export * from "./getworkspaceusersresponse.js"; +export * from "./getworkspaceuserssortingoption.js"; export * from "./jwtgrantresponse.js"; export * from "./party.js"; export * from "./pausenewworkflowinstancessuccess.js"; @@ -17,6 +33,7 @@ export * from "./publicauthcodegrantrequestbody.js"; export * from "./resourcemetadata.js"; export * from "./responsemetadata.js"; export * from "./resumenewworkflowinstancessuccess.js"; +export * from "./revokeworkspaceuserdetails.js"; export * from "./security.js"; export * from "./tab.js"; export * from "./tabconnectedfieldsdata.js"; @@ -26,9 +43,26 @@ export * from "./tabinfo.js"; export * from "./triggerinputs.js"; export * from "./triggerworkflow.js"; export * from "./triggerworkflowsuccess.js"; +export * from "./updateworkspaceuploadrequestbody.js"; +export * from "./updateworkspaceuserresponse.js"; export * from "./userinfo.js"; export * from "./workflow.js"; export * from "./workflowinstance.js"; export * from "./workflowinstancecollection.js"; export * from "./workflowslistsuccess.js"; export * from "./workflowtriggerrequirementssuccess.js"; +export * from "./workspacedocument.js"; +export * from "./workspacedocumentowner.js"; +export * from "./workspaceenvelopeforcreate.js"; +export * from "./workspaceenvelopesummary.js"; +export * from "./workspacerolesummary.js"; +export * from "./workspacesummary.js"; +export * from "./workspaceuploadrequest.js"; +export * from "./workspaceuploadrequestassignment.js"; +export * from "./workspaceuploadrequestdocument.js"; +export * from "./workspaceuploadrequestowner.js"; +export * from "./workspaceuploadrequestresponsibilitytype.js"; +export * from "./workspaceuploadrequeststatus.js"; +export * from "./workspaceuserforcreate.js"; +export * from "./workspaceuserforupdate.js"; +export * from "./workspaceusersummary.js"; diff --git a/src/models/components/revokeworkspaceuserdetails.ts b/src/models/components/revokeworkspaceuserdetails.ts new file mode 100644 index 0000000..b6a9c0e --- /dev/null +++ b/src/models/components/revokeworkspaceuserdetails.ts @@ -0,0 +1,81 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type RevokeWorkspaceUserDetails = { + /** + * The optional date in the future to initiate the revocation. If not specified, the revocation will be immediate + */ + revocationDate?: Date | null | undefined; +}; + +/** @internal */ +export const RevokeWorkspaceUserDetails$inboundSchema: z.ZodType< + RevokeWorkspaceUserDetails, + z.ZodTypeDef, + unknown +> = z.object({ + revocation_date: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), +}).transform((v) => { + return remap$(v, { + "revocation_date": "revocationDate", + }); +}); + +/** @internal */ +export type RevokeWorkspaceUserDetails$Outbound = { + revocation_date?: string | null | undefined; +}; + +/** @internal */ +export const RevokeWorkspaceUserDetails$outboundSchema: z.ZodType< + RevokeWorkspaceUserDetails$Outbound, + z.ZodTypeDef, + RevokeWorkspaceUserDetails +> = z.object({ + revocationDate: z.nullable(z.date().transform(v => v.toISOString())) + .optional(), +}).transform((v) => { + return remap$(v, { + revocationDate: "revocation_date", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RevokeWorkspaceUserDetails$ { + /** @deprecated use `RevokeWorkspaceUserDetails$inboundSchema` instead. */ + export const inboundSchema = RevokeWorkspaceUserDetails$inboundSchema; + /** @deprecated use `RevokeWorkspaceUserDetails$outboundSchema` instead. */ + export const outboundSchema = RevokeWorkspaceUserDetails$outboundSchema; + /** @deprecated use `RevokeWorkspaceUserDetails$Outbound` instead. */ + export type Outbound = RevokeWorkspaceUserDetails$Outbound; +} + +export function revokeWorkspaceUserDetailsToJSON( + revokeWorkspaceUserDetails: RevokeWorkspaceUserDetails, +): string { + return JSON.stringify( + RevokeWorkspaceUserDetails$outboundSchema.parse(revokeWorkspaceUserDetails), + ); +} + +export function revokeWorkspaceUserDetailsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => RevokeWorkspaceUserDetails$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'RevokeWorkspaceUserDetails' from JSON`, + ); +} diff --git a/src/models/components/updateworkspaceuploadrequestbody.ts b/src/models/components/updateworkspaceuploadrequestbody.ts new file mode 100644 index 0000000..7fbb204 --- /dev/null +++ b/src/models/components/updateworkspaceuploadrequestbody.ts @@ -0,0 +1,237 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + WorkspaceUploadRequestAssignment, + WorkspaceUploadRequestAssignment$inboundSchema, + WorkspaceUploadRequestAssignment$Outbound, + WorkspaceUploadRequestAssignment$outboundSchema, +} from "./workspaceuploadrequestassignment.js"; +import { + WorkspaceUploadRequestDocument, + WorkspaceUploadRequestDocument$inboundSchema, + WorkspaceUploadRequestDocument$Outbound, + WorkspaceUploadRequestDocument$outboundSchema, +} from "./workspaceuploadrequestdocument.js"; +import { + WorkspaceUploadRequestOwner, + WorkspaceUploadRequestOwner$inboundSchema, + WorkspaceUploadRequestOwner$Outbound, + WorkspaceUploadRequestOwner$outboundSchema, +} from "./workspaceuploadrequestowner.js"; +import { + WorkspaceUploadRequestStatus, + WorkspaceUploadRequestStatus$inboundSchema, + WorkspaceUploadRequestStatus$outboundSchema, +} from "./workspaceuploadrequeststatus.js"; + +/** + * Upload request details for update operations + */ +export type UpdateWorkspaceUploadRequestBody = { + /** + * The ID of the upload request + */ + uploadRequestId?: string | null | undefined; + /** + * The ID of the workspace + */ + workspaceId?: string | null | undefined; + /** + * The name of the upload request (editable) + */ + name: string | null; + /** + * The description of the upload request (editable) + */ + description: string | null; + uploadRequestOwner?: WorkspaceUploadRequestOwner | undefined; + /** + * Enum representing the status of a workspace upload request + */ + status: WorkspaceUploadRequestStatus; + /** + * List of documents associated with the upload request + */ + documents?: Array | null | undefined; + /** + * List of user assignments for the upload request + */ + assignments?: Array | null | undefined; + /** + * The date the upload request was created + */ + createdDate?: string | null | undefined; + /** + * The date the upload request was last updated + */ + updatedDate?: string | null | undefined; + /** + * The due date for the upload request (editable) + */ + dueDate: string | null; + /** + * The date the upload request was sent + */ + sentDate?: string | null | undefined; + /** + * The date the upload request was completed + */ + completedDate?: string | null | undefined; + /** + * Whether the current user can view the upload request + */ + canView?: boolean | null | undefined; + /** + * Whether the current user can edit the upload request + */ + canEdit?: boolean | null | undefined; + /** + * Whether the current user can delete the upload request + */ + canDelete?: boolean | null | undefined; +}; + +/** @internal */ +export const UpdateWorkspaceUploadRequestBody$inboundSchema: z.ZodType< + UpdateWorkspaceUploadRequestBody, + z.ZodTypeDef, + unknown +> = z.object({ + upload_request_id: z.nullable(z.string()).optional(), + workspace_id: z.nullable(z.string()).optional(), + name: z.nullable(z.string()), + description: z.nullable(z.string()), + upload_request_owner: WorkspaceUploadRequestOwner$inboundSchema.optional(), + status: WorkspaceUploadRequestStatus$inboundSchema, + documents: z.nullable(z.array(WorkspaceUploadRequestDocument$inboundSchema)) + .optional(), + assignments: z.nullable( + z.array(WorkspaceUploadRequestAssignment$inboundSchema), + ).optional(), + created_date: z.nullable(z.string()).optional(), + updated_date: z.nullable(z.string()).optional(), + due_date: z.nullable(z.string()), + sent_date: z.nullable(z.string()).optional(), + completed_date: z.nullable(z.string()).optional(), + can_view: z.nullable(z.boolean()).optional(), + can_edit: z.nullable(z.boolean()).optional(), + can_delete: z.nullable(z.boolean()).optional(), +}).transform((v) => { + return remap$(v, { + "upload_request_id": "uploadRequestId", + "workspace_id": "workspaceId", + "upload_request_owner": "uploadRequestOwner", + "created_date": "createdDate", + "updated_date": "updatedDate", + "due_date": "dueDate", + "sent_date": "sentDate", + "completed_date": "completedDate", + "can_view": "canView", + "can_edit": "canEdit", + "can_delete": "canDelete", + }); +}); + +/** @internal */ +export type UpdateWorkspaceUploadRequestBody$Outbound = { + upload_request_id?: string | null | undefined; + workspace_id?: string | null | undefined; + name: string | null; + description: string | null; + upload_request_owner?: WorkspaceUploadRequestOwner$Outbound | undefined; + status: string; + documents?: Array | null | undefined; + assignments?: + | Array + | null + | undefined; + created_date?: string | null | undefined; + updated_date?: string | null | undefined; + due_date: string | null; + sent_date?: string | null | undefined; + completed_date?: string | null | undefined; + can_view?: boolean | null | undefined; + can_edit?: boolean | null | undefined; + can_delete?: boolean | null | undefined; +}; + +/** @internal */ +export const UpdateWorkspaceUploadRequestBody$outboundSchema: z.ZodType< + UpdateWorkspaceUploadRequestBody$Outbound, + z.ZodTypeDef, + UpdateWorkspaceUploadRequestBody +> = z.object({ + uploadRequestId: z.nullable(z.string()).optional(), + workspaceId: z.nullable(z.string()).optional(), + name: z.nullable(z.string()), + description: z.nullable(z.string()), + uploadRequestOwner: WorkspaceUploadRequestOwner$outboundSchema.optional(), + status: WorkspaceUploadRequestStatus$outboundSchema, + documents: z.nullable(z.array(WorkspaceUploadRequestDocument$outboundSchema)) + .optional(), + assignments: z.nullable( + z.array(WorkspaceUploadRequestAssignment$outboundSchema), + ).optional(), + createdDate: z.nullable(z.string()).optional(), + updatedDate: z.nullable(z.string()).optional(), + dueDate: z.nullable(z.string()), + sentDate: z.nullable(z.string()).optional(), + completedDate: z.nullable(z.string()).optional(), + canView: z.nullable(z.boolean()).optional(), + canEdit: z.nullable(z.boolean()).optional(), + canDelete: z.nullable(z.boolean()).optional(), +}).transform((v) => { + return remap$(v, { + uploadRequestId: "upload_request_id", + workspaceId: "workspace_id", + uploadRequestOwner: "upload_request_owner", + createdDate: "created_date", + updatedDate: "updated_date", + dueDate: "due_date", + sentDate: "sent_date", + completedDate: "completed_date", + canView: "can_view", + canEdit: "can_edit", + canDelete: "can_delete", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateWorkspaceUploadRequestBody$ { + /** @deprecated use `UpdateWorkspaceUploadRequestBody$inboundSchema` instead. */ + export const inboundSchema = UpdateWorkspaceUploadRequestBody$inboundSchema; + /** @deprecated use `UpdateWorkspaceUploadRequestBody$outboundSchema` instead. */ + export const outboundSchema = UpdateWorkspaceUploadRequestBody$outboundSchema; + /** @deprecated use `UpdateWorkspaceUploadRequestBody$Outbound` instead. */ + export type Outbound = UpdateWorkspaceUploadRequestBody$Outbound; +} + +export function updateWorkspaceUploadRequestBodyToJSON( + updateWorkspaceUploadRequestBody: UpdateWorkspaceUploadRequestBody, +): string { + return JSON.stringify( + UpdateWorkspaceUploadRequestBody$outboundSchema.parse( + updateWorkspaceUploadRequestBody, + ), + ); +} + +export function updateWorkspaceUploadRequestBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UpdateWorkspaceUploadRequestBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UpdateWorkspaceUploadRequestBody' from JSON`, + ); +} diff --git a/src/models/components/updateworkspaceuserresponse.ts b/src/models/components/updateworkspaceuserresponse.ts new file mode 100644 index 0000000..a4c6d52 --- /dev/null +++ b/src/models/components/updateworkspaceuserresponse.ts @@ -0,0 +1,80 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type UpdateWorkspaceUserResponse = { + /** + * The ID of the role assigned to the user + */ + roleId?: string | undefined; +}; + +/** @internal */ +export const UpdateWorkspaceUserResponse$inboundSchema: z.ZodType< + UpdateWorkspaceUserResponse, + z.ZodTypeDef, + unknown +> = z.object({ + role_id: z.string().optional(), +}).transform((v) => { + return remap$(v, { + "role_id": "roleId", + }); +}); + +/** @internal */ +export type UpdateWorkspaceUserResponse$Outbound = { + role_id?: string | undefined; +}; + +/** @internal */ +export const UpdateWorkspaceUserResponse$outboundSchema: z.ZodType< + UpdateWorkspaceUserResponse$Outbound, + z.ZodTypeDef, + UpdateWorkspaceUserResponse +> = z.object({ + roleId: z.string().optional(), +}).transform((v) => { + return remap$(v, { + roleId: "role_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateWorkspaceUserResponse$ { + /** @deprecated use `UpdateWorkspaceUserResponse$inboundSchema` instead. */ + export const inboundSchema = UpdateWorkspaceUserResponse$inboundSchema; + /** @deprecated use `UpdateWorkspaceUserResponse$outboundSchema` instead. */ + export const outboundSchema = UpdateWorkspaceUserResponse$outboundSchema; + /** @deprecated use `UpdateWorkspaceUserResponse$Outbound` instead. */ + export type Outbound = UpdateWorkspaceUserResponse$Outbound; +} + +export function updateWorkspaceUserResponseToJSON( + updateWorkspaceUserResponse: UpdateWorkspaceUserResponse, +): string { + return JSON.stringify( + UpdateWorkspaceUserResponse$outboundSchema.parse( + updateWorkspaceUserResponse, + ), + ); +} + +export function updateWorkspaceUserResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UpdateWorkspaceUserResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UpdateWorkspaceUserResponse' from JSON`, + ); +} diff --git a/src/models/components/workspacedocument.ts b/src/models/components/workspacedocument.ts new file mode 100644 index 0000000..db6bb52 --- /dev/null +++ b/src/models/components/workspacedocument.ts @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + WorkspaceDocumentOwner, + WorkspaceDocumentOwner$inboundSchema, + WorkspaceDocumentOwner$Outbound, + WorkspaceDocumentOwner$outboundSchema, +} from "./workspacedocumentowner.js"; + +export type WorkspaceDocument = { + /** + * The ID of the document + */ + documentId: string; + /** + * The name of the document + */ + name?: string | null | undefined; + /** + * The ID of the user who owns the document + */ + ownerId?: string | null | undefined; + /** + * The size of the document in bytes + */ + size?: number | null | undefined; + /** + * The date the document was created + */ + createdDate?: Date | null | undefined; + /** + * The date the document was last updated + */ + lastUpdatedDate?: Date | null | undefined; + owner?: WorkspaceDocumentOwner | undefined; +}; + +/** @internal */ +export const WorkspaceDocument$inboundSchema: z.ZodType< + WorkspaceDocument, + z.ZodTypeDef, + unknown +> = z.object({ + document_id: z.string(), + name: z.nullable(z.string()).optional(), + owner_id: z.nullable(z.string()).optional(), + size: z.nullable(z.number().int()).optional(), + created_date: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), + last_updated_date: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), + owner: WorkspaceDocumentOwner$inboundSchema.optional(), +}).transform((v) => { + return remap$(v, { + "document_id": "documentId", + "owner_id": "ownerId", + "created_date": "createdDate", + "last_updated_date": "lastUpdatedDate", + }); +}); + +/** @internal */ +export type WorkspaceDocument$Outbound = { + document_id: string; + name?: string | null | undefined; + owner_id?: string | null | undefined; + size?: number | null | undefined; + created_date?: string | null | undefined; + last_updated_date?: string | null | undefined; + owner?: WorkspaceDocumentOwner$Outbound | undefined; +}; + +/** @internal */ +export const WorkspaceDocument$outboundSchema: z.ZodType< + WorkspaceDocument$Outbound, + z.ZodTypeDef, + WorkspaceDocument +> = z.object({ + documentId: z.string(), + name: z.nullable(z.string()).optional(), + ownerId: z.nullable(z.string()).optional(), + size: z.nullable(z.number().int()).optional(), + createdDate: z.nullable(z.date().transform(v => v.toISOString())).optional(), + lastUpdatedDate: z.nullable(z.date().transform(v => v.toISOString())) + .optional(), + owner: WorkspaceDocumentOwner$outboundSchema.optional(), +}).transform((v) => { + return remap$(v, { + documentId: "document_id", + ownerId: "owner_id", + createdDate: "created_date", + lastUpdatedDate: "last_updated_date", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WorkspaceDocument$ { + /** @deprecated use `WorkspaceDocument$inboundSchema` instead. */ + export const inboundSchema = WorkspaceDocument$inboundSchema; + /** @deprecated use `WorkspaceDocument$outboundSchema` instead. */ + export const outboundSchema = WorkspaceDocument$outboundSchema; + /** @deprecated use `WorkspaceDocument$Outbound` instead. */ + export type Outbound = WorkspaceDocument$Outbound; +} + +export function workspaceDocumentToJSON( + workspaceDocument: WorkspaceDocument, +): string { + return JSON.stringify( + WorkspaceDocument$outboundSchema.parse(workspaceDocument), + ); +} + +export function workspaceDocumentFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => WorkspaceDocument$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'WorkspaceDocument' from JSON`, + ); +} diff --git a/src/models/components/workspacedocumentowner.ts b/src/models/components/workspacedocumentowner.ts new file mode 100644 index 0000000..8b26418 --- /dev/null +++ b/src/models/components/workspacedocumentowner.ts @@ -0,0 +1,87 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type WorkspaceDocumentOwner = { + /** + * The first name of the document owner + */ + firstName?: string | null | undefined; + /** + * The last name of the document owner + */ + lastName?: string | null | undefined; +}; + +/** @internal */ +export const WorkspaceDocumentOwner$inboundSchema: z.ZodType< + WorkspaceDocumentOwner, + z.ZodTypeDef, + unknown +> = z.object({ + first_name: z.nullable(z.string()).optional(), + last_name: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + "first_name": "firstName", + "last_name": "lastName", + }); +}); + +/** @internal */ +export type WorkspaceDocumentOwner$Outbound = { + first_name?: string | null | undefined; + last_name?: string | null | undefined; +}; + +/** @internal */ +export const WorkspaceDocumentOwner$outboundSchema: z.ZodType< + WorkspaceDocumentOwner$Outbound, + z.ZodTypeDef, + WorkspaceDocumentOwner +> = z.object({ + firstName: z.nullable(z.string()).optional(), + lastName: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + firstName: "first_name", + lastName: "last_name", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WorkspaceDocumentOwner$ { + /** @deprecated use `WorkspaceDocumentOwner$inboundSchema` instead. */ + export const inboundSchema = WorkspaceDocumentOwner$inboundSchema; + /** @deprecated use `WorkspaceDocumentOwner$outboundSchema` instead. */ + export const outboundSchema = WorkspaceDocumentOwner$outboundSchema; + /** @deprecated use `WorkspaceDocumentOwner$Outbound` instead. */ + export type Outbound = WorkspaceDocumentOwner$Outbound; +} + +export function workspaceDocumentOwnerToJSON( + workspaceDocumentOwner: WorkspaceDocumentOwner, +): string { + return JSON.stringify( + WorkspaceDocumentOwner$outboundSchema.parse(workspaceDocumentOwner), + ); +} + +export function workspaceDocumentOwnerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => WorkspaceDocumentOwner$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'WorkspaceDocumentOwner' from JSON`, + ); +} diff --git a/src/models/components/workspaceenvelopeforcreate.ts b/src/models/components/workspaceenvelopeforcreate.ts new file mode 100644 index 0000000..50b3ea4 --- /dev/null +++ b/src/models/components/workspaceenvelopeforcreate.ts @@ -0,0 +1,87 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type WorkspaceEnvelopeForCreate = { + /** + * The name for the envelope + */ + envelopeName: string | null; + /** + * The optional list of document IDs to be added to the envelope + */ + documentIds?: Array | null | undefined; +}; + +/** @internal */ +export const WorkspaceEnvelopeForCreate$inboundSchema: z.ZodType< + WorkspaceEnvelopeForCreate, + z.ZodTypeDef, + unknown +> = z.object({ + envelope_name: z.nullable(z.string()), + document_ids: z.nullable(z.array(z.string())).optional(), +}).transform((v) => { + return remap$(v, { + "envelope_name": "envelopeName", + "document_ids": "documentIds", + }); +}); + +/** @internal */ +export type WorkspaceEnvelopeForCreate$Outbound = { + envelope_name: string | null; + document_ids?: Array | null | undefined; +}; + +/** @internal */ +export const WorkspaceEnvelopeForCreate$outboundSchema: z.ZodType< + WorkspaceEnvelopeForCreate$Outbound, + z.ZodTypeDef, + WorkspaceEnvelopeForCreate +> = z.object({ + envelopeName: z.nullable(z.string()), + documentIds: z.nullable(z.array(z.string())).optional(), +}).transform((v) => { + return remap$(v, { + envelopeName: "envelope_name", + documentIds: "document_ids", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WorkspaceEnvelopeForCreate$ { + /** @deprecated use `WorkspaceEnvelopeForCreate$inboundSchema` instead. */ + export const inboundSchema = WorkspaceEnvelopeForCreate$inboundSchema; + /** @deprecated use `WorkspaceEnvelopeForCreate$outboundSchema` instead. */ + export const outboundSchema = WorkspaceEnvelopeForCreate$outboundSchema; + /** @deprecated use `WorkspaceEnvelopeForCreate$Outbound` instead. */ + export type Outbound = WorkspaceEnvelopeForCreate$Outbound; +} + +export function workspaceEnvelopeForCreateToJSON( + workspaceEnvelopeForCreate: WorkspaceEnvelopeForCreate, +): string { + return JSON.stringify( + WorkspaceEnvelopeForCreate$outboundSchema.parse(workspaceEnvelopeForCreate), + ); +} + +export function workspaceEnvelopeForCreateFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => WorkspaceEnvelopeForCreate$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'WorkspaceEnvelopeForCreate' from JSON`, + ); +} diff --git a/src/models/components/workspaceenvelopesummary.ts b/src/models/components/workspaceenvelopesummary.ts new file mode 100644 index 0000000..71993e8 --- /dev/null +++ b/src/models/components/workspaceenvelopesummary.ts @@ -0,0 +1,125 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +/** + * The summary of the envelope in the workspace + */ +export type WorkspaceEnvelopeSummary = { + /** + * The ID of the envelope + */ + envelopeId: string | null; + /** + * The status of the envelope in the workspace + */ + status: string | null; + /** + * The envelope name + */ + name?: string | null | undefined; + /** + * The envelope subject + */ + subject?: string | null | undefined; + /** + * The date the envelope was created + */ + createdDate?: Date | null | undefined; + /** + * The date the envelope was last updated + */ + lastUpdatedDate?: Date | null | undefined; +}; + +/** @internal */ +export const WorkspaceEnvelopeSummary$inboundSchema: z.ZodType< + WorkspaceEnvelopeSummary, + z.ZodTypeDef, + unknown +> = z.object({ + envelope_id: z.nullable(z.string()), + status: z.nullable(z.string()), + name: z.nullable(z.string()).optional(), + subject: z.nullable(z.string()).optional(), + created_date: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), + last_updated_date: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), +}).transform((v) => { + return remap$(v, { + "envelope_id": "envelopeId", + "created_date": "createdDate", + "last_updated_date": "lastUpdatedDate", + }); +}); + +/** @internal */ +export type WorkspaceEnvelopeSummary$Outbound = { + envelope_id: string | null; + status: string | null; + name?: string | null | undefined; + subject?: string | null | undefined; + created_date?: string | null | undefined; + last_updated_date?: string | null | undefined; +}; + +/** @internal */ +export const WorkspaceEnvelopeSummary$outboundSchema: z.ZodType< + WorkspaceEnvelopeSummary$Outbound, + z.ZodTypeDef, + WorkspaceEnvelopeSummary +> = z.object({ + envelopeId: z.nullable(z.string()), + status: z.nullable(z.string()), + name: z.nullable(z.string()).optional(), + subject: z.nullable(z.string()).optional(), + createdDate: z.nullable(z.date().transform(v => v.toISOString())).optional(), + lastUpdatedDate: z.nullable(z.date().transform(v => v.toISOString())) + .optional(), +}).transform((v) => { + return remap$(v, { + envelopeId: "envelope_id", + createdDate: "created_date", + lastUpdatedDate: "last_updated_date", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WorkspaceEnvelopeSummary$ { + /** @deprecated use `WorkspaceEnvelopeSummary$inboundSchema` instead. */ + export const inboundSchema = WorkspaceEnvelopeSummary$inboundSchema; + /** @deprecated use `WorkspaceEnvelopeSummary$outboundSchema` instead. */ + export const outboundSchema = WorkspaceEnvelopeSummary$outboundSchema; + /** @deprecated use `WorkspaceEnvelopeSummary$Outbound` instead. */ + export type Outbound = WorkspaceEnvelopeSummary$Outbound; +} + +export function workspaceEnvelopeSummaryToJSON( + workspaceEnvelopeSummary: WorkspaceEnvelopeSummary, +): string { + return JSON.stringify( + WorkspaceEnvelopeSummary$outboundSchema.parse(workspaceEnvelopeSummary), + ); +} + +export function workspaceEnvelopeSummaryFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => WorkspaceEnvelopeSummary$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'WorkspaceEnvelopeSummary' from JSON`, + ); +} diff --git a/src/models/components/workspacerolesummary.ts b/src/models/components/workspacerolesummary.ts new file mode 100644 index 0000000..6a7529d --- /dev/null +++ b/src/models/components/workspacerolesummary.ts @@ -0,0 +1,105 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type WorkspaceRoleSummary = { + /** + * The ID of the role + */ + roleId?: string | undefined; + /** + * The name of the role + */ + name?: string | null | undefined; + /** + * If this role is applicable to any participant of a workspace including those outside the account. If false, this role may only be assigned to internal users of the same account + */ + isExternal?: boolean | null | undefined; + /** + * The date the role was created + */ + createdDate?: Date | null | undefined; +}; + +/** @internal */ +export const WorkspaceRoleSummary$inboundSchema: z.ZodType< + WorkspaceRoleSummary, + z.ZodTypeDef, + unknown +> = z.object({ + role_id: z.string().optional(), + name: z.nullable(z.string()).optional(), + is_external: z.nullable(z.boolean()).optional(), + created_date: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), +}).transform((v) => { + return remap$(v, { + "role_id": "roleId", + "is_external": "isExternal", + "created_date": "createdDate", + }); +}); + +/** @internal */ +export type WorkspaceRoleSummary$Outbound = { + role_id?: string | undefined; + name?: string | null | undefined; + is_external?: boolean | null | undefined; + created_date?: string | null | undefined; +}; + +/** @internal */ +export const WorkspaceRoleSummary$outboundSchema: z.ZodType< + WorkspaceRoleSummary$Outbound, + z.ZodTypeDef, + WorkspaceRoleSummary +> = z.object({ + roleId: z.string().optional(), + name: z.nullable(z.string()).optional(), + isExternal: z.nullable(z.boolean()).optional(), + createdDate: z.nullable(z.date().transform(v => v.toISOString())).optional(), +}).transform((v) => { + return remap$(v, { + roleId: "role_id", + isExternal: "is_external", + createdDate: "created_date", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WorkspaceRoleSummary$ { + /** @deprecated use `WorkspaceRoleSummary$inboundSchema` instead. */ + export const inboundSchema = WorkspaceRoleSummary$inboundSchema; + /** @deprecated use `WorkspaceRoleSummary$outboundSchema` instead. */ + export const outboundSchema = WorkspaceRoleSummary$outboundSchema; + /** @deprecated use `WorkspaceRoleSummary$Outbound` instead. */ + export type Outbound = WorkspaceRoleSummary$Outbound; +} + +export function workspaceRoleSummaryToJSON( + workspaceRoleSummary: WorkspaceRoleSummary, +): string { + return JSON.stringify( + WorkspaceRoleSummary$outboundSchema.parse(workspaceRoleSummary), + ); +} + +export function workspaceRoleSummaryFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => WorkspaceRoleSummary$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'WorkspaceRoleSummary' from JSON`, + ); +} diff --git a/src/models/components/workspacesummary.ts b/src/models/components/workspacesummary.ts new file mode 100644 index 0000000..56389af --- /dev/null +++ b/src/models/components/workspacesummary.ts @@ -0,0 +1,105 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type WorkspaceSummary = { + /** + * The ID of the workspace + */ + workspaceId?: string | undefined; + /** + * The name of the workspace + */ + name?: string | null | undefined; + /** + * The date the workspace was created + */ + createdDate?: Date | null | undefined; + /** + * The ID of the user who created the workspace + */ + createdByUserId?: string | undefined; +}; + +/** @internal */ +export const WorkspaceSummary$inboundSchema: z.ZodType< + WorkspaceSummary, + z.ZodTypeDef, + unknown +> = z.object({ + workspace_id: z.string().optional(), + name: z.nullable(z.string()).optional(), + created_date: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), + created_by_user_id: z.string().optional(), +}).transform((v) => { + return remap$(v, { + "workspace_id": "workspaceId", + "created_date": "createdDate", + "created_by_user_id": "createdByUserId", + }); +}); + +/** @internal */ +export type WorkspaceSummary$Outbound = { + workspace_id?: string | undefined; + name?: string | null | undefined; + created_date?: string | null | undefined; + created_by_user_id?: string | undefined; +}; + +/** @internal */ +export const WorkspaceSummary$outboundSchema: z.ZodType< + WorkspaceSummary$Outbound, + z.ZodTypeDef, + WorkspaceSummary +> = z.object({ + workspaceId: z.string().optional(), + name: z.nullable(z.string()).optional(), + createdDate: z.nullable(z.date().transform(v => v.toISOString())).optional(), + createdByUserId: z.string().optional(), +}).transform((v) => { + return remap$(v, { + workspaceId: "workspace_id", + createdDate: "created_date", + createdByUserId: "created_by_user_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WorkspaceSummary$ { + /** @deprecated use `WorkspaceSummary$inboundSchema` instead. */ + export const inboundSchema = WorkspaceSummary$inboundSchema; + /** @deprecated use `WorkspaceSummary$outboundSchema` instead. */ + export const outboundSchema = WorkspaceSummary$outboundSchema; + /** @deprecated use `WorkspaceSummary$Outbound` instead. */ + export type Outbound = WorkspaceSummary$Outbound; +} + +export function workspaceSummaryToJSON( + workspaceSummary: WorkspaceSummary, +): string { + return JSON.stringify( + WorkspaceSummary$outboundSchema.parse(workspaceSummary), + ); +} + +export function workspaceSummaryFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => WorkspaceSummary$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'WorkspaceSummary' from JSON`, + ); +} diff --git a/src/models/components/workspaceuploadrequest.ts b/src/models/components/workspaceuploadrequest.ts new file mode 100644 index 0000000..a03c85d --- /dev/null +++ b/src/models/components/workspaceuploadrequest.ts @@ -0,0 +1,238 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + WorkspaceUploadRequestAssignment, + WorkspaceUploadRequestAssignment$inboundSchema, + WorkspaceUploadRequestAssignment$Outbound, + WorkspaceUploadRequestAssignment$outboundSchema, +} from "./workspaceuploadrequestassignment.js"; +import { + WorkspaceUploadRequestDocument, + WorkspaceUploadRequestDocument$inboundSchema, + WorkspaceUploadRequestDocument$Outbound, + WorkspaceUploadRequestDocument$outboundSchema, +} from "./workspaceuploadrequestdocument.js"; +import { + WorkspaceUploadRequestOwner, + WorkspaceUploadRequestOwner$inboundSchema, + WorkspaceUploadRequestOwner$Outbound, + WorkspaceUploadRequestOwner$outboundSchema, +} from "./workspaceuploadrequestowner.js"; +import { + WorkspaceUploadRequestStatus, + WorkspaceUploadRequestStatus$inboundSchema, + WorkspaceUploadRequestStatus$outboundSchema, +} from "./workspaceuploadrequeststatus.js"; + +export type WorkspaceUploadRequest = { + /** + * The ID of the upload request + */ + uploadRequestId: string; + /** + * The ID of the workspace + */ + workspaceId: string; + /** + * The name of the upload request + */ + name: string | null; + /** + * The description of the upload request + */ + description?: string | null | undefined; + uploadRequestOwner: WorkspaceUploadRequestOwner; + /** + * Enum representing the status of a workspace upload request + */ + status: WorkspaceUploadRequestStatus; + /** + * List of documents associated with the upload request + */ + documents: Array | null; + /** + * List of user assignments for the upload request + */ + assignments: Array | null; + /** + * The date the upload request was created + */ + createdDate: Date; + /** + * The date the upload request was last updated + */ + updatedDate: Date; + /** + * The due date for the upload request + */ + dueDate?: Date | null | undefined; + /** + * The date the upload request was sent + */ + sentDate?: Date | null | undefined; + /** + * The date the upload request was completed + */ + completedDate?: Date | null | undefined; + /** + * Whether the current user can view the upload request + */ + canView: boolean; + /** + * Whether the current user can edit the upload request + */ + canEdit: boolean; + /** + * Whether the current user can delete the upload request + */ + canDelete: boolean; +}; + +/** @internal */ +export const WorkspaceUploadRequest$inboundSchema: z.ZodType< + WorkspaceUploadRequest, + z.ZodTypeDef, + unknown +> = z.object({ + upload_request_id: z.string(), + workspace_id: z.string(), + name: z.nullable(z.string()), + description: z.nullable(z.string()).optional(), + upload_request_owner: WorkspaceUploadRequestOwner$inboundSchema, + status: WorkspaceUploadRequestStatus$inboundSchema, + documents: z.nullable(z.array(WorkspaceUploadRequestDocument$inboundSchema)), + assignments: z.nullable( + z.array(WorkspaceUploadRequestAssignment$inboundSchema), + ), + created_date: z.string().datetime({ offset: true }).transform(v => + new Date(v) + ), + updated_date: z.string().datetime({ offset: true }).transform(v => + new Date(v) + ), + due_date: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), + sent_date: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), + completed_date: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), + can_view: z.boolean(), + can_edit: z.boolean(), + can_delete: z.boolean(), +}).transform((v) => { + return remap$(v, { + "upload_request_id": "uploadRequestId", + "workspace_id": "workspaceId", + "upload_request_owner": "uploadRequestOwner", + "created_date": "createdDate", + "updated_date": "updatedDate", + "due_date": "dueDate", + "sent_date": "sentDate", + "completed_date": "completedDate", + "can_view": "canView", + "can_edit": "canEdit", + "can_delete": "canDelete", + }); +}); + +/** @internal */ +export type WorkspaceUploadRequest$Outbound = { + upload_request_id: string; + workspace_id: string; + name: string | null; + description?: string | null | undefined; + upload_request_owner: WorkspaceUploadRequestOwner$Outbound; + status: string; + documents: Array | null; + assignments: Array | null; + created_date: string; + updated_date: string; + due_date?: string | null | undefined; + sent_date?: string | null | undefined; + completed_date?: string | null | undefined; + can_view: boolean; + can_edit: boolean; + can_delete: boolean; +}; + +/** @internal */ +export const WorkspaceUploadRequest$outboundSchema: z.ZodType< + WorkspaceUploadRequest$Outbound, + z.ZodTypeDef, + WorkspaceUploadRequest +> = z.object({ + uploadRequestId: z.string(), + workspaceId: z.string(), + name: z.nullable(z.string()), + description: z.nullable(z.string()).optional(), + uploadRequestOwner: WorkspaceUploadRequestOwner$outboundSchema, + status: WorkspaceUploadRequestStatus$outboundSchema, + documents: z.nullable(z.array(WorkspaceUploadRequestDocument$outboundSchema)), + assignments: z.nullable( + z.array(WorkspaceUploadRequestAssignment$outboundSchema), + ), + createdDate: z.date().transform(v => v.toISOString()), + updatedDate: z.date().transform(v => v.toISOString()), + dueDate: z.nullable(z.date().transform(v => v.toISOString())).optional(), + sentDate: z.nullable(z.date().transform(v => v.toISOString())).optional(), + completedDate: z.nullable(z.date().transform(v => v.toISOString())) + .optional(), + canView: z.boolean(), + canEdit: z.boolean(), + canDelete: z.boolean(), +}).transform((v) => { + return remap$(v, { + uploadRequestId: "upload_request_id", + workspaceId: "workspace_id", + uploadRequestOwner: "upload_request_owner", + createdDate: "created_date", + updatedDate: "updated_date", + dueDate: "due_date", + sentDate: "sent_date", + completedDate: "completed_date", + canView: "can_view", + canEdit: "can_edit", + canDelete: "can_delete", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WorkspaceUploadRequest$ { + /** @deprecated use `WorkspaceUploadRequest$inboundSchema` instead. */ + export const inboundSchema = WorkspaceUploadRequest$inboundSchema; + /** @deprecated use `WorkspaceUploadRequest$outboundSchema` instead. */ + export const outboundSchema = WorkspaceUploadRequest$outboundSchema; + /** @deprecated use `WorkspaceUploadRequest$Outbound` instead. */ + export type Outbound = WorkspaceUploadRequest$Outbound; +} + +export function workspaceUploadRequestToJSON( + workspaceUploadRequest: WorkspaceUploadRequest, +): string { + return JSON.stringify( + WorkspaceUploadRequest$outboundSchema.parse(workspaceUploadRequest), + ); +} + +export function workspaceUploadRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => WorkspaceUploadRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'WorkspaceUploadRequest' from JSON`, + ); +} diff --git a/src/models/components/workspaceuploadrequestassignment.ts b/src/models/components/workspaceuploadrequestassignment.ts new file mode 100644 index 0000000..2c42176 --- /dev/null +++ b/src/models/components/workspaceuploadrequestassignment.ts @@ -0,0 +1,99 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + WorkspaceUploadRequestResponsibilityType, + WorkspaceUploadRequestResponsibilityType$inboundSchema, + WorkspaceUploadRequestResponsibilityType$outboundSchema, +} from "./workspaceuploadrequestresponsibilitytype.js"; + +export type WorkspaceUploadRequestAssignment = { + /** + * The ID of the assigned user + */ + assigneeUserId: string; + /** + * Enum representing the responsibility type for a workspace upload request assignment + */ + uploadRequestResponsibilityTypeId?: + | WorkspaceUploadRequestResponsibilityType + | undefined; +}; + +/** @internal */ +export const WorkspaceUploadRequestAssignment$inboundSchema: z.ZodType< + WorkspaceUploadRequestAssignment, + z.ZodTypeDef, + unknown +> = z.object({ + assignee_user_id: z.string(), + upload_request_responsibility_type_id: + WorkspaceUploadRequestResponsibilityType$inboundSchema.optional(), +}).transform((v) => { + return remap$(v, { + "assignee_user_id": "assigneeUserId", + "upload_request_responsibility_type_id": + "uploadRequestResponsibilityTypeId", + }); +}); + +/** @internal */ +export type WorkspaceUploadRequestAssignment$Outbound = { + assignee_user_id: string; + upload_request_responsibility_type_id?: string | undefined; +}; + +/** @internal */ +export const WorkspaceUploadRequestAssignment$outboundSchema: z.ZodType< + WorkspaceUploadRequestAssignment$Outbound, + z.ZodTypeDef, + WorkspaceUploadRequestAssignment +> = z.object({ + assigneeUserId: z.string(), + uploadRequestResponsibilityTypeId: + WorkspaceUploadRequestResponsibilityType$outboundSchema.optional(), +}).transform((v) => { + return remap$(v, { + assigneeUserId: "assignee_user_id", + uploadRequestResponsibilityTypeId: "upload_request_responsibility_type_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WorkspaceUploadRequestAssignment$ { + /** @deprecated use `WorkspaceUploadRequestAssignment$inboundSchema` instead. */ + export const inboundSchema = WorkspaceUploadRequestAssignment$inboundSchema; + /** @deprecated use `WorkspaceUploadRequestAssignment$outboundSchema` instead. */ + export const outboundSchema = WorkspaceUploadRequestAssignment$outboundSchema; + /** @deprecated use `WorkspaceUploadRequestAssignment$Outbound` instead. */ + export type Outbound = WorkspaceUploadRequestAssignment$Outbound; +} + +export function workspaceUploadRequestAssignmentToJSON( + workspaceUploadRequestAssignment: WorkspaceUploadRequestAssignment, +): string { + return JSON.stringify( + WorkspaceUploadRequestAssignment$outboundSchema.parse( + workspaceUploadRequestAssignment, + ), + ); +} + +export function workspaceUploadRequestAssignmentFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => WorkspaceUploadRequestAssignment$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'WorkspaceUploadRequestAssignment' from JSON`, + ); +} diff --git a/src/models/components/workspaceuploadrequestdocument.ts b/src/models/components/workspaceuploadrequestdocument.ts new file mode 100644 index 0000000..58bcda7 --- /dev/null +++ b/src/models/components/workspaceuploadrequestdocument.ts @@ -0,0 +1,89 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type WorkspaceUploadRequestDocument = { + /** + * The document name + */ + documentName?: string | null | undefined; + /** + * The document ID + */ + documentId?: string | null | undefined; +}; + +/** @internal */ +export const WorkspaceUploadRequestDocument$inboundSchema: z.ZodType< + WorkspaceUploadRequestDocument, + z.ZodTypeDef, + unknown +> = z.object({ + document_name: z.nullable(z.string()).optional(), + document_id: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + "document_name": "documentName", + "document_id": "documentId", + }); +}); + +/** @internal */ +export type WorkspaceUploadRequestDocument$Outbound = { + document_name?: string | null | undefined; + document_id?: string | null | undefined; +}; + +/** @internal */ +export const WorkspaceUploadRequestDocument$outboundSchema: z.ZodType< + WorkspaceUploadRequestDocument$Outbound, + z.ZodTypeDef, + WorkspaceUploadRequestDocument +> = z.object({ + documentName: z.nullable(z.string()).optional(), + documentId: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + documentName: "document_name", + documentId: "document_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WorkspaceUploadRequestDocument$ { + /** @deprecated use `WorkspaceUploadRequestDocument$inboundSchema` instead. */ + export const inboundSchema = WorkspaceUploadRequestDocument$inboundSchema; + /** @deprecated use `WorkspaceUploadRequestDocument$outboundSchema` instead. */ + export const outboundSchema = WorkspaceUploadRequestDocument$outboundSchema; + /** @deprecated use `WorkspaceUploadRequestDocument$Outbound` instead. */ + export type Outbound = WorkspaceUploadRequestDocument$Outbound; +} + +export function workspaceUploadRequestDocumentToJSON( + workspaceUploadRequestDocument: WorkspaceUploadRequestDocument, +): string { + return JSON.stringify( + WorkspaceUploadRequestDocument$outboundSchema.parse( + workspaceUploadRequestDocument, + ), + ); +} + +export function workspaceUploadRequestDocumentFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => WorkspaceUploadRequestDocument$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'WorkspaceUploadRequestDocument' from JSON`, + ); +} diff --git a/src/models/components/workspaceuploadrequestowner.ts b/src/models/components/workspaceuploadrequestowner.ts new file mode 100644 index 0000000..f00fdee --- /dev/null +++ b/src/models/components/workspaceuploadrequestowner.ts @@ -0,0 +1,80 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type WorkspaceUploadRequestOwner = { + /** + * The ID of the upload request owner + */ + userId: string; +}; + +/** @internal */ +export const WorkspaceUploadRequestOwner$inboundSchema: z.ZodType< + WorkspaceUploadRequestOwner, + z.ZodTypeDef, + unknown +> = z.object({ + user_id: z.string(), +}).transform((v) => { + return remap$(v, { + "user_id": "userId", + }); +}); + +/** @internal */ +export type WorkspaceUploadRequestOwner$Outbound = { + user_id: string; +}; + +/** @internal */ +export const WorkspaceUploadRequestOwner$outboundSchema: z.ZodType< + WorkspaceUploadRequestOwner$Outbound, + z.ZodTypeDef, + WorkspaceUploadRequestOwner +> = z.object({ + userId: z.string(), +}).transform((v) => { + return remap$(v, { + userId: "user_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WorkspaceUploadRequestOwner$ { + /** @deprecated use `WorkspaceUploadRequestOwner$inboundSchema` instead. */ + export const inboundSchema = WorkspaceUploadRequestOwner$inboundSchema; + /** @deprecated use `WorkspaceUploadRequestOwner$outboundSchema` instead. */ + export const outboundSchema = WorkspaceUploadRequestOwner$outboundSchema; + /** @deprecated use `WorkspaceUploadRequestOwner$Outbound` instead. */ + export type Outbound = WorkspaceUploadRequestOwner$Outbound; +} + +export function workspaceUploadRequestOwnerToJSON( + workspaceUploadRequestOwner: WorkspaceUploadRequestOwner, +): string { + return JSON.stringify( + WorkspaceUploadRequestOwner$outboundSchema.parse( + workspaceUploadRequestOwner, + ), + ); +} + +export function workspaceUploadRequestOwnerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => WorkspaceUploadRequestOwner$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'WorkspaceUploadRequestOwner' from JSON`, + ); +} diff --git a/src/models/components/workspaceuploadrequestresponsibilitytype.ts b/src/models/components/workspaceuploadrequestresponsibilitytype.ts new file mode 100644 index 0000000..0a36b83 --- /dev/null +++ b/src/models/components/workspaceuploadrequestresponsibilitytype.ts @@ -0,0 +1,43 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { ClosedEnum } from "../../types/enums.js"; + +/** + * Enum representing the responsibility type for a workspace upload request assignment + */ +export const WorkspaceUploadRequestResponsibilityType = { + Watcher: "watcher", + Assignee: "assignee", +} as const; +/** + * Enum representing the responsibility type for a workspace upload request assignment + */ +export type WorkspaceUploadRequestResponsibilityType = ClosedEnum< + typeof WorkspaceUploadRequestResponsibilityType +>; + +/** @internal */ +export const WorkspaceUploadRequestResponsibilityType$inboundSchema: + z.ZodNativeEnum = z + .nativeEnum(WorkspaceUploadRequestResponsibilityType); + +/** @internal */ +export const WorkspaceUploadRequestResponsibilityType$outboundSchema: + z.ZodNativeEnum = + WorkspaceUploadRequestResponsibilityType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WorkspaceUploadRequestResponsibilityType$ { + /** @deprecated use `WorkspaceUploadRequestResponsibilityType$inboundSchema` instead. */ + export const inboundSchema = + WorkspaceUploadRequestResponsibilityType$inboundSchema; + /** @deprecated use `WorkspaceUploadRequestResponsibilityType$outboundSchema` instead. */ + export const outboundSchema = + WorkspaceUploadRequestResponsibilityType$outboundSchema; +} diff --git a/src/models/components/workspaceuploadrequeststatus.ts b/src/models/components/workspaceuploadrequeststatus.ts new file mode 100644 index 0000000..40ed672 --- /dev/null +++ b/src/models/components/workspaceuploadrequeststatus.ts @@ -0,0 +1,44 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { ClosedEnum } from "../../types/enums.js"; + +/** + * Enum representing the status of a workspace upload request + */ +export const WorkspaceUploadRequestStatus = { + Draft: "draft", + InProgress: "in_progress", + Overdue: "overdue", + Complete: "complete", + Unknown: "unknown", +} as const; +/** + * Enum representing the status of a workspace upload request + */ +export type WorkspaceUploadRequestStatus = ClosedEnum< + typeof WorkspaceUploadRequestStatus +>; + +/** @internal */ +export const WorkspaceUploadRequestStatus$inboundSchema: z.ZodNativeEnum< + typeof WorkspaceUploadRequestStatus +> = z.nativeEnum(WorkspaceUploadRequestStatus); + +/** @internal */ +export const WorkspaceUploadRequestStatus$outboundSchema: z.ZodNativeEnum< + typeof WorkspaceUploadRequestStatus +> = WorkspaceUploadRequestStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WorkspaceUploadRequestStatus$ { + /** @deprecated use `WorkspaceUploadRequestStatus$inboundSchema` instead. */ + export const inboundSchema = WorkspaceUploadRequestStatus$inboundSchema; + /** @deprecated use `WorkspaceUploadRequestStatus$outboundSchema` instead. */ + export const outboundSchema = WorkspaceUploadRequestStatus$outboundSchema; +} diff --git a/src/models/components/workspaceuserforcreate.ts b/src/models/components/workspaceuserforcreate.ts new file mode 100644 index 0000000..570286b --- /dev/null +++ b/src/models/components/workspaceuserforcreate.ts @@ -0,0 +1,103 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type WorkspaceUserForCreate = { + /** + * The email address of the added user. May be an internal user to the account or an external user + */ + email: string; + /** + * The first name of the added user + */ + firstName: string; + /** + * The last name of the added user + */ + lastName: string; + /** + * The optional Role ID to assign to the user. Defaults to the "Participate" role + */ + roleId?: string | null | undefined; +}; + +/** @internal */ +export const WorkspaceUserForCreate$inboundSchema: z.ZodType< + WorkspaceUserForCreate, + z.ZodTypeDef, + unknown +> = z.object({ + email: z.string(), + first_name: z.string(), + last_name: z.string(), + role_id: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + "first_name": "firstName", + "last_name": "lastName", + "role_id": "roleId", + }); +}); + +/** @internal */ +export type WorkspaceUserForCreate$Outbound = { + email: string; + first_name: string; + last_name: string; + role_id?: string | null | undefined; +}; + +/** @internal */ +export const WorkspaceUserForCreate$outboundSchema: z.ZodType< + WorkspaceUserForCreate$Outbound, + z.ZodTypeDef, + WorkspaceUserForCreate +> = z.object({ + email: z.string(), + firstName: z.string(), + lastName: z.string(), + roleId: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + firstName: "first_name", + lastName: "last_name", + roleId: "role_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WorkspaceUserForCreate$ { + /** @deprecated use `WorkspaceUserForCreate$inboundSchema` instead. */ + export const inboundSchema = WorkspaceUserForCreate$inboundSchema; + /** @deprecated use `WorkspaceUserForCreate$outboundSchema` instead. */ + export const outboundSchema = WorkspaceUserForCreate$outboundSchema; + /** @deprecated use `WorkspaceUserForCreate$Outbound` instead. */ + export type Outbound = WorkspaceUserForCreate$Outbound; +} + +export function workspaceUserForCreateToJSON( + workspaceUserForCreate: WorkspaceUserForCreate, +): string { + return JSON.stringify( + WorkspaceUserForCreate$outboundSchema.parse(workspaceUserForCreate), + ); +} + +export function workspaceUserForCreateFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => WorkspaceUserForCreate$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'WorkspaceUserForCreate' from JSON`, + ); +} diff --git a/src/models/components/workspaceuserforupdate.ts b/src/models/components/workspaceuserforupdate.ts new file mode 100644 index 0000000..4c227d5 --- /dev/null +++ b/src/models/components/workspaceuserforupdate.ts @@ -0,0 +1,78 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type WorkspaceUserForUpdate = { + /** + * The ID of the role to update to + */ + roleId?: string | undefined; +}; + +/** @internal */ +export const WorkspaceUserForUpdate$inboundSchema: z.ZodType< + WorkspaceUserForUpdate, + z.ZodTypeDef, + unknown +> = z.object({ + role_id: z.string().optional(), +}).transform((v) => { + return remap$(v, { + "role_id": "roleId", + }); +}); + +/** @internal */ +export type WorkspaceUserForUpdate$Outbound = { + role_id?: string | undefined; +}; + +/** @internal */ +export const WorkspaceUserForUpdate$outboundSchema: z.ZodType< + WorkspaceUserForUpdate$Outbound, + z.ZodTypeDef, + WorkspaceUserForUpdate +> = z.object({ + roleId: z.string().optional(), +}).transform((v) => { + return remap$(v, { + roleId: "role_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WorkspaceUserForUpdate$ { + /** @deprecated use `WorkspaceUserForUpdate$inboundSchema` instead. */ + export const inboundSchema = WorkspaceUserForUpdate$inboundSchema; + /** @deprecated use `WorkspaceUserForUpdate$outboundSchema` instead. */ + export const outboundSchema = WorkspaceUserForUpdate$outboundSchema; + /** @deprecated use `WorkspaceUserForUpdate$Outbound` instead. */ + export type Outbound = WorkspaceUserForUpdate$Outbound; +} + +export function workspaceUserForUpdateToJSON( + workspaceUserForUpdate: WorkspaceUserForUpdate, +): string { + return JSON.stringify( + WorkspaceUserForUpdate$outboundSchema.parse(workspaceUserForUpdate), + ); +} + +export function workspaceUserForUpdateFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => WorkspaceUserForUpdate$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'WorkspaceUserForUpdate' from JSON`, + ); +} diff --git a/src/models/components/workspaceusersummary.ts b/src/models/components/workspaceusersummary.ts new file mode 100644 index 0000000..c5986df --- /dev/null +++ b/src/models/components/workspaceusersummary.ts @@ -0,0 +1,121 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type WorkspaceUserSummary = { + /** + * The ID of the user + */ + userId?: string | undefined; + /** + * The email of the user + */ + email?: string | null | undefined; + /** + * The first name of the user + */ + firstName?: string | null | undefined; + /** + * The last name of the user + */ + lastName?: string | null | undefined; + /** + * The ID of the users's role + */ + roleId?: string | null | undefined; + /** + * The name of the user's role + */ + roleName?: string | null | undefined; +}; + +/** @internal */ +export const WorkspaceUserSummary$inboundSchema: z.ZodType< + WorkspaceUserSummary, + z.ZodTypeDef, + unknown +> = z.object({ + user_id: z.string().optional(), + email: z.nullable(z.string()).optional(), + first_name: z.nullable(z.string()).optional(), + last_name: z.nullable(z.string()).optional(), + role_id: z.nullable(z.string()).optional(), + role_name: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + "user_id": "userId", + "first_name": "firstName", + "last_name": "lastName", + "role_id": "roleId", + "role_name": "roleName", + }); +}); + +/** @internal */ +export type WorkspaceUserSummary$Outbound = { + user_id?: string | undefined; + email?: string | null | undefined; + first_name?: string | null | undefined; + last_name?: string | null | undefined; + role_id?: string | null | undefined; + role_name?: string | null | undefined; +}; + +/** @internal */ +export const WorkspaceUserSummary$outboundSchema: z.ZodType< + WorkspaceUserSummary$Outbound, + z.ZodTypeDef, + WorkspaceUserSummary +> = z.object({ + userId: z.string().optional(), + email: z.nullable(z.string()).optional(), + firstName: z.nullable(z.string()).optional(), + lastName: z.nullable(z.string()).optional(), + roleId: z.nullable(z.string()).optional(), + roleName: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + userId: "user_id", + firstName: "first_name", + lastName: "last_name", + roleId: "role_id", + roleName: "role_name", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WorkspaceUserSummary$ { + /** @deprecated use `WorkspaceUserSummary$inboundSchema` instead. */ + export const inboundSchema = WorkspaceUserSummary$inboundSchema; + /** @deprecated use `WorkspaceUserSummary$outboundSchema` instead. */ + export const outboundSchema = WorkspaceUserSummary$outboundSchema; + /** @deprecated use `WorkspaceUserSummary$Outbound` instead. */ + export type Outbound = WorkspaceUserSummary$Outbound; +} + +export function workspaceUserSummaryToJSON( + workspaceUserSummary: WorkspaceUserSummary, +): string { + return JSON.stringify( + WorkspaceUserSummary$outboundSchema.parse(workspaceUserSummary), + ); +} + +export function workspaceUserSummaryFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => WorkspaceUserSummary$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'WorkspaceUserSummary' from JSON`, + ); +} diff --git a/src/models/errors/error.ts b/src/models/errors/error.ts index 99910d8..ac4725f 100644 --- a/src/models/errors/error.ts +++ b/src/models/errors/error.ts @@ -16,7 +16,7 @@ export type ErrorTData = { /** * HTTP status code for the error. */ - code?: number | undefined; + code?: string | undefined; /** * The timestamp when the error occurred. */ @@ -34,7 +34,7 @@ export class ErrorT extends IamClientError { /** * HTTP status code for the error. */ - code?: number | undefined; + code?: string | undefined; /** * The timestamp when the error occurred. */ @@ -64,7 +64,7 @@ export class ErrorT extends IamClientError { export const ErrorT$inboundSchema: z.ZodType = z .object({ error: z.string().optional(), - code: z.number().int().optional(), + code: z.string().optional(), timestamp: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), request$: z.instanceof(Request), @@ -82,7 +82,7 @@ export const ErrorT$inboundSchema: z.ZodType = z /** @internal */ export type ErrorT$Outbound = { error?: string | undefined; - code?: number | undefined; + code?: string | undefined; timestamp?: string | undefined; }; @@ -95,7 +95,7 @@ export const ErrorT$outboundSchema: z.ZodType< .transform(v => v.data$) .pipe(z.object({ error: z.string().optional(), - code: z.number().int().optional(), + code: z.string().optional(), timestamp: z.date().transform(v => v.toISOString()).optional(), })); diff --git a/src/models/errors/errordetails.ts b/src/models/errors/errordetails.ts new file mode 100644 index 0000000..30a00d2 --- /dev/null +++ b/src/models/errors/errordetails.ts @@ -0,0 +1,107 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { IamClientError } from "./iamclienterror.js"; + +/** + * The error response object for the Workspaces API + */ +export type ErrorDetailsData = { + /** + * A brief message describing the error condition + */ + message?: string | null | undefined; + /** + * A standardized code that generalizes the specific error + */ + errorCode?: string | null | undefined; +}; + +/** + * The error response object for the Workspaces API + */ +export class ErrorDetails extends IamClientError { + /** + * A standardized code that generalizes the specific error + */ + errorCode?: string | null | undefined; + + /** The original data that was passed to this error instance. */ + data$: ErrorDetailsData; + + constructor( + err: ErrorDetailsData, + httpMeta: { response: Response; request: Request; body: string }, + ) { + const message = err.message || `API error occurred: ${JSON.stringify(err)}`; + super(message, httpMeta); + this.data$ = err; + if (err.errorCode != null) this.errorCode = err.errorCode; + + this.name = "ErrorDetails"; + } +} + +/** @internal */ +export const ErrorDetails$inboundSchema: z.ZodType< + ErrorDetails, + z.ZodTypeDef, + unknown +> = z.object({ + message: z.nullable(z.string()).optional(), + error_code: z.nullable(z.string()).optional(), + request$: z.instanceof(Request), + response$: z.instanceof(Response), + body$: z.string(), +}) + .transform((v) => { + const remapped = remap$(v, { + "error_code": "errorCode", + }); + + return new ErrorDetails(remapped, { + request: v.request$, + response: v.response$, + body: v.body$, + }); + }); + +/** @internal */ +export type ErrorDetails$Outbound = { + message?: string | null | undefined; + error_code?: string | null | undefined; +}; + +/** @internal */ +export const ErrorDetails$outboundSchema: z.ZodType< + ErrorDetails$Outbound, + z.ZodTypeDef, + ErrorDetails +> = z.instanceof(ErrorDetails) + .transform(v => v.data$) + .pipe( + z.object({ + message: z.nullable(z.string()).optional(), + errorCode: z.nullable(z.string()).optional(), + }).transform((v) => { + return remap$(v, { + errorCode: "error_code", + }); + }), + ); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ErrorDetails$ { + /** @deprecated use `ErrorDetails$inboundSchema` instead. */ + export const inboundSchema = ErrorDetails$inboundSchema; + /** @deprecated use `ErrorDetails$outboundSchema` instead. */ + export const outboundSchema = ErrorDetails$outboundSchema; + /** @deprecated use `ErrorDetails$Outbound` instead. */ + export type Outbound = ErrorDetails$Outbound; +} diff --git a/src/models/errors/index.ts b/src/models/errors/index.ts index 9d9a997..f6fc9d4 100644 --- a/src/models/errors/index.ts +++ b/src/models/errors/index.ts @@ -4,6 +4,7 @@ export * from "./apierror.js"; export * from "./error.js"; +export * from "./errordetails.js"; export * from "./httpclienterrors.js"; export * from "./oautherrorresponse.js"; export * from "./responsevalidationerror.js"; diff --git a/src/models/operations/addworkspaceuser.ts b/src/models/operations/addworkspaceuser.ts new file mode 100644 index 0000000..c001900 --- /dev/null +++ b/src/models/operations/addworkspaceuser.ts @@ -0,0 +1,97 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as components from "../components/index.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type AddWorkspaceUserRequest = { + /** + * The ID of the account + */ + accountId: string; + /** + * The ID of the workspace + */ + workspaceId: string; + /** + * The user details + */ + workspaceUserForCreate?: components.WorkspaceUserForCreate | undefined; +}; + +/** @internal */ +export const AddWorkspaceUserRequest$inboundSchema: z.ZodType< + AddWorkspaceUserRequest, + z.ZodTypeDef, + unknown +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + WorkspaceUserForCreate: components.WorkspaceUserForCreate$inboundSchema + .optional(), +}).transform((v) => { + return remap$(v, { + "WorkspaceUserForCreate": "workspaceUserForCreate", + }); +}); + +/** @internal */ +export type AddWorkspaceUserRequest$Outbound = { + accountId: string; + workspaceId: string; + WorkspaceUserForCreate?: + | components.WorkspaceUserForCreate$Outbound + | undefined; +}; + +/** @internal */ +export const AddWorkspaceUserRequest$outboundSchema: z.ZodType< + AddWorkspaceUserRequest$Outbound, + z.ZodTypeDef, + AddWorkspaceUserRequest +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + workspaceUserForCreate: components.WorkspaceUserForCreate$outboundSchema + .optional(), +}).transform((v) => { + return remap$(v, { + workspaceUserForCreate: "WorkspaceUserForCreate", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AddWorkspaceUserRequest$ { + /** @deprecated use `AddWorkspaceUserRequest$inboundSchema` instead. */ + export const inboundSchema = AddWorkspaceUserRequest$inboundSchema; + /** @deprecated use `AddWorkspaceUserRequest$outboundSchema` instead. */ + export const outboundSchema = AddWorkspaceUserRequest$outboundSchema; + /** @deprecated use `AddWorkspaceUserRequest$Outbound` instead. */ + export type Outbound = AddWorkspaceUserRequest$Outbound; +} + +export function addWorkspaceUserRequestToJSON( + addWorkspaceUserRequest: AddWorkspaceUserRequest, +): string { + return JSON.stringify( + AddWorkspaceUserRequest$outboundSchema.parse(addWorkspaceUserRequest), + ); +} + +export function addWorkspaceUserRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AddWorkspaceUserRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AddWorkspaceUserRequest' from JSON`, + ); +} diff --git a/src/models/operations/completeworkspaceuploadrequest.ts b/src/models/operations/completeworkspaceuploadrequest.ts new file mode 100644 index 0000000..3ef68a7 --- /dev/null +++ b/src/models/operations/completeworkspaceuploadrequest.ts @@ -0,0 +1,88 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type CompleteWorkspaceUploadRequestRequest = { + /** + * The ID of the account + */ + accountId: string; + /** + * The ID of the workspace + */ + workspaceId: string; + /** + * The ID of the upload request to complete + */ + uploadRequestId: string; +}; + +/** @internal */ +export const CompleteWorkspaceUploadRequestRequest$inboundSchema: z.ZodType< + CompleteWorkspaceUploadRequestRequest, + z.ZodTypeDef, + unknown +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + uploadRequestId: z.string(), +}); + +/** @internal */ +export type CompleteWorkspaceUploadRequestRequest$Outbound = { + accountId: string; + workspaceId: string; + uploadRequestId: string; +}; + +/** @internal */ +export const CompleteWorkspaceUploadRequestRequest$outboundSchema: z.ZodType< + CompleteWorkspaceUploadRequestRequest$Outbound, + z.ZodTypeDef, + CompleteWorkspaceUploadRequestRequest +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + uploadRequestId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CompleteWorkspaceUploadRequestRequest$ { + /** @deprecated use `CompleteWorkspaceUploadRequestRequest$inboundSchema` instead. */ + export const inboundSchema = + CompleteWorkspaceUploadRequestRequest$inboundSchema; + /** @deprecated use `CompleteWorkspaceUploadRequestRequest$outboundSchema` instead. */ + export const outboundSchema = + CompleteWorkspaceUploadRequestRequest$outboundSchema; + /** @deprecated use `CompleteWorkspaceUploadRequestRequest$Outbound` instead. */ + export type Outbound = CompleteWorkspaceUploadRequestRequest$Outbound; +} + +export function completeWorkspaceUploadRequestRequestToJSON( + completeWorkspaceUploadRequestRequest: CompleteWorkspaceUploadRequestRequest, +): string { + return JSON.stringify( + CompleteWorkspaceUploadRequestRequest$outboundSchema.parse( + completeWorkspaceUploadRequestRequest, + ), + ); +} + +export function completeWorkspaceUploadRequestRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + CompleteWorkspaceUploadRequestRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CompleteWorkspaceUploadRequestRequest' from JSON`, + ); +} diff --git a/src/models/operations/createworkspace.ts b/src/models/operations/createworkspace.ts new file mode 100644 index 0000000..b32eeef --- /dev/null +++ b/src/models/operations/createworkspace.ts @@ -0,0 +1,86 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as components from "../components/index.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type CreateWorkspaceRequest = { + /** + * The ID of the account + */ + accountId: string; + /** + * The details of the workspace to be created including the name + */ + createWorkspaceBody: components.CreateWorkspaceBody; +}; + +/** @internal */ +export const CreateWorkspaceRequest$inboundSchema: z.ZodType< + CreateWorkspaceRequest, + z.ZodTypeDef, + unknown +> = z.object({ + accountId: z.string(), + CreateWorkspaceBody: components.CreateWorkspaceBody$inboundSchema, +}).transform((v) => { + return remap$(v, { + "CreateWorkspaceBody": "createWorkspaceBody", + }); +}); + +/** @internal */ +export type CreateWorkspaceRequest$Outbound = { + accountId: string; + CreateWorkspaceBody: components.CreateWorkspaceBody$Outbound; +}; + +/** @internal */ +export const CreateWorkspaceRequest$outboundSchema: z.ZodType< + CreateWorkspaceRequest$Outbound, + z.ZodTypeDef, + CreateWorkspaceRequest +> = z.object({ + accountId: z.string(), + createWorkspaceBody: components.CreateWorkspaceBody$outboundSchema, +}).transform((v) => { + return remap$(v, { + createWorkspaceBody: "CreateWorkspaceBody", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateWorkspaceRequest$ { + /** @deprecated use `CreateWorkspaceRequest$inboundSchema` instead. */ + export const inboundSchema = CreateWorkspaceRequest$inboundSchema; + /** @deprecated use `CreateWorkspaceRequest$outboundSchema` instead. */ + export const outboundSchema = CreateWorkspaceRequest$outboundSchema; + /** @deprecated use `CreateWorkspaceRequest$Outbound` instead. */ + export type Outbound = CreateWorkspaceRequest$Outbound; +} + +export function createWorkspaceRequestToJSON( + createWorkspaceRequest: CreateWorkspaceRequest, +): string { + return JSON.stringify( + CreateWorkspaceRequest$outboundSchema.parse(createWorkspaceRequest), + ); +} + +export function createWorkspaceRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreateWorkspaceRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreateWorkspaceRequest' from JSON`, + ); +} diff --git a/src/models/operations/createworkspaceenvelope.ts b/src/models/operations/createworkspaceenvelope.ts new file mode 100644 index 0000000..e1ac467 --- /dev/null +++ b/src/models/operations/createworkspaceenvelope.ts @@ -0,0 +1,97 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as components from "../components/index.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type CreateWorkspaceEnvelopeRequest = { + /** + * The ID of the account + */ + accountId: string; + /** + * The ID of the workspace + */ + workspaceId: string; + /** + * The details of the envelope to be created including the list of document IDs to add to the envelope + */ + workspaceEnvelopeForCreate: components.WorkspaceEnvelopeForCreate; +}; + +/** @internal */ +export const CreateWorkspaceEnvelopeRequest$inboundSchema: z.ZodType< + CreateWorkspaceEnvelopeRequest, + z.ZodTypeDef, + unknown +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + WorkspaceEnvelopeForCreate: + components.WorkspaceEnvelopeForCreate$inboundSchema, +}).transform((v) => { + return remap$(v, { + "WorkspaceEnvelopeForCreate": "workspaceEnvelopeForCreate", + }); +}); + +/** @internal */ +export type CreateWorkspaceEnvelopeRequest$Outbound = { + accountId: string; + workspaceId: string; + WorkspaceEnvelopeForCreate: components.WorkspaceEnvelopeForCreate$Outbound; +}; + +/** @internal */ +export const CreateWorkspaceEnvelopeRequest$outboundSchema: z.ZodType< + CreateWorkspaceEnvelopeRequest$Outbound, + z.ZodTypeDef, + CreateWorkspaceEnvelopeRequest +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + workspaceEnvelopeForCreate: + components.WorkspaceEnvelopeForCreate$outboundSchema, +}).transform((v) => { + return remap$(v, { + workspaceEnvelopeForCreate: "WorkspaceEnvelopeForCreate", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateWorkspaceEnvelopeRequest$ { + /** @deprecated use `CreateWorkspaceEnvelopeRequest$inboundSchema` instead. */ + export const inboundSchema = CreateWorkspaceEnvelopeRequest$inboundSchema; + /** @deprecated use `CreateWorkspaceEnvelopeRequest$outboundSchema` instead. */ + export const outboundSchema = CreateWorkspaceEnvelopeRequest$outboundSchema; + /** @deprecated use `CreateWorkspaceEnvelopeRequest$Outbound` instead. */ + export type Outbound = CreateWorkspaceEnvelopeRequest$Outbound; +} + +export function createWorkspaceEnvelopeRequestToJSON( + createWorkspaceEnvelopeRequest: CreateWorkspaceEnvelopeRequest, +): string { + return JSON.stringify( + CreateWorkspaceEnvelopeRequest$outboundSchema.parse( + createWorkspaceEnvelopeRequest, + ), + ); +} + +export function createWorkspaceEnvelopeRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreateWorkspaceEnvelopeRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreateWorkspaceEnvelopeRequest' from JSON`, + ); +} diff --git a/src/models/operations/createworkspaceuploadrequest.ts b/src/models/operations/createworkspaceuploadrequest.ts new file mode 100644 index 0000000..373c846 --- /dev/null +++ b/src/models/operations/createworkspaceuploadrequest.ts @@ -0,0 +1,101 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as components from "../components/index.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type CreateWorkspaceUploadRequestRequest = { + /** + * The ID of the account + */ + accountId: string; + /** + * The ID of the workspace + */ + workspaceId: string; + /** + * The upload request details including name, description, assignments, and status + */ + createWorkspaceUploadRequestBody: components.CreateWorkspaceUploadRequestBody; +}; + +/** @internal */ +export const CreateWorkspaceUploadRequestRequest$inboundSchema: z.ZodType< + CreateWorkspaceUploadRequestRequest, + z.ZodTypeDef, + unknown +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + CreateWorkspaceUploadRequestBody: + components.CreateWorkspaceUploadRequestBody$inboundSchema, +}).transform((v) => { + return remap$(v, { + "CreateWorkspaceUploadRequestBody": "createWorkspaceUploadRequestBody", + }); +}); + +/** @internal */ +export type CreateWorkspaceUploadRequestRequest$Outbound = { + accountId: string; + workspaceId: string; + CreateWorkspaceUploadRequestBody: + components.CreateWorkspaceUploadRequestBody$Outbound; +}; + +/** @internal */ +export const CreateWorkspaceUploadRequestRequest$outboundSchema: z.ZodType< + CreateWorkspaceUploadRequestRequest$Outbound, + z.ZodTypeDef, + CreateWorkspaceUploadRequestRequest +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + createWorkspaceUploadRequestBody: + components.CreateWorkspaceUploadRequestBody$outboundSchema, +}).transform((v) => { + return remap$(v, { + createWorkspaceUploadRequestBody: "CreateWorkspaceUploadRequestBody", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateWorkspaceUploadRequestRequest$ { + /** @deprecated use `CreateWorkspaceUploadRequestRequest$inboundSchema` instead. */ + export const inboundSchema = + CreateWorkspaceUploadRequestRequest$inboundSchema; + /** @deprecated use `CreateWorkspaceUploadRequestRequest$outboundSchema` instead. */ + export const outboundSchema = + CreateWorkspaceUploadRequestRequest$outboundSchema; + /** @deprecated use `CreateWorkspaceUploadRequestRequest$Outbound` instead. */ + export type Outbound = CreateWorkspaceUploadRequestRequest$Outbound; +} + +export function createWorkspaceUploadRequestRequestToJSON( + createWorkspaceUploadRequestRequest: CreateWorkspaceUploadRequestRequest, +): string { + return JSON.stringify( + CreateWorkspaceUploadRequestRequest$outboundSchema.parse( + createWorkspaceUploadRequestRequest, + ), + ); +} + +export function createWorkspaceUploadRequestRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + CreateWorkspaceUploadRequestRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreateWorkspaceUploadRequestRequest' from JSON`, + ); +} diff --git a/src/models/operations/deleteworkspacedocument.ts b/src/models/operations/deleteworkspacedocument.ts new file mode 100644 index 0000000..a94d388 --- /dev/null +++ b/src/models/operations/deleteworkspacedocument.ts @@ -0,0 +1,85 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type DeleteWorkspaceDocumentRequest = { + /** + * The ID of the account + */ + accountId: string; + /** + * The ID of the workspace + */ + workspaceId: string; + /** + * The ID of the document + */ + documentId: string; +}; + +/** @internal */ +export const DeleteWorkspaceDocumentRequest$inboundSchema: z.ZodType< + DeleteWorkspaceDocumentRequest, + z.ZodTypeDef, + unknown +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + documentId: z.string(), +}); + +/** @internal */ +export type DeleteWorkspaceDocumentRequest$Outbound = { + accountId: string; + workspaceId: string; + documentId: string; +}; + +/** @internal */ +export const DeleteWorkspaceDocumentRequest$outboundSchema: z.ZodType< + DeleteWorkspaceDocumentRequest$Outbound, + z.ZodTypeDef, + DeleteWorkspaceDocumentRequest +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + documentId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DeleteWorkspaceDocumentRequest$ { + /** @deprecated use `DeleteWorkspaceDocumentRequest$inboundSchema` instead. */ + export const inboundSchema = DeleteWorkspaceDocumentRequest$inboundSchema; + /** @deprecated use `DeleteWorkspaceDocumentRequest$outboundSchema` instead. */ + export const outboundSchema = DeleteWorkspaceDocumentRequest$outboundSchema; + /** @deprecated use `DeleteWorkspaceDocumentRequest$Outbound` instead. */ + export type Outbound = DeleteWorkspaceDocumentRequest$Outbound; +} + +export function deleteWorkspaceDocumentRequestToJSON( + deleteWorkspaceDocumentRequest: DeleteWorkspaceDocumentRequest, +): string { + return JSON.stringify( + DeleteWorkspaceDocumentRequest$outboundSchema.parse( + deleteWorkspaceDocumentRequest, + ), + ); +} + +export function deleteWorkspaceDocumentRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => DeleteWorkspaceDocumentRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'DeleteWorkspaceDocumentRequest' from JSON`, + ); +} diff --git a/src/models/operations/deleteworkspaceuploadrequest.ts b/src/models/operations/deleteworkspaceuploadrequest.ts new file mode 100644 index 0000000..0aa6331 --- /dev/null +++ b/src/models/operations/deleteworkspaceuploadrequest.ts @@ -0,0 +1,88 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type DeleteWorkspaceUploadRequestRequest = { + /** + * The ID of the account + */ + accountId: string; + /** + * The ID of the workspace + */ + workspaceId: string; + /** + * The ID of the upload request to delete + */ + uploadRequestId: string; +}; + +/** @internal */ +export const DeleteWorkspaceUploadRequestRequest$inboundSchema: z.ZodType< + DeleteWorkspaceUploadRequestRequest, + z.ZodTypeDef, + unknown +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + uploadRequestId: z.string(), +}); + +/** @internal */ +export type DeleteWorkspaceUploadRequestRequest$Outbound = { + accountId: string; + workspaceId: string; + uploadRequestId: string; +}; + +/** @internal */ +export const DeleteWorkspaceUploadRequestRequest$outboundSchema: z.ZodType< + DeleteWorkspaceUploadRequestRequest$Outbound, + z.ZodTypeDef, + DeleteWorkspaceUploadRequestRequest +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + uploadRequestId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DeleteWorkspaceUploadRequestRequest$ { + /** @deprecated use `DeleteWorkspaceUploadRequestRequest$inboundSchema` instead. */ + export const inboundSchema = + DeleteWorkspaceUploadRequestRequest$inboundSchema; + /** @deprecated use `DeleteWorkspaceUploadRequestRequest$outboundSchema` instead. */ + export const outboundSchema = + DeleteWorkspaceUploadRequestRequest$outboundSchema; + /** @deprecated use `DeleteWorkspaceUploadRequestRequest$Outbound` instead. */ + export type Outbound = DeleteWorkspaceUploadRequestRequest$Outbound; +} + +export function deleteWorkspaceUploadRequestRequestToJSON( + deleteWorkspaceUploadRequestRequest: DeleteWorkspaceUploadRequestRequest, +): string { + return JSON.stringify( + DeleteWorkspaceUploadRequestRequest$outboundSchema.parse( + deleteWorkspaceUploadRequestRequest, + ), + ); +} + +export function deleteWorkspaceUploadRequestRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + DeleteWorkspaceUploadRequestRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'DeleteWorkspaceUploadRequestRequest' from JSON`, + ); +} diff --git a/src/models/operations/getworkspace.ts b/src/models/operations/getworkspace.ts new file mode 100644 index 0000000..13894df --- /dev/null +++ b/src/models/operations/getworkspace.ts @@ -0,0 +1,76 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type GetWorkspaceRequest = { + /** + * The ID of the account + */ + accountId: string; + /** + * The ID of the workspace + */ + workspaceId: string; +}; + +/** @internal */ +export const GetWorkspaceRequest$inboundSchema: z.ZodType< + GetWorkspaceRequest, + z.ZodTypeDef, + unknown +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), +}); + +/** @internal */ +export type GetWorkspaceRequest$Outbound = { + accountId: string; + workspaceId: string; +}; + +/** @internal */ +export const GetWorkspaceRequest$outboundSchema: z.ZodType< + GetWorkspaceRequest$Outbound, + z.ZodTypeDef, + GetWorkspaceRequest +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspaceRequest$ { + /** @deprecated use `GetWorkspaceRequest$inboundSchema` instead. */ + export const inboundSchema = GetWorkspaceRequest$inboundSchema; + /** @deprecated use `GetWorkspaceRequest$outboundSchema` instead. */ + export const outboundSchema = GetWorkspaceRequest$outboundSchema; + /** @deprecated use `GetWorkspaceRequest$Outbound` instead. */ + export type Outbound = GetWorkspaceRequest$Outbound; +} + +export function getWorkspaceRequestToJSON( + getWorkspaceRequest: GetWorkspaceRequest, +): string { + return JSON.stringify( + GetWorkspaceRequest$outboundSchema.parse(getWorkspaceRequest), + ); +} + +export function getWorkspaceRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceRequest' from JSON`, + ); +} diff --git a/src/models/operations/getworkspaceassignableroles.ts b/src/models/operations/getworkspaceassignableroles.ts new file mode 100644 index 0000000..7d35dd7 --- /dev/null +++ b/src/models/operations/getworkspaceassignableroles.ts @@ -0,0 +1,110 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type GetWorkspaceAssignableRolesRequest = { + /** + * The ID of the account + */ + accountId: string; + /** + * The ID of the workspace + */ + workspaceId: string; + /** + * A search filter that returns assignable roles by the beginning of the role name + */ + filter?: string | undefined; + /** + * The index position within the total result set from which to start returning values. The default value is 0 + */ + startPosition?: number | undefined; + /** + * The number of results to return. This value must be a number between 1 and 100 (default) + */ + count?: number | undefined; +}; + +/** @internal */ +export const GetWorkspaceAssignableRolesRequest$inboundSchema: z.ZodType< + GetWorkspaceAssignableRolesRequest, + z.ZodTypeDef, + unknown +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + filter: z.string().optional(), + start_position: z.number().int().optional(), + count: z.number().int().optional(), +}).transform((v) => { + return remap$(v, { + "start_position": "startPosition", + }); +}); + +/** @internal */ +export type GetWorkspaceAssignableRolesRequest$Outbound = { + accountId: string; + workspaceId: string; + filter?: string | undefined; + start_position?: number | undefined; + count?: number | undefined; +}; + +/** @internal */ +export const GetWorkspaceAssignableRolesRequest$outboundSchema: z.ZodType< + GetWorkspaceAssignableRolesRequest$Outbound, + z.ZodTypeDef, + GetWorkspaceAssignableRolesRequest +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + filter: z.string().optional(), + startPosition: z.number().int().optional(), + count: z.number().int().optional(), +}).transform((v) => { + return remap$(v, { + startPosition: "start_position", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspaceAssignableRolesRequest$ { + /** @deprecated use `GetWorkspaceAssignableRolesRequest$inboundSchema` instead. */ + export const inboundSchema = GetWorkspaceAssignableRolesRequest$inboundSchema; + /** @deprecated use `GetWorkspaceAssignableRolesRequest$outboundSchema` instead. */ + export const outboundSchema = + GetWorkspaceAssignableRolesRequest$outboundSchema; + /** @deprecated use `GetWorkspaceAssignableRolesRequest$Outbound` instead. */ + export type Outbound = GetWorkspaceAssignableRolesRequest$Outbound; +} + +export function getWorkspaceAssignableRolesRequestToJSON( + getWorkspaceAssignableRolesRequest: GetWorkspaceAssignableRolesRequest, +): string { + return JSON.stringify( + GetWorkspaceAssignableRolesRequest$outboundSchema.parse( + getWorkspaceAssignableRolesRequest, + ), + ); +} + +export function getWorkspaceAssignableRolesRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetWorkspaceAssignableRolesRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceAssignableRolesRequest' from JSON`, + ); +} diff --git a/src/models/operations/getworkspacedocument.ts b/src/models/operations/getworkspacedocument.ts new file mode 100644 index 0000000..7d831e2 --- /dev/null +++ b/src/models/operations/getworkspacedocument.ts @@ -0,0 +1,85 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type GetWorkspaceDocumentRequest = { + /** + * The ID of the account + */ + accountId: string; + /** + * The ID of the workspace + */ + workspaceId: string; + /** + * The ID of the document + */ + documentId: string; +}; + +/** @internal */ +export const GetWorkspaceDocumentRequest$inboundSchema: z.ZodType< + GetWorkspaceDocumentRequest, + z.ZodTypeDef, + unknown +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + documentId: z.string(), +}); + +/** @internal */ +export type GetWorkspaceDocumentRequest$Outbound = { + accountId: string; + workspaceId: string; + documentId: string; +}; + +/** @internal */ +export const GetWorkspaceDocumentRequest$outboundSchema: z.ZodType< + GetWorkspaceDocumentRequest$Outbound, + z.ZodTypeDef, + GetWorkspaceDocumentRequest +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + documentId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspaceDocumentRequest$ { + /** @deprecated use `GetWorkspaceDocumentRequest$inboundSchema` instead. */ + export const inboundSchema = GetWorkspaceDocumentRequest$inboundSchema; + /** @deprecated use `GetWorkspaceDocumentRequest$outboundSchema` instead. */ + export const outboundSchema = GetWorkspaceDocumentRequest$outboundSchema; + /** @deprecated use `GetWorkspaceDocumentRequest$Outbound` instead. */ + export type Outbound = GetWorkspaceDocumentRequest$Outbound; +} + +export function getWorkspaceDocumentRequestToJSON( + getWorkspaceDocumentRequest: GetWorkspaceDocumentRequest, +): string { + return JSON.stringify( + GetWorkspaceDocumentRequest$outboundSchema.parse( + getWorkspaceDocumentRequest, + ), + ); +} + +export function getWorkspaceDocumentRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceDocumentRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceDocumentRequest' from JSON`, + ); +} diff --git a/src/models/operations/getworkspacedocumentcontents.ts b/src/models/operations/getworkspacedocumentcontents.ts new file mode 100644 index 0000000..94a0a83 --- /dev/null +++ b/src/models/operations/getworkspacedocumentcontents.ts @@ -0,0 +1,88 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type GetWorkspaceDocumentContentsRequest = { + /** + * The ID of the account + */ + accountId: string; + /** + * The ID of the workspace + */ + workspaceId: string; + /** + * The ID of the document + */ + documentId: string; +}; + +/** @internal */ +export const GetWorkspaceDocumentContentsRequest$inboundSchema: z.ZodType< + GetWorkspaceDocumentContentsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + documentId: z.string(), +}); + +/** @internal */ +export type GetWorkspaceDocumentContentsRequest$Outbound = { + accountId: string; + workspaceId: string; + documentId: string; +}; + +/** @internal */ +export const GetWorkspaceDocumentContentsRequest$outboundSchema: z.ZodType< + GetWorkspaceDocumentContentsRequest$Outbound, + z.ZodTypeDef, + GetWorkspaceDocumentContentsRequest +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + documentId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspaceDocumentContentsRequest$ { + /** @deprecated use `GetWorkspaceDocumentContentsRequest$inboundSchema` instead. */ + export const inboundSchema = + GetWorkspaceDocumentContentsRequest$inboundSchema; + /** @deprecated use `GetWorkspaceDocumentContentsRequest$outboundSchema` instead. */ + export const outboundSchema = + GetWorkspaceDocumentContentsRequest$outboundSchema; + /** @deprecated use `GetWorkspaceDocumentContentsRequest$Outbound` instead. */ + export type Outbound = GetWorkspaceDocumentContentsRequest$Outbound; +} + +export function getWorkspaceDocumentContentsRequestToJSON( + getWorkspaceDocumentContentsRequest: GetWorkspaceDocumentContentsRequest, +): string { + return JSON.stringify( + GetWorkspaceDocumentContentsRequest$outboundSchema.parse( + getWorkspaceDocumentContentsRequest, + ), + ); +} + +export function getWorkspaceDocumentContentsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetWorkspaceDocumentContentsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceDocumentContentsRequest' from JSON`, + ); +} diff --git a/src/models/operations/getworkspacedocuments.ts b/src/models/operations/getworkspacedocuments.ts new file mode 100644 index 0000000..fea6f08 --- /dev/null +++ b/src/models/operations/getworkspacedocuments.ts @@ -0,0 +1,110 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type GetWorkspaceDocumentsRequest = { + /** + * The ID of the account + */ + accountId: string; + /** + * The ID of the workspace + */ + workspaceId: string; + /** + * Number of documents to return. Defaults to the maximum which is 100 + */ + count?: number | undefined; + /** + * Position of the first item in the total results. Defaults to 0 + */ + startPosition?: number | undefined; + /** + * Filter documents where Name contains the filter. Defaults to null, to not filter + */ + nameFilter?: string | undefined; +}; + +/** @internal */ +export const GetWorkspaceDocumentsRequest$inboundSchema: z.ZodType< + GetWorkspaceDocumentsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + count: z.number().int().optional(), + start_position: z.number().int().optional(), + name_filter: z.string().optional(), +}).transform((v) => { + return remap$(v, { + "start_position": "startPosition", + "name_filter": "nameFilter", + }); +}); + +/** @internal */ +export type GetWorkspaceDocumentsRequest$Outbound = { + accountId: string; + workspaceId: string; + count?: number | undefined; + start_position?: number | undefined; + name_filter?: string | undefined; +}; + +/** @internal */ +export const GetWorkspaceDocumentsRequest$outboundSchema: z.ZodType< + GetWorkspaceDocumentsRequest$Outbound, + z.ZodTypeDef, + GetWorkspaceDocumentsRequest +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + count: z.number().int().optional(), + startPosition: z.number().int().optional(), + nameFilter: z.string().optional(), +}).transform((v) => { + return remap$(v, { + startPosition: "start_position", + nameFilter: "name_filter", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspaceDocumentsRequest$ { + /** @deprecated use `GetWorkspaceDocumentsRequest$inboundSchema` instead. */ + export const inboundSchema = GetWorkspaceDocumentsRequest$inboundSchema; + /** @deprecated use `GetWorkspaceDocumentsRequest$outboundSchema` instead. */ + export const outboundSchema = GetWorkspaceDocumentsRequest$outboundSchema; + /** @deprecated use `GetWorkspaceDocumentsRequest$Outbound` instead. */ + export type Outbound = GetWorkspaceDocumentsRequest$Outbound; +} + +export function getWorkspaceDocumentsRequestToJSON( + getWorkspaceDocumentsRequest: GetWorkspaceDocumentsRequest, +): string { + return JSON.stringify( + GetWorkspaceDocumentsRequest$outboundSchema.parse( + getWorkspaceDocumentsRequest, + ), + ); +} + +export function getWorkspaceDocumentsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceDocumentsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceDocumentsRequest' from JSON`, + ); +} diff --git a/src/models/operations/getworkspaceenvelopes.ts b/src/models/operations/getworkspaceenvelopes.ts new file mode 100644 index 0000000..be4bea1 --- /dev/null +++ b/src/models/operations/getworkspaceenvelopes.ts @@ -0,0 +1,78 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type GetWorkspaceEnvelopesRequest = { + /** + * The ID of the account + */ + accountId: string; + /** + * The ID of the workspace + */ + workspaceId: string; +}; + +/** @internal */ +export const GetWorkspaceEnvelopesRequest$inboundSchema: z.ZodType< + GetWorkspaceEnvelopesRequest, + z.ZodTypeDef, + unknown +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), +}); + +/** @internal */ +export type GetWorkspaceEnvelopesRequest$Outbound = { + accountId: string; + workspaceId: string; +}; + +/** @internal */ +export const GetWorkspaceEnvelopesRequest$outboundSchema: z.ZodType< + GetWorkspaceEnvelopesRequest$Outbound, + z.ZodTypeDef, + GetWorkspaceEnvelopesRequest +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspaceEnvelopesRequest$ { + /** @deprecated use `GetWorkspaceEnvelopesRequest$inboundSchema` instead. */ + export const inboundSchema = GetWorkspaceEnvelopesRequest$inboundSchema; + /** @deprecated use `GetWorkspaceEnvelopesRequest$outboundSchema` instead. */ + export const outboundSchema = GetWorkspaceEnvelopesRequest$outboundSchema; + /** @deprecated use `GetWorkspaceEnvelopesRequest$Outbound` instead. */ + export type Outbound = GetWorkspaceEnvelopesRequest$Outbound; +} + +export function getWorkspaceEnvelopesRequestToJSON( + getWorkspaceEnvelopesRequest: GetWorkspaceEnvelopesRequest, +): string { + return JSON.stringify( + GetWorkspaceEnvelopesRequest$outboundSchema.parse( + getWorkspaceEnvelopesRequest, + ), + ); +} + +export function getWorkspaceEnvelopesRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceEnvelopesRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceEnvelopesRequest' from JSON`, + ); +} diff --git a/src/models/operations/getworkspaces.ts b/src/models/operations/getworkspaces.ts new file mode 100644 index 0000000..c1f4065 --- /dev/null +++ b/src/models/operations/getworkspaces.ts @@ -0,0 +1,92 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type GetWorkspacesRequest = { + /** + * The ID of the account + */ + accountId: string; + /** + * Number of workspaces to return. Defaults to the maximum which is 100 + */ + count?: number | undefined; + /** + * Position of the first item in the total results. Defaults to 0 + */ + startPosition?: number | undefined; +}; + +/** @internal */ +export const GetWorkspacesRequest$inboundSchema: z.ZodType< + GetWorkspacesRequest, + z.ZodTypeDef, + unknown +> = z.object({ + accountId: z.string(), + count: z.number().int().optional(), + start_position: z.number().int().optional(), +}).transform((v) => { + return remap$(v, { + "start_position": "startPosition", + }); +}); + +/** @internal */ +export type GetWorkspacesRequest$Outbound = { + accountId: string; + count?: number | undefined; + start_position?: number | undefined; +}; + +/** @internal */ +export const GetWorkspacesRequest$outboundSchema: z.ZodType< + GetWorkspacesRequest$Outbound, + z.ZodTypeDef, + GetWorkspacesRequest +> = z.object({ + accountId: z.string(), + count: z.number().int().optional(), + startPosition: z.number().int().optional(), +}).transform((v) => { + return remap$(v, { + startPosition: "start_position", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspacesRequest$ { + /** @deprecated use `GetWorkspacesRequest$inboundSchema` instead. */ + export const inboundSchema = GetWorkspacesRequest$inboundSchema; + /** @deprecated use `GetWorkspacesRequest$outboundSchema` instead. */ + export const outboundSchema = GetWorkspacesRequest$outboundSchema; + /** @deprecated use `GetWorkspacesRequest$Outbound` instead. */ + export type Outbound = GetWorkspacesRequest$Outbound; +} + +export function getWorkspacesRequestToJSON( + getWorkspacesRequest: GetWorkspacesRequest, +): string { + return JSON.stringify( + GetWorkspacesRequest$outboundSchema.parse(getWorkspacesRequest), + ); +} + +export function getWorkspacesRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspacesRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspacesRequest' from JSON`, + ); +} diff --git a/src/models/operations/getworkspaceuploadrequest.ts b/src/models/operations/getworkspaceuploadrequest.ts new file mode 100644 index 0000000..64c6772 --- /dev/null +++ b/src/models/operations/getworkspaceuploadrequest.ts @@ -0,0 +1,85 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type GetWorkspaceUploadRequestRequest = { + /** + * The ID of the account + */ + accountId: string; + /** + * The ID of the workspace + */ + workspaceId: string; + /** + * The ID of the upload request + */ + uploadRequestId: string; +}; + +/** @internal */ +export const GetWorkspaceUploadRequestRequest$inboundSchema: z.ZodType< + GetWorkspaceUploadRequestRequest, + z.ZodTypeDef, + unknown +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + uploadRequestId: z.string(), +}); + +/** @internal */ +export type GetWorkspaceUploadRequestRequest$Outbound = { + accountId: string; + workspaceId: string; + uploadRequestId: string; +}; + +/** @internal */ +export const GetWorkspaceUploadRequestRequest$outboundSchema: z.ZodType< + GetWorkspaceUploadRequestRequest$Outbound, + z.ZodTypeDef, + GetWorkspaceUploadRequestRequest +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + uploadRequestId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspaceUploadRequestRequest$ { + /** @deprecated use `GetWorkspaceUploadRequestRequest$inboundSchema` instead. */ + export const inboundSchema = GetWorkspaceUploadRequestRequest$inboundSchema; + /** @deprecated use `GetWorkspaceUploadRequestRequest$outboundSchema` instead. */ + export const outboundSchema = GetWorkspaceUploadRequestRequest$outboundSchema; + /** @deprecated use `GetWorkspaceUploadRequestRequest$Outbound` instead. */ + export type Outbound = GetWorkspaceUploadRequestRequest$Outbound; +} + +export function getWorkspaceUploadRequestRequestToJSON( + getWorkspaceUploadRequestRequest: GetWorkspaceUploadRequestRequest, +): string { + return JSON.stringify( + GetWorkspaceUploadRequestRequest$outboundSchema.parse( + getWorkspaceUploadRequestRequest, + ), + ); +} + +export function getWorkspaceUploadRequestRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceUploadRequestRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceUploadRequestRequest' from JSON`, + ); +} diff --git a/src/models/operations/getworkspaceuploadrequests.ts b/src/models/operations/getworkspaceuploadrequests.ts new file mode 100644 index 0000000..f7a9358 --- /dev/null +++ b/src/models/operations/getworkspaceuploadrequests.ts @@ -0,0 +1,79 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type GetWorkspaceUploadRequestsRequest = { + /** + * The ID of the account + */ + accountId: string; + /** + * The ID of the workspace + */ + workspaceId: string; +}; + +/** @internal */ +export const GetWorkspaceUploadRequestsRequest$inboundSchema: z.ZodType< + GetWorkspaceUploadRequestsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), +}); + +/** @internal */ +export type GetWorkspaceUploadRequestsRequest$Outbound = { + accountId: string; + workspaceId: string; +}; + +/** @internal */ +export const GetWorkspaceUploadRequestsRequest$outboundSchema: z.ZodType< + GetWorkspaceUploadRequestsRequest$Outbound, + z.ZodTypeDef, + GetWorkspaceUploadRequestsRequest +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspaceUploadRequestsRequest$ { + /** @deprecated use `GetWorkspaceUploadRequestsRequest$inboundSchema` instead. */ + export const inboundSchema = GetWorkspaceUploadRequestsRequest$inboundSchema; + /** @deprecated use `GetWorkspaceUploadRequestsRequest$outboundSchema` instead. */ + export const outboundSchema = + GetWorkspaceUploadRequestsRequest$outboundSchema; + /** @deprecated use `GetWorkspaceUploadRequestsRequest$Outbound` instead. */ + export type Outbound = GetWorkspaceUploadRequestsRequest$Outbound; +} + +export function getWorkspaceUploadRequestsRequestToJSON( + getWorkspaceUploadRequestsRequest: GetWorkspaceUploadRequestsRequest, +): string { + return JSON.stringify( + GetWorkspaceUploadRequestsRequest$outboundSchema.parse( + getWorkspaceUploadRequestsRequest, + ), + ); +} + +export function getWorkspaceUploadRequestsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceUploadRequestsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceUploadRequestsRequest' from JSON`, + ); +} diff --git a/src/models/operations/getworkspaceusers.ts b/src/models/operations/getworkspaceusers.ts new file mode 100644 index 0000000..95530ec --- /dev/null +++ b/src/models/operations/getworkspaceusers.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as components from "../components/index.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type GetWorkspaceUsersRequest = { + /** + * The ID of the account + */ + accountId: string; + /** + * The ID of the workspace + */ + workspaceId: string; + /** + * Number of workspace users to return. Defaults to the maximum which is 100. + */ + count?: number | undefined; + /** + * Position of the first item in the total results. Defaults to 0. + */ + startPosition?: number | undefined; + /** + * Returns workspace users filtered by Name and Email + */ + filter?: string | undefined; + /** + * Sorts results. Options are `first_name_asc`, `first_name_desc`, `last_name_asc`, `last_name_desc`, `email_asc`, `email_desc`. Defaults to `last_name_desc` + */ + sort?: components.GetWorkspaceUsersSortingOption | undefined; +}; + +/** @internal */ +export const GetWorkspaceUsersRequest$inboundSchema: z.ZodType< + GetWorkspaceUsersRequest, + z.ZodTypeDef, + unknown +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + count: z.number().int().optional(), + start_position: z.number().int().optional(), + filter: z.string().optional(), + sort: components.GetWorkspaceUsersSortingOption$inboundSchema.optional(), +}).transform((v) => { + return remap$(v, { + "start_position": "startPosition", + }); +}); + +/** @internal */ +export type GetWorkspaceUsersRequest$Outbound = { + accountId: string; + workspaceId: string; + count?: number | undefined; + start_position?: number | undefined; + filter?: string | undefined; + sort?: string | undefined; +}; + +/** @internal */ +export const GetWorkspaceUsersRequest$outboundSchema: z.ZodType< + GetWorkspaceUsersRequest$Outbound, + z.ZodTypeDef, + GetWorkspaceUsersRequest +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + count: z.number().int().optional(), + startPosition: z.number().int().optional(), + filter: z.string().optional(), + sort: components.GetWorkspaceUsersSortingOption$outboundSchema.optional(), +}).transform((v) => { + return remap$(v, { + startPosition: "start_position", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspaceUsersRequest$ { + /** @deprecated use `GetWorkspaceUsersRequest$inboundSchema` instead. */ + export const inboundSchema = GetWorkspaceUsersRequest$inboundSchema; + /** @deprecated use `GetWorkspaceUsersRequest$outboundSchema` instead. */ + export const outboundSchema = GetWorkspaceUsersRequest$outboundSchema; + /** @deprecated use `GetWorkspaceUsersRequest$Outbound` instead. */ + export type Outbound = GetWorkspaceUsersRequest$Outbound; +} + +export function getWorkspaceUsersRequestToJSON( + getWorkspaceUsersRequest: GetWorkspaceUsersRequest, +): string { + return JSON.stringify( + GetWorkspaceUsersRequest$outboundSchema.parse(getWorkspaceUsersRequest), + ); +} + +export function getWorkspaceUsersRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceUsersRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceUsersRequest' from JSON`, + ); +} diff --git a/src/models/operations/index.ts b/src/models/operations/index.ts index 62cecf2..3a6dc41 100644 --- a/src/models/operations/index.ts +++ b/src/models/operations/index.ts @@ -2,10 +2,17 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ +export * from "./addworkspaceuser.js"; export * from "./cancelworkflowinstance.js"; +export * from "./completeworkspaceuploadrequest.js"; export * from "./connectedfieldsapigettabgroups.js"; export * from "./createagreementsummary.js"; +export * from "./createworkspace.js"; +export * from "./createworkspaceenvelope.js"; +export * from "./createworkspaceuploadrequest.js"; export * from "./deleteagreement.js"; +export * from "./deleteworkspacedocument.js"; +export * from "./deleteworkspaceuploadrequest.js"; export * from "./getagreement.js"; export * from "./getagreementslist.js"; export * from "./gettokenfromconfidentialauthcode.js"; @@ -17,6 +24,20 @@ export * from "./getworkflowinstance.js"; export * from "./getworkflowinstanceslist.js"; export * from "./getworkflowslist.js"; export * from "./getworkflowtriggerrequirements.js"; +export * from "./getworkspace.js"; +export * from "./getworkspaceassignableroles.js"; +export * from "./getworkspacedocument.js"; +export * from "./getworkspacedocumentcontents.js"; +export * from "./getworkspacedocuments.js"; +export * from "./getworkspaceenvelopes.js"; +export * from "./getworkspaces.js"; +export * from "./getworkspaceuploadrequest.js"; +export * from "./getworkspaceuploadrequests.js"; +export * from "./getworkspaceusers.js"; export * from "./pausenewworkflowinstances.js"; +export * from "./restoreworkspaceuseraccess.js"; export * from "./resumepausedworkflow.js"; +export * from "./revokeworkspaceuseraccess.js"; export * from "./triggerworkflow.js"; +export * from "./updateworkspaceuploadrequest.js"; +export * from "./updateworkspaceuser.js"; diff --git a/src/models/operations/restoreworkspaceuseraccess.ts b/src/models/operations/restoreworkspaceuseraccess.ts new file mode 100644 index 0000000..134a22d --- /dev/null +++ b/src/models/operations/restoreworkspaceuseraccess.ts @@ -0,0 +1,86 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type RestoreWorkspaceUserAccessRequest = { + /** + * The ID of the account + */ + accountId: string; + /** + * The ID of the workspace to restore access + */ + workspaceId: string; + /** + * The ID of the user to be restored to the workspace + */ + userId: string; +}; + +/** @internal */ +export const RestoreWorkspaceUserAccessRequest$inboundSchema: z.ZodType< + RestoreWorkspaceUserAccessRequest, + z.ZodTypeDef, + unknown +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + userId: z.string(), +}); + +/** @internal */ +export type RestoreWorkspaceUserAccessRequest$Outbound = { + accountId: string; + workspaceId: string; + userId: string; +}; + +/** @internal */ +export const RestoreWorkspaceUserAccessRequest$outboundSchema: z.ZodType< + RestoreWorkspaceUserAccessRequest$Outbound, + z.ZodTypeDef, + RestoreWorkspaceUserAccessRequest +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + userId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RestoreWorkspaceUserAccessRequest$ { + /** @deprecated use `RestoreWorkspaceUserAccessRequest$inboundSchema` instead. */ + export const inboundSchema = RestoreWorkspaceUserAccessRequest$inboundSchema; + /** @deprecated use `RestoreWorkspaceUserAccessRequest$outboundSchema` instead. */ + export const outboundSchema = + RestoreWorkspaceUserAccessRequest$outboundSchema; + /** @deprecated use `RestoreWorkspaceUserAccessRequest$Outbound` instead. */ + export type Outbound = RestoreWorkspaceUserAccessRequest$Outbound; +} + +export function restoreWorkspaceUserAccessRequestToJSON( + restoreWorkspaceUserAccessRequest: RestoreWorkspaceUserAccessRequest, +): string { + return JSON.stringify( + RestoreWorkspaceUserAccessRequest$outboundSchema.parse( + restoreWorkspaceUserAccessRequest, + ), + ); +} + +export function restoreWorkspaceUserAccessRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => RestoreWorkspaceUserAccessRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'RestoreWorkspaceUserAccessRequest' from JSON`, + ); +} diff --git a/src/models/operations/revokeworkspaceuseraccess.ts b/src/models/operations/revokeworkspaceuseraccess.ts new file mode 100644 index 0000000..6ac71ba --- /dev/null +++ b/src/models/operations/revokeworkspaceuseraccess.ts @@ -0,0 +1,108 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as components from "../components/index.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type RevokeWorkspaceUserAccessRequest = { + /** + * The ID of the account + */ + accountId: string; + /** + * The ID of the workspace to revoke access from + */ + workspaceId: string; + /** + * The ID of the user to be revoked from the workspace + */ + userId: string; + /** + * Optional details. Allows scheduling the revocation for the future + */ + revokeWorkspaceUserDetails?: + | components.RevokeWorkspaceUserDetails + | undefined; +}; + +/** @internal */ +export const RevokeWorkspaceUserAccessRequest$inboundSchema: z.ZodType< + RevokeWorkspaceUserAccessRequest, + z.ZodTypeDef, + unknown +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + userId: z.string(), + RevokeWorkspaceUserDetails: components + .RevokeWorkspaceUserDetails$inboundSchema.optional(), +}).transform((v) => { + return remap$(v, { + "RevokeWorkspaceUserDetails": "revokeWorkspaceUserDetails", + }); +}); + +/** @internal */ +export type RevokeWorkspaceUserAccessRequest$Outbound = { + accountId: string; + workspaceId: string; + userId: string; + RevokeWorkspaceUserDetails?: + | components.RevokeWorkspaceUserDetails$Outbound + | undefined; +}; + +/** @internal */ +export const RevokeWorkspaceUserAccessRequest$outboundSchema: z.ZodType< + RevokeWorkspaceUserAccessRequest$Outbound, + z.ZodTypeDef, + RevokeWorkspaceUserAccessRequest +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + userId: z.string(), + revokeWorkspaceUserDetails: components + .RevokeWorkspaceUserDetails$outboundSchema.optional(), +}).transform((v) => { + return remap$(v, { + revokeWorkspaceUserDetails: "RevokeWorkspaceUserDetails", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RevokeWorkspaceUserAccessRequest$ { + /** @deprecated use `RevokeWorkspaceUserAccessRequest$inboundSchema` instead. */ + export const inboundSchema = RevokeWorkspaceUserAccessRequest$inboundSchema; + /** @deprecated use `RevokeWorkspaceUserAccessRequest$outboundSchema` instead. */ + export const outboundSchema = RevokeWorkspaceUserAccessRequest$outboundSchema; + /** @deprecated use `RevokeWorkspaceUserAccessRequest$Outbound` instead. */ + export type Outbound = RevokeWorkspaceUserAccessRequest$Outbound; +} + +export function revokeWorkspaceUserAccessRequestToJSON( + revokeWorkspaceUserAccessRequest: RevokeWorkspaceUserAccessRequest, +): string { + return JSON.stringify( + RevokeWorkspaceUserAccessRequest$outboundSchema.parse( + revokeWorkspaceUserAccessRequest, + ), + ); +} + +export function revokeWorkspaceUserAccessRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => RevokeWorkspaceUserAccessRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'RevokeWorkspaceUserAccessRequest' from JSON`, + ); +} diff --git a/src/models/operations/updateworkspaceuploadrequest.ts b/src/models/operations/updateworkspaceuploadrequest.ts new file mode 100644 index 0000000..3cb9922 --- /dev/null +++ b/src/models/operations/updateworkspaceuploadrequest.ts @@ -0,0 +1,108 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as components from "../components/index.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type UpdateWorkspaceUploadRequestRequest = { + /** + * The ID of the account + */ + accountId: string; + /** + * The ID of the workspace + */ + workspaceId: string; + /** + * The ID of the upload request to update + */ + uploadRequestId: string; + /** + * The upload request object with updated values + */ + updateWorkspaceUploadRequestBody: components.UpdateWorkspaceUploadRequestBody; +}; + +/** @internal */ +export const UpdateWorkspaceUploadRequestRequest$inboundSchema: z.ZodType< + UpdateWorkspaceUploadRequestRequest, + z.ZodTypeDef, + unknown +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + uploadRequestId: z.string(), + UpdateWorkspaceUploadRequestBody: + components.UpdateWorkspaceUploadRequestBody$inboundSchema, +}).transform((v) => { + return remap$(v, { + "UpdateWorkspaceUploadRequestBody": "updateWorkspaceUploadRequestBody", + }); +}); + +/** @internal */ +export type UpdateWorkspaceUploadRequestRequest$Outbound = { + accountId: string; + workspaceId: string; + uploadRequestId: string; + UpdateWorkspaceUploadRequestBody: + components.UpdateWorkspaceUploadRequestBody$Outbound; +}; + +/** @internal */ +export const UpdateWorkspaceUploadRequestRequest$outboundSchema: z.ZodType< + UpdateWorkspaceUploadRequestRequest$Outbound, + z.ZodTypeDef, + UpdateWorkspaceUploadRequestRequest +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + uploadRequestId: z.string(), + updateWorkspaceUploadRequestBody: + components.UpdateWorkspaceUploadRequestBody$outboundSchema, +}).transform((v) => { + return remap$(v, { + updateWorkspaceUploadRequestBody: "UpdateWorkspaceUploadRequestBody", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateWorkspaceUploadRequestRequest$ { + /** @deprecated use `UpdateWorkspaceUploadRequestRequest$inboundSchema` instead. */ + export const inboundSchema = + UpdateWorkspaceUploadRequestRequest$inboundSchema; + /** @deprecated use `UpdateWorkspaceUploadRequestRequest$outboundSchema` instead. */ + export const outboundSchema = + UpdateWorkspaceUploadRequestRequest$outboundSchema; + /** @deprecated use `UpdateWorkspaceUploadRequestRequest$Outbound` instead. */ + export type Outbound = UpdateWorkspaceUploadRequestRequest$Outbound; +} + +export function updateWorkspaceUploadRequestRequestToJSON( + updateWorkspaceUploadRequestRequest: UpdateWorkspaceUploadRequestRequest, +): string { + return JSON.stringify( + UpdateWorkspaceUploadRequestRequest$outboundSchema.parse( + updateWorkspaceUploadRequestRequest, + ), + ); +} + +export function updateWorkspaceUploadRequestRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + UpdateWorkspaceUploadRequestRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UpdateWorkspaceUploadRequestRequest' from JSON`, + ); +} diff --git a/src/models/operations/updateworkspaceuser.ts b/src/models/operations/updateworkspaceuser.ts new file mode 100644 index 0000000..8148e91 --- /dev/null +++ b/src/models/operations/updateworkspaceuser.ts @@ -0,0 +1,104 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as components from "../components/index.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type UpdateWorkspaceUserRequest = { + /** + * The ID of the account + */ + accountId: string; + /** + * The ID of the workspace + */ + workspaceId: string; + /** + * The ID of the user to update + */ + userId: string; + /** + * The user details to update to including the RoleId + */ + workspaceUserForUpdate?: components.WorkspaceUserForUpdate | undefined; +}; + +/** @internal */ +export const UpdateWorkspaceUserRequest$inboundSchema: z.ZodType< + UpdateWorkspaceUserRequest, + z.ZodTypeDef, + unknown +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + userId: z.string(), + WorkspaceUserForUpdate: components.WorkspaceUserForUpdate$inboundSchema + .optional(), +}).transform((v) => { + return remap$(v, { + "WorkspaceUserForUpdate": "workspaceUserForUpdate", + }); +}); + +/** @internal */ +export type UpdateWorkspaceUserRequest$Outbound = { + accountId: string; + workspaceId: string; + userId: string; + WorkspaceUserForUpdate?: + | components.WorkspaceUserForUpdate$Outbound + | undefined; +}; + +/** @internal */ +export const UpdateWorkspaceUserRequest$outboundSchema: z.ZodType< + UpdateWorkspaceUserRequest$Outbound, + z.ZodTypeDef, + UpdateWorkspaceUserRequest +> = z.object({ + accountId: z.string(), + workspaceId: z.string(), + userId: z.string(), + workspaceUserForUpdate: components.WorkspaceUserForUpdate$outboundSchema + .optional(), +}).transform((v) => { + return remap$(v, { + workspaceUserForUpdate: "WorkspaceUserForUpdate", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateWorkspaceUserRequest$ { + /** @deprecated use `UpdateWorkspaceUserRequest$inboundSchema` instead. */ + export const inboundSchema = UpdateWorkspaceUserRequest$inboundSchema; + /** @deprecated use `UpdateWorkspaceUserRequest$outboundSchema` instead. */ + export const outboundSchema = UpdateWorkspaceUserRequest$outboundSchema; + /** @deprecated use `UpdateWorkspaceUserRequest$Outbound` instead. */ + export type Outbound = UpdateWorkspaceUserRequest$Outbound; +} + +export function updateWorkspaceUserRequestToJSON( + updateWorkspaceUserRequest: UpdateWorkspaceUserRequest, +): string { + return JSON.stringify( + UpdateWorkspaceUserRequest$outboundSchema.parse(updateWorkspaceUserRequest), + ); +} + +export function updateWorkspaceUserRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UpdateWorkspaceUserRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UpdateWorkspaceUserRequest' from JSON`, + ); +} diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index 970c140..4c04ae1 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -7,6 +7,7 @@ import { Auth } from "./auth.js"; import { ConnectedFields } from "./connectedfields.js"; import { Maestro } from "./maestro.js"; import { Navigator } from "./navigator.js"; +import { Workspaces1 } from "./workspaces1.js"; export class IamClient extends ClientSDK { private _auth?: Auth; @@ -28,4 +29,9 @@ export class IamClient extends ClientSDK { get connectedFields(): ConnectedFields { return (this._connectedFields ??= new ConnectedFields(this._options)); } + + private _workspaces1?: Workspaces1; + get workspaces1(): Workspaces1 { + return (this._workspaces1 ??= new Workspaces1(this._options)); + } } diff --git a/src/sdk/workspacedocuments.ts b/src/sdk/workspacedocuments.ts new file mode 100644 index 0000000..136f0f7 --- /dev/null +++ b/src/sdk/workspacedocuments.ts @@ -0,0 +1,84 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +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 { + return unwrapAsync(workspacesWorkspaceDocumentsGetWorkspaceDocuments( + 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 { + 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 { + 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> { + return unwrapAsync(workspacesWorkspaceDocumentsGetWorkspaceDocumentContents( + this, + request, + options, + )); + } +} diff --git a/src/sdk/workspaces1.ts b/src/sdk/workspaces1.ts new file mode 100644 index 0000000..43a5ac0 --- /dev/null +++ b/src/sdk/workspaces1.ts @@ -0,0 +1,33 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClientSDK } from "../lib/sdks.js"; +import { WorkspaceDocuments } from "./workspacedocuments.js"; +import { Workspaces2 } from "./workspaces2.js"; +import { WorkspaceUploadRequest } from "./workspaceuploadrequest.js"; +import { WorkspaceUsers } from "./workspaceusers.js"; + +export class Workspaces1 extends ClientSDK { + private _workspaceDocuments?: WorkspaceDocuments; + get workspaceDocuments(): WorkspaceDocuments { + return (this._workspaceDocuments ??= new WorkspaceDocuments(this._options)); + } + + private _workspaceUploadRequest?: WorkspaceUploadRequest; + get workspaceUploadRequest(): WorkspaceUploadRequest { + return (this._workspaceUploadRequest ??= new WorkspaceUploadRequest( + this._options, + )); + } + + private _workspaceUsers?: WorkspaceUsers; + get workspaceUsers(): WorkspaceUsers { + return (this._workspaceUsers ??= new WorkspaceUsers(this._options)); + } + + private _workspaces?: Workspaces2; + get workspaces(): Workspaces2 { + return (this._workspaces ??= new Workspaces2(this._options)); + } +} diff --git a/src/sdk/workspaces2.ts b/src/sdk/workspaces2.ts new file mode 100644 index 0000000..a9188a5 --- /dev/null +++ b/src/sdk/workspaces2.ts @@ -0,0 +1,136 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { workspacesWorkspacesCreateWorkspace } from "../funcs/workspacesWorkspacesCreateWorkspace.js"; +import { workspacesWorkspacesCreateWorkspaceEnvelope } from "../funcs/workspacesWorkspacesCreateWorkspaceEnvelope.js"; +import { workspacesWorkspacesGetWorkspace } from "../funcs/workspacesWorkspacesGetWorkspace.js"; +import { workspacesWorkspacesGetWorkspaceAssignableRoles } from "../funcs/workspacesWorkspacesGetWorkspaceAssignableRoles.js"; +import { workspacesWorkspacesGetWorkspaceEnvelopes } from "../funcs/workspacesWorkspacesGetWorkspaceEnvelopes.js"; +import { workspacesWorkspacesGetWorkspaces } from "../funcs/workspacesWorkspacesGetWorkspaces.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 Workspaces2 extends ClientSDK { + /** + * Gets workspaces available to the calling user + * + * @remarks + * This operation retrieves a list of workspaces available to the calling user. It returns basic information about each workspace, including its unique identifier (ID), name, and metadata such as when it was created and by whom. + * + * 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 getWorkspaces( + request: operations.GetWorkspacesRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(workspacesWorkspacesGetWorkspaces( + this, + request, + options, + )); + } + + /** + * Creates a new workspace + * + * @remarks + * This operation creates a new workspace. The calling user is automatically added as a member of the workspace with the role of Manage. + * + * Once created, the `workspace_id` is utilized to associate tasks such as envelopes. Participants on tasks will automatically be added to the workspace with the Participate role. + */ + async createWorkspace( + request: operations.CreateWorkspaceRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(workspacesWorkspacesCreateWorkspace( + this, + request, + options, + )); + } + + /** + * Returns details about the workspace + * + * @remarks + * This operation retrieves details about a specific workspace. It returns the workspace's unique identifier (ID), name, and metadata such as when it was created and by whom. + */ + async getWorkspace( + request: operations.GetWorkspaceRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(workspacesWorkspacesGetWorkspace( + this, + request, + options, + )); + } + + /** + * Returns the roles the caller can assign to workspace users + * + * @remarks + * This operation returns roles that are assignable to users in the workspace based on the caller's role in the workspace. Roles available include Manage (internal) and Participate (external). Participate is the default role. + * + * Users within the account are considered "Internal" and may be assigned any role. Users outside the account are considered "External" and may only be assigned "External" roles. + * + * 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 getWorkspaceAssignableRoles( + request: operations.GetWorkspaceAssignableRolesRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(workspacesWorkspacesGetWorkspaceAssignableRoles( + this, + request, + options, + )); + } + + /** + * Creates an envelope with the given documents. Returns the ID of the created envelope + * + * @remarks + * This operation creates an envelope associated with the workspace. Using the `envelope_id` from the response, the [eSignature API](https://developers.docusign.com/docs/esign-rest-api/) may be utilized to modify the envelope and ultimately send it. + * + * Envelope recipients will automatically be granted Participate access to the workspace. Envelope recipients will receive consolidated notifications from Docusign Workspaces rather than standard individual envelope notifications. + * + * Docusign Connect events may be utilized to receive updates to individual envelope events. + * + * The `envelopes` operation on the workspace may be utilized to query the status of all the envelopes in the workspace. + * + * When `document_ids` is empty or excluded, the envelope is created without any documents from the workspace. eSignature API calls, including adding documents and templates, may be utilized to modify the envelope before it is sent. The eSignature API must be utilized to send the envelope. + */ + async createWorkspaceEnvelope( + request: operations.CreateWorkspaceEnvelopeRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(workspacesWorkspacesCreateWorkspaceEnvelope( + this, + request, + options, + )); + } + + /** + * Returns the envelopes associated with the given workspace + * + * @remarks + * This operation retrieves a list of all associated workspace envelopes. The [`status`](https://support.docusign.com/s/document-item?bundleId=oeq1643226594604&topicId=wdm1578456348227.html) on each envelope can be used to track envelope progress. Statuses are formatted as ProperCase. e.g. `Sent`, `WaitingForOthers`, `Completed`, etc. + * + * Based on the permissions of the caller, additional envelope details may be retrieved from the [eSignature API](https://developers.docusign.com/docs/esign-rest-api/) using the `envelope_id`. + */ + async getWorkspaceEnvelopes( + request: operations.GetWorkspaceEnvelopesRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(workspacesWorkspacesGetWorkspaceEnvelopes( + this, + request, + options, + )); + } +} diff --git a/src/sdk/workspaceuploadrequest.ts b/src/sdk/workspaceuploadrequest.ts new file mode 100644 index 0000000..e76eec6 --- /dev/null +++ b/src/sdk/workspaceuploadrequest.ts @@ -0,0 +1,130 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { workspacesWorkspaceUploadRequestCompleteWorkspaceUploadRequest } from "../funcs/workspacesWorkspaceUploadRequestCompleteWorkspaceUploadRequest.js"; +import { workspacesWorkspaceUploadRequestCreateWorkspaceUploadRequest } from "../funcs/workspacesWorkspaceUploadRequestCreateWorkspaceUploadRequest.js"; +import { workspacesWorkspaceUploadRequestDeleteWorkspaceUploadRequest } from "../funcs/workspacesWorkspaceUploadRequestDeleteWorkspaceUploadRequest.js"; +import { workspacesWorkspaceUploadRequestGetWorkspaceUploadRequest } from "../funcs/workspacesWorkspaceUploadRequestGetWorkspaceUploadRequest.js"; +import { workspacesWorkspaceUploadRequestGetWorkspaceUploadRequests } from "../funcs/workspacesWorkspaceUploadRequestGetWorkspaceUploadRequests.js"; +import { workspacesWorkspaceUploadRequestUpdateWorkspaceUploadRequest } from "../funcs/workspacesWorkspaceUploadRequestUpdateWorkspaceUploadRequest.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 WorkspaceUploadRequest extends ClientSDK { + /** + * Creates a new upload request within a workspace + * + * @remarks + * This operation creates a new upload request within a workspace. The upload request includes name, description, due date, and user assignments. Upload requests can be created as drafts or sent immediately based on the status field. + */ + async createWorkspaceUploadRequest( + request: operations.CreateWorkspaceUploadRequestRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync( + workspacesWorkspaceUploadRequestCreateWorkspaceUploadRequest( + this, + request, + options, + ), + ); + } + + /** + * Gets upload requests within a workspace + * + * @remarks + * This operation retrieves a list of upload requests within a workspace. Each upload request includes details such as ID, name, description, status, owner information, associated documents, assignments, and various dates. + */ + async getWorkspaceUploadRequests( + request: operations.GetWorkspaceUploadRequestsRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync( + workspacesWorkspaceUploadRequestGetWorkspaceUploadRequests( + this, + request, + options, + ), + ); + } + + /** + * Gets details for a specific upload request + * + * @remarks + * This operation retrieves details about a specific upload request within a workspace. The response includes comprehensive information about the upload request including status, assigned users, associated documents, owner details, and various dates. + */ + async getWorkspaceUploadRequest( + request: operations.GetWorkspaceUploadRequestRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync( + workspacesWorkspaceUploadRequestGetWorkspaceUploadRequest( + this, + request, + options, + ), + ); + } + + /** + * Updates a specific upload request + * + * @remarks + * This operation updates a specific upload request within a workspace. Only draft upload requests can be edited. The editable fields are name, description, due date, and status. Status changes are restricted - only transitions from draft to in_progress are allowed. Attempting to update a non-draft upload request will result in an INVALID_STATUS error. Attempting an invalid status change will result in an INVALID_STATUS_CHANGE error. + */ + async updateWorkspaceUploadRequest( + request: operations.UpdateWorkspaceUploadRequestRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync( + workspacesWorkspaceUploadRequestUpdateWorkspaceUploadRequest( + this, + request, + options, + ), + ); + } + + /** + * Deletes a specific upload request + * + * @remarks + * This operation deletes a specific upload request within a workspace. Upload requests cannot be deleted if they are complete or have associated documents. + */ + async deleteWorkspaceUploadRequest( + request: operations.DeleteWorkspaceUploadRequestRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync( + workspacesWorkspaceUploadRequestDeleteWorkspaceUploadRequest( + this, + request, + options, + ), + ); + } + + /** + * Complete an upload request + * + * @remarks + * This operation completes a specific upload request within a workspace and is intended to be called by the user completing the upload request. Only upload requests that are in progress can be completed. + */ + async completeWorkspaceUploadRequest( + request: operations.CompleteWorkspaceUploadRequestRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync( + workspacesWorkspaceUploadRequestCompleteWorkspaceUploadRequest( + this, + request, + options, + ), + ); + } +} diff --git a/src/sdk/workspaceusers.ts b/src/sdk/workspaceusers.ts new file mode 100644 index 0000000..338a545 --- /dev/null +++ b/src/sdk/workspaceusers.ts @@ -0,0 +1,104 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { workspacesWorkspaceUsersAddWorkspaceUser } from "../funcs/workspacesWorkspaceUsersAddWorkspaceUser.js"; +import { workspacesWorkspaceUsersGetWorkspaceUsers } from "../funcs/workspacesWorkspaceUsersGetWorkspaceUsers.js"; +import { workspacesWorkspaceUsersRestoreWorkspaceUserAccess } from "../funcs/workspacesWorkspaceUsersRestoreWorkspaceUserAccess.js"; +import { workspacesWorkspaceUsersRevokeWorkspaceUserAccess } from "../funcs/workspacesWorkspaceUsersRevokeWorkspaceUserAccess.js"; +import { workspacesWorkspaceUsersUpdateWorkspaceUser } from "../funcs/workspacesWorkspaceUsersUpdateWorkspaceUser.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 WorkspaceUsers extends ClientSDK { + /** + * Retrieves the list of users in the given workspace + * + * @remarks + * This operations retrieves the users in a workspace. Users sent envelopes or assigned tasks will automatically be added to the workspace with the Participate role. + * + * 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 getWorkspaceUsers( + request: operations.GetWorkspaceUsersRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(workspacesWorkspaceUsersGetWorkspaceUsers( + this, + request, + options, + )); + } + + /** + * Adds a user to the workspace by email address + * + * @remarks + * This operation manually adds an internal or external user to a specific workspace by email address. Users within the account are considered "Internal" and may be assigned any role. Users outside the account are considered "External" and may only be assigned the Participate role. This operation is not typically needed for adding external participants to a Workspace as they will be automatically added as tasks are assigned. + * + * Available role IDs can be retrieved via the Assignable Roles operation on a workspace. If the `role_id` is not passed, the user is added with the Participate role. + */ + async addWorkspaceUser( + request: operations.AddWorkspaceUserRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(workspacesWorkspaceUsersAddWorkspaceUser( + this, + request, + options, + )); + } + + /** + * Updates the specified user's role + * + * @remarks + * This operation updates the specified user's role in the workspace. Users within the account are considered "Internal" and may be assigned any role. Users outside the account are considered "External" and may only be assigned "External" roles. + */ + async updateWorkspaceUser( + request: operations.UpdateWorkspaceUserRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(workspacesWorkspaceUsersUpdateWorkspaceUser( + this, + request, + options, + )); + } + + /** + * Revokes the specified user's access to the workspace + * + * @remarks + * This operation revokes the specified user's access to the workspace. The optional `revocation_date` may be set to schedule revocation in the future. If not specified, the revocation will be immediate. + */ + async revokeWorkspaceUserAccess( + request: operations.RevokeWorkspaceUserAccessRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(workspacesWorkspaceUsersRevokeWorkspaceUserAccess( + this, + request, + options, + )); + } + + /** + * Restores the specified user's access to the workspace + * + * @remarks + * This operation restores the specified user's access to the workspace. The user must have been previously revoked from the workspace. The access is immediately restored. + */ + async restoreWorkspaceUserAccess( + request: operations.RestoreWorkspaceUserAccessRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(workspacesWorkspaceUsersRestoreWorkspaceUserAccess( + this, + request, + options, + )); + } +} diff --git a/src/security/scopes.ts b/src/security/scopes.ts index e35fecb..004236e 100644 --- a/src/security/scopes.ts +++ b/src/security/scopes.ts @@ -44,6 +44,23 @@ export const DOCUSIGN_IAM_NAVIGATOR_OAUTH_SCOPES = [ export type DocusignIamNavigatorOAuthScope = (typeof DOCUSIGN_IAM_NAVIGATOR_OAUTH_SCOPES)[number]; +/** + * WORKSPACE SCOPES + */ + +/** OAuth Scopes for Docusign Workspace API */ +export const DOCUSIGN_IAM_WORKSPACE_OAUTH_SCOPES = [ + "signature", + "dtr.company.read", + "dtr.rooms.read", + "dtr.rooms.write", + "dtr.documents.write", +] as const; + +/** OAuth Scopes for Docusign Workspace API */ +export type DocusignIamWorkspaceOAuthScope = + (typeof DOCUSIGN_IAM_WORKSPACE_OAUTH_SCOPES)[number]; + /** * COMMON SCOPES */ @@ -64,6 +81,7 @@ export const DOCUSIGN_IAM_OAUTH_SCOPES = [ ...DOCUSIGN_IAM_CONNECTED_FIELDS_OAUTH_SCOPES, ...DOCUSIGN_IAM_MAESTRO_OAUTH_SCOPES, ...DOCUSIGN_IAM_NAVIGATOR_OAUTH_SCOPES, + ...DOCUSIGN_IAM_WORKSPACE_OAUTH_SCOPES, ] as const; /** Schema to validate OAuth scopes for Docusign API's */