From ea7f10d4adaa1895092fce132ad23f2d5c19366d Mon Sep 17 00:00:00 2001 From: pdsaroka Date: Mon, 5 Jan 2026 15:58:59 +0000 Subject: [PATCH 1/2] v7.0.0-rc.1 --- .gitignore | 2 +- README.md | 145 +- docs/APILogsApi.md | 34 +- docs/CommunicationPreferencesApi.md | 73 + docs/ContactsApi.md | 15 +- docs/ContentLibraryItemsApi.md | 197 +- docs/DocumentAttachmentsApi.md | 114 +- docs/DocumentAuditTrailApi.md | 72 + docs/DocumentFieldsApi.md | 157 + docs/DocumentLinkToCRMApi.md | 282 + docs/DocumentRecipientsApi.md | 32 +- docs/DocumentRemindersApi.md | 290 ++ docs/DocumentSectionsBundlesApi.md | 404 ++ docs/DocumentSettingsApi.md | 131 + docs/DocumentsApi.md | 853 +++- docs/{FoldersAPIApi.md => FoldersApi.md} | 64 +- docs/FormsApi.md | 29 +- docs/MembersApi.md | 87 +- docs/NotaryApi.md | 279 + docs/OAuth20AuthenticationApi.md | 3 +- docs/ProductCatalogApi.md | 415 ++ docs/QuotesApi.md | 7 + docs/SectionsApi.md | 375 -- docs/TemplateSettingsApi.md | 129 + docs/TemplatesApi.md | 381 +- docs/UserAndWorkspaceManagementApi.md | 342 +- docs/WebhookEventsApi.md | 58 +- docs/WebhookSubscriptionsApi.md | 31 +- ...eateDocumentFromPandadocTemplateAndSend.ts | 2 + examples/createDocumentFromPdfUrlAndSend.ts | 4 + package.json | 39 +- src/.gitattributes | 8 + src/apis/APILogsApi.ts | 135 +- src/apis/CommunicationPreferencesApi.ts | 147 + src/apis/ContactsApi.ts | 304 +- src/apis/ContentLibraryItemsApi.ts | 502 +- src/apis/DocumentAttachmentsApi.ts | 473 +- src/apis/DocumentAuditTrailApi.ts | 119 + src/apis/DocumentFieldsApi.ts | 273 + src/apis/DocumentLinkToCRMApi.ts | 578 +++ src/apis/DocumentRecipientsApi.ts | 304 +- src/apis/DocumentRemindersApi.ts | 550 ++ src/apis/DocumentSectionsBundlesApi.ts | 790 +++ src/apis/DocumentSettingsApi.ts | 203 + src/apis/DocumentsApi.ts | 2178 +++++--- src/apis/{FoldersAPIApi.ts => FoldersApi.ts} | 365 +- src/apis/FormsApi.ts | 87 +- src/apis/MembersApi.ts | 333 +- src/apis/NotaryApi.ts | 460 ++ src/apis/OAuth20AuthenticationApi.ts | 47 +- src/apis/ProductCatalogApi.ts | 581 +++ src/apis/QuotesApi.ts | 84 +- src/apis/SectionsApi.ts | 474 -- src/apis/TemplateSettingsApi.ts | 203 + src/apis/TemplatesApi.ts | 856 +++- src/apis/UserAndWorkspaceManagementApi.ts | 810 ++- src/apis/WebhookEventsApi.ts | 123 +- src/apis/WebhookSubscriptionsApi.ts | 386 +- src/apis/baseapi.ts | 2 +- src/apis/exception.ts | 16 +- src/auth/auth.ts | 5 +- src/configuration.ts | 95 +- src/http/http.ts | 137 +- src/http/isomorphic-fetch.ts | 1 + src/index.ts | 8 +- src/middleware.ts | 6 +- src/models/APILogDetailsResponse.ts | 9 +- src/models/APILogListResponse.ts | 9 +- ...s.ts => APILogListResponseResultsInner.ts} | 7 +- src/models/AccessToken400Response.ts | 33 + src/models/AddDsvNamedItemsRequest.ts | 37 + .../AddDsvNamedItemsRequestItemsInner.ts | 56 + src/models/AddDsvNamedItemsResponse.ts | 47 + .../AddDsvNamedItemsResponseResultsInner.ts | 76 + src/models/AddMember400Response.ts | 40 + src/models/AddMemberRequest.ts | 12 +- src/models/AddMemberResponse.ts | 9 +- src/models/ApiKeyTypeEnum.ts | 18 + src/models/ApiLogEnvironmentTypeEnum.ts | 15 + src/models/ApiLogMethodEnum.ts | 18 + src/models/ApiLogStatusEnum.ts | 18 + src/models/AppendCLIDataRequest.ts | 34 + src/models/AppendCLIDataRequestCli.ts | 50 + .../AppendCLIDataRequestCliPagesInner.ts | 46 + src/models/AppendCLIDataResponse.ts | 42 + .../AppendCLIDataResponseBlockMapping.ts | 73 + ...dCLIDataResponseBlockMappingImagesInner.ts | 46 + ...aResponseBlockMappingPricingTablesInner.ts | 46 + ...dCLIDataResponseBlockMappingTablesInner.ts | 46 + ...ndCLIDataResponseBlockMappingTextsInner.ts | 46 + src/models/AppendCLIDataResponseCli.ts | 50 + .../AppendCLIDataResponseCliPagesInner.ts | 46 + .../AssignedToRecipientDeliveryMethods.ts | 40 + src/models/AutoReminders.ts | 76 + src/models/BaseActor.ts | 46 + src/models/BaseEditingSessionResponse.ts | 77 + src/models/BaseField.ts | 85 + src/models/BaseFieldAssignedTo.ts | 146 + src/models/BaseIdentity.ts | 66 + src/models/ChangeDocumentStatus409Response.ts | 47 + src/models/Checkbox.ts | 104 + src/models/CollectFile.ts | 95 + src/models/CollectFileAllOfValue.ts | 43 + src/models/ContactCreateRequest.ts | 63 +- src/models/ContactDetailsResponse.ts | 66 +- src/models/ContactListResponse.ts | 5 +- src/models/ContactUpdateRequest.ts | 28 +- .../ContentLibraryItemCreateFromUrlRequest.ts | 46 + src/models/ContentLibraryItemCreateRequest.ts | 36 + src/models/ContentLibraryItemListResponse.ts | 9 +- ...entLibraryItemListResponseResultsInner.ts} | 7 +- src/models/ContentLibraryItemResponse.ts | 18 +- .../ContentLibraryItemResponseCreatedBy.ts | 5 +- src/models/ContentLibraryResponse.ts | 75 + src/models/CreateApiKeyRequest.ts | 43 + src/models/CreateApiKeyResponse.ts | 66 + src/models/CreateDocument400Response.ts | 40 + src/models/CreateDocumentActor.ts | 144 + ...CreateDocumentEditingSession201Response.ts | 87 + src/models/CreateDocumentFieldsRequest.ts | 37 + src/models/CreateDocumentFieldsResponse.ts | 34 + src/models/CreateDocumentRecipient.ts | 122 + src/models/CreateDocumentRecipientGroup.ts | 73 + src/models/CreateMemberTokenRequest.ts | 36 + src/models/CreateMemberTokenResponse.ts | 33 + src/models/CreateNotarizationRequest.ts | 62 + .../CreateNotarizationRequestInvitation.ts | 44 + ...arizationRequestInvitationInviteesInner.ts | 47 + src/models/CreateNotarizationRequestNotary.ts | 59 + src/models/CreateNotarizationResponse.ts | 104 + .../CreateNotarizationResponseCreatedBy.ts | 66 + ...CreateNotarizationResponseInviteesInner.ts | 76 + ...CreateTemplateEditingSession201Response.ts | 87 + src/models/CreateTemplateFromUrlRequest.ts | 85 + src/models/CreateTemplateRequest.ts | 75 + src/models/CreateTemplateRequestOwner.ts | 43 + src/models/CreateUser400Response.ts | 40 + src/models/CreateUserRequest.ts | 17 +- src/models/CreateUserRequestUser.ts | 3 +- ...ts => CreateUserRequestWorkspacesInner.ts} | 13 +- src/models/CreateUserResponse.ts | 11 +- .../CreateUserResponseWorkspacesInner.ts | 47 + src/models/CreateWorkspaceRequest.ts | 6 +- src/models/CreateWorkspaceResponse.ts | 3 +- .../DeleteNotarizationRequest404Response.ts | 41 + src/models/DocumentAttachmentMetadata.ts | 36 + src/models/DocumentAttachmentRequest.ts | 46 + src/models/DocumentAttachmentResponse.ts | 7 +- .../DocumentAttachmentResponseCreatedBy.ts | 5 +- src/models/DocumentAuditTrailResponse.ts | 47 + .../DocumentAuditTrailResponseResultsInner.ts | 87 + ...umentAuditTrailResponseResultsInnerUser.ts | 49 + src/models/DocumentAutoRemindersResponse.ts | 34 + .../DocumentAutoRemindersResponse400.ts | 43 + ...ocumentAutoRemindersResponseResultInner.ts | 53 + src/models/DocumentCreateByPdfRequest.ts | 88 +- src/models/DocumentCreateByTemplateRequest.ts | 153 +- ...emplateRequestContentPlaceholdersInner.ts} | 16 +- ...ceholdersInnerContentLibraryItemsInner.ts} | 18 +- ...ontentLibraryItemsInnerRecipientsInner.ts} | 21 +- ...umentCreateByTemplateRequestFieldsValue.ts | 44 + ...CreateByTemplateRequestFieldsValueValue.ts | 33 + ...mentCreateByTemplateRequestImagesInner.ts} | 7 +- .../DocumentCreateByTemplateRequestOwner.ts | 43 + ...cumentCreateByTemplateRequestTextsInner.ts | 46 + ...umentCreateByTemplateRequestTokensInner.ts | 40 + src/models/DocumentCreateLinkRequest.ts | 7 +- src/models/DocumentCreateLinkResponse.ts | 9 +- src/models/DocumentCreateRequest.ts | 178 +- src/models/DocumentCreateRequestOneOf.ts | 182 + src/models/DocumentCreateRequestOneOf1.ts | 127 + src/models/DocumentCreateResponse.ts | 20 +- ...ts => DocumentCreateResponseLinksInner.ts} | 7 +- src/models/DocumentDeliveryMethodEnum.ts | 18 + ...ipients.ts => DocumentDetailsRecipient.ts} | 86 +- src/models/DocumentDetailsRecipientGroup.ts | 102 + ...=> DocumentDetailsRecipientGroupMember.ts} | 48 +- src/models/DocumentDetailsResponse.ts | 139 +- .../DocumentDetailsResponseCreatedBy.ts | 26 +- .../DocumentDetailsResponseGrandTotal.ts | 12 +- .../DocumentDetailsResponseImagesInner.ts | 36 + ...cumentDetailsResponseLinkedObjectsInner.ts | 77 + ...esponseLinkedObjectsInnerChildrenInner.ts} | 23 +- .../DocumentDetailsResponseRecipientsInner.ts | 33 + .../DocumentDetailsResponseTablesInner.ts | 36 + src/models/DocumentDetailsResponseTemplate.ts | 12 +- .../DocumentDetailsResponseTextsInner.ts | 36 + src/models/DocumentDocxExport.ts | 56 + src/models/DocumentDocxExportStatusEnum.ts | 20 + src/models/DocumentESignDisclosure.ts | 34 + src/models/DocumentESignDisclosureResult.ts | 53 + src/models/DocumentFieldAnchorPointEnum.ts | 17 + src/models/DocumentFieldTypeEnum.ts | 23 + src/models/DocumentFieldsField.ts | 101 + ...ts.ts => DocumentFieldsFieldAssignedTo.ts} | 72 +- src/models/DocumentFieldsFieldCreate.ts | 81 + src/models/DocumentFieldsLayout.ts | 49 + src/models/DocumentFieldsLayoutPosition.ts | 50 + src/models/DocumentFieldsLayoutStyle.ts | 40 + src/models/DocumentLanguageEnum.ts | 33 + src/models/DocumentListResponse.ts | 9 +- .../DocumentListResponseResultsInner.ts | 82 + src/models/DocumentOrderingFieldsEnum.ts | 23 +- src/models/DocumentRecipientCreateRequest.ts | 12 +- src/models/DocumentRecipientEditRequest.ts | 38 +- src/models/DocumentRecipientResponse.ts | 3 +- ...ts.ts => DocumentRevertToDraftResponse.ts} | 9 +- .../DocumentSendManualReminder200Response.ts | 34 + ...endManualReminder200ResponseResultInner.ts | 60 + ...nualReminder200ResponseResultInnerEmail.ts | 74 + ...00ResponseResultInnerEmailCustomization.ts | 49 + ...ManualReminder200ResponseResultInnerSms.ts | 74 + .../DocumentSendManualReminder409Response.ts | 47 + .../DocumentSendManualReminderRequest.ts | 37 + ...SendManualReminderRequestRemindersInner.ts | 52 + ...RequestRemindersInnerEmailCustomization.ts | 49 + src/models/DocumentSendRequest.ts | 25 +- .../DocumentSendRequestForwardingSettings.ts | 9 +- .../DocumentSendRequestSelectedApprovers.ts | 13 +- ...SendRequestSelectedApproversStepsInner.ts} | 15 +- ...equestSelectedApproversStepsInnerGroup.ts} | 21 +- ...ApproversStepsInnerGroupAssigneesInner.ts} | 11 +- src/models/DocumentSendRequestSender.ts | 49 + src/models/DocumentSendResponse.ts | 9 +- ...=> DocumentSendResponseRecipientsInner.ts} | 19 +- src/models/DocumentSettingsResponse.ts | 59 + src/models/DocumentStatusChangeRequest.ts | 9 +- .../DocumentStatusChangeRequestStatusEnum.ts | 20 + src/models/DocumentStatusEnum.ts | 17 +- src/models/DocumentStatusRequestEnum.ts | 17 +- src/models/DocumentStatusResponse.ts | 11 +- .../DocumentTransferAllOwnershipRequest.ts | 3 +- .../DocumentTransferOwnershipRequest.ts | 3 +- src/models/DocumentUpdateRequest.ts | 68 +- src/models/DocumentUpdateRequestFieldValue.ts | 34 + ...ts => DocumentUpdateRequestImagesInner.ts} | 7 +- src/models/DocumentUpdateRequestTextsInner.ts | 46 + ...ts => DocumentUpdateRequestTokensInner.ts} | 7 +- src/models/DocumentsFolderCreateRequest.ts | 3 +- src/models/DocumentsFolderCreateResponse.ts | 3 +- src/models/DocumentsFolderListResponse.ts | 9 +- ...ocumentsFolderListResponseResultsInner.ts} | 7 +- src/models/DocumentsFolderRenameRequest.ts | 3 +- src/models/DocumentsFolderRenameResponse.ts | 3 +- src/models/DocxExportTaskResponse.ts | 67 + .../DocxExportTaskResponseAllOfDocxItems.ts | 49 + src/models/Dropdown.ts | 104 + src/models/EditingSessionRequest.ts | 46 + src/models/Field.ts | 135 + src/models/FormListResponse.ts | 9 +- ...lts.ts => FormListResponseResultsInner.ts} | 7 +- src/models/Initials.ts | 97 + src/models/LinkedObjectChild.ts | 59 + src/models/LinkedObjectCreateRequest.ts | 7 +- src/models/LinkedObjectCreateResponse.ts | 24 +- src/models/LinkedObjectListResponse.ts | 5 +- src/models/ListCatalogItemsSearchResponse.ts | 48 + src/models/ListDocumentFieldsResponse.ts | 34 + src/models/ListDocuments400Response.ts | 40 + src/models/ListDocuments401Response.ts | 40 + src/models/ListDocuments403Response.ts | 61 + .../ListDocuments403ResponseLinksInner.ts | 47 + src/models/ListDocuments429Response.ts | 40 + ...stDocumentsByLinkedObjectsResponseInner.ts | 54 + src/models/ListNotaries400Response.ts | 41 + .../ListNotaries400ResponseDetailsInner.ts | 53 + src/models/ListNotaries403Response.ts | 41 + src/models/ListNotaries429Response.ts | 41 + src/models/ListNotariesResponse.ts | 47 + .../ListNotariesResponseResultsInner.ts | 82 + src/models/ListSmsOptOutChangelogResponse.ts | 34 + ...tSmsOptOutChangelogResponseResultsInner.ts | 53 + src/models/ListUsersResponse.ts | 44 + src/models/ListUsersResponseResultsInner.ts | 101 + ...sersResponseResultsInnerWorkspacesInner.ts | 56 + src/models/ListWorkspacesResponse.ts | 44 + .../ListWorkspacesResponseResultsInner.ts | 66 + src/models/MemberDetailsResponse.ts | 15 +- src/models/MemberListResponse.ts | 5 +- src/models/ModelDate.ts | 104 + .../NotarizationRequestDetailsResponse.ts | 130 + ...rizationRequestDetailsResponseCreatedBy.ts | 66 + ...tionRequestDetailsResponseInviteesInner.ts | 66 + ...rizationRequestDetailsResponseRecording.ts | 56 + ...uestDetailsResponseSignedDocumentsInner.ts | 72 + src/models/OAuth2AccessTokenResponse.ts | 3 +- src/models/ObjectSerializer.ts | 1598 ++++-- src/models/Payment.ts | 97 + src/models/PricingResponse.ts | 7 +- src/models/PricingTableRequest.ts | 9 +- src/models/PricingTableRequestRowOptions.ts | 3 +- ...ts => PricingTableRequestSectionsInner.ts} | 13 +- ...cingTableRequestSectionsInnerRowsInner.ts} | 9 +- src/models/PricingTableResponse.ts | 13 +- ...s.ts => PricingTableResponseItemsInner.ts} | 57 +- ...PricingTableResponseItemsInnerDiscount.ts} | 19 +- ... PricingTableResponseItemsInnerOptions.ts} | 15 +- src/models/PricingTableResponseSummary.ts | 18 +- .../ProductCatalogCatalogCustomBundleItem.ts | 70 + .../ProductCatalogCatalogItemInBundle.ts | 83 + .../ProductCatalogCustomBundleItemNoId.ts | 76 + ...ProductCatalogCustomCatalogItemInBundle.ts | 76 + src/models/ProductCatalogItemPatchRequest.ts | 66 + ...CatalogItemPatchRequestBundleItemsInner.ts | 41 + ...mPatchRequestBundleItemsInnerItemOrUuid.ts | 29 + ...ctCatalogItemPatchRequestProductVariant.ts | 64 + .../ProductCatalogItemPriceConfiguration.ts | 82 + ...iers.ts => ProductCatalogItemPriceTier.ts} | 19 +- src/models/ProductCatalogItemRequest.ts | 96 + ...oductCatalogItemRequestBundleItemsInner.ts | 41 + ...ogItemRequestBundleItemsInnerItemOrUuid.ts | 29 + ...ductCatalogItemRequestCustomFieldsInner.ts | 40 + .../ProductCatalogItemRequestImagesInner.ts | 47 + src/models/ProductCatalogItemResponse.ts | 116 + ...ductCatalogItemResponseBundleItemsInner.ts | 41 + ...CatalogItemResponseBundleItemsInnerItem.ts | 85 + ...ogItemResponseDefaultPriceConfiguration.ts | 86 + ...ProductCatalogItemResponseVariantsInner.ts | 92 + src/models/ProductCatalogPricingMethodEnum.ts | 16 + ...ProductCatalogSearchCatalogItemResponse.ts | 214 + ...rchCatalogItemResponseCustomFieldsInner.ts | 40 + ...logSearchCatalogItemResponseImagesInner.ts | 47 + ...logSearchCatalogItemResponseTiersInner.ts} | 18 +- src/models/ProductCatalogTypeEnum.ts | 15 + src/models/QuoteResponse.ts | 19 +- ...les.ts => QuoteResponseMergeRulesInner.ts} | 19 +- ... => QuoteResponseMergeRulesInnerAction.ts} | 7 +- ... QuoteResponseMergeRulesInnerCondition.ts} | 13 +- ...ergeRulesInnerConditionComparisonInner.ts} | 7 +- src/models/QuoteResponseSectionColumn.ts | 7 +- src/models/QuoteResponseSectionItem.ts | 62 +- ....ts => QuoteResponseSectionItemOptions.ts} | 11 +- src/models/QuoteResponseSectionSummary.ts | 25 +- ...tions.ts => QuoteResponseSectionsInner.ts} | 17 +- src/models/QuoteResponseSettings.ts | 9 +- src/models/QuoteResponseSummary.ts | 37 +- ... => QuoteResponseSummaryDiscountsValue.ts} | 19 +- ...eResponseSummaryRecurringSubtotalInner.ts} | 7 +- src/models/QuoteSectionSettings.ts | 9 +- src/models/QuoteUpdateRequest.ts | 11 +- .../QuoteUpdateRequestBillingFrequencyEnum.ts | 18 + .../QuoteUpdateRequestDiscountTypeEnum.ts | 15 + src/models/QuoteUpdateRequestSettings.ts | 25 +- src/models/QuoteUpdateRequestSettings1.ts | 38 - ...ateRequestSettingsSelectionTypeTypeEnum.ts | 16 + src/models/RadioButtons.ts | 104 + src/models/RecipientAssignedTo.ts | 127 + src/models/RecipientAssignmentDetails.ts | 68 + ...Methods.ts => RecipientDeliveryMethods.ts} | 7 +- src/models/RecipientKindEnum.ts | 15 + src/models/RecipientPersonalDetails.ts | 78 + src/models/RecipientRedirect.ts | 8 +- src/models/RecipientRedirectSettings.ts | 40 + src/models/RecipientVerificationPlaceEnum.ts | 18 + src/models/RecipientVerificationSettings.ts | 37 +- ...pientVerificationSettingsIdVerification.ts | 36 + ...ientVerificationSettingsKbaVerification.ts | 50 + ...erificationSettingsPasscodeVerification.ts | 9 +- ...ntVerificationSettingsPhoneVerification.ts | 9 +- src/models/RecipientsGroupAssignedTo.ts | 98 + ... RecipientsGroupAssignedToAllOfMembers.ts} | 33 +- src/models/RemoveMember400Response.ts | 40 + src/models/RemoveMember404Response.ts | 40 + src/models/SearchCatalogItems401Response.ts | 41 + src/models/SectionInfoResponse.ts | 3 +- src/models/Signature.ts | 97 + src/models/Stamp.ts | 97 + src/models/StatusDocument404Response.ts | 40 + .../StatusDocumentAutoReminder400Response.ts | 40 + src/models/TableCell.ts | 59 + src/models/TableRequest.ts | 44 + src/models/TableRequestData.ts | 34 + src/models/TableRequestDataSectionsInner.ts | 41 + ...seResults.ts => TemplateCreateResponse.ts} | 25 +- src/models/TemplateDetailsResponse.ts | 49 +- ...etailsResponseContentPlaceholdersInner.ts} | 7 +- ... => TemplateDetailsResponseImagesInner.ts} | 9 +- ...s => TemplateDetailsResponseRolesInner.ts} | 15 +- ...ailsResponseRolesInnerPreassignedPerson.ts | 79 + ...RolesInnerPreassignedPersonMembersInner.ts | 47 + ... => TemplateDetailsResponseTokensInner.ts} | 7 +- src/models/TemplateListResponse.ts | 9 +- src/models/TemplateSettingsResponse.ts | 39 + src/models/TemplateStatusResponse.ts | 75 + src/models/TemplateUpdateRequest.ts | 37 + src/models/TemplatesFolderCreateRequest.ts | 3 +- src/models/TemplatesFolderCreateResponse.ts | 3 +- src/models/TemplatesFolderListResponse.ts | 9 +- ...emplatesFolderListResponseResultsInner.ts} | 7 +- src/models/TemplatesFolderRenameRequest.ts | 3 +- src/models/TemplatesFolderRenameResponse.ts | 3 +- src/models/Text.ts | 104 + src/models/UpdateDocument400Response.ts | 40 + src/models/UpdateDocumentActor.ts | 142 + .../UpdateDocumentAutoRemindersRequest.ts | 76 + .../UpdateDocumentAutoRemindersResponse.ts | 76 + src/models/UpdateDocumentRecipient.ts | 121 + src/models/UpdateDocumentRecipientGroup.ts | 80 + src/models/UpdateDocumentSettingsRequest.ts | 59 + src/models/UpdateIntegrationQuoteSection.ts | 13 +- .../UpdateIntegrationQuoteSectionItem.ts | 53 +- ...tegrationQuoteSectionItemDiscountsValue.ts | 43 + ...dateIntegrationQuoteSectionItemOptions.ts} | 7 +- ...tegrationQuoteSectionItemPriceSettings.ts} | 15 +- ...QuoteSectionItemPriceSettingsTiersInner.ts | 40 + .../UpdateIntegrationQuoteSectionSettings.ts | 53 + src/models/UpdateTemplateSettingsRequest.ts | 39 + src/models/UploadSectionBase.ts | 68 + src/models/UploadSectionByPdfRequest.ts | 83 - src/models/UploadSectionByTemplateRequest.ts | 67 +- ...emplateRequestAllOfContentLibraryItems.ts} | 32 +- ...emplateRequestAllOfContentPlaceholders.ts} | 28 +- src/models/UploadSectionListResponse.ts | 9 +- ... UploadSectionListResponseResultsInner.ts} | 7 +- src/models/UploadSectionRequest.ts | 127 +- src/models/UploadSectionRequestOneOf.ts | 98 + src/models/UploadSectionResponse.ts | 14 +- src/models/UploadSectionStatusEnum.ts | 6 +- src/models/UploadSectionStatusResponse.ts | 5 +- src/models/UserLicenseEnum.ts | 18 + src/models/WebhookEventDetailsResponse.ts | 17 +- src/models/WebhookEventErrorEnum.ts | 7 +- .../WebhookEventHttpStatusCodeGroupEnum.ts | 8 +- src/models/WebhookEventItemResponse.ts | 13 +- src/models/WebhookEventPageResponse.ts | 5 +- src/models/WebhookEventTriggerEnum.ts | 16 +- .../WebhookSubscriptionCreateRequest.ts | 33 +- src/models/WebhookSubscriptionItemResponse.ts | 15 +- src/models/WebhookSubscriptionListResponse.ts | 5 +- src/models/WebhookSubscriptionPatchRequest.ts | 26 +- src/models/WebhookSubscriptionPayloadEnum.ts | 8 +- .../WebhookSubscriptionSharedKeyResponse.ts | 3 +- src/models/WebhookSubscriptionStatusEnum.ts | 6 +- src/models/WebhookSubscriptionTriggerEnum.ts | 16 +- src/models/WorkspaceMemberRoleEnum.ts | 20 + src/models/all.ts | 521 +- src/pandadoc/httpErrorBody.ts | 36 + src/pandadoc/oneOfTypeResolver.ts | 23 + src/servers.ts | 11 +- src/types/ObjectParamAPI.ts | 3828 ++++++++++++-- src/types/ObservableAPI.ts | 4533 ++++++++++++++--- src/types/PromiseAPI.ts | 3390 ++++++++++-- tsconfig.json | 30 +- 443 files changed, 39159 insertions(+), 7100 deletions(-) create mode 100644 docs/CommunicationPreferencesApi.md create mode 100644 docs/DocumentAuditTrailApi.md create mode 100644 docs/DocumentFieldsApi.md create mode 100644 docs/DocumentLinkToCRMApi.md create mode 100644 docs/DocumentRemindersApi.md create mode 100644 docs/DocumentSectionsBundlesApi.md create mode 100644 docs/DocumentSettingsApi.md rename docs/{FoldersAPIApi.md => FoldersApi.md} (76%) create mode 100644 docs/NotaryApi.md create mode 100644 docs/ProductCatalogApi.md delete mode 100644 docs/SectionsApi.md create mode 100644 docs/TemplateSettingsApi.md create mode 100644 src/.gitattributes create mode 100644 src/apis/CommunicationPreferencesApi.ts create mode 100644 src/apis/DocumentAuditTrailApi.ts create mode 100644 src/apis/DocumentFieldsApi.ts create mode 100644 src/apis/DocumentLinkToCRMApi.ts create mode 100644 src/apis/DocumentRemindersApi.ts create mode 100644 src/apis/DocumentSectionsBundlesApi.ts create mode 100644 src/apis/DocumentSettingsApi.ts rename src/apis/{FoldersAPIApi.ts => FoldersApi.ts} (58%) create mode 100644 src/apis/NotaryApi.ts create mode 100644 src/apis/ProductCatalogApi.ts delete mode 100644 src/apis/SectionsApi.ts create mode 100644 src/apis/TemplateSettingsApi.ts rename src/models/{APILogListResponseResults.ts => APILogListResponseResultsInner.ts} (87%) create mode 100644 src/models/AccessToken400Response.ts create mode 100644 src/models/AddDsvNamedItemsRequest.ts create mode 100644 src/models/AddDsvNamedItemsRequestItemsInner.ts create mode 100644 src/models/AddDsvNamedItemsResponse.ts create mode 100644 src/models/AddDsvNamedItemsResponseResultsInner.ts create mode 100644 src/models/AddMember400Response.ts create mode 100644 src/models/ApiKeyTypeEnum.ts create mode 100644 src/models/ApiLogEnvironmentTypeEnum.ts create mode 100644 src/models/ApiLogMethodEnum.ts create mode 100644 src/models/ApiLogStatusEnum.ts create mode 100644 src/models/AppendCLIDataRequest.ts create mode 100644 src/models/AppendCLIDataRequestCli.ts create mode 100644 src/models/AppendCLIDataRequestCliPagesInner.ts create mode 100644 src/models/AppendCLIDataResponse.ts create mode 100644 src/models/AppendCLIDataResponseBlockMapping.ts create mode 100644 src/models/AppendCLIDataResponseBlockMappingImagesInner.ts create mode 100644 src/models/AppendCLIDataResponseBlockMappingPricingTablesInner.ts create mode 100644 src/models/AppendCLIDataResponseBlockMappingTablesInner.ts create mode 100644 src/models/AppendCLIDataResponseBlockMappingTextsInner.ts create mode 100644 src/models/AppendCLIDataResponseCli.ts create mode 100644 src/models/AppendCLIDataResponseCliPagesInner.ts create mode 100644 src/models/AssignedToRecipientDeliveryMethods.ts create mode 100644 src/models/AutoReminders.ts create mode 100644 src/models/BaseActor.ts create mode 100644 src/models/BaseEditingSessionResponse.ts create mode 100644 src/models/BaseField.ts create mode 100644 src/models/BaseFieldAssignedTo.ts create mode 100644 src/models/BaseIdentity.ts create mode 100644 src/models/ChangeDocumentStatus409Response.ts create mode 100644 src/models/Checkbox.ts create mode 100644 src/models/CollectFile.ts create mode 100644 src/models/CollectFileAllOfValue.ts create mode 100644 src/models/ContentLibraryItemCreateFromUrlRequest.ts create mode 100644 src/models/ContentLibraryItemCreateRequest.ts rename src/models/{ContentLibraryItemListResponseResults.ts => ContentLibraryItemListResponseResultsInner.ts} (86%) create mode 100644 src/models/ContentLibraryResponse.ts create mode 100644 src/models/CreateApiKeyRequest.ts create mode 100644 src/models/CreateApiKeyResponse.ts create mode 100644 src/models/CreateDocument400Response.ts create mode 100644 src/models/CreateDocumentActor.ts create mode 100644 src/models/CreateDocumentEditingSession201Response.ts create mode 100644 src/models/CreateDocumentFieldsRequest.ts create mode 100644 src/models/CreateDocumentFieldsResponse.ts create mode 100644 src/models/CreateDocumentRecipient.ts create mode 100644 src/models/CreateDocumentRecipientGroup.ts create mode 100644 src/models/CreateMemberTokenRequest.ts create mode 100644 src/models/CreateMemberTokenResponse.ts create mode 100644 src/models/CreateNotarizationRequest.ts create mode 100644 src/models/CreateNotarizationRequestInvitation.ts create mode 100644 src/models/CreateNotarizationRequestInvitationInviteesInner.ts create mode 100644 src/models/CreateNotarizationRequestNotary.ts create mode 100644 src/models/CreateNotarizationResponse.ts create mode 100644 src/models/CreateNotarizationResponseCreatedBy.ts create mode 100644 src/models/CreateNotarizationResponseInviteesInner.ts create mode 100644 src/models/CreateTemplateEditingSession201Response.ts create mode 100644 src/models/CreateTemplateFromUrlRequest.ts create mode 100644 src/models/CreateTemplateRequest.ts create mode 100644 src/models/CreateTemplateRequestOwner.ts create mode 100644 src/models/CreateUser400Response.ts rename src/models/{CreateUserRequestWorkspaces.ts => CreateUserRequestWorkspacesInner.ts} (69%) create mode 100644 src/models/CreateUserResponseWorkspacesInner.ts create mode 100644 src/models/DeleteNotarizationRequest404Response.ts create mode 100644 src/models/DocumentAttachmentMetadata.ts create mode 100644 src/models/DocumentAttachmentRequest.ts create mode 100644 src/models/DocumentAuditTrailResponse.ts create mode 100644 src/models/DocumentAuditTrailResponseResultsInner.ts create mode 100644 src/models/DocumentAuditTrailResponseResultsInnerUser.ts create mode 100644 src/models/DocumentAutoRemindersResponse.ts create mode 100644 src/models/DocumentAutoRemindersResponse400.ts create mode 100644 src/models/DocumentAutoRemindersResponseResultInner.ts rename src/models/{DocumentCreateByTemplateRequestContentPlaceholders.ts => DocumentCreateByTemplateRequestContentPlaceholdersInner.ts} (66%) rename src/models/{DocumentCreateByTemplateRequestContentLibraryItems.ts => DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInner.ts} (57%) rename src/models/{DocumentCreateRequestRecipients.ts => DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInnerRecipientsInner.ts} (73%) create mode 100644 src/models/DocumentCreateByTemplateRequestFieldsValue.ts create mode 100644 src/models/DocumentCreateByTemplateRequestFieldsValueValue.ts rename src/models/{DocumentCreateRequestImages.ts => DocumentCreateByTemplateRequestImagesInner.ts} (80%) create mode 100644 src/models/DocumentCreateByTemplateRequestOwner.ts create mode 100644 src/models/DocumentCreateByTemplateRequestTextsInner.ts create mode 100644 src/models/DocumentCreateByTemplateRequestTokensInner.ts create mode 100644 src/models/DocumentCreateRequestOneOf.ts create mode 100644 src/models/DocumentCreateRequestOneOf1.ts rename src/models/{DocumentCreateResponseLinks.ts => DocumentCreateResponseLinksInner.ts} (83%) create mode 100644 src/models/DocumentDeliveryMethodEnum.ts rename src/models/{DocumentDetailsResponseRecipients.ts => DocumentDetailsRecipient.ts} (72%) create mode 100644 src/models/DocumentDetailsRecipientGroup.ts rename src/models/{DocumentUpdateRequestRecipients.ts => DocumentDetailsRecipientGroupMember.ts} (66%) create mode 100644 src/models/DocumentDetailsResponseImagesInner.ts create mode 100644 src/models/DocumentDetailsResponseLinkedObjectsInner.ts rename src/models/{DocumentDetailsResponseLinkedObjects.ts => DocumentDetailsResponseLinkedObjectsInnerChildrenInner.ts} (72%) create mode 100644 src/models/DocumentDetailsResponseRecipientsInner.ts create mode 100644 src/models/DocumentDetailsResponseTablesInner.ts create mode 100644 src/models/DocumentDetailsResponseTextsInner.ts create mode 100644 src/models/DocumentDocxExport.ts create mode 100644 src/models/DocumentDocxExportStatusEnum.ts create mode 100644 src/models/DocumentESignDisclosure.ts create mode 100644 src/models/DocumentESignDisclosureResult.ts create mode 100644 src/models/DocumentFieldAnchorPointEnum.ts create mode 100644 src/models/DocumentFieldTypeEnum.ts create mode 100644 src/models/DocumentFieldsField.ts rename src/models/{DocumentCreateByTemplateRequestRecipients.ts => DocumentFieldsFieldAssignedTo.ts} (62%) create mode 100644 src/models/DocumentFieldsFieldCreate.ts create mode 100644 src/models/DocumentFieldsLayout.ts create mode 100644 src/models/DocumentFieldsLayoutPosition.ts create mode 100644 src/models/DocumentFieldsLayoutStyle.ts create mode 100644 src/models/DocumentLanguageEnum.ts create mode 100644 src/models/DocumentListResponseResultsInner.ts rename src/models/{DocumentListResponseResults.ts => DocumentRevertToDraftResponse.ts} (88%) create mode 100644 src/models/DocumentSendManualReminder200Response.ts create mode 100644 src/models/DocumentSendManualReminder200ResponseResultInner.ts create mode 100644 src/models/DocumentSendManualReminder200ResponseResultInnerEmail.ts create mode 100644 src/models/DocumentSendManualReminder200ResponseResultInnerEmailCustomization.ts create mode 100644 src/models/DocumentSendManualReminder200ResponseResultInnerSms.ts create mode 100644 src/models/DocumentSendManualReminder409Response.ts create mode 100644 src/models/DocumentSendManualReminderRequest.ts create mode 100644 src/models/DocumentSendManualReminderRequestRemindersInner.ts create mode 100644 src/models/DocumentSendManualReminderRequestRemindersInnerEmailCustomization.ts rename src/models/{DocumentSendRequestSelectedApproversSteps.ts => DocumentSendRequestSelectedApproversStepsInner.ts} (61%) rename src/models/{DocumentSendRequestSelectedApproversGroup.ts => DocumentSendRequestSelectedApproversStepsInnerGroup.ts} (60%) rename src/models/{DocumentSendRequestSelectedApproversGroupAssignees.ts => DocumentSendRequestSelectedApproversStepsInnerGroupAssigneesInner.ts} (74%) create mode 100644 src/models/DocumentSendRequestSender.ts rename src/models/{DocumentSendResponseRecipients.ts => DocumentSendResponseRecipientsInner.ts} (80%) create mode 100644 src/models/DocumentSettingsResponse.ts create mode 100644 src/models/DocumentStatusChangeRequestStatusEnum.ts create mode 100644 src/models/DocumentUpdateRequestFieldValue.ts rename src/models/{DocumentCreateByTemplateRequestImages.ts => DocumentUpdateRequestImagesInner.ts} (81%) create mode 100644 src/models/DocumentUpdateRequestTextsInner.ts rename src/models/{DocumentCreateByTemplateRequestTokens.ts => DocumentUpdateRequestTokensInner.ts} (81%) rename src/models/{DocumentsFolderListResponseResults.ts => DocumentsFolderListResponseResultsInner.ts} (86%) create mode 100644 src/models/DocxExportTaskResponse.ts create mode 100644 src/models/DocxExportTaskResponseAllOfDocxItems.ts create mode 100644 src/models/Dropdown.ts create mode 100644 src/models/EditingSessionRequest.ts create mode 100644 src/models/Field.ts rename src/models/{FormListResponseResults.ts => FormListResponseResultsInner.ts} (88%) create mode 100644 src/models/Initials.ts create mode 100644 src/models/LinkedObjectChild.ts create mode 100644 src/models/ListCatalogItemsSearchResponse.ts create mode 100644 src/models/ListDocumentFieldsResponse.ts create mode 100644 src/models/ListDocuments400Response.ts create mode 100644 src/models/ListDocuments401Response.ts create mode 100644 src/models/ListDocuments403Response.ts create mode 100644 src/models/ListDocuments403ResponseLinksInner.ts create mode 100644 src/models/ListDocuments429Response.ts create mode 100644 src/models/ListDocumentsByLinkedObjectsResponseInner.ts create mode 100644 src/models/ListNotaries400Response.ts create mode 100644 src/models/ListNotaries400ResponseDetailsInner.ts create mode 100644 src/models/ListNotaries403Response.ts create mode 100644 src/models/ListNotaries429Response.ts create mode 100644 src/models/ListNotariesResponse.ts create mode 100644 src/models/ListNotariesResponseResultsInner.ts create mode 100644 src/models/ListSmsOptOutChangelogResponse.ts create mode 100644 src/models/ListSmsOptOutChangelogResponseResultsInner.ts create mode 100644 src/models/ListUsersResponse.ts create mode 100644 src/models/ListUsersResponseResultsInner.ts create mode 100644 src/models/ListUsersResponseResultsInnerWorkspacesInner.ts create mode 100644 src/models/ListWorkspacesResponse.ts create mode 100644 src/models/ListWorkspacesResponseResultsInner.ts create mode 100644 src/models/ModelDate.ts create mode 100644 src/models/NotarizationRequestDetailsResponse.ts create mode 100644 src/models/NotarizationRequestDetailsResponseCreatedBy.ts create mode 100644 src/models/NotarizationRequestDetailsResponseInviteesInner.ts create mode 100644 src/models/NotarizationRequestDetailsResponseRecording.ts create mode 100644 src/models/NotarizationRequestDetailsResponseSignedDocumentsInner.ts create mode 100644 src/models/Payment.ts rename src/models/{PricingTableRequestSections.ts => PricingTableRequestSectionsInner.ts} (72%) rename src/models/{PricingTableRequestRows.ts => PricingTableRequestSectionsInnerRowsInner.ts} (78%) rename src/models/{PricingTableResponseItems.ts => PricingTableResponseItemsInner.ts} (70%) rename src/models/{QuoteResponseSummaryDiscounts.ts => PricingTableResponseItemsInnerDiscount.ts} (75%) rename src/models/{PricingTableResponseOptions.ts => PricingTableResponseItemsInnerOptions.ts} (76%) create mode 100644 src/models/ProductCatalogCatalogCustomBundleItem.ts create mode 100644 src/models/ProductCatalogCatalogItemInBundle.ts create mode 100644 src/models/ProductCatalogCustomBundleItemNoId.ts create mode 100644 src/models/ProductCatalogCustomCatalogItemInBundle.ts create mode 100644 src/models/ProductCatalogItemPatchRequest.ts create mode 100644 src/models/ProductCatalogItemPatchRequestBundleItemsInner.ts create mode 100644 src/models/ProductCatalogItemPatchRequestBundleItemsInnerItemOrUuid.ts create mode 100644 src/models/ProductCatalogItemPatchRequestProductVariant.ts create mode 100644 src/models/ProductCatalogItemPriceConfiguration.ts rename src/models/{QuoteUpdateRequestPriceSettingsTiers.ts => ProductCatalogItemPriceTier.ts} (79%) create mode 100644 src/models/ProductCatalogItemRequest.ts create mode 100644 src/models/ProductCatalogItemRequestBundleItemsInner.ts create mode 100644 src/models/ProductCatalogItemRequestBundleItemsInnerItemOrUuid.ts create mode 100644 src/models/ProductCatalogItemRequestCustomFieldsInner.ts create mode 100644 src/models/ProductCatalogItemRequestImagesInner.ts create mode 100644 src/models/ProductCatalogItemResponse.ts create mode 100644 src/models/ProductCatalogItemResponseBundleItemsInner.ts create mode 100644 src/models/ProductCatalogItemResponseBundleItemsInnerItem.ts create mode 100644 src/models/ProductCatalogItemResponseDefaultPriceConfiguration.ts create mode 100644 src/models/ProductCatalogItemResponseVariantsInner.ts create mode 100644 src/models/ProductCatalogPricingMethodEnum.ts create mode 100644 src/models/ProductCatalogSearchCatalogItemResponse.ts create mode 100644 src/models/ProductCatalogSearchCatalogItemResponseCustomFieldsInner.ts create mode 100644 src/models/ProductCatalogSearchCatalogItemResponseImagesInner.ts rename src/models/{QuoteUpdateRequestDiscounts.ts => ProductCatalogSearchCatalogItemResponseTiersInner.ts} (68%) create mode 100644 src/models/ProductCatalogTypeEnum.ts rename src/models/{QuoteResponseMergeRules.ts => QuoteResponseMergeRulesInner.ts} (63%) rename src/models/{QuoteResponseAction.ts => QuoteResponseMergeRulesInnerAction.ts} (81%) rename src/models/{QuoteResponseCondition.ts => QuoteResponseMergeRulesInnerCondition.ts} (66%) rename src/models/{QuoteResponseConditionComparison.ts => QuoteResponseMergeRulesInnerConditionComparisonInner.ts} (78%) rename src/models/{QuoteResponseOptions.ts => QuoteResponseSectionItemOptions.ts} (76%) rename src/models/{QuoteResponseSections.ts => QuoteResponseSectionsInner.ts} (76%) rename src/models/{PricingTableResponseDiscount.ts => QuoteResponseSummaryDiscountsValue.ts} (76%) rename src/models/{QuoteResponseSummaryRecurringSubtotal.ts => QuoteResponseSummaryRecurringSubtotalInner.ts} (80%) create mode 100644 src/models/QuoteUpdateRequestBillingFrequencyEnum.ts create mode 100644 src/models/QuoteUpdateRequestDiscountTypeEnum.ts delete mode 100644 src/models/QuoteUpdateRequestSettings1.ts create mode 100644 src/models/QuoteUpdateRequestSettingsSelectionTypeTypeEnum.ts create mode 100644 src/models/RadioButtons.ts create mode 100644 src/models/RecipientAssignedTo.ts create mode 100644 src/models/RecipientAssignmentDetails.ts rename src/models/{RicipientDeliveryMethods.ts => RecipientDeliveryMethods.ts} (82%) create mode 100644 src/models/RecipientKindEnum.ts create mode 100644 src/models/RecipientPersonalDetails.ts create mode 100644 src/models/RecipientRedirectSettings.ts create mode 100644 src/models/RecipientVerificationPlaceEnum.ts create mode 100644 src/models/RecipientVerificationSettingsIdVerification.ts create mode 100644 src/models/RecipientVerificationSettingsKbaVerification.ts create mode 100644 src/models/RecipientsGroupAssignedTo.ts rename src/models/{TemplateDetailsResponsePreassignedPerson.ts => RecipientsGroupAssignedToAllOfMembers.ts} (62%) create mode 100644 src/models/RemoveMember400Response.ts create mode 100644 src/models/RemoveMember404Response.ts create mode 100644 src/models/SearchCatalogItems401Response.ts create mode 100644 src/models/Signature.ts create mode 100644 src/models/Stamp.ts create mode 100644 src/models/StatusDocument404Response.ts create mode 100644 src/models/StatusDocumentAutoReminder400Response.ts create mode 100644 src/models/TableCell.ts create mode 100644 src/models/TableRequest.ts create mode 100644 src/models/TableRequestData.ts create mode 100644 src/models/TableRequestDataSectionsInner.ts rename src/models/{TemplateListResponseResults.ts => TemplateCreateResponse.ts} (74%) rename src/models/{TemplateDetailsResponseContentPlaceholders.ts => TemplateDetailsResponseContentPlaceholdersInner.ts} (82%) rename src/models/{TemplateDetailsResponseImages.ts => TemplateDetailsResponseImagesInner.ts} (81%) rename src/models/{TemplateDetailsResponseRoles.ts => TemplateDetailsResponseRolesInner.ts} (68%) create mode 100644 src/models/TemplateDetailsResponseRolesInnerPreassignedPerson.ts create mode 100644 src/models/TemplateDetailsResponseRolesInnerPreassignedPersonMembersInner.ts rename src/models/{TemplateDetailsResponseTokens.ts => TemplateDetailsResponseTokensInner.ts} (81%) create mode 100644 src/models/TemplateSettingsResponse.ts create mode 100644 src/models/TemplateStatusResponse.ts create mode 100644 src/models/TemplateUpdateRequest.ts rename src/models/{TemplatesFolderListResponseResults.ts => TemplatesFolderListResponseResultsInner.ts} (86%) create mode 100644 src/models/Text.ts create mode 100644 src/models/UpdateDocument400Response.ts create mode 100644 src/models/UpdateDocumentActor.ts create mode 100644 src/models/UpdateDocumentAutoRemindersRequest.ts create mode 100644 src/models/UpdateDocumentAutoRemindersResponse.ts create mode 100644 src/models/UpdateDocumentRecipient.ts create mode 100644 src/models/UpdateDocumentRecipientGroup.ts create mode 100644 src/models/UpdateDocumentSettingsRequest.ts create mode 100644 src/models/UpdateIntegrationQuoteSectionItemDiscountsValue.ts rename src/models/{QuoteUpdateRequestOptions.ts => UpdateIntegrationQuoteSectionItemOptions.ts} (84%) rename src/models/{QuoteUpdateRequestPriceSettings.ts => UpdateIntegrationQuoteSectionItemPriceSettings.ts} (66%) create mode 100644 src/models/UpdateIntegrationQuoteSectionItemPriceSettingsTiersInner.ts create mode 100644 src/models/UpdateIntegrationQuoteSectionSettings.ts create mode 100644 src/models/UpdateTemplateSettingsRequest.ts create mode 100644 src/models/UploadSectionBase.ts delete mode 100644 src/models/UploadSectionByPdfRequest.ts rename src/models/{DocumentCreateRequestContentLibraryItems.ts => UploadSectionByTemplateRequestAllOfContentLibraryItems.ts} (60%) rename src/models/{DocumentCreateRequestContentPlaceholders.ts => UploadSectionByTemplateRequestAllOfContentPlaceholders.ts} (58%) rename src/models/{UploadSectionListResponseResults.ts => UploadSectionListResponseResultsInner.ts} (80%) create mode 100644 src/models/UploadSectionRequestOneOf.ts create mode 100644 src/models/UserLicenseEnum.ts create mode 100644 src/models/WorkspaceMemberRoleEnum.ts create mode 100644 src/pandadoc/httpErrorBody.ts create mode 100644 src/pandadoc/oneOfTypeResolver.ts diff --git a/.gitignore b/.gitignore index 0515d3f..7a82c57 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,4 @@ dist .idea .vscode .history -.npmrc \ No newline at end of file +.npmrc diff --git a/README.md b/README.md index d69070c..279a3c4 100644 --- a/README.md +++ b/README.md @@ -58,72 +58,119 @@ All URIs are relative to *https://api.pandadoc.com* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*APILogsApi* | [**detailsLog**](docs/APILogsApi.md#detailslog) | **GET** /public/v1/logs/{id} | Details API Log +*APILogsApi* | [**detailsLog**](docs/APILogsApi.md#detailslog) | **GET** /public/v1/logs/{id} | API Log Details *APILogsApi* | [**listLogs**](docs/APILogsApi.md#listlogs) | **GET** /public/v1/logs | List API Log +*CommunicationPreferencesApi* | [**listRecentSmsOptOuts**](docs/CommunicationPreferencesApi.md#listrecentsmsoptouts) | **GET** /public/v1/sms-opt-outs | Recent SMS Opt-out *ContactsApi* | [**createContact**](docs/ContactsApi.md#createcontact) | **POST** /public/v1/contacts | Create contact -*ContactsApi* | [**deleteContact**](docs/ContactsApi.md#deletecontact) | **DELETE** /public/v1/contacts/{id} | Delete contact by id -*ContactsApi* | [**detailsContact**](docs/ContactsApi.md#detailscontact) | **GET** /public/v1/contacts/{id} | Get contact details by id +*ContactsApi* | [**deleteContact**](docs/ContactsApi.md#deletecontact) | **DELETE** /public/v1/contacts/{id} | Delete Contact +*ContactsApi* | [**detailsContact**](docs/ContactsApi.md#detailscontact) | **GET** /public/v1/contacts/{id} | Contact Details *ContactsApi* | [**listContacts**](docs/ContactsApi.md#listcontacts) | **GET** /public/v1/contacts | List contacts -*ContactsApi* | [**updateContact**](docs/ContactsApi.md#updatecontact) | **PATCH** /public/v1/contacts/{id} | Update contact by id -*ContentLibraryItemsApi* | [**detailsContentLibraryItem**](docs/ContentLibraryItemsApi.md#detailscontentlibraryitem) | **GET** /public/v1/content-library-items/{id}/details | Details Content Library Item +*ContactsApi* | [**updateContact**](docs/ContactsApi.md#updatecontact) | **PATCH** /public/v1/contacts/{id} | Update Contact +*ContentLibraryItemsApi* | [**createContentLibraryItem**](docs/ContentLibraryItemsApi.md#createcontentlibraryitem) | **POST** /public/v1/content-library-items | Create Content Library Item +*ContentLibraryItemsApi* | [**createContentLibraryItemFromUpload**](docs/ContentLibraryItemsApi.md#createcontentlibraryitemfromupload) | **POST** /public/v1/content-library-items?upload | Create Content Library Item from File Upload +*ContentLibraryItemsApi* | [**detailsContentLibraryItem**](docs/ContentLibraryItemsApi.md#detailscontentlibraryitem) | **GET** /public/v1/content-library-items/{id}/details | Content Library Item Details *ContentLibraryItemsApi* | [**listContentLibraryItems**](docs/ContentLibraryItemsApi.md#listcontentlibraryitems) | **GET** /public/v1/content-library-items | List Content Library Item -*DocumentAttachmentsApi* | [**createDocumentAttachment**](docs/DocumentAttachmentsApi.md#createdocumentattachment) | **POST** /public/v1/documents/{id}/attachments | Document Attachment Create -*DocumentAttachmentsApi* | [**deleteDocumentAttachment**](docs/DocumentAttachmentsApi.md#deletedocumentattachment) | **DELETE** /public/v1/documents/{id}/attachments/{attachment_id} | Document Attachment Delete +*ContentLibraryItemsApi* | [**statusContentLibraryItem**](docs/ContentLibraryItemsApi.md#statuscontentlibraryitem) | **GET** /public/v1/content-library-items/{id} | Content Library Item Status +*DocumentAttachmentsApi* | [**createDocumentAttachment**](docs/DocumentAttachmentsApi.md#createdocumentattachment) | **POST** /public/v1/documents/{id}/attachments | Create Document Attachment +*DocumentAttachmentsApi* | [**createDocumentAttachmentFromFileUpload**](docs/DocumentAttachmentsApi.md#createdocumentattachmentfromfileupload) | **POST** /public/v1/documents/{id}/attachments?upload | Create Document Attachment From Upload +*DocumentAttachmentsApi* | [**deleteDocumentAttachment**](docs/DocumentAttachmentsApi.md#deletedocumentattachment) | **DELETE** /public/v1/documents/{id}/attachments/{attachment_id} | Delete Document Attachment *DocumentAttachmentsApi* | [**detailsDocumentAttachment**](docs/DocumentAttachmentsApi.md#detailsdocumentattachment) | **GET** /public/v1/documents/{id}/attachments/{attachment_id} | Document Attachment Details -*DocumentAttachmentsApi* | [**downloadDocumentAttachment**](docs/DocumentAttachmentsApi.md#downloaddocumentattachment) | **GET** /public/v1/documents/{id}/attachments/{attachment_id}/download | Document Attachment Download -*DocumentAttachmentsApi* | [**listDocumentAttachments**](docs/DocumentAttachmentsApi.md#listdocumentattachments) | **GET** /public/v1/documents/{id}/attachments | Document Attachment List +*DocumentAttachmentsApi* | [**downloadDocumentAttachment**](docs/DocumentAttachmentsApi.md#downloaddocumentattachment) | **GET** /public/v1/documents/{id}/attachments/{attachment_id}/download | Download Document Attachment +*DocumentAttachmentsApi* | [**listDocumentAttachments**](docs/DocumentAttachmentsApi.md#listdocumentattachments) | **GET** /public/v1/documents/{id}/attachments | List Document Attachments +*DocumentAuditTrailApi* | [**listDocumentAuditTrail**](docs/DocumentAuditTrailApi.md#listdocumentaudittrail) | **GET** /public/v2/documents/{document_id}/audit-trail | List Document Audit Trail +*DocumentFieldsApi* | [**createDocumentFields**](docs/DocumentFieldsApi.md#createdocumentfields) | **POST** /public/v1/documents/{id}/fields | Create Document Fields +*DocumentFieldsApi* | [**listDocumentFields**](docs/DocumentFieldsApi.md#listdocumentfields) | **GET** /public/v1/documents/{id}/fields | List Document Fields +*DocumentLinkToCRMApi* | [**createLinkedObject**](docs/DocumentLinkToCRMApi.md#createlinkedobject) | **POST** /public/v1/documents/{id}/linked-objects | Create Linked Object +*DocumentLinkToCRMApi* | [**deleteLinkedObject**](docs/DocumentLinkToCRMApi.md#deletelinkedobject) | **DELETE** /public/v1/documents/{id}/linked-objects/{linked_object_id} | Delete Linked Object +*DocumentLinkToCRMApi* | [**listDocumentsByLinkedObject**](docs/DocumentLinkToCRMApi.md#listdocumentsbylinkedobject) | **GET** /public/v1/documents/linked-objects | List Documents by Linked Object +*DocumentLinkToCRMApi* | [**listLinkedObjects**](docs/DocumentLinkToCRMApi.md#listlinkedobjects) | **GET** /public/v1/documents/{id}/linked-objects | List Linked Objects *DocumentRecipientsApi* | [**addDocumentRecipient**](docs/DocumentRecipientsApi.md#adddocumentrecipient) | **POST** /public/v1/documents/{id}/recipients | Add Document Recipient *DocumentRecipientsApi* | [**deleteDocumentRecipient**](docs/DocumentRecipientsApi.md#deletedocumentrecipient) | **DELETE** /public/v1/documents/{id}/recipients/{recipient_id} | Delete Document Recipient -*DocumentRecipientsApi* | [**editDocumentRecipient**](docs/DocumentRecipientsApi.md#editdocumentrecipient) | **PATCH** /public/v1/documents/{id}/recipients/recipient/{recipient_id} | Edit Document Recipient -*DocumentRecipientsApi* | [**reassignDocumentRecipient**](docs/DocumentRecipientsApi.md#reassigndocumentrecipient) | **POST** /public/v1/documents/{id}/recipients/{recipient_id}/reassign | Reassign Document Recipient -*DocumentsApi* | [**changeDocumentStatus**](docs/DocumentsApi.md#changedocumentstatus) | **PATCH** /public/v1/documents/{id}/status | Document status change -*DocumentsApi* | [**createDocument**](docs/DocumentsApi.md#createdocument) | **POST** /public/v1/documents | Create document -*DocumentsApi* | [**createDocumentLink**](docs/DocumentsApi.md#createdocumentlink) | **POST** /public/v1/documents/{id}/session | Create a Document Link -*DocumentsApi* | [**createLinkedObject**](docs/DocumentsApi.md#createlinkedobject) | **POST** /public/v1/documents/{id}/linked-objects | Create Linked Object -*DocumentsApi* | [**deleteDocument**](docs/DocumentsApi.md#deletedocument) | **DELETE** /public/v1/documents/{id} | Delete document by id -*DocumentsApi* | [**deleteLinkedObject**](docs/DocumentsApi.md#deletelinkedobject) | **DELETE** /public/v1/documents/{id}/linked-objects/{linked_object_id} | Delete Linked Object -*DocumentsApi* | [**detailsDocument**](docs/DocumentsApi.md#detailsdocument) | **GET** /public/v1/documents/{id}/details | Document details +*DocumentRecipientsApi* | [**editDocumentRecipient**](docs/DocumentRecipientsApi.md#editdocumentrecipient) | **PATCH** /public/v1/documents/{id}/recipients/recipient/{recipient_id} | Update Document Recipient +*DocumentRecipientsApi* | [**reassignDocumentRecipient**](docs/DocumentRecipientsApi.md#reassigndocumentrecipient) | **POST** /public/v1/documents/{id}/recipients/{recipient_id}/reassign | Change Signer (Reassign Document Recipient) +*DocumentRemindersApi* | [**createManualReminder**](docs/DocumentRemindersApi.md#createmanualreminder) | **POST** /public/v1/documents/{document_id}/send-reminder | Send Manual Reminder +*DocumentRemindersApi* | [**getDocumentAutoReminderSettings**](docs/DocumentRemindersApi.md#getdocumentautoremindersettings) | **GET** /public/v1/documents/{document_id}/auto-reminders | Document Auto Reminder Settings +*DocumentRemindersApi* | [**statusDocumentAutoReminder**](docs/DocumentRemindersApi.md#statusdocumentautoreminder) | **GET** /public/v1/documents/{document_id}/auto-reminders/status | Document Auto Reminder Status +*DocumentRemindersApi* | [**updateDocumentAutoReminderSettings**](docs/DocumentRemindersApi.md#updatedocumentautoremindersettings) | **PATCH** /public/v1/documents/{document_id}/auto-reminders | Update Document Auto Reminder Settings +*DocumentSectionsBundlesApi* | [**deleteSection**](docs/DocumentSectionsBundlesApi.md#deletesection) | **DELETE** /public/v1/documents/{document_id}/sections/{section_id} | Delete Document Section +*DocumentSectionsBundlesApi* | [**listSections**](docs/DocumentSectionsBundlesApi.md#listsections) | **GET** /public/v1/documents/{document_id}/sections | List Document Sections +*DocumentSectionsBundlesApi* | [**sectionDetails**](docs/DocumentSectionsBundlesApi.md#sectiondetails) | **GET** /public/v1/documents/{document_id}/sections/uploads/{upload_id} | Document Section Upload Status +*DocumentSectionsBundlesApi* | [**sectionInfo**](docs/DocumentSectionsBundlesApi.md#sectioninfo) | **GET** /public/v1/documents/{document_id}/sections/{section_id} | Document Section Details +*DocumentSectionsBundlesApi* | [**uploadSection**](docs/DocumentSectionsBundlesApi.md#uploadsection) | **POST** /public/v1/documents/{document_id}/sections/uploads | Create Document Section +*DocumentSectionsBundlesApi* | [**uploadSectionWithUpload**](docs/DocumentSectionsBundlesApi.md#uploadsectionwithupload) | **POST** /public/v1/documents/{document_id}/sections/uploads?upload | Create Document Section from File Upload +*DocumentSettingsApi* | [**documentSettingsGet**](docs/DocumentSettingsApi.md#documentsettingsget) | **GET** /public/v2/documents/{document_id}/settings | Get document settings +*DocumentSettingsApi* | [**documentSettingsUpdate**](docs/DocumentSettingsApi.md#documentsettingsupdate) | **PATCH** /public/v2/documents/{document_id}/settings | Update document settings +*DocumentsApi* | [**appendContentLibraryItemToDocument**](docs/DocumentsApi.md#appendcontentlibraryitemtodocument) | **POST** /public/v1/documents/{id}/append-content-library-item | Append Content Library Item to a document +*DocumentsApi* | [**changeDocumentStatus**](docs/DocumentsApi.md#changedocumentstatus) | **PATCH** /public/v1/documents/{id}/status | Document Status Change +*DocumentsApi* | [**changeDocumentStatusWithUpload**](docs/DocumentsApi.md#changedocumentstatuswithupload) | **PATCH** /public/v1/documents/{id}/status?upload | Document Status Change with Upload +*DocumentsApi* | [**createDocument**](docs/DocumentsApi.md#createdocument) | **POST** /public/v1/documents | Create Document +*DocumentsApi* | [**createDocumentEditingSession**](docs/DocumentsApi.md#createdocumenteditingsession) | **POST** /public/v1/documents/{id}/editing-sessions | Create Document Editing Session +*DocumentsApi* | [**createDocumentFromUpload**](docs/DocumentsApi.md#createdocumentfromupload) | **POST** /public/v1/documents?upload | Create Document from File Upload +*DocumentsApi* | [**createDocumentLink**](docs/DocumentsApi.md#createdocumentlink) | **POST** /public/v1/documents/{id}/session | Create Document Session for Embedded Sign +*DocumentsApi* | [**createExportDocxTask**](docs/DocumentsApi.md#createexportdocxtask) | **POST** /public/beta/documents/{document_id}/docx-export-tasks | [Beta] Create DOCX Export Task +*DocumentsApi* | [**deleteDocument**](docs/DocumentsApi.md#deletedocument) | **DELETE** /public/v1/documents/{id} | Delete Document +*DocumentsApi* | [**detailsDocument**](docs/DocumentsApi.md#detailsdocument) | **GET** /public/v1/documents/{id}/details | Document Details +*DocumentsApi* | [**documentESignDisclosure**](docs/DocumentsApi.md#documentesigndisclosure) | **GET** /public/v1/documents/{document_id}/esign-disclosure | Document eSign disclosure *DocumentsApi* | [**documentMoveToFolder**](docs/DocumentsApi.md#documentmovetofolder) | **POST** /public/v1/documents/{id}/move-to-folder/{folder_id} | Document move to folder -*DocumentsApi* | [**downloadDocument**](docs/DocumentsApi.md#downloaddocument) | **GET** /public/v1/documents/{id}/download | Document download -*DocumentsApi* | [**downloadProtectedDocument**](docs/DocumentsApi.md#downloadprotecteddocument) | **GET** /public/v1/documents/{id}/download-protected | Download document protected -*DocumentsApi* | [**listDocuments**](docs/DocumentsApi.md#listdocuments) | **GET** /public/v1/documents | List documents -*DocumentsApi* | [**listLinkedObjects**](docs/DocumentsApi.md#listlinkedobjects) | **GET** /public/v1/documents/{id}/linked-objects | List Linked Objects +*DocumentsApi* | [**documentRevertToDraft**](docs/DocumentsApi.md#documentreverttodraft) | **POST** /public/v1/documents/{id}/draft | Move Document to Draft +*DocumentsApi* | [**downloadDocument**](docs/DocumentsApi.md#downloaddocument) | **GET** /public/v1/documents/{id}/download | Document Download +*DocumentsApi* | [**downloadProtectedDocument**](docs/DocumentsApi.md#downloadprotecteddocument) | **GET** /public/v1/documents/{id}/download-protected | Download Completed Document +*DocumentsApi* | [**getDocxExportTask**](docs/DocumentsApi.md#getdocxexporttask) | **GET** /public/beta/documents/{document_id}/docx-export-tasks/{task_id} | [Beta] DOCX Export Task +*DocumentsApi* | [**listDocuments**](docs/DocumentsApi.md#listdocuments) | **GET** /public/v1/documents | List Documents *DocumentsApi* | [**sendDocument**](docs/DocumentsApi.md#senddocument) | **POST** /public/v1/documents/{id}/send | Send Document -*DocumentsApi* | [**statusDocument**](docs/DocumentsApi.md#statusdocument) | **GET** /public/v1/documents/{id} | Document status +*DocumentsApi* | [**statusDocument**](docs/DocumentsApi.md#statusdocument) | **GET** /public/v1/documents/{id} | Document Status *DocumentsApi* | [**transferAllDocumentsOwnership**](docs/DocumentsApi.md#transferalldocumentsownership) | **PATCH** /public/v1/documents/ownership | Transfer all documents ownership *DocumentsApi* | [**transferDocumentOwnership**](docs/DocumentsApi.md#transferdocumentownership) | **PATCH** /public/v1/documents/{id}/ownership | Update document ownership -*DocumentsApi* | [**updateDocument**](docs/DocumentsApi.md#updatedocument) | **PATCH** /public/v1/documents/{id} | Update Document only in the draft status -*FoldersAPIApi* | [**createDocumentFolder**](docs/FoldersAPIApi.md#createdocumentfolder) | **POST** /public/v1/documents/folders | Create Documents Folder -*FoldersAPIApi* | [**createTemplateFolder**](docs/FoldersAPIApi.md#createtemplatefolder) | **POST** /public/v1/templates/folders | Create Templates Folder -*FoldersAPIApi* | [**listDocumentFolders**](docs/FoldersAPIApi.md#listdocumentfolders) | **GET** /public/v1/documents/folders | List Documents Folders -*FoldersAPIApi* | [**listTemplateFolders**](docs/FoldersAPIApi.md#listtemplatefolders) | **GET** /public/v1/templates/folders | List Templates Folders -*FoldersAPIApi* | [**renameDocumentFolder**](docs/FoldersAPIApi.md#renamedocumentfolder) | **PUT** /public/v1/documents/folders/{id} | Rename Documents Folder -*FoldersAPIApi* | [**renameTemplateFolder**](docs/FoldersAPIApi.md#renametemplatefolder) | **PUT** /public/v1/templates/folders/{id} | Rename Templates Folder -*FormsApi* | [**listForm**](docs/FormsApi.md#listform) | **GET** /public/v1/forms | Forms -*MembersApi* | [**detailsCurrentMember**](docs/MembersApi.md#detailscurrentmember) | **GET** /public/v1/members/current | Current member details -*MembersApi* | [**detailsMember**](docs/MembersApi.md#detailsmember) | **GET** /public/v1/members/{id} | Member details -*MembersApi* | [**listMembers**](docs/MembersApi.md#listmembers) | **GET** /public/v1/members | List members +*DocumentsApi* | [**updateDocument**](docs/DocumentsApi.md#updatedocument) | **PATCH** /public/v1/documents/{id} | Update Document +*FoldersApi* | [**createDocumentFolder**](docs/FoldersApi.md#createdocumentfolder) | **POST** /public/v1/documents/folders | Create Documents Folder +*FoldersApi* | [**createTemplateFolder**](docs/FoldersApi.md#createtemplatefolder) | **POST** /public/v1/templates/folders | Create Templates Folder +*FoldersApi* | [**listDocumentFolders**](docs/FoldersApi.md#listdocumentfolders) | **GET** /public/v1/documents/folders | List Documents Folders +*FoldersApi* | [**listTemplateFolders**](docs/FoldersApi.md#listtemplatefolders) | **GET** /public/v1/templates/folders | List Templates Folders +*FoldersApi* | [**renameDocumentFolder**](docs/FoldersApi.md#renamedocumentfolder) | **PUT** /public/v1/documents/folders/{id} | Rename Documents Folder +*FoldersApi* | [**renameTemplateFolder**](docs/FoldersApi.md#renametemplatefolder) | **PUT** /public/v1/templates/folders/{id} | Rename Templates Folder +*FormsApi* | [**listForm**](docs/FormsApi.md#listform) | **GET** /public/v1/forms | List Forms +*MembersApi* | [**createMemberToken**](docs/MembersApi.md#createmembertoken) | **POST** /public/v1/members/{member_id}/token | Create Member Token +*MembersApi* | [**detailsCurrentMember**](docs/MembersApi.md#detailscurrentmember) | **GET** /public/v1/members/current | Current Member Details +*MembersApi* | [**detailsMember**](docs/MembersApi.md#detailsmember) | **GET** /public/v1/members/{id} | Member Details +*MembersApi* | [**listMembers**](docs/MembersApi.md#listmembers) | **GET** /public/v1/members | List Members +*NotaryApi* | [**createNotarizationRequest**](docs/NotaryApi.md#createnotarizationrequest) | **POST** /public/v2/notary/notarization-requests | Create Notarization Request +*NotaryApi* | [**deleteNotarizationRequest**](docs/NotaryApi.md#deletenotarizationrequest) | **DELETE** /public/v2/notary/notarization-requests/{session_request_id} | Delete Notarization Request +*NotaryApi* | [**listNotaries**](docs/NotaryApi.md#listnotaries) | **GET** /public/v2/notary/notaries | List Notaries +*NotaryApi* | [**notarizationRequestDetails**](docs/NotaryApi.md#notarizationrequestdetails) | **GET** /public/v2/notary/notarization-requests/{session_request_id} | Notarization Request Details *OAuth20AuthenticationApi* | [**accessToken**](docs/OAuth20AuthenticationApi.md#accesstoken) | **POST** /oauth2/access_token | Create/Refresh Access Token +*ProductCatalogApi* | [**createCatalogItem**](docs/ProductCatalogApi.md#createcatalogitem) | **POST** /public/v2/product-catalog/items | Create Catalog Item +*ProductCatalogApi* | [**deleteCatalogItem**](docs/ProductCatalogApi.md#deletecatalogitem) | **DELETE** /public/v2/product-catalog/items/{item_uuid} | Delete Catalog Item +*ProductCatalogApi* | [**getCatalogItem**](docs/ProductCatalogApi.md#getcatalogitem) | **GET** /public/v2/product-catalog/items/{item_uuid} | Catalog Item Details +*ProductCatalogApi* | [**searchCatalogItems**](docs/ProductCatalogApi.md#searchcatalogitems) | **GET** /public/v2/product-catalog/items/search | List Catalog Items Search +*ProductCatalogApi* | [**updateCatalogItem**](docs/ProductCatalogApi.md#updatecatalogitem) | **PATCH** /public/v2/product-catalog/items/{item_uuid} | Update Catalog Item *QuotesApi* | [**quoteUpdate**](docs/QuotesApi.md#quoteupdate) | **PUT** /public/v1/documents/{document_id}/quotes/{quote_id} | Quote update -*SectionsApi* | [**listSections**](docs/SectionsApi.md#listsections) | **GET** /public/v1/documents/{document_id}/sections | List sections -*SectionsApi* | [**sectionDetails**](docs/SectionsApi.md#sectiondetails) | **GET** /public/v1/documents/{document_id}/sections/uploads/{upload_id} | Section details -*SectionsApi* | [**sectionInfo**](docs/SectionsApi.md#sectioninfo) | **GET** /public/v1/documents/{document_id}/sections/{section_id} | Section Info -*SectionsApi* | [**uploadSection**](docs/SectionsApi.md#uploadsection) | **POST** /public/v1/documents/{document_id}/sections/uploads | Upload section +*TemplateSettingsApi* | [**templateSettingsGet**](docs/TemplateSettingsApi.md#templatesettingsget) | **GET** /public/v2/templates/{template_id}/settings | Get template settings +*TemplateSettingsApi* | [**templateSettingsUpdate**](docs/TemplateSettingsApi.md#templatesettingsupdate) | **PATCH** /public/v2/templates/{template_id}/settings | Update template settings +*TemplatesApi* | [**createTemplate**](docs/TemplatesApi.md#createtemplate) | **POST** /public/v1/templates | Create Template +*TemplatesApi* | [**createTemplateEditingSession**](docs/TemplatesApi.md#createtemplateeditingsession) | **POST** /public/v1/templates/{id}/editing-sessions | Create Template Editing Session +*TemplatesApi* | [**createTemplateWithUpload**](docs/TemplatesApi.md#createtemplatewithupload) | **POST** /public/v1/templates?upload | Create Template from File Upload *TemplatesApi* | [**deleteTemplate**](docs/TemplatesApi.md#deletetemplate) | **DELETE** /public/v1/templates/{id} | Delete Template -*TemplatesApi* | [**detailsTemplate**](docs/TemplatesApi.md#detailstemplate) | **GET** /public/v1/templates/{id}/details | Details Template +*TemplatesApi* | [**detailsTemplate**](docs/TemplatesApi.md#detailstemplate) | **GET** /public/v1/templates/{id}/details | Template Details *TemplatesApi* | [**listTemplates**](docs/TemplatesApi.md#listtemplates) | **GET** /public/v1/templates | List Templates -*UserAndWorkspaceManagementApi* | [**addMember**](docs/UserAndWorkspaceManagementApi.md#addmember) | **POST** /public/v1/workspaces/{workspace_id}/members | Add member +*TemplatesApi* | [**statusTemplate**](docs/TemplatesApi.md#statustemplate) | **GET** /public/v1/templates/{id} | Template Status +*TemplatesApi* | [**updateTemplate**](docs/TemplatesApi.md#updatetemplate) | **PATCH** /public/v1/templates/{id} | Template Update +*UserAndWorkspaceManagementApi* | [**addMember**](docs/UserAndWorkspaceManagementApi.md#addmember) | **POST** /public/v1/workspaces/{workspace_id}/members | Add Member to Workspace +*UserAndWorkspaceManagementApi* | [**createApiKey**](docs/UserAndWorkspaceManagementApi.md#createapikey) | **POST** /public/v1/workspaces/{workspace_id}/api-keys | Create API Key *UserAndWorkspaceManagementApi* | [**createUser**](docs/UserAndWorkspaceManagementApi.md#createuser) | **POST** /public/v1/users | Create User *UserAndWorkspaceManagementApi* | [**createWorkspace**](docs/UserAndWorkspaceManagementApi.md#createworkspace) | **POST** /public/v1/workspaces | Create Workspace -*WebhookEventsApi* | [**detailsWebhookEvent**](docs/WebhookEventsApi.md#detailswebhookevent) | **GET** /public/v1/webhook-events/{id} | Get webhook event by uuid -*WebhookEventsApi* | [**listWebhookEvent**](docs/WebhookEventsApi.md#listwebhookevent) | **GET** /public/v1/webhook-events | Get webhook event page -*WebhookSubscriptionsApi* | [**createWebhookSubscription**](docs/WebhookSubscriptionsApi.md#createwebhooksubscription) | **POST** /public/v1/webhook-subscriptions | Create webhook subscription -*WebhookSubscriptionsApi* | [**deleteWebhookSubscription**](docs/WebhookSubscriptionsApi.md#deletewebhooksubscription) | **DELETE** /public/v1/webhook-subscriptions/{id} | Delete webhook subscription -*WebhookSubscriptionsApi* | [**detailsWebhookSubscription**](docs/WebhookSubscriptionsApi.md#detailswebhooksubscription) | **GET** /public/v1/webhook-subscriptions/{id} | Get webhook subscription by uuid -*WebhookSubscriptionsApi* | [**listWebhookSubscriptions**](docs/WebhookSubscriptionsApi.md#listwebhooksubscriptions) | **GET** /public/v1/webhook-subscriptions | Get all webhook subscriptions -*WebhookSubscriptionsApi* | [**updateWebhookSubscription**](docs/WebhookSubscriptionsApi.md#updatewebhooksubscription) | **PATCH** /public/v1/webhook-subscriptions/{id} | Update webhook subscription -*WebhookSubscriptionsApi* | [**updateWebhookSubscriptionSharedKey**](docs/WebhookSubscriptionsApi.md#updatewebhooksubscriptionsharedkey) | **PATCH** /public/v1/webhook-subscriptions/{id}/shared-key | Regenerate webhook subscription shared key +*UserAndWorkspaceManagementApi* | [**deactivateWorkspace**](docs/UserAndWorkspaceManagementApi.md#deactivateworkspace) | **POST** /public/v1/workspaces/{workspace_id}/deactivate | Deactivate Workspace +*UserAndWorkspaceManagementApi* | [**getWorkspacesList**](docs/UserAndWorkspaceManagementApi.md#getworkspaceslist) | **GET** /public/v1/workspaces | List Workspaces +*UserAndWorkspaceManagementApi* | [**listUsers**](docs/UserAndWorkspaceManagementApi.md#listusers) | **GET** /public/v1/users | List Users +*UserAndWorkspaceManagementApi* | [**removeMember**](docs/UserAndWorkspaceManagementApi.md#removemember) | **DELETE** /public/v1/workspaces/{workspace_id}/members/{member_id} | Remove Member from Workspace +*WebhookEventsApi* | [**detailsWebhookEvent**](docs/WebhookEventsApi.md#detailswebhookevent) | **GET** /public/v1/webhook-events/{id} | Webhook Event Details +*WebhookEventsApi* | [**listWebhookEvent**](docs/WebhookEventsApi.md#listwebhookevent) | **GET** /public/v1/webhook-events | List Webhook Events +*WebhookSubscriptionsApi* | [**createWebhookSubscription**](docs/WebhookSubscriptionsApi.md#createwebhooksubscription) | **POST** /public/v1/webhook-subscriptions | Create Webhook Subscription +*WebhookSubscriptionsApi* | [**deleteWebhookSubscription**](docs/WebhookSubscriptionsApi.md#deletewebhooksubscription) | **DELETE** /public/v1/webhook-subscriptions/{id} | Delete Webhook Subscription +*WebhookSubscriptionsApi* | [**detailsWebhookSubscription**](docs/WebhookSubscriptionsApi.md#detailswebhooksubscription) | **GET** /public/v1/webhook-subscriptions/{id} | Webhook Subscription Details +*WebhookSubscriptionsApi* | [**listWebhookSubscriptions**](docs/WebhookSubscriptionsApi.md#listwebhooksubscriptions) | **GET** /public/v1/webhook-subscriptions | List Webhook Subscriptions +*WebhookSubscriptionsApi* | [**updateWebhookSubscription**](docs/WebhookSubscriptionsApi.md#updatewebhooksubscription) | **PATCH** /public/v1/webhook-subscriptions/{id} | Update Webhook Subscription +*WebhookSubscriptionsApi* | [**updateWebhookSubscriptionSharedKey**](docs/WebhookSubscriptionsApi.md#updatewebhooksubscriptionsharedkey) | **PATCH** /public/v1/webhook-subscriptions/{id}/shared-key | Update Webhook Subscription Shared Key ## License -SDK is licensed under the [MIT License](https://github.com/PandaDoc/pandadoc-api-node-client/blob/main/LICENSE). \ No newline at end of file +SDK is licensed under the [MIT License](https://github.com/PandaDoc/pandadoc-api-node-client/blob/main/LICENSE). diff --git a/docs/APILogsApi.md b/docs/APILogsApi.md index 2aac2aa..f3d325e 100644 --- a/docs/APILogsApi.md +++ b/docs/APILogsApi.md @@ -4,7 +4,7 @@ All URIs are relative to *https://api.pandadoc.com* Method | HTTP request | Description ------------- | ------------- | ------------- -[**detailsLog**](APILogsApi.md#detailsLog) | **GET** /public/v1/logs/{id} | Details API Log +[**detailsLog**](APILogsApi.md#detailsLog) | **GET** /public/v1/logs/{id} | API Log Details [**listLogs**](APILogsApi.md#listLogs) | **GET** /public/v1/logs | List API Log @@ -28,7 +28,7 @@ const apiInstance = new pd_api.APILogsApi(configuration); const body:pd_api.APILogsApiDetailsLogRequest = { // string | Log event id. - id: "AXp2jrHMK2MKv_lRqmQ", + id: "AZC86i5PYKMjQjMMMw9e", }; apiInstance.detailsLog(body).then((data) => { @@ -71,7 +71,7 @@ Name | Type | Description | Notes # **listLogs** > APILogListResponse listLogs() -Get the list of all logs within the selected workspace. Optionally filter by date, page, and `#` of items per page. +Get the list of all logs within the selected workspace.\\ Optionally filter by date, page, and `#` of items per page. ### Example @@ -93,15 +93,19 @@ const body:pd_api.APILogsApiListLogsRequest = { to: "now", // number | The amount of items on each page. (optional) count: 10, - // number | Page number of the results returned. (optional) + // number | Returns page of the results by number. (optional) page: 1, - // Array<100 | 200 | 300 | 400 | 500> | Returns only the predefined status codes. Allows 1xx, 2xx, 3xx, 4xx, and 5xx. (optional) - statuses: [400,500], - // Array<'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'> | Returns only the predefined HTTP methods. Allows GET, POST, PUT, PATCH, and DELETE. (optional) - methods: ["GET","POST"], + // Array | Returns only the predefined status codes. (optional) + statuses: [ + [400,500], + ], + // Array | Returns only the predefined HTTP methods. Allows GET, POST, PUT, PATCH, and DELETE. (optional) + methods: [ + "["GET","POST"]", + ], // string | Returns the results containing a string. (optional) search: "documents/hryJY9mqYZHjQCYQuSjRQg/send", - // 'PRODUCTION' | 'SANDBOX' | Returns logs for production/sandbox. (optional) + // ApiLogEnvironmentTypeEnum | Returns logs for production/sandbox. (optional) environmentType: "PRODUCTION", }; @@ -115,14 +119,14 @@ apiInstance.listLogs(body).then((data) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **since** | [**string**] | Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \"-90d\" (for past 90 days). | (optional) defaults to undefined + **since** | [**string**] | Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \"-90d\" (for past 90 days). | (optional) defaults to '-90d' **to** | [**string**] | Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \"-10d\" (for past 10 days) or a special \"now\" value. | (optional) defaults to undefined - **count** | [**number**] | The amount of items on each page. | (optional) defaults to undefined - **page** | [**number**] | Page number of the results returned. | (optional) defaults to undefined - **statuses** | **Array<100 | 200 | 300 | 400 | 500>** | Returns only the predefined status codes. Allows 1xx, 2xx, 3xx, 4xx, and 5xx. | (optional) defaults to undefined - **methods** | **Array<'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'>** | Returns only the predefined HTTP methods. Allows GET, POST, PUT, PATCH, and DELETE. | (optional) defaults to undefined + **count** | [**number**] | The amount of items on each page. | (optional) defaults to 100 + **page** | [**number**] | Returns page of the results by number. | (optional) defaults to 1 + **statuses** | **Array<ApiLogStatusEnum>** | Returns only the predefined status codes. | (optional) defaults to undefined + **methods** | **Array<ApiLogMethodEnum>** | Returns only the predefined HTTP methods. Allows GET, POST, PUT, PATCH, and DELETE. | (optional) defaults to undefined **search** | [**string**] | Returns the results containing a string. | (optional) defaults to undefined - **environmentType** | [**'PRODUCTION' | 'SANDBOX'**]**Array<'PRODUCTION' | 'SANDBOX'>** | Returns logs for production/sandbox. | (optional) defaults to undefined + **environmentType** | **ApiLogEnvironmentTypeEnum** | Returns logs for production/sandbox. | (optional) defaults to undefined ### Return type diff --git a/docs/CommunicationPreferencesApi.md b/docs/CommunicationPreferencesApi.md new file mode 100644 index 0000000..5e585ee --- /dev/null +++ b/docs/CommunicationPreferencesApi.md @@ -0,0 +1,73 @@ +# .CommunicationPreferencesApi + +All URIs are relative to *https://api.pandadoc.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**listRecentSmsOptOuts**](CommunicationPreferencesApi.md#listRecentSmsOptOuts) | **GET** /public/v1/sms-opt-outs | Recent SMS Opt-out + + +# **listRecentSmsOptOuts** +> ListSmsOptOutChangelogResponse listRecentSmsOptOuts() + +Retrieves a list of the most recent SMS opt-out changes for each phone numbers used in your workspace. > 📘 You can filter results by time range using `timestamp_from` and `timestamp_to`. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.CommunicationPreferencesApi(configuration); + +const body:pd_api.CommunicationPreferencesApiListRecentSmsOptOutsRequest = { + // Date | The start of the timestamp. If no timestamp is provided, 1 hour before the current time will be used. (optional) + timestampFrom: new Date('2025-01-28T00:00:00Z'), + // Date | The end of the timestamp range. If no timestamp is provided the current time will be used. (optional) + timestampTo: new Date('2025-01-28T23:59:59Z'), +}; + +apiInstance.listRecentSmsOptOuts(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **timestampFrom** | [**Date**] | The start of the timestamp. If no timestamp is provided, 1 hour before the current time will be used. | (optional) defaults to undefined + **timestampTo** | [**Date**] | The end of the timestamp range. If no timestamp is provided the current time will be used. | (optional) defaults to undefined + + +### Return type + +**ListSmsOptOutChangelogResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A list of phone numbers, their SMS current opt-out statuses and timestamp of the last change. | - | +**400** | Bad Request | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/ContactsApi.md b/docs/ContactsApi.md index 09daccb..3936bbe 100644 --- a/docs/ContactsApi.md +++ b/docs/ContactsApi.md @@ -5,15 +5,16 @@ All URIs are relative to *https://api.pandadoc.com* Method | HTTP request | Description ------------- | ------------- | ------------- [**createContact**](ContactsApi.md#createContact) | **POST** /public/v1/contacts | Create contact -[**deleteContact**](ContactsApi.md#deleteContact) | **DELETE** /public/v1/contacts/{id} | Delete contact by id -[**detailsContact**](ContactsApi.md#detailsContact) | **GET** /public/v1/contacts/{id} | Get contact details by id +[**deleteContact**](ContactsApi.md#deleteContact) | **DELETE** /public/v1/contacts/{id} | Delete Contact +[**detailsContact**](ContactsApi.md#detailsContact) | **GET** /public/v1/contacts/{id} | Contact Details [**listContacts**](ContactsApi.md#listContacts) | **GET** /public/v1/contacts | List contacts -[**updateContact**](ContactsApi.md#updateContact) | **PATCH** /public/v1/contacts/{id} | Update contact by id +[**updateContact**](ContactsApi.md#updateContact) | **PATCH** /public/v1/contacts/{id} | Update Contact # **createContact** > ContactDetailsResponse createContact(contactCreateRequest) +This method adds a contact into a contacts list. ### Example @@ -37,6 +38,7 @@ const body:pd_api.ContactsApiCreateContactRequest = { company: "John Doe Inc.", jobTitle: "CTO", phone: "+14842634627", + country: "USA", state: "Texas", streetAddress: "1313 Mockingbird Lane", city: "Austin", @@ -84,6 +86,7 @@ Name | Type | Description | Notes # **deleteContact** > void deleteContact() +This method deletes a contact. ### Example @@ -144,6 +147,7 @@ Name | Type | Description | Notes # **detailsContact** > ContactDetailsResponse detailsContact() +Returns contact details by its ID. ### Example @@ -204,6 +208,7 @@ Name | Type | Description | Notes # **listContacts** > ContactListResponse listContacts() +This method returns a list of contacts associated with a workspace. ### Example @@ -220,7 +225,7 @@ const apiInstance = new pd_api.ContactsApi(configuration); const body:pd_api.ContactsApiListContactsRequest = { // string | Optional search parameter. Filter results by exact match. (optional) - email: "josh@example.com", + email: "", }; apiInstance.listContacts(body).then((data) => { @@ -264,6 +269,7 @@ Name | Type | Description | Notes # **updateContact** > ContactDetailsResponse updateContact(contactUpdateRequest) +This method updates a contact details. ### Example @@ -283,7 +289,6 @@ const body:pd_api.ContactsApiUpdateContactRequest = { id: "SyoufNkJiHRn24LpuJ7RXb", // ContactUpdateRequest contactUpdateRequest: { - email: "user01@pandadoc.com", firstName: "John", lastName: "Doe", company: "John Doe Inc.", diff --git a/docs/ContentLibraryItemsApi.md b/docs/ContentLibraryItemsApi.md index a25cd12..43b93b7 100644 --- a/docs/ContentLibraryItemsApi.md +++ b/docs/ContentLibraryItemsApi.md @@ -4,14 +4,142 @@ All URIs are relative to *https://api.pandadoc.com* Method | HTTP request | Description ------------- | ------------- | ------------- -[**detailsContentLibraryItem**](ContentLibraryItemsApi.md#detailsContentLibraryItem) | **GET** /public/v1/content-library-items/{id}/details | Details Content Library Item +[**createContentLibraryItem**](ContentLibraryItemsApi.md#createContentLibraryItem) | **POST** /public/v1/content-library-items | Create Content Library Item +[**createContentLibraryItemFromUpload**](ContentLibraryItemsApi.md#createContentLibraryItemFromUpload) | **POST** /public/v1/content-library-items?upload | Create Content Library Item from File Upload +[**detailsContentLibraryItem**](ContentLibraryItemsApi.md#detailsContentLibraryItem) | **GET** /public/v1/content-library-items/{id}/details | Content Library Item Details [**listContentLibraryItems**](ContentLibraryItemsApi.md#listContentLibraryItems) | **GET** /public/v1/content-library-items | List Content Library Item +[**statusContentLibraryItem**](ContentLibraryItemsApi.md#statusContentLibraryItem) | **GET** /public/v1/content-library-items/{id} | Content Library Item Status +# **createContentLibraryItem** +> ContentLibraryResponse createContentLibraryItem(contentLibraryItemCreateFromUrlRequest) + +This API endpoint allows users to create an empty item in the content library. No actual content or data is required to be provided in the initial creation. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.ContentLibraryItemsApi(configuration); + +const body:pd_api.ContentLibraryItemsApiCreateContentLibraryItemRequest = { + // ContentLibraryItemCreateFromUrlRequest + contentLibraryItemCreateFromUrlRequest: null, +}; + +apiInstance.createContentLibraryItem(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contentLibraryItemCreateFromUrlRequest** | **ContentLibraryItemCreateFromUrlRequest**| | + + +### Return type + +**ContentLibraryResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | OK | - | +**400** | Bad Request | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **createContentLibraryItemFromUpload** +> ContentLibraryResponse createContentLibraryItemFromUpload() + +This asynchronous endpoint allows users to create a new CLI by uploading a file. The uploaded file is processed in the background to generate the CLI. The maximum allowable file size for upload is 100 MB. Field tags and form fields are not supported yet. Once the file is uploaded, the processing will happen asynchronously, and users need to check the status of the CLI creation. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.ContentLibraryItemsApi(configuration); + +const body:pd_api.ContentLibraryItemsApiCreateContentLibraryItemFromUploadRequest = { + // HttpFile | Binary PDF File (optional) + file: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' }, + // ContentLibraryItemCreateRequest | JSON as a multipart/form-data request. (optional) + data: null, +}; + +apiInstance.createContentLibraryItemFromUpload(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file** | [**HttpFile**] | Binary PDF File | (optional) defaults to undefined + **data** | **ContentLibraryItemCreateRequest** | JSON as a multipart/form-data request. | (optional) defaults to undefined + + +### Return type + +**ContentLibraryResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | OK | - | +**400** | Bad Request | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + # **detailsContentLibraryItem** > ContentLibraryItemResponse detailsContentLibraryItem() -Return detailed data about a content library item. +Retrieve detailed information about a specific content library item using its ID. The details include: - **Roles** - **All fields with values** - **All tokens with values** - **Pricing information (pricing tables, products, etc)** - **Metadata** - **Tags** - **Modification Timestamps**: note that `date_modified` means any changes associated with the CLI, while `content_date_modified` logs any changes in CLI content. ### Example @@ -72,7 +200,7 @@ Name | Type | Description | Notes # **listContentLibraryItems** > ContentLibraryItemListResponse listContentLibraryItems() -Optionally filter by a search query or tags. +The endpoint retrieves items from the content library in PandaDoc. This endpoint supports filtering options to narrow down the results, allowing users to search by query, tags, folder, and more. > ### ⚠️ Please avoid empty values for the parameters > API returns \"400\" error when any of the parameters has an empty value. Please remove such a parameter from the request or add a value. ### Example @@ -93,7 +221,7 @@ const body:pd_api.ContentLibraryItemsApiListContentLibraryItemsRequest = { // string | Specify content library item ID. (optional) id: "UXdP7Lnbvvr4WEb2wzM2hc", // boolean | Returns only the deleted content library items. (optional) - deleted: true, + deleted: false, // string | The UUID of the folder where the content library items are stored. (optional) folderUuid: "S6xX7saJfA44mtJxGWd95L", // number | Specify how many content library items to return. Default is 50 content library items, maximum is 100 content library items. (optional) @@ -147,3 +275,64 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +# **statusContentLibraryItem** +> ContentLibraryResponse statusContentLibraryItem() + +Requesting the CLI status helps verify that a CLI is in the expected state before invoking additional API methods. ## Available CLI Statuses The following is a complete list of all possible CLI statuses returned: | CLI Status | Status Description | |-----------------|--------------------| | `cli.UPLOADED` | The CLI upload process has been initiated and is currently in progress. It will soon transition to the `cli.PROCESSED` state. | | `cli.PROCESSED` | The CLI has been successfully uploaded and created. At this stage, all aspects of the CLI are editable. | | `cli.ERROR` | The CLI upload process has failed. Please refer to the error details in the response for more information. | + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.ContentLibraryItemsApi(configuration); + +const body:pd_api.ContentLibraryItemsApiStatusContentLibraryItemRequest = { + // string | Content Library Item ID + id: "EE8yUNg5HztqVAuH85He8V", +}; + +apiInstance.statusContentLibraryItem(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | [**string**] | Content Library Item ID | defaults to undefined + + +### Return type + +**ContentLibraryResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/DocumentAttachmentsApi.md b/docs/DocumentAttachmentsApi.md index 976738e..f17ee06 100644 --- a/docs/DocumentAttachmentsApi.md +++ b/docs/DocumentAttachmentsApi.md @@ -4,15 +4,16 @@ All URIs are relative to *https://api.pandadoc.com* Method | HTTP request | Description ------------- | ------------- | ------------- -[**createDocumentAttachment**](DocumentAttachmentsApi.md#createDocumentAttachment) | **POST** /public/v1/documents/{id}/attachments | Document Attachment Create -[**deleteDocumentAttachment**](DocumentAttachmentsApi.md#deleteDocumentAttachment) | **DELETE** /public/v1/documents/{id}/attachments/{attachment_id} | Document Attachment Delete +[**createDocumentAttachment**](DocumentAttachmentsApi.md#createDocumentAttachment) | **POST** /public/v1/documents/{id}/attachments | Create Document Attachment +[**createDocumentAttachmentFromFileUpload**](DocumentAttachmentsApi.md#createDocumentAttachmentFromFileUpload) | **POST** /public/v1/documents/{id}/attachments?upload | Create Document Attachment From Upload +[**deleteDocumentAttachment**](DocumentAttachmentsApi.md#deleteDocumentAttachment) | **DELETE** /public/v1/documents/{id}/attachments/{attachment_id} | Delete Document Attachment [**detailsDocumentAttachment**](DocumentAttachmentsApi.md#detailsDocumentAttachment) | **GET** /public/v1/documents/{id}/attachments/{attachment_id} | Document Attachment Details -[**downloadDocumentAttachment**](DocumentAttachmentsApi.md#downloadDocumentAttachment) | **GET** /public/v1/documents/{id}/attachments/{attachment_id}/download | Document Attachment Download -[**listDocumentAttachments**](DocumentAttachmentsApi.md#listDocumentAttachments) | **GET** /public/v1/documents/{id}/attachments | Document Attachment List +[**downloadDocumentAttachment**](DocumentAttachmentsApi.md#downloadDocumentAttachment) | **GET** /public/v1/documents/{id}/attachments/{attachment_id}/download | Download Document Attachment +[**listDocumentAttachments**](DocumentAttachmentsApi.md#listDocumentAttachments) | **GET** /public/v1/documents/{id}/attachments | List Document Attachments # **createDocumentAttachment** -> DocumentAttachmentResponse createDocumentAttachment() +> DocumentAttachmentResponse createDocumentAttachment(documentAttachmentRequest) Creates an attachment for a particular document @@ -30,17 +31,79 @@ const configuration = pd_api.createConfiguration( const apiInstance = new pd_api.DocumentAttachmentsApi(configuration); const body:pd_api.DocumentAttachmentsApiCreateDocumentAttachmentRequest = { + // string | Document UUID + id: "BhVzRcxH9Z2LgfPPGXFUBa", + // DocumentAttachmentRequest + documentAttachmentRequest: null, +}; + +apiInstance.createDocumentAttachment(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **documentAttachmentRequest** | **DocumentAttachmentRequest**| | + **id** | [**string**] | Document UUID | defaults to undefined + + +### Return type + +**DocumentAttachmentResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Authentication error | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **createDocumentAttachmentFromFileUpload** +> DocumentAttachmentResponse createDocumentAttachmentFromFileUpload() + +Creates an attachment for a particular document + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.DocumentAttachmentsApi(configuration); + +const body:pd_api.DocumentAttachmentsApiCreateDocumentAttachmentFromFileUploadRequest = { // string | Document UUID id: "BhVzRcxH9Z2LgfPPGXFUBa", // HttpFile | Binary file to be attached to a document (optional) file: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' }, - // string | URL link to the file to be attached to a document (optional) - source: "https://is3-ssl.mzstatic.com/1e7fbd74-d10c-8e3a-63c3-0beb3ea231a5/512x512bb.jpg", // string | Optional name to set for uploaded file (optional) name: "Additional agreement", }; -apiInstance.createDocumentAttachment(body).then((data) => { +apiInstance.createDocumentAttachmentFromFileUpload(body).then((data) => { console.log('API called successfully. Returned data: %o', data); }).catch((error) => console.error(error)); ``` @@ -52,7 +115,6 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | [**string**] | Document UUID | defaults to undefined **file** | [**HttpFile**] | Binary file to be attached to a document | (optional) defaults to undefined - **source** | [**string**] | URL link to the file to be attached to a document | (optional) defaults to undefined **name** | [**string**] | Optional name to set for uploaded file | (optional) defaults to undefined @@ -84,7 +146,7 @@ Name | Type | Description | Notes # **deleteDocumentAttachment** > void deleteDocumentAttachment() -Deletes specific document's attachment +Deletes an attachment from the document. ### Example @@ -100,9 +162,9 @@ const configuration = pd_api.createConfiguration( const apiInstance = new pd_api.DocumentAttachmentsApi(configuration); const body:pd_api.DocumentAttachmentsApiDeleteDocumentAttachmentRequest = { - // string | Document UUID + // string | Document UUID. id: "BhVzRcxH9Z2LgfPPGXFUBa", - // string | Attachment UUID + // string | Attachment UUID. attachmentId: "89ce2f49-10fb-4e9b-b5f3-e28be2a5c042", }; @@ -116,8 +178,8 @@ apiInstance.deleteDocumentAttachment(body).then((data) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | [**string**] | Document UUID | defaults to undefined - **attachmentId** | [**string**] | Attachment UUID | defaults to undefined + **id** | [**string**] | Document UUID. | defaults to undefined + **attachmentId** | [**string**] | Attachment UUID. | defaults to undefined ### Return type @@ -147,7 +209,7 @@ Name | Type | Description | Notes # **detailsDocumentAttachment** > DocumentAttachmentResponse detailsDocumentAttachment() -Returns details of the specific document's attachment +Returns details of the specific document\'s attachment. ### Example @@ -163,9 +225,9 @@ const configuration = pd_api.createConfiguration( const apiInstance = new pd_api.DocumentAttachmentsApi(configuration); const body:pd_api.DocumentAttachmentsApiDetailsDocumentAttachmentRequest = { - // string | Document UUID + // string | Document UUID. id: "BhVzRcxH9Z2LgfPPGXFUBa", - // string | Attachment UUID + // string | Attachment UUID. attachmentId: "89ce2f49-10fb-4e9b-b5f3-e28be2a5c042", }; @@ -179,8 +241,8 @@ apiInstance.detailsDocumentAttachment(body).then((data) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | [**string**] | Document UUID | defaults to undefined - **attachmentId** | [**string**] | Attachment UUID | defaults to undefined + **id** | [**string**] | Document UUID. | defaults to undefined + **attachmentId** | [**string**] | Attachment UUID. | defaults to undefined ### Return type @@ -211,7 +273,7 @@ Name | Type | Description | Notes # **downloadDocumentAttachment** > HttpFile downloadDocumentAttachment() -Returns document attachment file for download +Download an attachment by ID. ### Example @@ -227,9 +289,9 @@ const configuration = pd_api.createConfiguration( const apiInstance = new pd_api.DocumentAttachmentsApi(configuration); const body:pd_api.DocumentAttachmentsApiDownloadDocumentAttachmentRequest = { - // string | Document UUID + // string | Document UUID. id: "BhVzRcxH9Z2LgfPPGXFUBa", - // string | Attachment UUID + // string | Attachment UUID. attachmentId: "89ce2f49-10fb-4e9b-b5f3-e28be2a5c042", }; @@ -243,8 +305,8 @@ apiInstance.downloadDocumentAttachment(body).then((data) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | [**string**] | Document UUID | defaults to undefined - **attachmentId** | [**string**] | Attachment UUID | defaults to undefined + **id** | [**string**] | Document UUID. | defaults to undefined + **attachmentId** | [**string**] | Attachment UUID. | defaults to undefined ### Return type @@ -258,7 +320,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/_*, application/json + - **Accept**: application/*, application/json ### HTTP response details @@ -275,7 +337,7 @@ Name | Type | Description | Notes # **listDocumentAttachments** > Array listDocumentAttachments() -Return list of objects attached to particular document +Returns a list of attachments associated with a specified document. ### Example diff --git a/docs/DocumentAuditTrailApi.md b/docs/DocumentAuditTrailApi.md new file mode 100644 index 0000000..f2b1570 --- /dev/null +++ b/docs/DocumentAuditTrailApi.md @@ -0,0 +1,72 @@ +# .DocumentAuditTrailApi + +All URIs are relative to *https://api.pandadoc.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**listDocumentAuditTrail**](DocumentAuditTrailApi.md#listDocumentAuditTrail) | **GET** /public/v2/documents/{document_id}/audit-trail | List Document Audit Trail + + +# **listDocumentAuditTrail** +> DocumentAuditTrailResponse listDocumentAuditTrail() + +Retrieves the full audit trail for a specified document. The audit trail includes detailed user actions such as sending, viewing, signing, and editing, along with metadata like timestamps, IP addresses, and user identity. This endpoint is accessible to authorized workspace administrators only. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.DocumentAuditTrailApi(configuration); + +const body:pd_api.DocumentAuditTrailApiListDocumentAuditTrailRequest = { + // string | Unique identifier of the document to retrieve the audit trail for. + documentId: "BhVzRcxH9Z2LgfPPGXFUBa", + // number | Maximum number of items to return. (optional) + limit: 20, + // number | Number of items to skip before starting to collect the result set. (optional) + offset: 0, +}; + +apiInstance.listDocumentAuditTrail(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **documentId** | [**string**] | Unique identifier of the document to retrieve the audit trail for. | defaults to undefined + **limit** | [**number**] | Maximum number of items to return. | (optional) defaults to 20 + **offset** | [**number**] | Number of items to skip before starting to collect the result set. | (optional) defaults to 0 + + +### Return type + +**DocumentAuditTrailResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully retrieved audit trail. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/DocumentFieldsApi.md b/docs/DocumentFieldsApi.md new file mode 100644 index 0000000..32bd319 --- /dev/null +++ b/docs/DocumentFieldsApi.md @@ -0,0 +1,157 @@ +# .DocumentFieldsApi + +All URIs are relative to *https://api.pandadoc.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createDocumentFields**](DocumentFieldsApi.md#createDocumentFields) | **POST** /public/v1/documents/{id}/fields | Create Document Fields +[**listDocumentFields**](DocumentFieldsApi.md#listDocumentFields) | **GET** /public/v1/documents/{id}/fields | List Document Fields + + +# **createDocumentFields** +> CreateDocumentFieldsResponse createDocumentFields(createDocumentFieldsRequest) + +Creates fields for a particular document. For CFR11-compliant workspaces (21 CFR Part 11), signature fields must have a minimum size of 108×33. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.DocumentFieldsApi(configuration); + +const body:pd_api.DocumentFieldsApiCreateDocumentFieldsRequest = { + // string | Document UUID. + id: "BhVzRcxH9Z2LgfPPGXFUBa", + // CreateDocumentFieldsRequest + createDocumentFieldsRequest: { + fields: [ + { + fieldId: "fieldId_example", + mergeField: "mergeField_example", + type: "payment_details", + placeholder: "placeholder_example", + assignedTo: "assignedTo_example", + layout: { + page: 1, + position: { + offsetX: 3.14, + offsetY: 3.14, + anchorPoint: "topleft", + }, + style: { + width: 1, + height: 1, + }, + }, + }, + ], + }, +}; + +apiInstance.createDocumentFields(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createDocumentFieldsRequest** | **CreateDocumentFieldsRequest**| | + **id** | [**string**] | Document UUID. | defaults to undefined + + +### Return type + +**CreateDocumentFieldsResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Authentication error | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **listDocumentFields** +> ListDocumentFieldsResponse listDocumentFields() + +Return the list of fields for a particular document. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.DocumentFieldsApi(configuration); + +const body:pd_api.DocumentFieldsApiListDocumentFieldsRequest = { + // string | Document UUID. + id: "BhVzRcxH9Z2LgfPPGXFUBa", +}; + +apiInstance.listDocumentFields(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | [**string**] | Document UUID. | defaults to undefined + + +### Return type + +**ListDocumentFieldsResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Authentication error | - | +**404** | Not found | - | +**409** | Conflict | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/DocumentLinkToCRMApi.md b/docs/DocumentLinkToCRMApi.md new file mode 100644 index 0000000..5ab3136 --- /dev/null +++ b/docs/DocumentLinkToCRMApi.md @@ -0,0 +1,282 @@ +# .DocumentLinkToCRMApi + +All URIs are relative to *https://api.pandadoc.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createLinkedObject**](DocumentLinkToCRMApi.md#createLinkedObject) | **POST** /public/v1/documents/{id}/linked-objects | Create Linked Object +[**deleteLinkedObject**](DocumentLinkToCRMApi.md#deleteLinkedObject) | **DELETE** /public/v1/documents/{id}/linked-objects/{linked_object_id} | Delete Linked Object +[**listDocumentsByLinkedObject**](DocumentLinkToCRMApi.md#listDocumentsByLinkedObject) | **GET** /public/v1/documents/linked-objects | List Documents by Linked Object +[**listLinkedObjects**](DocumentLinkToCRMApi.md#listLinkedObjects) | **GET** /public/v1/documents/{id}/linked-objects | List Linked Objects + + +# **createLinkedObject** +> LinkedObjectCreateResponse createLinkedObject(linkedObjectCreateRequest) + +Create a linked object in the document. > 🚧 > > You can only link each document to each CRM once. This ensures the consistent functionality of the [two-way CRM sync](https://support.pandadoc.com/en/articles/9714877-hubspot-crm#h_3a3344e8-2a6e-4fd8-86be-0da8c121e4ac). > > You can, however, link one document to several external systems. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.DocumentLinkToCRMApi(configuration); + +const body:pd_api.DocumentLinkToCRMApiCreateLinkedObjectRequest = { + // string | Specify document ID. + id: "ZPeAfcpzr9aiVs5vqUf6jg", + // LinkedObjectCreateRequest + linkedObjectCreateRequest: { + provider: "pipedrive", + entityType: "deal", + entityId: "9372", + }, +}; + +apiInstance.createLinkedObject(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **linkedObjectCreateRequest** | **LinkedObjectCreateRequest**| | + **id** | [**string**] | Specify document ID. | defaults to undefined + + +### Return type + +**LinkedObjectCreateResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **deleteLinkedObject** +> void deleteLinkedObject() + +Delete a linked object associated with a document. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.DocumentLinkToCRMApi(configuration); + +const body:pd_api.DocumentLinkToCRMApiDeleteLinkedObjectRequest = { + // string | Specify document ID. + id: "ZPeAfcpzr9aiVs5vqUf6jg", + // string | Specify linked object ID. + linkedObjectId: "deb0d530-d759-4189-a422-8d2265e01b2e", +}; + +apiInstance.deleteLinkedObject(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | [**string**] | Specify document ID. | defaults to undefined + **linkedObjectId** | [**string**] | Specify linked object ID. | defaults to undefined + + +### Return type + +**void** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**404** | Not found | - | +**409** | Conflict | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **listDocumentsByLinkedObject** +> Array listDocumentsByLinkedObject() + +Get a list of documents connected to a linked object - an entity from an integration. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.DocumentLinkToCRMApi(configuration); + +const body:pd_api.DocumentLinkToCRMApiListDocumentsByLinkedObjectRequest = { + // string | You can get entity id from your integration, for example, from a url of a HubSpot deal. + entityId: "12345", + // string | See the available entity types: https://developers.pandadoc.com/reference/link-service#examples-of-the-most-popular-crms + entityType: "deal", + // string | See the available providers: https://developers.pandadoc.com/reference/link-service#examples-of-the-most-popular-crms + provider: "hubspot", + // string (optional) + orderBy: "-date_created", + // Array (optional) + ownerIds: ["owner1","owner2"], +}; + +apiInstance.listDocumentsByLinkedObject(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **entityId** | [**string**] | You can get entity id from your integration, for example, from a url of a HubSpot deal. | defaults to undefined + **entityType** | [**string**] | See the available entity types: https://developers.pandadoc.com/reference/link-service#examples-of-the-most-popular-crms | defaults to undefined + **provider** | [**string**] | See the available providers: https://developers.pandadoc.com/reference/link-service#examples-of-the-most-popular-crms | defaults to undefined + **orderBy** | [**string**] | | (optional) defaults to '-date_created' + **ownerIds** | **Array<string>** | | (optional) defaults to undefined + + +### Return type + +**Array** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | 200 | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**404** | Not found | - | +**409** | Conflict | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **listLinkedObjects** +> LinkedObjectListResponse listLinkedObjects() + +Get a list of linked objects for the document. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.DocumentLinkToCRMApi(configuration); + +const body:pd_api.DocumentLinkToCRMApiListLinkedObjectsRequest = { + // string | Specify document ID. + id: "ZPeAfcpzr9aiVs5vqUf6jg", +}; + +apiInstance.listLinkedObjects(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | [**string**] | Specify document ID. | defaults to undefined + + +### Return type + +**LinkedObjectListResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success response | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**404** | Not found | - | +**409** | Conflict | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/DocumentRecipientsApi.md b/docs/DocumentRecipientsApi.md index 94746f4..325626a 100644 --- a/docs/DocumentRecipientsApi.md +++ b/docs/DocumentRecipientsApi.md @@ -6,14 +6,14 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**addDocumentRecipient**](DocumentRecipientsApi.md#addDocumentRecipient) | **POST** /public/v1/documents/{id}/recipients | Add Document Recipient [**deleteDocumentRecipient**](DocumentRecipientsApi.md#deleteDocumentRecipient) | **DELETE** /public/v1/documents/{id}/recipients/{recipient_id} | Delete Document Recipient -[**editDocumentRecipient**](DocumentRecipientsApi.md#editDocumentRecipient) | **PATCH** /public/v1/documents/{id}/recipients/recipient/{recipient_id} | Edit Document Recipient -[**reassignDocumentRecipient**](DocumentRecipientsApi.md#reassignDocumentRecipient) | **POST** /public/v1/documents/{id}/recipients/{recipient_id}/reassign | Reassign Document Recipient +[**editDocumentRecipient**](DocumentRecipientsApi.md#editDocumentRecipient) | **PATCH** /public/v1/documents/{id}/recipients/recipient/{recipient_id} | Update Document Recipient +[**reassignDocumentRecipient**](DocumentRecipientsApi.md#reassignDocumentRecipient) | **POST** /public/v1/documents/{id}/recipients/{recipient_id}/reassign | Change Signer (Reassign Document Recipient) # **addDocumentRecipient** > DocumentRecipientResponse addDocumentRecipient(documentRecipientCreateRequest) -Adds recipient as CC to document +Add a CC recipient to a document. > 🚧 Before you start > > To add a CC recipient, please ensure that: > > - You have the \'Can Manage Recipients\' permission. > - This recipient is already created in your contacts. If not, add them using the [Create Contact](https://developers.pandadoc.com/reference/create-contact) endpoint. To add a new CC recipient to a document, two parameters must be included in the request body: - `kind`: Set this parameter to `contact` to specify an individual contact. - `id`: Input the ID of the desired contact. To retrieve the contact\'s ID, use the [List Contacts](https://developers.pandadoc.com/reference/list-contacts) endpoint to access a list of all contacts, and then locate the desired contact by searching using the name or email address within the returned list. ### Document status You can add CC recipients in any document status except for the \'Expired\' (`document.voided`) and \'Declined\' (`document.declined`). > 📘 Email notification to access the document > > **Note**: When a document is in one of the following statuses: \'Sent\' (`document.sent`), \'Viewed\' (`document.viewed`), \'Completed\' (`document.completed`), \'Waiting for Payment\' (`document.waiting_pay`), or \'Paid\' (`document.paid`), any added CC recipient will receive an instant notification at their email address, allowing them access to the document. ### Example @@ -81,7 +81,7 @@ Name | Type | Description | Notes # **deleteDocumentRecipient** > void deleteDocumentRecipient() -Deleted recipient from document +Remove a recipient from a document. > 🚧 Before you start > > Please ensure that you have the \'Can Manage Recipients\' permission. To remove a recipient from a document, you must specify their ID in the path parameter (note that this is different from their contact\'s ID). The recipient\'s ID can be retrieved via the [Document Details](https://developers.pandadoc.com/reference/document-details) endpoint. ### Document status - Removing a signer is only possible when the document is in the \'Draft\' (`document.draft`) status and this action will unassign all fields associated with that signer. - Removing a CC recipient is allowed in any document status except for the \'Expired\' (`document.voided`) and \'Declined\' (`document.declined`). If a CC recipient is removed, their access will be revoked. ### Example @@ -145,7 +145,7 @@ Name | Type | Description | Notes # **editDocumentRecipient** > void editDocumentRecipient(documentRecipientEditRequest) -Edit document recipient's details +Modify recipient\'s personal details. > 🚧 Before you start > > To edit a recipient, please ensure that you have the \'Can Edit Document\' permission. Use this endpoint to easily fix typos in a recipient\'s name or email, or to change any other recipient information in a sent document. > 📘 Please note that changes made to a recipient within a document will also update their `Contact` information. However, these changes will not update information about this recipient in other documents where they have already been added. ### Document status - You can edit a signer in the following document statuses: - \'Draft\' (`document.draft`), - \'Waiting Approval\' (`document.waiting_approval`), - \'Approved\' (`document.approved`), - \'Rejected\' (`document.rejected`), - \'Sent\' (`document.sent`), - \'Viewed\' (`document.viewed`), but only until they have signed the document. - You can edit a CC recipient in any document status **except**: - \'Expired\' (`document.voided`), - \'Declined\' (`document.declined`). > 📘 Updating a recipient\'s email after sending a document > > **Note**: If you update a recipient\'s email address after sending a document, they will receive an instant notification at the new email address, allowing them access to the document. Access via the previous email will be revoked. ### Restrictions for updating a recipient\'s email - You cannot change emails of PandaDoc users. - You cannot use the email addresses of existing contacts. If you need to use an email from an existing contact, use the [Change Signer](https://developers.pandadoc.com/reference/change-signer) endpoint to replace a signer with this contact. ### Example @@ -161,9 +161,9 @@ const configuration = pd_api.createConfiguration( const apiInstance = new pd_api.DocumentRecipientsApi(configuration); const body:pd_api.DocumentRecipientsApiEditDocumentRecipientRequest = { - // string | Document UUID + // string | Document UUID. id: "BhVzRcxH9Z2LgfPPGXFUBa", - // string | Recipient UUID + // string | Recipient UUID. recipientId: "tf5dGS3Tmu3cj228ao6fnc", // DocumentRecipientEditRequest documentRecipientEditRequest: { @@ -171,7 +171,7 @@ const body:pd_api.DocumentRecipientsApiEditDocumentRecipientRequest = { phone: "+14842634627", deliveryMethods: { email: true, - sms: false, + sms: true, }, firstName: "John", lastName: "Doe", @@ -189,9 +189,17 @@ const body:pd_api.DocumentRecipientsApiEditDocumentRecipientRequest = { phoneVerification: { phoneNumber: "+1234567890", }, + kbaVerification: { + timeLimitSec: 120, + scoreThreshold: 80, + maxAttemptsCount: 2, + }, + idVerification: { + enabled: true, + }, }, redirect: { - isEnabled: true, + isEnabled: false, url: "https://example.com", }, }, @@ -208,8 +216,8 @@ apiInstance.editDocumentRecipient(body).then((data) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **documentRecipientEditRequest** | **DocumentRecipientEditRequest**| | - **id** | [**string**] | Document UUID | defaults to undefined - **recipientId** | [**string**] | Recipient UUID | defaults to undefined + **id** | [**string**] | Document UUID. | defaults to undefined + **recipientId** | [**string**] | Recipient UUID. | defaults to undefined ### Return type @@ -241,7 +249,7 @@ Name | Type | Description | Notes # **reassignDocumentRecipient** > DocumentRecipientResponse reassignDocumentRecipient(documentRecipientCreateRequest) -Replace document recipient with another contact +Reassign fields to another signer. > 🚧 Before you start > > To change a signer in a document, please ensure that: > > - You have the \'Can Manage Recipients\' permission. > - New signer is already created in your contacts. If not, add them using the [Create Contact](https://developers.pandadoc.com/reference/create-contact) endpoint. You can reassign fields to another signer before the original signer has signed the document. You can choose any person except those recipients who have already signed the document. The endpoint path includes the `recipient_id` of the original signer and the request body must include the following two parameters: - `kind`: Set this parameter to `contact` to specify an individual contact. - `id`: Input the ID of the contact you want to use as a replacement for the original signer. To retrieve the contact\'s ID, use the [List Contacts](https://developers.pandadoc.com/reference/list-contacts) endpoint to access a list of all contacts, and then locate the desired contact by searching using the name or email address within the returned list. Once you execute the call to change the signer, the original signer will be entirely removed from the document. If you wish to retain the original signer as a CC recipient, you can re-add them using the [Add CC Recipient](https://developers.pandadoc.com/reference/add-new-recipient-cc) endpoint. > 🚧 Pre-filled fields > > If you change the signer in a document that has already been sent, the signer\'s pre-filled fields will be completely reset. In the \'Draft\' (`document.draft`) status, pre-filled fields will remain. ### Example diff --git a/docs/DocumentRemindersApi.md b/docs/DocumentRemindersApi.md new file mode 100644 index 0000000..5091a81 --- /dev/null +++ b/docs/DocumentRemindersApi.md @@ -0,0 +1,290 @@ +# .DocumentRemindersApi + +All URIs are relative to *https://api.pandadoc.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createManualReminder**](DocumentRemindersApi.md#createManualReminder) | **POST** /public/v1/documents/{document_id}/send-reminder | Send Manual Reminder +[**getDocumentAutoReminderSettings**](DocumentRemindersApi.md#getDocumentAutoReminderSettings) | **GET** /public/v1/documents/{document_id}/auto-reminders | Document Auto Reminder Settings +[**statusDocumentAutoReminder**](DocumentRemindersApi.md#statusDocumentAutoReminder) | **GET** /public/v1/documents/{document_id}/auto-reminders/status | Document Auto Reminder Status +[**updateDocumentAutoReminderSettings**](DocumentRemindersApi.md#updateDocumentAutoReminderSettings) | **PATCH** /public/v1/documents/{document_id}/auto-reminders | Update Document Auto Reminder Settings + + +# **createManualReminder** +> DocumentSendManualReminder200Response createManualReminder(documentSendManualReminderRequest) + +Sends manual reminders to one or more recipients of a specified document. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.DocumentRemindersApi(configuration); + +const body:pd_api.DocumentRemindersApiCreateManualReminderRequest = { + // string | The UUID of the document. + documentId: "BhVzRcxH9Z2LgfPPGXFUBa", + // DocumentSendManualReminderRequest + documentSendManualReminderRequest: { + reminders: [ + { + recipientId: "2eWSKSvVqmuVCnuUK3iWwD", + deliveryMethods: { + email: true, + sms: true, + }, + emailCustomization: { + subject: "Reminder: Please sign the document "Service Agreement"", + message: `**Reminder:** Please review and sign the document *"Service Agreement"*. + +Thank you, +**The Tech Solutions Team** +`, + }, + }, + ], + }, +}; + +apiInstance.createManualReminder(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **documentSendManualReminderRequest** | **DocumentSendManualReminderRequest**| | + **documentId** | [**string**] | The UUID of the document. | defaults to undefined + + +### Return type + +**DocumentSendManualReminder200Response** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully processed reminder requests. Returns an array of objects, where each object details the outcome of the reminder delivery attempt for a specific recipient. | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**404** | Not found | - | +**409** | Returned when a manual reminder cannot be sent due to the document\'s current status. This occurs when: - The document has not been sent yet. - The document is in a final state (e.g., completed, paid, declined, or expired). - The document is in \"suggesting mode,\" during which reminders are disabled. | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **getDocumentAutoReminderSettings** +> AutoReminders getDocumentAutoReminderSettings() + +Retrieves the current auto reminder configuration for a specified document. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.DocumentRemindersApi(configuration); + +const body:pd_api.DocumentRemindersApiGetDocumentAutoReminderSettingsRequest = { + // string | The UUID of the document. + documentId: "BhVzRcxH9Z2LgfPPGXFUBa", +}; + +apiInstance.getDocumentAutoReminderSettings(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **documentId** | [**string**] | The UUID of the document. | defaults to undefined + + +### Return type + +**AutoReminders** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Auto reminder settings retrieved successfully. | - | +**400** | Returned when auto reminder settings could not be retrieved from the document. This occurs when document is in a final state (e.g., completed, paid, declined, or expired). | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **statusDocumentAutoReminder** +> DocumentAutoRemindersResponse statusDocumentAutoReminder() + +Retrieves the current auto reminder status per recipient for a specified document. Recipients who could not receive reminders due to validations (recipient groups, non-signers, etc.) will be skipped and not included in the response. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.DocumentRemindersApi(configuration); + +const body:pd_api.DocumentRemindersApiStatusDocumentAutoReminderRequest = { + // string | The UUID of the document. + documentId: "BhVzRcxH9Z2LgfPPGXFUBa", +}; + +apiInstance.statusDocumentAutoReminder(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **documentId** | [**string**] | The UUID of the document. | defaults to undefined + + +### Return type + +**DocumentAutoRemindersResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Auto reminder status retrieved successfully. | - | +**400** | Returned when auto reminder status could not be retrieved due to the document\'s current status or reminders configuration. This occurs when: - The document has not been sent yet. - The document is in a final state (e.g., completed, paid, declined, or expired). - The auto reminders are disabled in the document settings. | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **updateDocumentAutoReminderSettings** +> UpdateDocumentAutoRemindersResponse updateDocumentAutoReminderSettings(updateDocumentAutoRemindersRequest) + +Configures automatic reminders for document recipients. These reminders are sent after the document\'s initial dispatch. Settings include enabling reminders, delivery method (email/SMS), initial delay, and recurrence frequency. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.DocumentRemindersApi(configuration); + +const body:pd_api.DocumentRemindersApiUpdateDocumentAutoReminderSettingsRequest = { + // string | The UUID of the document. + documentId: "BhVzRcxH9Z2LgfPPGXFUBa", + // UpdateDocumentAutoRemindersRequest + updateDocumentAutoRemindersRequest: { + enabled: true, + deliveryMethod: "email", + initialDelayDays: 1, + isRecurring: true, + recurrenceFrequencyDays: 1, + }, +}; + +apiInstance.updateDocumentAutoReminderSettings(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **updateDocumentAutoRemindersRequest** | **UpdateDocumentAutoRemindersRequest**| | + **documentId** | [**string**] | The UUID of the document. | defaults to undefined + + +### Return type + +**UpdateDocumentAutoRemindersResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Auto reminder settings updated successfully. | - | +**400** | Returned when auto reminder settings could not be retrieved from the document. This occurs when document is in a final state (e.g., completed, paid, declined, or expired). | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/DocumentSectionsBundlesApi.md b/docs/DocumentSectionsBundlesApi.md new file mode 100644 index 0000000..bda12a2 --- /dev/null +++ b/docs/DocumentSectionsBundlesApi.md @@ -0,0 +1,404 @@ +# .DocumentSectionsBundlesApi + +All URIs are relative to *https://api.pandadoc.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteSection**](DocumentSectionsBundlesApi.md#deleteSection) | **DELETE** /public/v1/documents/{document_id}/sections/{section_id} | Delete Document Section +[**listSections**](DocumentSectionsBundlesApi.md#listSections) | **GET** /public/v1/documents/{document_id}/sections | List Document Sections +[**sectionDetails**](DocumentSectionsBundlesApi.md#sectionDetails) | **GET** /public/v1/documents/{document_id}/sections/uploads/{upload_id} | Document Section Upload Status +[**sectionInfo**](DocumentSectionsBundlesApi.md#sectionInfo) | **GET** /public/v1/documents/{document_id}/sections/{section_id} | Document Section Details +[**uploadSection**](DocumentSectionsBundlesApi.md#uploadSection) | **POST** /public/v1/documents/{document_id}/sections/uploads | Create Document Section +[**uploadSectionWithUpload**](DocumentSectionsBundlesApi.md#uploadSectionWithUpload) | **POST** /public/v1/documents/{document_id}/sections/uploads?upload | Create Document Section from File Upload + + +# **deleteSection** +> void deleteSection() + +Removes selected section from the document. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.DocumentSectionsBundlesApi(configuration); + +const body:pd_api.DocumentSectionsBundlesApiDeleteSectionRequest = { + // string | Specify document ID. + documentId: "ZPeAfcpzr9aiVs5vqUf6jg", + // string | Specify section ID. + sectionId: "BhVzRcxH9Z2LgfPPGXFUBa", +}; + +apiInstance.deleteSection(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **documentId** | [**string**] | Specify document ID. | defaults to undefined + **sectionId** | [**string**] | Specify section ID. | defaults to undefined + + +### Return type + +**void** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **listSections** +> UploadSectionListResponse listSections() + +Retrieve information about the sections within a document. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.DocumentSectionsBundlesApi(configuration); + +const body:pd_api.DocumentSectionsBundlesApiListSectionsRequest = { + // string | Document ID + documentId: "BhVzRcxH9Z2LgfPPGXFUBa", +}; + +apiInstance.listSections(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **documentId** | [**string**] | Document ID | defaults to undefined + + +### Return type + +**UploadSectionListResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **sectionDetails** +> UploadSectionStatusResponse sectionDetails() + +Receive the upload status of the document and sections by their `upload_id`. Requesting document section upload status is useful to ensure a document section upload is in the expected state before calling additional API methods. In response, you receive an array with `sections_uuid`. You can receive information about each section using the [Document Section Info](https://developers.pandadoc.com/reference/document-section-info) endpoint. ```json \"section_uuids\": [ \"H8T8CJofGY6JwTsWsPuDEF\", \"8MwLaU4SaZywqLiDk26mDF\" ] ``` ## Available Document Section Upload Statuses The following is a complete list of all possible document statuses returned: | Document Status | Status Description | | :----------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `document_sections_upload.UPLOADED` | The document section upload process has just been created. It is in processing and will be in `document_sections_upload.PROCESSED` state momentarily. | | `document_sections_upload.PROCESSED` | The document sections upload is processed and the sections are already created in the document. All aspects of the document sections can be edited in this state. | | `document_sections_upload.ERROR` | Document section upload procces has been failed. For more information check error details in the response. | + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.DocumentSectionsBundlesApi(configuration); + +const body:pd_api.DocumentSectionsBundlesApiSectionDetailsRequest = { + // string | Document ID. + documentId: "BhVzRcxH9Z2LgfPPGXFUBa", + // string | Upload ID. + uploadId: "LQ6cUT7xevPLUEgJeF8Zrm", +}; + +apiInstance.sectionDetails(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **documentId** | [**string**] | Document ID. | defaults to undefined + **uploadId** | [**string**] | Upload ID. | defaults to undefined + + +### Return type + +**UploadSectionStatusResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**404** | Not found | - | +**409** | Conflict | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **sectionInfo** +> SectionInfoResponse sectionInfo() + +Receive information about each section. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.DocumentSectionsBundlesApi(configuration); + +const body:pd_api.DocumentSectionsBundlesApiSectionInfoRequest = { + // string | Document ID. + documentId: "BhVzRcxH9Z2LgfPPGXFUBa", + // string | Section ID. + sectionId: "LQ6cUT7xevPLUEgJeF8Zrm", +}; + +apiInstance.sectionInfo(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **documentId** | [**string**] | Document ID. | defaults to undefined + **sectionId** | [**string**] | Section ID. | defaults to undefined + + +### Return type + +**SectionInfoResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**404** | Not found | - | +**409** | Conflict | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **uploadSection** +> UploadSectionResponse uploadSection(uploadSectionRequest) + +With this endpoint, you can add a new section to an existing PandaDoc document (create a bundle). You can upload a section to the document using a PandaDoc template or a file by URL. > ⏱️ Document Section creation is a non-blocking (asynchronous) operation > > The document creation process may take some time. > > With a successful request, you receive a response with the created upload ID and status `document_sections_upload.uploaded`. After processing completes on our servers, usually a few seconds, the document moves to the `document_sections_upload.PROCESSED` status. ## Using a PandaDoc template
> 🚧 Current Version Limitations > > Images in sections are currently not supported. > 📘 Pricing tables note > > Each pricing table must have a unique name to populate it with data correctly. A PandaDoc template is a document template created and edited in the PandaDoc web application. Our [help center](https://support.pandadoc.com/en/articles/9714616-save-time-with-a-reusable-template) has further information on PandaDoc templates. If you don\'t have any PandaDoc Template yet, you can easily create one by clicking [Copy a Sample PandaDoc template](https://app.pandadoc.com/get-this-template/?pt=public_template&pub=eiC3a6qBVfEfbw7VCYgaeN). This will open the PandaDoc application in a new tab, copy the sample template into your account, and create a new document from the template.
## Using a File by URL
Using this endpoint you can add a section to the existing document. The section is created from a file you upload. The file can be a PDF, DocX, or RTF. > 📘 We\'ve prepared two samples that you can use to test the request. > Download them here: > > - [Download a Sample PDF with Form Fields](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) > - [Download a Sample PDF with Field Tags](https://5132871.fs1.hubspotusercontent-na1.net/hubfs/5132871/SamplePandaDocPdf_FieldTags_updated.pdf) > ❗️ Limitations > > * This method does not support multiple documents. > * The maximum supported file size is 50 MB. API returns \"413 Request entity too large\" in case of bigger files. > * PandaDoc does not support creating document from a PDF with encrypted files (to check whether a file is encrypted or not, try Get info -> Secure: Password Encrypted). ### PDF Form Fields PandaDoc recognizes PDF form fields. To enable this feature, pass the optional `parse_form_fields` value as `true` when making a create document section API call. We support Text fields, Dropdowns, and Signature fields. If you would like to pass additional parameters to configure PDF form fields, use the PDF field name as an optId. You can use a PDF editor such as Adobe Acrobat, Foxit to get and edit field names in your PDF. [**Download a Sample PDF with Form Fields**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) ### PDF/DocX/RTF Field Tags This parsing format allows a word processor such as [Microsoft Word](https://support.office.com/en-us/article/Save-as-PDF-d85416c5-7d77-4fd6-a216-6f4bf7c7c110?ui=en-US&rs=en-US&ad=US) or [Google Docs](https://support.google.com/drive/answer/2423534?co=GENIE.Platform%3DDesktop&hl=en) to prepare a document and save it in PDF, DocX or RTF format. Within the text, PandaDoc parses field tags. A field tag starts and ends with brackets. The field tag includes basic information on how to create a form field in the PandaDoc document. The request JSON object `optId` can also extend this information for even greater control. Here is an example of how the field tag in a PDF/DocX/RTF is converted to a text field in the PandaDoc document: ![](https://files.readme.io/38afedf-ex3.png \"ex3.png\") [**Download a Sample PDF with Field Tags**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FieldTags.pdf) #### PDF Field Tag Key ![](https://files.readme.io/a81fbf1-field-tag-structure.png \"field-tag-structure.png\") | Number | Key | Description | Example | | :----- | :---------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------- | | 1 | `fieldType` | Field type from the table documented below | `signature`, or `s` for shorthand | | 2 | `*` | Optional `*` denotes the field is not required | `*` | | 3 | `role` | Role name. Associate the field tag with a recipient role. Roles must be assigned to recipients in the request body. In this case we are using role `s1` to keep the length short and denote the concept of \"signer 1\". `s1` would be the value passed as role in a recipient JSON object. | `s1` | | 4 | `optId` | Optional field Id. Specify more information about the field tag within the post request by using this id. | `sigBox17` | | 5 | `_____` | Use underscores to widen the field if desired. The form fields in PandaDoc will scale to the length and size of your field tag. | `_____` | > 🚧 Role names restrictions > > Underscores are not supported in role names for a file with a Field Tag. #### PDF/DocX/RTF Field Tag Supported Types | Field Type | Short Notation | Is PandaDoc Field | | :---------- | :------------- | :---------------- | | `textfield` | `t` | Field | | `checkbox` | `c` | Field | | `signature` | `s` | Field | | `date` | `d` | Field | | `initials` | `i` | Field | | `dropdown` | `dd` | Field | ```json Field Tags Example \"fields\": { \"textfield\": { \"value\": \"Jane\", \"role\": \"user\" }, \"dropdown\": { \"value\": \"opt1\", \"role\": \"user\", \"options\":[ \"opt1\", \"opt2\", \"opt3\" ] }, \"checkbox\": { \"value\": true, \"role\": \"user\" }, \"date\":{ \"value\": \"2022-05-20\", \"role\": \"user\" }, \"signature\": { \"value\": \"\", \"role\": \"user\" } } ``` > 📘 Fields in PandaDoc > > The following article explains how to use Fields: [Everything you need to know about Fields](https://support.pandadoc.com/en/articles/9714583-fields) ### Signing order Set a signing order for document section sections created from a file. ```json \"recipients\": [ { \"email\": \"josh@example.com\", \"first_name\": \"Josh\", \"last_name\": \"Ron\", \"role\": \"user\", \"signing_order\": 1 } ] ``` > 📘 Signing order in PandaDoc > > The following article explains how to use signing order: [How to use signing order](https://support.pandadoc.com/en/articles/9714771-signing-order) ### Error handling | Error description | Type | Root cause | |---|---|---| | Document version 1 is not supported. | Validation errors: Form fields | The creation document section is supported only for document version 2 | | PDF content hasn\'t been processed: document is broken or locked | Processing errors: Failed to process document content | Document converter service can’t process PDF. This may be caused by locked PDF or if it’s broken. | | Error occurred while parsing PDF field tags. Please try PDF flattening or reach out to support | Processing errors: Field tag / Form field validation error | Doc converter managed to parse PDF and extract tags, but at least 1 of them is invalid (having negative position, for example). Usually we recommend PDF flattening and it helps | | No role=\'{role}\' for field tag specified in `recipients` found, roles passed were {roles} | Validation errors: Field tags | Role is invalid. When the role specified in field tag is empty or wasn’t provided in a payload for any recipient | | All field tags within PDF must be declared within `fields`  object of the JSON Payload. No field with optId=\'{optid}\' found in fields object, fields passed were {optids} | Validation errors: Field tags | Label is invalid. Occurs when **optId** specified in field tag is empty or no field with **name = optId** was provided in a payload | | One of field tags in PDF with type=\'{field}\' doesn\'t have a role | Validation errors: Field tags | Field tag in PDF has no role. One of field tags in PDF with type=% doesn\'t have a role. | | Role for form field with name=\'{role}\' is not provided in payload | Validation errors: Form fields | Role for form field with ‘name’ is not provided. Occurs when `role` for form field with name=%s  is not provided in payload | | Field for form field with name=\'{name}\' is not specified in payload, available names are {names} | Validation errors: Form fields | Field ‘name’ is not specified in payload. Occurs when no field with name = form field name was provided in a payload | | No role=\'{role}\' for form field specified in \'recipients\' found, roles passed were {roles}\" | Validation errors: Form fields | Failed to resolve field actor for `role` in form field with ‘name’.   Occurs when role from the form field is not found in recipient’s from payload | | Failed to download file from link {url}. | Source errors | Error on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload | | Failed to download file from link {url} (status code: {status code}) | Source errors | Error with HTTP status code on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload - remote server responded with the HTTP status code | | Content type=\'{type}\' is not supported, available types are {types} | Source errors | Content type is not supported.  Content type should be one of the following: PDF, ZIP, doc, docx, RTF | | The maximum file size is exceeded, limit is {limit} MB | Source errors | The file size has exceeded the allowed limits. An error occurred while trying to download a file that is too large (limit is 50M) |
+ +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.DocumentSectionsBundlesApi(configuration); + +const body:pd_api.DocumentSectionsBundlesApiUploadSectionRequest = { + // string | Document ID + documentId: "CFz2UnLXDck3UJkeGGEuB3", + // UploadSectionRequest + uploadSectionRequest: null, + // 'document' | 'upload' | Determines how the fields are mapped when creating a section. * document: Default value. The fields of the entire document are updated. * upload: Only the fields from the created section are updated. The merge field is appended with the upload ID. (optional) + mergeFieldScope: "document", +}; + +apiInstance.uploadSection(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uploadSectionRequest** | **UploadSectionRequest**| | + **documentId** | [**string**] | Document ID | defaults to undefined + **mergeFieldScope** | [**'document' | 'upload'**]**Array<'document' | 'upload'>** | Determines how the fields are mapped when creating a section. * document: Default value. The fields of the entire document are updated. * upload: Only the fields from the created section are updated. The merge field is appended with the upload ID. | (optional) defaults to undefined + + +### Return type + +**UploadSectionResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | OK | - | +**400** | Bad Request | - | +**401** | Authentication error | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **uploadSectionWithUpload** +> UploadSectionResponse uploadSectionWithUpload() + +With this endpoint, you can add a new section to an existing PandaDoc document (create a bundle). The section is created from a file you upload. The file can be a PDF, DocX, or RTF. > 📘 We\'ve prepared two samples that you can use to test the request. > Download them here: > > - [Download a Sample PDF with Form Fields](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) > - [Download a Sample PDF with Field Tags](https://5132871.fs1.hubspotusercontent-na1.net/hubfs/5132871/SamplePandaDocPdf_FieldTags_updated.pdf) > 🚧 Usage specifics > > 1. This method uses a `multipart/form-data` request type instead of the `application/json` typically found in the PandaDoc API. This is to accommodate the upload of the included document. > 2. You can send a URL instead of a file in the document creation request. > In this case, you need to use the `application/json` content type and add the URL parameter in the body request. As an example, see [Create from public PDF](https://developers.pandadoc.com/docs/create-and-send-a-document-from-a-publicly-available-pdf) guide for more details. > 3. A file you upload is not stored in your PandaDoc account, so you have to upload it with every request. > ❗️ Limitations > > 1. This method does not support multiple documents. > 2. The maximum supported file size is 50 MB. API returns \"413 Request entity too large\" in case of bigger files. > 3. PandaDoc does not support creating document from a PDF with encrypted files (to check whether a file is encrypted or not, try Get info -> Secure: Password Encrypted). > ⏱️ Document Section creation is a non-blocking (asynchronous) operation > > The document creation process may take some time. > > With a successful request, you receive a response with the created upload ID and status `document_sections_upload.uploaded`. After processing completes on our servers, usually a few seconds, the document moves to the `document_sections_upload.PROCESSED` status. ## PDF Form Fields PandaDoc recognizes PDF form fields. To enable this feature, pass the optional `parse_form_fields` value as `true` when making a create document section API call. We support Text fields, Dropdowns, and Signature fields. If you would like to pass additional parameters to configure PDF form fields, use the PDF field name as an optId. You can use a PDF editor such as Adobe Acrobat, Foxit to get and edit field names in your PDF. [**Download a Sample PDF with Form Fields**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) ## PDF/DocX/RTF Field Tags This parsing format allows a word processor such as [Microsoft Word](https://support.office.com/en-us/article/Save-as-PDF-d85416c5-7d77-4fd6-a216-6f4bf7c7c110?ui=en-US&rs=en-US&ad=US) or [Google Docs](https://support.google.com/drive/answer/2423534?co=GENIE.Platform%3DDesktop&hl=en) to prepare a document and save it in PDF, DocX or RTF format. Within the text, PandaDoc parses field tags. A field tag starts and ends with brackets. The field tag includes basic information on how to create a form field in the PandaDoc document. The request JSON object `optId` can also extend this information for even greater control. Here is an example of how the field tag in a PDF/DocX/RTF is converted to a text field in the PandaDoc document: ![](https://files.readme.io/38afedf-ex3.png \"ex3.png\") [**Download a Sample PDF with Field Tags**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FieldTags.pdf)
### PDF Field Tag Key ![](https://files.readme.io/a81fbf1-field-tag-structure.png \"field-tag-structure.png\") | Number | Key | Description | Example | | :----- | :---------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------- | | 1 | `fieldType` | Field type from the table documented below | `signature`, or `s` for shorthand | | 2 | `*` | Optional `*` denotes the field is not required | `*` | | 3 | `role` | Role name. Associate the field tag with a recipient role. Roles must be assigned to recipients in the request body. In this case we are using role `s1` to keep the length short and denote the concept of \"signer 1\". `s1` would be the value passed as role in a recipient JSON object. | `s1` | | 4 | `optId` | Optional field Id. Specify more information about the field tag within the post request by using this id. | `sigBox17` | | 5 | `_____` | Use underscores to widen the field if desired. The form fields in PandaDoc will scale to the length and size of your field tag. | `_____` | > 🚧 Role names restrictions > > Underscores are not supported in role names for a file with a Field Tag. ### PDF/DocX/RTF Field Tag Supported Types | Field Type | Short Notation | Is PandaDoc Field | | :---------- | :------------- | :---------------- | | `textfield` | `t` | Field | | `checkbox` | `c` | Field | | `signature` | `s` | Field | | `date` | `d` | Field | | `initials` | `i` | Field | | `dropdown` | `dd` | Field | > 📘 Fields in PandaDoc > > The following article explains how to use Fields: [Everything you need to know about Fields](https://support.pandadoc.com/en/articles/9714583-fields) ```json Field Tags Example \"fields\": { \"textfield\": { \"value\": \"Jane\", \"role\": \"user\" }, \"dropdown\": { \"value\": \"opt1\", \"role\": \"user\", \"options\":[ \"opt1\", \"opt2\", \"opt3\" ] }, \"checkbox\": { \"value\": true, \"role\": \"user\" }, \"date\":{ \"value\": \"2022-05-20\", \"role\": \"user\" }, \"signature\": { \"value\": \"\", \"role\": \"user\" } } ```
## Signing order Set a signing order for document section sections created from a file. ```json \"recipients\": [ { \"email\": \"josh@example.com\", \"first_name\": \"Josh\", \"last_name\": \"Ron\", \"role\": \"user\", \"signing_order\": 1 } ] ``` ## Error handling | Error description | Type | Root cause | |---|---|---| | Document version 1 is not supported. | Validation errors: Form fields | The creation document section is supported only for document version 2 | | PDF content hasn\'t been processed: document is broken or locked | Processing errors: Failed to process document content | Document converter service can’t process PDF. This may be caused by locked PDF or if it’s broken. | | Error occurred while parsing PDF field tags. Please try PDF flattening or reach out to support | Processing errors: Field tag / Form field validation error | Doc converter managed to parse PDF and extract tags, but at least 1 of them is invalid (having negative position, for example). Usually we recommend PDF flattening and it helps | | No role=\'{role}\' for field tag specified in `recipients` found, roles passed were {roles} | Validation errors: Field tags | Role is invalid. When the role specified in field tag is empty or wasn’t provided in a payload for any recipient | | All field tags within PDF must be declared within `fields`  object of the JSON Payload. No field with optId=\'{optid}\' found in fields object, fields passed were {optids} | Validation errors: Field tags | Label is invalid. Occurs when **optId** specified in field tag is empty or no field with **name = optId** was provided in a payload | | One of field tags in PDF with type=\'{field}\' doesn\'t have a role | Validation errors: Field tags | Field tag in PDF has no role. One of field tags in PDF with type=% doesn\'t have a role. | | Role for form field with name=\'{role}\' is not provided in payload | Validation errors: Form fields | Role for form field with ‘name’ is not provided. Occurs when `role` for form field with name=%s  is not provided in payload | | Field for form field with name=\'{name}\' is not specified in payload, available names are {names} | Validation errors: Form fields | Field ‘name’ is not specified in payload. Occurs when no field with name = form field name was provided in a payload | | No role=\'{role}\' for form field specified in \'recipients\' found, roles passed were {roles}\" | Validation errors: Form fields | Failed to resolve field actor for `role` in form field with ‘name’.   Occurs when role from the form field is not found in recipient’s from payload | | Failed to download file from link {url}. | Source errors | Error on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload | | Failed to download file from link {url} (status code: {status code}) | Source errors | Error with HTTP status code on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload - remote server responded with the HTTP status code | | Content type=\'{type}\' is not supported, available types are {types} | Source errors | Content type is not supported.  Content type should be one of the following: PDF, ZIP, doc, docx, RTF | | The maximum file size is exceeded, limit is {limit} MB | Source errors | The file size has exceeded the allowed limits. An error occurred while trying to download a file that is too large (limit is 50M) | + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.DocumentSectionsBundlesApi(configuration); + +const body:pd_api.DocumentSectionsBundlesApiUploadSectionWithUploadRequest = { + // string | Document ID + documentId: "BhVzRcxH9Z2LgfPPGXFUBa", + // 'document' | 'upload' | Determines how the fields are mapped when creating a section. * document: Default value. The fields of the entire document are updated. * upload: Only the fields from the created section are updated. The merge field is appended with the upload ID. (optional) + mergeFieldScope: "document", + // HttpFile | Binary PDF/DocX/RTF File. (optional) + file: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' }, + // UploadSectionRequest | JSON as a multipart/form-data string. (optional) + data: null, +}; + +apiInstance.uploadSectionWithUpload(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **documentId** | [**string**] | Document ID | defaults to undefined + **mergeFieldScope** | [**'document' | 'upload'**]**Array<'document' | 'upload'>** | Determines how the fields are mapped when creating a section. * document: Default value. The fields of the entire document are updated. * upload: Only the fields from the created section are updated. The merge field is appended with the upload ID. | (optional) defaults to undefined + **file** | [**HttpFile**] | Binary PDF/DocX/RTF File. | (optional) defaults to undefined + **data** | **UploadSectionRequest** | JSON as a multipart/form-data string. | (optional) defaults to undefined + + +### Return type + +**UploadSectionResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: multipart/form-data, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | OK | - | +**400** | Bad Request | - | +**401** | Authentication error | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/DocumentSettingsApi.md b/docs/DocumentSettingsApi.md new file mode 100644 index 0000000..7527bc4 --- /dev/null +++ b/docs/DocumentSettingsApi.md @@ -0,0 +1,131 @@ +# .DocumentSettingsApi + +All URIs are relative to *https://api.pandadoc.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**documentSettingsGet**](DocumentSettingsApi.md#documentSettingsGet) | **GET** /public/v2/documents/{document_id}/settings | Get document settings +[**documentSettingsUpdate**](DocumentSettingsApi.md#documentSettingsUpdate) | **PATCH** /public/v2/documents/{document_id}/settings | Update document settings + + +# **documentSettingsGet** +> DocumentSettingsResponse documentSettingsGet() + +Retrieves the settings for a specified document. Supported fields: language, qualified_electronic_signature, expires_in (in days). + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.DocumentSettingsApi(configuration); + +const body:pd_api.DocumentSettingsApiDocumentSettingsGetRequest = { + // string | Unique identifier of the document to retrieve settings for. + documentId: "BhVzRcxH9Z2LgfPPGXFUBa", +}; + +apiInstance.documentSettingsGet(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **documentId** | [**string**] | Unique identifier of the document to retrieve settings for. | defaults to undefined + + +### Return type + +**DocumentSettingsResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully retrieved document settings. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **documentSettingsUpdate** +> DocumentSettingsResponse documentSettingsUpdate(updateDocumentSettingsRequest) + +Updates the settings for a specified document. Supported fields: language, qualified_electronic_signature, expires_in (in days). + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.DocumentSettingsApi(configuration); + +const body:pd_api.DocumentSettingsApiDocumentSettingsUpdateRequest = { + // string | Unique identifier of the document to update settings for. + documentId: "BhVzRcxH9Z2LgfPPGXFUBa", + // UpdateDocumentSettingsRequest + updateDocumentSettingsRequest: { + language: "en-US", + qualifiedElectronicSignature: true, + expiresIn: 1, + }, +}; + +apiInstance.documentSettingsUpdate(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **updateDocumentSettingsRequest** | **UpdateDocumentSettingsRequest**| | + **documentId** | [**string**] | Unique identifier of the document to update settings for. | defaults to undefined + + +### Return type + +**DocumentSettingsResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully updated document settings. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/DocumentsApi.md b/docs/DocumentsApi.md index d5bb08c..6bc86d1 100644 --- a/docs/DocumentsApi.md +++ b/docs/DocumentsApi.md @@ -4,28 +4,109 @@ All URIs are relative to *https://api.pandadoc.com* Method | HTTP request | Description ------------- | ------------- | ------------- -[**changeDocumentStatus**](DocumentsApi.md#changeDocumentStatus) | **PATCH** /public/v1/documents/{id}/status | Document status change -[**createDocument**](DocumentsApi.md#createDocument) | **POST** /public/v1/documents | Create document -[**createDocumentLink**](DocumentsApi.md#createDocumentLink) | **POST** /public/v1/documents/{id}/session | Create a Document Link -[**createLinkedObject**](DocumentsApi.md#createLinkedObject) | **POST** /public/v1/documents/{id}/linked-objects | Create Linked Object -[**deleteDocument**](DocumentsApi.md#deleteDocument) | **DELETE** /public/v1/documents/{id} | Delete document by id -[**deleteLinkedObject**](DocumentsApi.md#deleteLinkedObject) | **DELETE** /public/v1/documents/{id}/linked-objects/{linked_object_id} | Delete Linked Object -[**detailsDocument**](DocumentsApi.md#detailsDocument) | **GET** /public/v1/documents/{id}/details | Document details +[**appendContentLibraryItemToDocument**](DocumentsApi.md#appendContentLibraryItemToDocument) | **POST** /public/v1/documents/{id}/append-content-library-item | Append Content Library Item to a document +[**changeDocumentStatus**](DocumentsApi.md#changeDocumentStatus) | **PATCH** /public/v1/documents/{id}/status | Document Status Change +[**changeDocumentStatusWithUpload**](DocumentsApi.md#changeDocumentStatusWithUpload) | **PATCH** /public/v1/documents/{id}/status?upload | Document Status Change with Upload +[**createDocument**](DocumentsApi.md#createDocument) | **POST** /public/v1/documents | Create Document +[**createDocumentEditingSession**](DocumentsApi.md#createDocumentEditingSession) | **POST** /public/v1/documents/{id}/editing-sessions | Create Document Editing Session +[**createDocumentFromUpload**](DocumentsApi.md#createDocumentFromUpload) | **POST** /public/v1/documents?upload | Create Document from File Upload +[**createDocumentLink**](DocumentsApi.md#createDocumentLink) | **POST** /public/v1/documents/{id}/session | Create Document Session for Embedded Sign +[**createExportDocxTask**](DocumentsApi.md#createExportDocxTask) | **POST** /public/beta/documents/{document_id}/docx-export-tasks | [Beta] Create DOCX Export Task +[**deleteDocument**](DocumentsApi.md#deleteDocument) | **DELETE** /public/v1/documents/{id} | Delete Document +[**detailsDocument**](DocumentsApi.md#detailsDocument) | **GET** /public/v1/documents/{id}/details | Document Details +[**documentESignDisclosure**](DocumentsApi.md#documentESignDisclosure) | **GET** /public/v1/documents/{document_id}/esign-disclosure | Document eSign disclosure [**documentMoveToFolder**](DocumentsApi.md#documentMoveToFolder) | **POST** /public/v1/documents/{id}/move-to-folder/{folder_id} | Document move to folder -[**downloadDocument**](DocumentsApi.md#downloadDocument) | **GET** /public/v1/documents/{id}/download | Document download -[**downloadProtectedDocument**](DocumentsApi.md#downloadProtectedDocument) | **GET** /public/v1/documents/{id}/download-protected | Download document protected -[**listDocuments**](DocumentsApi.md#listDocuments) | **GET** /public/v1/documents | List documents -[**listLinkedObjects**](DocumentsApi.md#listLinkedObjects) | **GET** /public/v1/documents/{id}/linked-objects | List Linked Objects +[**documentRevertToDraft**](DocumentsApi.md#documentRevertToDraft) | **POST** /public/v1/documents/{id}/draft | Move Document to Draft +[**downloadDocument**](DocumentsApi.md#downloadDocument) | **GET** /public/v1/documents/{id}/download | Document Download +[**downloadProtectedDocument**](DocumentsApi.md#downloadProtectedDocument) | **GET** /public/v1/documents/{id}/download-protected | Download Completed Document +[**getDocxExportTask**](DocumentsApi.md#getDocxExportTask) | **GET** /public/beta/documents/{document_id}/docx-export-tasks/{task_id} | [Beta] DOCX Export Task +[**listDocuments**](DocumentsApi.md#listDocuments) | **GET** /public/v1/documents | List Documents [**sendDocument**](DocumentsApi.md#sendDocument) | **POST** /public/v1/documents/{id}/send | Send Document -[**statusDocument**](DocumentsApi.md#statusDocument) | **GET** /public/v1/documents/{id} | Document status +[**statusDocument**](DocumentsApi.md#statusDocument) | **GET** /public/v1/documents/{id} | Document Status [**transferAllDocumentsOwnership**](DocumentsApi.md#transferAllDocumentsOwnership) | **PATCH** /public/v1/documents/ownership | Transfer all documents ownership [**transferDocumentOwnership**](DocumentsApi.md#transferDocumentOwnership) | **PATCH** /public/v1/documents/{id}/ownership | Update document ownership -[**updateDocument**](DocumentsApi.md#updateDocument) | **PATCH** /public/v1/documents/{id} | Update Document only in the draft status +[**updateDocument**](DocumentsApi.md#updateDocument) | **PATCH** /public/v1/documents/{id} | Update Document +# **appendContentLibraryItemToDocument** +> AppendCLIDataResponse appendContentLibraryItemToDocument(appendCLIDataRequest) + +Appends a Content Library Item (CLI) to a document and provides a name mapping for its content blocks. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.DocumentsApi(configuration); + +const body:pd_api.DocumentsApiAppendContentLibraryItemToDocumentRequest = { + // string | Specify document id. + id: "BhVzRcxH9Z2LgfPPGXFUBa", + // AppendCLIDataRequest + appendCLIDataRequest: { + cli: { + id: "QYCPtavst3DqqBK72ZRtbF", + pages: [ + { + index: 1, + name: "Page 1", + }, + ], + }, + }, +}; + +apiInstance.appendContentLibraryItemToDocument(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appendCLIDataRequest** | **AppendCLIDataRequest**| | + **id** | [**string**] | Specify document id. | defaults to undefined + + +### Return type + +**AppendCLIDataResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | OK | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**404** | Not found | - | +**409** | Conflict | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + # **changeDocumentStatus** > void changeDocumentStatus(documentStatusChangeRequest) +PandaDoc has eight document statuses, but you can manually set your document status to only four: ### Document statuses - Completed - `document.completed` - API code `2` - Expired - `document.voided` - code `11` - Paid - `document.paid` - code `10`. **Important**: You can only set it if you have a payment app connected. - Declined - `document.declined` - code `12` > 🚧 Pass a numeric code for the corresponding document status, for example, `2` for `document.completed`. Find more details in [\\[Editor 2.0\\] Manually change document status](https://support.pandadoc.com/en/articles/9714842-manually-change-document-status) topic. | Current Status | To Completed: | To Expired: | To Paid: | To Declined: | |----------------|---------------|-------------|----------|--------------| | Draft | YES | NO | YES | YES | | Approved | NO | NO | NO | NO | | Sent | YES | YES | NO | YES | | Viewed | YES | YES | NO | YES | | Completed (Auto) | NO | NO | NO | YES | | Waithing for payment | NO | NO | YES | YES | | Paid | NO | NO | NO | NO | | Expired | YES | NO | YES | YES | | Declined | YES | NO | YES | NO | > ✅ - from `document.voided` to `document.paid` > > ❌ - from `document.paid` to `document.voided` ### Example @@ -42,7 +123,7 @@ const apiInstance = new pd_api.DocumentsApi(configuration); const body:pd_api.DocumentsApiChangeDocumentStatusRequest = { // string | Specify document ID. - id: "BhVzRcxH9Z2LgfPPGXFUBa", + id: "iGsFiaV2hEEvQdhr2WAkMk", // DocumentStatusChangeRequest documentStatusChangeRequest: { status: 12, @@ -75,7 +156,75 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, multipart/form-data + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**404** | Not found | - | +**409** | Conflict | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **changeDocumentStatusWithUpload** +> void changeDocumentStatusWithUpload() + +PandaDoc has eight document statuses, but you can manually set your document status to only four: ### Document statuses - Completed - `document.completed` - API code `2` - Expired - `document.voided` - code `11` - Paid - `document.paid` - code `10`. **Important**: You can only set it if you have a payment app connected. - Declined - `document.declined` - code `12` > 🚧 Pass a numeric code for the corresponding document status, for example, `2` for `document.completed`. Find more details in [\\[Editor 2.0\\] Manually change document status](https://support.pandadoc.com/en/articles/9714842-manually-change-document-status) topic. | Current Status | To Completed: | To Expired: | To Paid: | To Declined: | |----------------|---------------|-------------|----------|--------------| | Draft | YES | NO | YES | YES | | Approved | NO | NO | NO | NO | | Sent | YES | YES | NO | YES | | Viewed | YES | YES | NO | YES | | Completed (Auto) | NO | NO | NO | YES | | Waithing for payment | NO | NO | YES | YES | | Paid | NO | NO | NO | NO | | Expired | YES | NO | YES | YES | | Declined | YES | NO | YES | NO | > ✅ - from `document.voided` to `document.paid` > > ❌ - from `document.paid` to `document.voided` + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.DocumentsApi(configuration); + +const body:pd_api.DocumentsApiChangeDocumentStatusWithUploadRequest = { + // string | Specify document ID. + id: "iGsFiaV2hEEvQdhr2WAkMk", + // HttpFile | Binary attachment file (optional) + file: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' }, + // DocumentStatusChangeRequest | JSON as a multipart/form-data string. (optional) + data: null, +}; + +apiInstance.changeDocumentStatusWithUpload(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | [**string**] | Specify document ID. | defaults to undefined + **file** | [**HttpFile**] | Binary attachment file | (optional) defaults to undefined + **data** | **DocumentStatusChangeRequest** | JSON as a multipart/form-data string. | (optional) defaults to undefined + + +### Return type + +**void** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: multipart/form-data - **Accept**: application/json @@ -94,6 +243,7 @@ Name | Type | Description | Notes # **createDocument** > DocumentCreateResponse createDocument(documentCreateRequest) +## Create from a template > See the [Create document from template](https://developers.pandadoc.com/docs/create-document-from-template) tutorial for details on how to use this endpoint, as well as a sample template. ## Create from a URL > See the [Create from public PDF](https://developers.pandadoc.com/docs/create-and-send-a-document-from-a-publicly-available-pdf) guide for info about roles and fields, as well as PDF examples. ### Example @@ -109,135 +259,177 @@ const configuration = pd_api.createConfiguration( const apiInstance = new pd_api.DocumentsApi(configuration); const body:pd_api.DocumentsApiCreateDocumentRequest = { - // DocumentCreateRequest | Use a PandaDoc template or an existing PDF to create a document. See the creation request examples [by template](/schemas/DocumentCreateByTemplateRequest) and [by pdf](/schemas/DocumentCreateByPdfRequest) - documentCreateRequest: { + // DocumentCreateRequest + documentCreateRequest: null, + // string | Set this parameter as `ev1` if you want to create a document from PDF with Classic Editor when both editors are enabled for the workspace. (optional) + editorVer: "ev2", + // string | Set this parameter as `yes` or `1` or `true` (only when upload pdf with form fields) if you want to respect form fields properties, like `required`. (optional) + useFormFieldProperties: "true", +}; + +apiInstance.createDocument(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **documentCreateRequest** | **DocumentCreateRequest**| | + **editorVer** | [**string**] | Set this parameter as `ev1` if you want to create a document from PDF with Classic Editor when both editors are enabled for the workspace. | (optional) defaults to undefined + **useFormFieldProperties** | [**string**] | Set this parameter as `yes` or `1` or `true` (only when upload pdf with form fields) if you want to respect form fields properties, like `required`. | (optional) defaults to undefined + + +### Return type + +**DocumentCreateResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | OK | - | +**400** | Bad Request | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **createDocumentEditingSession** +> CreateDocumentEditingSession201Response createDocumentEditingSession(editingSessionRequest) + +Creates a new editing session for the Embedded Editor. The response includes an E-Token, which is required to open the document. > 🚧 **Important:** The Embedded Editor can only open documents that have a `draft` status. #### Limitations - **Single Active Session per User-Document Pair** Only one editing session can be active at a time for a specific user and document. Creating a new session for the same user-document pair will automatically invalidate the previous one. - **Weekly Session Cap** A maximum of **250** editing sessions can be created for a single document per week. Any attempt to exceed this limit will result in a `403 Forbidden` error. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.DocumentsApi(configuration); + +const body:pd_api.DocumentsApiCreateDocumentEditingSessionRequest = { + // string | Document ID + id: "pSgK5XYZjyg3zXYZxsoUWg", + // EditingSessionRequest + editingSessionRequest: { + email: "john.doe@pandadoc.com", + lifetime: 3600, + }, +}; + +apiInstance.createDocumentEditingSession(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **editingSessionRequest** | **EditingSessionRequest**| | + **id** | [**string**] | Document ID | defaults to undefined + + +### Return type + +**CreateDocumentEditingSession201Response** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Document Editing Session created | - | +**400** | Bad request | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **createDocumentFromUpload** +> DocumentCreateResponse createDocumentFromUpload() + +## Create from an upload > See the [Create from PDF](https://developers.pandadoc.com/docs/create-document-from-file) tutorial for the usage specifics and sample PDF files. **Note**: A file you upload is not stored in your PandaDoc account, so you have to upload it with every request. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.DocumentsApi(configuration); + +const body:pd_api.DocumentsApiCreateDocumentFromUploadRequest = { + // string | Set this parameter as `ev1` if you want to create a document from PDF with Classic Editor when both editors are enabled for the workspace. (optional) + editorVer: "ev2", + // string | Set this parameter as `yes` or `1` or `true` (only when upload pdf with form fields) if you want to respect form fields properties, like `required`. (optional) + useFormFieldProperties: "true", + // HttpFile | Binary PDF File (optional) + file: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' }, + // DocumentCreateByPdfRequest (optional) + data: { + parseFormFields: true, + fields: { + "key": { + value: null, + role: "user", + }, + }, name: "API Sample Document from PandaDoc Template", - detectTitleVariables: true, - templateUuid: "hryJY9mqYZHjQCYQuSjRQg", folderUuid: "QMDSzwabfFzTgjW4kUijqQ", owner: { - "key": "key_example", + email: "john.doe@example.com", + membershipId: "QMDSzwabfFzTgjW6KijHyu", }, recipients: [ - { - email: "josh@example.com", - phone: "+14842634627", - deliveryMethods: { - email: true, - sms: false, - }, - firstName: "Josh", - lastName: "Ron", - role: "user", - signingOrder: 1, - redirect: { - isEnabled: true, - url: "https://example.com", - }, - }, + null, ], tokens: [ { - name: "Favorite.Pet", - value: "Panda", + name: "Client.CompanyName", + value: "PandaDoc", }, ], - fields: {}, metadata: {}, - tags: ["created_via_api","test_document"], - images: [ - { - urls: ["https://s3.amazonaws.com/pd-static-content/public-docs/pandadoc-panda-bear.png"], - name: "Image 1", - }, - ], - pricingTables: [ - { - name: "Pricing Table 1", - dataMerge: true, - options: {}, - sections: [ - { - title: "Sample Section", - _default: true, - multichoiceEnabled: false, - rows: [ - { - options: { - qtyEditable: true, - optionalSelected: true, - optional: true, - }, - data: {}, - customFields: {}, - }, - ], - }, - ], - }, - ], - contentPlaceholders: [ - { - blockId: "Content Placeholder 1", - contentLibraryItems: [ - { - id: "hryJY9mqYZHjQCYQuSjRQg", - pricingTables: [ - { - name: "Pricing Table 1", - dataMerge: true, - options: {}, - sections: [ - { - title: "Sample Section", - _default: true, - multichoiceEnabled: false, - rows: [ - { - options: { - qtyEditable: true, - optionalSelected: true, - optional: true, - }, - data: {}, - customFields: {}, - }, - ], - }, - ], - }, - ], - fields: {}, - recipients: [ - { - email: "josh@example.com", - phone: "+14842634627", - deliveryMethods: { - email: true, - sms: false, - }, - firstName: "Josh", - lastName: "Ron", - role: "user", - signingOrder: 1, - redirect: { - isEnabled: true, - url: "https://example.com", - }, - }, - ], - }, - ], - }, - ], - url: "https://s3.amazonaws.com/pd-static-content/public-docs/pandadoc-panda-bear.png", - parseFormFields: true, + tags: ["created_via_api","test_document","created_from_source"], }, - // string | Set this parameter as `ev1` if you want to create a document from PDF with Classic Editor when both editors are enabled for the workspace. (optional) - editorVer: "ev2", }; -apiInstance.createDocument(body).then((data) => { +apiInstance.createDocumentFromUpload(body).then((data) => { console.log('API called successfully. Returned data: %o', data); }).catch((error) => console.error(error)); ``` @@ -247,8 +439,10 @@ apiInstance.createDocument(body).then((data) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **documentCreateRequest** | **DocumentCreateRequest**| Use a PandaDoc template or an existing PDF to create a document. See the creation request examples [by template](/schemas/DocumentCreateByTemplateRequest) and [by pdf](/schemas/DocumentCreateByPdfRequest) | **editorVer** | [**string**] | Set this parameter as `ev1` if you want to create a document from PDF with Classic Editor when both editors are enabled for the workspace. | (optional) defaults to undefined + **useFormFieldProperties** | [**string**] | Set this parameter as `yes` or `1` or `true` (only when upload pdf with form fields) if you want to respect form fields properties, like `required`. | (optional) defaults to undefined + **file** | [**HttpFile**] | Binary PDF File | (optional) defaults to undefined + **data** | **DocumentCreateByPdfRequest** | | (optional) defaults to undefined ### Return type @@ -261,7 +455,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, multipart/form-data + - **Content-Type**: multipart/form-data - **Accept**: application/json @@ -278,6 +472,7 @@ Name | Type | Description | Notes # **createDocumentLink** > DocumentCreateLinkResponse createDocumentLink(documentCreateLinkRequest) +Creates a document session for a recipient to view and sign a document. > 📘 How to create an Embedded Sign session > For more information on how to create an Embedded Sign session, see the [Embedded Signing](https://developers.pandadoc.com/docs/embedded-signing) documentation. ### Example @@ -342,9 +537,10 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) -# **createLinkedObject** -> LinkedObjectCreateResponse createLinkedObject(linkedObjectCreateRequest) +# **createExportDocxTask** +> DocumentDocxExport createExportDocxTask() +> ⏱️ Export as DOCX is a non-blocking (asynchronous) operation > The document generation process may take some time. > With a successful request, you receive a response with task ID, status **created** and document id. After process completes, usually in a few minutes, the task status moves to the **done** state. > You can download documents up to 300 pages. For documents of 301+ pages, you will receive an error “400: The number of pages more then limit 300” ### Example @@ -359,18 +555,12 @@ const configuration = pd_api.createConfiguration( ); const apiInstance = new pd_api.DocumentsApi(configuration); -const body:pd_api.DocumentsApiCreateLinkedObjectRequest = { - // string | Specify document ID. - id: "ZPeAfcpzr9aiVs5vqUf6jg", - // LinkedObjectCreateRequest - linkedObjectCreateRequest: { - provider: "pipedrive", - entityType: "deal", - entityId: "9372", - }, +const body:pd_api.DocumentsApiCreateExportDocxTaskRequest = { + // string | Specify document id. + documentId: "BhVzRcxH9Z2LgfPPGXFUBa", }; -apiInstance.createLinkedObject(body).then((data) => { +apiInstance.createExportDocxTask(body).then((data) => { console.log('API called successfully. Returned data: %o', data); }).catch((error) => console.error(error)); ``` @@ -380,13 +570,12 @@ apiInstance.createLinkedObject(body).then((data) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **linkedObjectCreateRequest** | **LinkedObjectCreateRequest**| | - **id** | [**string**] | Specify document ID. | defaults to undefined + **documentId** | [**string**] | Specify document id. | defaults to undefined ### Return type -**LinkedObjectCreateResponse** +**DocumentDocxExport** ### Authorization @@ -394,25 +583,25 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | OK | - | -**400** | Bad Request | - | +**200** | Export DOCX task was created. | - | **401** | Authentication error | - | **403** | Permission error | - | -**404** | Not found | - | -**429** | Too Many Requests | - | +**404** | Not found error | - | +**429** | Too many requests error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) # **deleteDocument** > void deleteDocument() +Delete a document by ID. ### Example @@ -467,9 +656,10 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) -# **deleteLinkedObject** -> void deleteLinkedObject() +# **detailsDocument** +> DocumentDetailsResponse detailsDocument() +Return detailed data about a document. Use Document Status for getting just a basic info and status. Get details about a document by its `id`. Details include: - Basic document information (name, document state, owner, sender, grand total, etc.) - Recipients (completion status, signing order, etc.) - Fields with values (incl. Collect Files field) - Tokens (variables) with values - Pricing information (pricing tables, products, quotes, etc.) - Content block names for table, image, and text blocks (tables, images, texts) - Metadata - Tags - Linked objects - [Approval flow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) (if present) - Timestamps associated with a document. Note that `date_modified` means any changes associated with the recipients and document status, while `content_date_modified` reflects any changes in the document content. ### Example @@ -484,14 +674,12 @@ const configuration = pd_api.createConfiguration( ); const apiInstance = new pd_api.DocumentsApi(configuration); -const body:pd_api.DocumentsApiDeleteLinkedObjectRequest = { - // string | Specify document ID. - id: "ZPeAfcpzr9aiVs5vqUf6jg", - // string | Specify linked object ID. - linkedObjectId: "deb0d530-d759-4189-a422-8d2265e01b2e", +const body:pd_api.DocumentsApiDetailsDocumentRequest = { + // string | Document ID + id: "BhVzRcxH9Z2LgfPPGXFUBa", }; -apiInstance.deleteLinkedObject(body).then((data) => { +apiInstance.detailsDocument(body).then((data) => { console.log('API called successfully. Returned data: %o', data); }).catch((error) => console.error(error)); ``` @@ -501,13 +689,12 @@ apiInstance.deleteLinkedObject(body).then((data) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | [**string**] | Specify document ID. | defaults to undefined - **linkedObjectId** | [**string**] | Specify linked object ID. | defaults to undefined + **id** | [**string**] | Document ID | defaults to undefined ### Return type -**void** +**DocumentDetailsResponse** ### Authorization @@ -522,7 +709,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | No content | - | +**200** | OK | - | **401** | Authentication error | - | **403** | Permission error | - | **404** | Not found | - | @@ -531,9 +718,10 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) -# **detailsDocument** -> DocumentDetailsResponse detailsDocument() +# **documentESignDisclosure** +> DocumentESignDisclosure documentESignDisclosure() +Retrieves the current version of eSign disclosure text for a specified document. ### Example @@ -548,12 +736,12 @@ const configuration = pd_api.createConfiguration( ); const apiInstance = new pd_api.DocumentsApi(configuration); -const body:pd_api.DocumentsApiDetailsDocumentRequest = { - // string | Document ID - id: "BhVzRcxH9Z2LgfPPGXFUBa", +const body:pd_api.DocumentsApiDocumentESignDisclosureRequest = { + // string | The UUID of the document. + documentId: "BhVzRcxH9Z2LgfPPGXFUBa", }; -apiInstance.detailsDocument(body).then((data) => { +apiInstance.documentESignDisclosure(body).then((data) => { console.log('API called successfully. Returned data: %o', data); }).catch((error) => console.error(error)); ``` @@ -563,12 +751,12 @@ apiInstance.detailsDocument(body).then((data) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | [**string**] | Document ID | defaults to undefined + **documentId** | [**string**] | The UUID of the document. | defaults to undefined ### Return type -**DocumentDetailsResponse** +**DocumentESignDisclosure** ### Authorization @@ -583,11 +771,10 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | OK | - | +**200** | ESign disclosure text retrieved successfully. | - | **401** | Authentication error | - | **403** | Permission error | - | **404** | Not found | - | -**409** | Conflict | - | **429** | Too Many Requests | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) @@ -595,6 +782,7 @@ Name | Type | Description | Notes # **documentMoveToFolder** > void documentMoveToFolder() +This operation allows you to move a document to a folder by specifying the document ID and folder ID. ### Example @@ -655,9 +843,67 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +# **documentRevertToDraft** +> DocumentRevertToDraftResponse documentRevertToDraft() + +Revert your document back to draft to continue editing it. > 📘 Returning to Draft works for any document status except Removed. ## After you move your document to the Draft status - `Signature` and `Initials` fields are cleared. All other fields stay filled in. - Recipients are **not** notified that the document is back in Draft. - You\'ll need to resend the document so that recipients can sign the updated version. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.DocumentsApi(configuration); + +const body:pd_api.DocumentsApiDocumentRevertToDraftRequest = { + // string | Specify document ID. + id: "iGsFiaV2hEEvQdhr2WAkMk", +}; + +apiInstance.documentRevertToDraft(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | [**string**] | Specify document ID. | defaults to undefined + + +### Return type + +**DocumentRevertToDraftResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + # **downloadDocument** > HttpFile downloadDocument() +Download documents as a PDF. ### Example @@ -683,8 +929,8 @@ const body:pd_api.DocumentsApiDownloadDocumentRequest = { watermarkOpacity: 0.5, // string | Specify watermark text. (optional) watermarkText: "John Doe inc.", - // boolean | Set as `true` if you want to receive a zip file with all documents in separate when document transaction contains more than 1. (optional) - separateFiles: true, + // boolean | Download document bundle as a zip-archive of separate PDFs (1 file per section). (optional) + separateFiles: false, }; apiInstance.downloadDocument(body).then((data) => { @@ -702,7 +948,7 @@ Name | Type | Description | Notes **watermarkFontSize** | [**number**] | Font size of the watermark. | (optional) defaults to undefined **watermarkOpacity** | [**number**] | In range 0.0-1.0 | (optional) defaults to undefined **watermarkText** | [**string**] | Specify watermark text. | (optional) defaults to undefined - **separateFiles** | [**boolean**] | Set as `true` if you want to receive a zip file with all documents in separate when document transaction contains more than 1. | (optional) defaults to undefined + **separateFiles** | [**boolean**] | Download document bundle as a zip-archive of separate PDFs (1 file per section). | (optional) defaults to false ### Return type @@ -735,7 +981,7 @@ Name | Type | Description | Notes # **downloadProtectedDocument** > HttpFile downloadProtectedDocument() -Download a signed PDF of a completed document +Download a completed document as a verifiable PDF (Download Protected Document) > 🚧 Production key only > > This endpoint only works with a Production key. You\'ll get a 401 Unauthorized error when trying to use a Sandbox key. Download a signed PDF of a completed document ### Example @@ -753,8 +999,8 @@ const apiInstance = new pd_api.DocumentsApi(configuration); const body:pd_api.DocumentsApiDownloadProtectedDocumentRequest = { // string | Specify document ID. id: "Mebvyy3NGsGBnY2rPLkH84", - // boolean | Set as `true` if you want to receive a zip file with all documents in separate when document transaction contains more than 1. (optional) - separateFiles: true, + // boolean | Download document bundle as a zip-archive of separate PDFs (1 file per section). (optional) + separateFiles: false, }; apiInstance.downloadProtectedDocument(body).then((data) => { @@ -768,7 +1014,7 @@ apiInstance.downloadProtectedDocument(body).then((data) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | [**string**] | Specify document ID. | defaults to undefined - **separateFiles** | [**boolean**] | Set as `true` if you want to receive a zip file with all documents in separate when document transaction contains more than 1. | (optional) defaults to undefined + **separateFiles** | [**boolean**] | Download document bundle as a zip-archive of separate PDFs (1 file per section). | (optional) defaults to false ### Return type @@ -797,9 +1043,10 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) -# **listDocuments** -> DocumentListResponse listDocuments() +# **getDocxExportTask** +> DocxExportTaskResponse getDocxExportTask() +> 📘 This endpoint returns the current state of a DOCX export task for a document. > The endpoint supports downloading only multiple files if the document contains several sections. Downloading as a single file in this case is not possible. ### Example @@ -814,52 +1061,14 @@ const configuration = pd_api.createConfiguration( ); const apiInstance = new pd_api.DocumentsApi(configuration); -const body:pd_api.DocumentsApiListDocumentsRequest = { - // string | Return results where the `date_completed` field (ISO 8601) is greater than or equal to this value. (optional) - completedFrom: "2021-10-27T15:22:23.132757Z", - // string | Return results where the `date_completed` field (ISO 8601) is less than or equal to this value. (optional) - completedTo: "2021-10-27T15:22:23.132757Z", - // string | Returns results where 'contact_id' is present in document as recipient or approver (optional) - contactId: "9FeAY2NB3C9qDdtQRb4tTL", - // number | Specify how many document results to return. Default is 50 documents, maximum is 100 documents. (optional) - count: 50, - // string | Return results where the `date_created` field (ISO 8601) is greater than or equal to this value. (optional) - createdFrom: "2021-10-27T15:22:23.132757Z", - // string | Return results where the `date_created` field (ISO 8601) is less than this value. (optional) - createdTo: "2021-10-27T15:22:23.132757Z", - // boolean | Returns only the deleted documents. (optional) - deleted: true, - // string (optional) - id: "BhVzRcxH9Z2LgfPPGXFUBa", - // string | The UUID of the folder where the documents are stored. (optional) - folderUuid: "BhVzRcxH9Z2LgfPPGXFUBa", - // string | Specify the form used for documents creation. This parameter can't be used with template_id. (optional) - formId: "BhVzRcxH9Z2LgfPPGXFUBa", - // string | Returns results where 'membership_id' is present in document as owner (should be member uuid) (optional) - membershipId: "BhVzRcxH9Z2LgfPPGXFUBa", - // Array | Specify metadata to filter by in the format of `metadata_{metadata-key}={metadata-value}` such as `metadata_opportunity_id=2181432`. The `metadata_` prefix is always required. (optional) - metadata: ["metadata_opportunity_id=2181432","metadata_custom_key=custom_value"], - // string | Return results where the `date_modified` field (iso-8601) is greater than or equal to this value. (optional) - modifiedFrom: "2021-10-27T15:22:23.132757Z", - // string | Return results where the `date_modified` field (iso-8601) is less than this value. (optional) - modifiedTo: "2021-10-27T15:22:23.132757Z", - // DocumentOrderingFieldsEnum | Specify the order of documents to return. Use `value` (for example, `date_created`) for ASC and `-value` (for example, `-date_created`) for DESC. (optional) - orderBy: "name", - // number | Specify which page of the dataset to return. (optional) - page: 1, - // string | Search query. Filter by document reference number (this token is stored on the template level) or name. (optional) - q: "Sample Document", - // DocumentStatusRequestEnum | Specify the status of documents to return. * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review (optional) - status: 12, - // DocumentStatusRequestEnum | Specify the status of documents to return (exclude). * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review (optional) - statusNe: 12, - // string | Search tag. Filter by document tag. (optional) - tag: "tag_1", - // string | Specify the template used for documents creation. Parameter can't be used with form_id. (optional) - templateId: "BhVzRcxH9Z2LgfPPGXFUBa", +const body:pd_api.DocumentsApiGetDocxExportTaskRequest = { + // string | Specify document id. + documentId: "BhVzRcxH9Z2LgfPPGXFUBa", + // string | Specify Task id. + taskId: "nPh2PDhFdDqAES9k64h9qX", }; -apiInstance.listDocuments(body).then((data) => { +apiInstance.getDocxExportTask(body).then((data) => { console.log('API called successfully. Returned data: %o', data); }).catch((error) => console.error(error)); ``` @@ -869,32 +1078,13 @@ apiInstance.listDocuments(body).then((data) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **completedFrom** | [**string**] | Return results where the `date_completed` field (ISO 8601) is greater than or equal to this value. | (optional) defaults to undefined - **completedTo** | [**string**] | Return results where the `date_completed` field (ISO 8601) is less than or equal to this value. | (optional) defaults to undefined - **contactId** | [**string**] | Returns results where 'contact_id' is present in document as recipient or approver | (optional) defaults to undefined - **count** | [**number**] | Specify how many document results to return. Default is 50 documents, maximum is 100 documents. | (optional) defaults to undefined - **createdFrom** | [**string**] | Return results where the `date_created` field (ISO 8601) is greater than or equal to this value. | (optional) defaults to undefined - **createdTo** | [**string**] | Return results where the `date_created` field (ISO 8601) is less than this value. | (optional) defaults to undefined - **deleted** | [**boolean**] | Returns only the deleted documents. | (optional) defaults to undefined - **id** | [**string**] | | (optional) defaults to undefined - **folderUuid** | [**string**] | The UUID of the folder where the documents are stored. | (optional) defaults to undefined - **formId** | [**string**] | Specify the form used for documents creation. This parameter can't be used with template_id. | (optional) defaults to undefined - **membershipId** | [**string**] | Returns results where 'membership_id' is present in document as owner (should be member uuid) | (optional) defaults to undefined - **metadata** | **Array<string>** | Specify metadata to filter by in the format of `metadata_{metadata-key}={metadata-value}` such as `metadata_opportunity_id=2181432`. The `metadata_` prefix is always required. | (optional) defaults to undefined - **modifiedFrom** | [**string**] | Return results where the `date_modified` field (iso-8601) is greater than or equal to this value. | (optional) defaults to undefined - **modifiedTo** | [**string**] | Return results where the `date_modified` field (iso-8601) is less than this value. | (optional) defaults to undefined - **orderBy** | **DocumentOrderingFieldsEnum** | Specify the order of documents to return. Use `value` (for example, `date_created`) for ASC and `-value` (for example, `-date_created`) for DESC. | (optional) defaults to undefined - **page** | [**number**] | Specify which page of the dataset to return. | (optional) defaults to undefined - **q** | [**string**] | Search query. Filter by document reference number (this token is stored on the template level) or name. | (optional) defaults to undefined - **status** | **DocumentStatusRequestEnum** | Specify the status of documents to return. * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review | (optional) defaults to undefined - **statusNe** | **DocumentStatusRequestEnum** | Specify the status of documents to return (exclude). * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review | (optional) defaults to undefined - **tag** | [**string**] | Search tag. Filter by document tag. | (optional) defaults to undefined - **templateId** | [**string**] | Specify the template used for documents creation. Parameter can't be used with form_id. | (optional) defaults to undefined + **documentId** | [**string**] | Specify document id. | defaults to undefined + **taskId** | [**string**] | Specify Task id. | defaults to undefined ### Return type -**DocumentListResponse** +**DocxExportTaskResponse** ### Authorization @@ -909,17 +1099,18 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | OK | - | -**400** | Bad Request | - | +**200** | Got state of export DOCX task. | - | **401** | Authentication error | - | **403** | Permission error | - | -**429** | Too Many Requests | - | +**404** | Not found error | - | +**429** | Too many requests error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) -# **listLinkedObjects** -> LinkedObjectListResponse listLinkedObjects() +# **listDocuments** +> DocumentListResponse listDocuments() +This endpoint will let you list and search for the documents. ### [Here](https://developers.pandadoc.com/docs/list-search-documents-api) you can find how to filter, search and order documents. ### Example @@ -934,12 +1125,52 @@ const configuration = pd_api.createConfiguration( ); const apiInstance = new pd_api.DocumentsApi(configuration); -const body:pd_api.DocumentsApiListLinkedObjectsRequest = { - // string | Specify document ID. - id: "ZPeAfcpzr9aiVs5vqUf6jg", +const body:pd_api.DocumentsApiListDocumentsRequest = { + // string | Filters by parent template. This Parameter can\'t be used with form_id. (optional) + templateId: "BhVzRcxH9Z2LgfPPGXFUBa", + // string | Filters by parent form. This parameter can\'t be used with template_id. (optional) + formId: "BhVzRcxH9Z2LgfPPGXFUBa", + // string | Filters by the folder where the documents are stored. (optional) + folderUuid: "BhVzRcxH9Z2LgfPPGXFUBa", + // string | Filters by recipient or approver with this \'contact_id\'. (optional) + contactId: "9FeAY2NB3C9qDdtQRb4tTL", + // number | Limits the size of the response. Default is 50 documents, maximum is 100 documents. (optional) + count: 50, + // number | Paginates the search result. Increase value to get the next page of results. (optional) + page: 1, + // DocumentOrderingFieldsEnum | Defines the sorting of the result. Use `date_created` for ASC and `-date_created` for DESC sorting. (optional) + orderBy: "date_status_changed", + // string | Limits results to the documents with the `date_created` greater than or equal to this value. (optional) + createdFrom: "2024-10-27T15:22:23.132757Z", + // string | Limits results to the documents with the `date_created` less than this value. (optional) + createdTo: "2024-10-27T15:22:23.132757Z", + // boolean | Returns only the deleted documents. (optional) + deleted: false, + // string (optional) + id: "BhVzRcxH9Z2LgfPPGXFUBa", + // string | Limits results to the documents with the `date_completed` greater than or equal to this value. (optional) + completedFrom: "2024-10-27T15:22:23.132757Z", + // string | Limits results to the documents with the `date_completed` less than this value. (optional) + completedTo: "2024-10-27T15:22:23.132757Z", + // string | Filter documents by the owner\'s \'membership_id\'. (optional) + membershipId: "BhVzRcxH9Z2LgfPPGXFUBa", + // Array | Filters documents by metadata. Pass metadata in the format of `metadata_{metadata-key}={metadata-value}` such as `metadata_opportunity_id=2181432`. The `metadata_` prefix is always required. (optional) + metadata: ["metadata_opportunity_id=2181432","metadata_custom_key=custom_value"], + // string | Limits results to the documents with the `date_modified` greater than or equal to this value. (optional) + modifiedFrom: "2024-10-27T15:22:23.132757Z", + // string | Limits results to the documents with the `date_modified` less than this value. (optional) + modifiedTo: "2024-10-27T15:22:23.132757Z", + // string | Filters documents by name or reference number (stored on the template level). (optional) + q: "Sample Document", + // DocumentStatusRequestEnum | Filters documents by the status. * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review (optional) + status: 5, + // DocumentStatusRequestEnum | Exludes documents with this status. * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review (optional) + statusNe: 5, + // string | Filters documents by tag. (optional) + tag: "tag_1", }; -apiInstance.listLinkedObjects(body).then((data) => { +apiInstance.listDocuments(body).then((data) => { console.log('API called successfully. Returned data: %o', data); }).catch((error) => console.error(error)); ``` @@ -949,12 +1180,32 @@ apiInstance.listLinkedObjects(body).then((data) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | [**string**] | Specify document ID. | defaults to undefined + **templateId** | [**string**] | Filters by parent template. This Parameter can\'t be used with form_id. | (optional) defaults to undefined + **formId** | [**string**] | Filters by parent form. This parameter can\'t be used with template_id. | (optional) defaults to undefined + **folderUuid** | [**string**] | Filters by the folder where the documents are stored. | (optional) defaults to undefined + **contactId** | [**string**] | Filters by recipient or approver with this \'contact_id\'. | (optional) defaults to undefined + **count** | [**number**] | Limits the size of the response. Default is 50 documents, maximum is 100 documents. | (optional) defaults to undefined + **page** | [**number**] | Paginates the search result. Increase value to get the next page of results. | (optional) defaults to undefined + **orderBy** | **DocumentOrderingFieldsEnum** | Defines the sorting of the result. Use `date_created` for ASC and `-date_created` for DESC sorting. | (optional) defaults to undefined + **createdFrom** | [**string**] | Limits results to the documents with the `date_created` greater than or equal to this value. | (optional) defaults to undefined + **createdTo** | [**string**] | Limits results to the documents with the `date_created` less than this value. | (optional) defaults to undefined + **deleted** | [**boolean**] | Returns only the deleted documents. | (optional) defaults to undefined + **id** | [**string**] | | (optional) defaults to undefined + **completedFrom** | [**string**] | Limits results to the documents with the `date_completed` greater than or equal to this value. | (optional) defaults to undefined + **completedTo** | [**string**] | Limits results to the documents with the `date_completed` less than this value. | (optional) defaults to undefined + **membershipId** | [**string**] | Filter documents by the owner\'s \'membership_id\'. | (optional) defaults to undefined + **metadata** | **Array<string>** | Filters documents by metadata. Pass metadata in the format of `metadata_{metadata-key}={metadata-value}` such as `metadata_opportunity_id=2181432`. The `metadata_` prefix is always required. | (optional) defaults to undefined + **modifiedFrom** | [**string**] | Limits results to the documents with the `date_modified` greater than or equal to this value. | (optional) defaults to undefined + **modifiedTo** | [**string**] | Limits results to the documents with the `date_modified` less than this value. | (optional) defaults to undefined + **q** | [**string**] | Filters documents by name or reference number (stored on the template level). | (optional) defaults to undefined + **status** | **DocumentStatusRequestEnum** | Filters documents by the status. * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review | (optional) defaults to undefined + **statusNe** | **DocumentStatusRequestEnum** | Exludes documents with this status. * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review | (optional) defaults to undefined + **tag** | [**string**] | Filters documents by tag. | (optional) defaults to undefined ### Return type -**LinkedObjectListResponse** +**DocumentListResponse** ### Authorization @@ -969,11 +1220,10 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Success response | - | +**200** | OK | - | +**400** | Bad Request | - | **401** | Authentication error | - | **403** | Permission error | - | -**404** | Not found | - | -**409** | Conflict | - | **429** | Too Many Requests | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) @@ -981,6 +1231,7 @@ Name | Type | Description | Notes # **sendDocument** > DocumentSendResponse sendDocument(documentSendRequest) +> 🚧 Using the Sandbox Key > > When you use a [sandbox API key](https://developers.pandadoc.com/reference/sandbox-key) during the free trial period, the sender and recipient email addresses must be from the same organisation (email domain). ## Document State - You can only send a document in the `document.draft` status. - After creating a new document, it usually retains a `document.uploaded` status for 3-5 seconds while the document syncs across PandaDoc servers. When the document is available for further API calls, it moves to the `document.draft` state. Use [Document Status](/reference/document-status) or [Webhooks](/reference/on-document-status-change) to check document status. - Moving a document to the `document.sent` status finalizes the document structure, before recipients can complete it. - If a template used for the document creation has an approval workflow turned on, the sent document moves to the `document.waiting_approval` status. Once the document is approved, you need to make the call again to move the document to `document.sent` status. ## Send and Silence Notifications - By default, PandaDoc sends a notification email to the recipient, as well as notifications the sender has configured. You may disable all notifications for recipients by passing `silent: true`. This is useful when you are using alternative delivery methods such as linking to the document or embedding the document. - The `silent: true` parameter disables sent, viewed, comment and completed document email notifications. \"Document Approval\" notification won\'t be affected by this parameter. - If you pass `silent: false`, the document is going to be delivered by email and/or SMS. ![Example email. Branding can be changed in workspace settings](https://files.readme.io/cc5a03e-email2.png) ## Select Approver from Group If you have previously set up an approval workflow with selectable groups on the UI, you can select a particular approver from this group. Learn more about [selectable groups](https://support.pandadoc.com/en/articles/9714799-approval-workflow#h_01H4GNY5GSGG38BPYY46XV7GB4). To set an approver, we recommend to follow these steps: 1. Run the [Document Details](https://developers.pandadoc.com/reference/document-details) request. 2. Copy the `steps` part from the `approval_execution` section of the response into the `selected_approvers` field of the Send Document payload. 3. Modify your payload according to business needs: set `is_selected` to true for one approver. > 📘 **Note**: You can change the selected approver only if you revert your document back to the `document.draft` status. ### Example @@ -1004,12 +1255,14 @@ const body:pd_api.DocumentsApiSendDocumentRequest = { subject: "Please check this test API document from PandaDoc", silent: true, sender: { - "key": "key_example", + membershipId: "QMDSzwabfFzTgjW6KijHyu", + email: "john.doe@example.com", }, forwardingSettings: { forwardingAllowed: true, forwardingWithReassigningAllowed: true, }, + replyTo: "john.doe@example.com", selectedApprovers: { steps: [ { @@ -1073,6 +1326,7 @@ Name | Type | Description | Notes # **statusDocument** > DocumentStatusResponse statusDocument() +It is useful to request document status to ensure a document is in the expected state before calling additional API methods. ### Required Document Statuses Here are some common methods and the `document.status` required to proceed: | API Method | Required Document State | | :------------------- | :---------------------- | | Send A Document | `document.draft` | | Get Document Details | `document.draft` | | Embed A Document | `document.sent` | | Download A Document | `document.completed` | > 📘 Polling vs Webhooks > > If you are using the `GET` document status endpoint for [**polling**](https://en.wikipedia.org/wiki/Polling_(computer_science)), we also support and recommend using **webhooks** for event-driven needs: ### Available Document Statuses The following is a complete list of all possible document statuses returned: | Document Status | Status Description | | :-------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `document.uploaded` | The document has just been created or uploaded. It is in processing and will be in `document.draft` state soon. | | `document.error` | The document creation has failed. This status is terminal, you should stop polling after getting it. | `document.draft` | The document is in a draft state. All aspects of the document can be edited in this state. Our API does not support edits after the document has been created, but it can still be edited manually on | | `document.sent` | The document has been \"sealed\" and optionally sent. No further document edits can occur except for document recipient(s) filling out or signing the document. | | `document.viewed` | Document recipient(s) have viewed the sent document. | | `document.waiting_approval` | The document has an [automatic approval workflow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) and has not yet been approved. | | `document.rejected` | The document has an [automatic approval workflow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) and was rejected. | | `document.approved` | The document has an [automatic approval workflow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) and was approved. | | `document.waiting_pay` | The document has a [Stripe payment](https://support.pandadoc.com/en/articles/9714942-stripe-checkout-payments) option and is awaiting payment. | | `document.paid` | The document has a [Stripe payment](https://support.pandadoc.com/en/articles/9714942-stripe-checkout-payments) option and was paid. | | `document.completed` | The document has been completed by all recipients. | | `document.voided` | The document expired and is no longer available for completion or signature. | | `document.declined` | The document was [manually marked](https://support.pandadoc.com/en/articles/9714842-manually-change-document-status) as \"Declined\" | | `document.external_review` | The document is reviewed by it\'s recipient using Suggest Edit feature | ### Example @@ -1089,7 +1343,7 @@ const apiInstance = new pd_api.DocumentsApi(configuration); const body:pd_api.DocumentsApiStatusDocumentRequest = { // string | Specify document ID. - id: "BhVzRcxH9Z2LgfPPGXFUBa", + id: "fANp5wW5EwY7AkiTkTGekZ", }; apiInstance.statusDocument(body).then((data) => { @@ -1133,6 +1387,7 @@ Name | Type | Description | Notes # **transferAllDocumentsOwnership** > void transferAllDocumentsOwnership(documentTransferAllOwnershipRequest) +This method transfers ownership of all documents from one member to another. ### Example @@ -1196,6 +1451,7 @@ Name | Type | Description | Notes # **transferDocumentOwnership** > void transferDocumentOwnership(documentTransferOwnershipRequest) +This operation allows transferring the ownership of a document to another user by specifying the document ID and membership ID. ### Example @@ -1262,6 +1518,7 @@ Name | Type | Description | Notes # **updateDocument** > void updateDocument(documentUpdateRequest) +Use the PATCH method to update a PandaDoc document. > 🚧 Document status > > You can only update a document in the Draft status (`document.draft`). > > After creating a new document, it usually retains a `document.uploaded` status for 3-5 seconds while the document syncs across PandaDoc servers. When the document is available for further API calls, the document moves to the `document.draft` state. Use [Document Status](https://developers.pandadoc.com/reference/document-status) or Webhooks to check document status. ### Example @@ -1283,29 +1540,20 @@ const body:pd_api.DocumentsApiUpdateDocumentRequest = { documentUpdateRequest: { name: "Contract", recipients: [ - { - id: "id_example", - email: "josh@example.com", - phone: "+14842634627", - firstName: "Josh", - lastName: "Ron", - deliveryMethods: { - email: true, - sms: false, - }, - redirect: { - isEnabled: true, - url: "https://example.com", - }, - }, + null, ], - fields: {}, + fields: { + "key": { + value: null, + }, + }, tokens: [ { name: "Favorite.Pet", value: "Panda", }, ], + tags: ["updated_via_api","test_document"], metadata: {}, pricingTables: [ { @@ -1332,6 +1580,49 @@ const body:pd_api.DocumentsApiUpdateDocumentRequest = { ], }, ], + tables: [ + { + name: "name_example", + data: { + sections: [ + { + header: [ + { + text: "text_example", + colSpan: 1, + rowSpan: 1, + }, + ], + rows: [ + [ + { + text: "text_example", + colSpan: 1, + rowSpan: 1, + }, + ], + ], + }, + ], + }, + }, + ], + images: [ + { + urls: ["https://s3.amazonaws.com/pd-static-content/public-docs/pandadoc-panda-bear.png"], + name: "Image 1", + }, + ], + texts: [ + { + name: "Legal Terms Section", + data: `## Terms of Service +This document outlines the terms and conditions. +- **Acceptance:** By using our service, you agree to these terms. +- **Changes:** We may update these terms at any time. +`, + }, + ], }, }; diff --git a/docs/FoldersAPIApi.md b/docs/FoldersApi.md similarity index 76% rename from docs/FoldersAPIApi.md rename to docs/FoldersApi.md index f0afda9..93cd90a 100644 --- a/docs/FoldersAPIApi.md +++ b/docs/FoldersApi.md @@ -1,21 +1,21 @@ -# .FoldersAPIApi +# .FoldersApi All URIs are relative to *https://api.pandadoc.com* Method | HTTP request | Description ------------- | ------------- | ------------- -[**createDocumentFolder**](FoldersAPIApi.md#createDocumentFolder) | **POST** /public/v1/documents/folders | Create Documents Folder -[**createTemplateFolder**](FoldersAPIApi.md#createTemplateFolder) | **POST** /public/v1/templates/folders | Create Templates Folder -[**listDocumentFolders**](FoldersAPIApi.md#listDocumentFolders) | **GET** /public/v1/documents/folders | List Documents Folders -[**listTemplateFolders**](FoldersAPIApi.md#listTemplateFolders) | **GET** /public/v1/templates/folders | List Templates Folders -[**renameDocumentFolder**](FoldersAPIApi.md#renameDocumentFolder) | **PUT** /public/v1/documents/folders/{id} | Rename Documents Folder -[**renameTemplateFolder**](FoldersAPIApi.md#renameTemplateFolder) | **PUT** /public/v1/templates/folders/{id} | Rename Templates Folder +[**createDocumentFolder**](FoldersApi.md#createDocumentFolder) | **POST** /public/v1/documents/folders | Create Documents Folder +[**createTemplateFolder**](FoldersApi.md#createTemplateFolder) | **POST** /public/v1/templates/folders | Create Templates Folder +[**listDocumentFolders**](FoldersApi.md#listDocumentFolders) | **GET** /public/v1/documents/folders | List Documents Folders +[**listTemplateFolders**](FoldersApi.md#listTemplateFolders) | **GET** /public/v1/templates/folders | List Templates Folders +[**renameDocumentFolder**](FoldersApi.md#renameDocumentFolder) | **PUT** /public/v1/documents/folders/{id} | Rename Documents Folder +[**renameTemplateFolder**](FoldersApi.md#renameTemplateFolder) | **PUT** /public/v1/templates/folders/{id} | Rename Templates Folder # **createDocumentFolder** > DocumentsFolderCreateResponse createDocumentFolder(documentsFolderCreateRequest) -Create a new folder to store your documents. +Create a new folder to store your documents. For the full list of folder operations and their limitations, see [Organize Documents and Folders](https://developers.pandadoc.com/docs/organize-folders). ### Example @@ -28,9 +28,9 @@ const API_KEY = "YOUR_API_KEY"; const configuration = pd_api.createConfiguration( { authMethods: {apiKey: `API-Key ${API_KEY}`} } ); -const apiInstance = new pd_api.FoldersAPIApi(configuration); +const apiInstance = new pd_api.FoldersApi(configuration); -const body:pd_api.FoldersAPIApiCreateDocumentFolderRequest = { +const body:pd_api.FoldersApiCreateDocumentFolderRequest = { // DocumentsFolderCreateRequest documentsFolderCreateRequest: { name: "A new document folder", @@ -78,7 +78,7 @@ Name | Type | Description | Notes # **createTemplateFolder** > TemplatesFolderCreateResponse createTemplateFolder(templatesFolderCreateRequest) -Create a new folder to store your templates. +Create a new folder to store your templates. For the full list of folder operations and their limitations, see [Organize Templates and Folders](https://developers.pandadoc.com/docs/organize-folders). ### Example @@ -91,9 +91,9 @@ const API_KEY = "YOUR_API_KEY"; const configuration = pd_api.createConfiguration( { authMethods: {apiKey: `API-Key ${API_KEY}`} } ); -const apiInstance = new pd_api.FoldersAPIApi(configuration); +const apiInstance = new pd_api.FoldersApi(configuration); -const body:pd_api.FoldersAPIApiCreateTemplateFolderRequest = { +const body:pd_api.FoldersApiCreateTemplateFolderRequest = { // TemplatesFolderCreateRequest templatesFolderCreateRequest: { name: "A new template folder", @@ -141,7 +141,7 @@ Name | Type | Description | Notes # **listDocumentFolders** > DocumentsFolderListResponse listDocumentFolders() -Get the list of folders that contain Documents in your account. +Get the list of folders which contain Documents in your account. > 📘 > > The root folder is not listed in the response. For the full list of folder operations and their limitations, see [Organize Documents and Folders](https://developers.pandadoc.com/docs/organize-folders). ### Example @@ -154,13 +154,13 @@ const API_KEY = "YOUR_API_KEY"; const configuration = pd_api.createConfiguration( { authMethods: {apiKey: `API-Key ${API_KEY}`} } ); -const apiInstance = new pd_api.FoldersAPIApi(configuration); +const apiInstance = new pd_api.FoldersApi(configuration); -const body:pd_api.FoldersAPIApiListDocumentFoldersRequest = { +const body:pd_api.FoldersApiListDocumentFoldersRequest = { // string | The UUID of the folder containing folders. To list the folders located in the root folder, remove this parameter in the request. (optional) parentUuid: "Nq8htXxFssmhRxAPSP4SBP", - // number | Optionally, specify how many folders to return. Default is 50 folders, maximum is 100 folders. (optional) - count: 10, + // number | Optionally, specify how many folders to return. (optional) + count: 50, // number | Optionally, specify which page of the dataset to return. (optional) page: 1, }; @@ -176,7 +176,7 @@ apiInstance.listDocumentFolders(body).then((data) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **parentUuid** | [**string**] | The UUID of the folder containing folders. To list the folders located in the root folder, remove this parameter in the request. | (optional) defaults to undefined - **count** | [**number**] | Optionally, specify how many folders to return. Default is 50 folders, maximum is 100 folders. | (optional) defaults to undefined + **count** | [**number**] | Optionally, specify how many folders to return. | (optional) defaults to 50 **page** | [**number**] | Optionally, specify which page of the dataset to return. | (optional) defaults to undefined @@ -207,7 +207,7 @@ Name | Type | Description | Notes # **listTemplateFolders** > TemplatesFolderListResponse listTemplateFolders() -Get the list of folders that contain Templates in your account. +Get the list of folders that contain Templates in your account. > 📘 > > The root folder is not listed in the response. For the full list of folder operations and their limitations, see [Organize Templates and Folders](https://developers.pandadoc.com/docs/organize-folders). ### Example @@ -220,13 +220,13 @@ const API_KEY = "YOUR_API_KEY"; const configuration = pd_api.createConfiguration( { authMethods: {apiKey: `API-Key ${API_KEY}`} } ); -const apiInstance = new pd_api.FoldersAPIApi(configuration); +const apiInstance = new pd_api.FoldersApi(configuration); -const body:pd_api.FoldersAPIApiListTemplateFoldersRequest = { +const body:pd_api.FoldersApiListTemplateFoldersRequest = { // string | The UUID of the folder containing folders. To list the folders located in the root folder, remove this parameter in the request. (optional) parentUuid: "Nq8htXxFssmhRxAPSP4SBP", - // number | Optionally, specify how many folders to return. Default is 50 folders, maximum is 100 folders. (optional) - count: 10, + // number | Optionally, specify how many folders to return. (optional) + count: 50, // number | Optionally, specify which page of the dataset to return. (optional) page: 1, }; @@ -242,7 +242,7 @@ apiInstance.listTemplateFolders(body).then((data) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **parentUuid** | [**string**] | The UUID of the folder containing folders. To list the folders located in the root folder, remove this parameter in the request. | (optional) defaults to undefined - **count** | [**number**] | Optionally, specify how many folders to return. Default is 50 folders, maximum is 100 folders. | (optional) defaults to undefined + **count** | [**number**] | Optionally, specify how many folders to return. | (optional) defaults to 50 **page** | [**number**] | Optionally, specify which page of the dataset to return. | (optional) defaults to undefined @@ -273,7 +273,7 @@ Name | Type | Description | Notes # **renameDocumentFolder** > DocumentsFolderRenameResponse renameDocumentFolder(documentsFolderRenameRequest) -Rename Documents Folder. +Rename Documents Folder. For the full list of folder operations and their limitations, see [Organize Documents and Folders](https://developers.pandadoc.com/docs/organize-folders). ### Example @@ -286,14 +286,14 @@ const API_KEY = "YOUR_API_KEY"; const configuration = pd_api.createConfiguration( { authMethods: {apiKey: `API-Key ${API_KEY}`} } ); -const apiInstance = new pd_api.FoldersAPIApi(configuration); +const apiInstance = new pd_api.FoldersApi(configuration); -const body:pd_api.FoldersAPIApiRenameDocumentFolderRequest = { +const body:pd_api.FoldersApiRenameDocumentFolderRequest = { // string | The UUID of the folder that you are renaming. id: "Nq8htXxFssmhRxAPSP4SBP", // DocumentsFolderRenameRequest documentsFolderRenameRequest: { - name: "Another document folder", + name: "Another document folder'", }, }; @@ -339,7 +339,7 @@ Name | Type | Description | Notes # **renameTemplateFolder** > TemplatesFolderRenameResponse renameTemplateFolder(templatesFolderRenameRequest) -Rename a templates folder. +Rename a templates folder. For the full list of folder operations and their limitations, see [Organize Templates and Folders](https://developers.pandadoc.com/docs/organize-folders). ### Example @@ -352,9 +352,9 @@ const API_KEY = "YOUR_API_KEY"; const configuration = pd_api.createConfiguration( { authMethods: {apiKey: `API-Key ${API_KEY}`} } ); -const apiInstance = new pd_api.FoldersAPIApi(configuration); +const apiInstance = new pd_api.FoldersApi(configuration); -const body:pd_api.FoldersAPIApiRenameTemplateFolderRequest = { +const body:pd_api.FoldersApiRenameTemplateFolderRequest = { // string | The UUID of the folder which you are renaming. id: "Nq8htXxFssmhRxAPSP4SBP", // TemplatesFolderRenameRequest diff --git a/docs/FormsApi.md b/docs/FormsApi.md index 92dd264..ea101aa 100644 --- a/docs/FormsApi.md +++ b/docs/FormsApi.md @@ -4,13 +4,13 @@ All URIs are relative to *https://api.pandadoc.com* Method | HTTP request | Description ------------- | ------------- | ------------- -[**listForm**](FormsApi.md#listForm) | **GET** /public/v1/forms | Forms +[**listForm**](FormsApi.md#listForm) | **GET** /public/v1/forms | List Forms # **listForm** > FormListResponse listForm() -List forms. +Retrieve a paginated list of forms with optional filtering and sorting options. ### Example @@ -26,17 +26,15 @@ const configuration = pd_api.createConfiguration( const apiInstance = new pd_api.FormsApi(configuration); const body:pd_api.FormsApiListFormRequest = { - // number | Optionally, specify how many forms to return. Default is 50 forms, maximum is 100 forms. (optional) + // number | Specify how many forms to return. Default is 50 forms, maximum is 100 forms. (optional) count: 10, - // number | Optionally, specify which page of the dataset to return. (optional) + // number | Specify which page of the dataset to return. (optional) page: 1, - // Array<'draft' | 'active' | 'disabled'> | Optionally, specify which status of the forms dataset to return. (optional) - status: [ - "draft", - ], - // 'name' | 'responses' | 'status' | 'created_date' | 'modified_date' | Optionally, specify the form dataset order to return. (optional) + // Array<'draft' | 'active' | 'disabled'> | Specify which status of the forms dataset to return. (optional) + status: ["draft","active"], + // 'name' | 'responses' | 'status' | 'created_date' | 'modified_date' | Specify the form dataset order to return. (optional) orderBy: "name", - // boolean | Optionally, specify sorting the result-set in ascending or descending order. (optional) + // boolean | Specify sorting the result-set in ascending or descending order. (optional) asc: true, // string | Specify the form name. (optional) name: "New Form", @@ -52,11 +50,11 @@ apiInstance.listForm(body).then((data) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **count** | [**number**] | Optionally, specify how many forms to return. Default is 50 forms, maximum is 100 forms. | (optional) defaults to undefined - **page** | [**number**] | Optionally, specify which page of the dataset to return. | (optional) defaults to undefined - **status** | **Array<'draft' | 'active' | 'disabled'>** | Optionally, specify which status of the forms dataset to return. | (optional) defaults to undefined - **orderBy** | [**'name' | 'responses' | 'status' | 'created_date' | 'modified_date'**]**Array<'name' | 'responses' | 'status' | 'created_date' | 'modified_date'>** | Optionally, specify the form dataset order to return. | (optional) defaults to undefined - **asc** | [**boolean**] | Optionally, specify sorting the result-set in ascending or descending order. | (optional) defaults to undefined + **count** | [**number**] | Specify how many forms to return. Default is 50 forms, maximum is 100 forms. | (optional) defaults to undefined + **page** | [**number**] | Specify which page of the dataset to return. | (optional) defaults to undefined + **status** | **Array<'draft' | 'active' | 'disabled'>** | Specify which status of the forms dataset to return. | (optional) defaults to undefined + **orderBy** | [**'name' | 'responses' | 'status' | 'created_date' | 'modified_date'**]**Array<'name' | 'responses' | 'status' | 'created_date' | 'modified_date'>** | Specify the form dataset order to return. | (optional) defaults to undefined + **asc** | [**boolean**] | Specify sorting the result-set in ascending or descending order. | (optional) defaults to undefined **name** | [**string**] | Specify the form name. | (optional) defaults to undefined @@ -80,6 +78,7 @@ Name | Type | Description | Notes **200** | | - | **400** | Bad Request | - | **401** | Authentication error | - | +**403** | Permission error | - | **429** | Too Many Requests | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MembersApi.md b/docs/MembersApi.md index 98334f8..c585922 100644 --- a/docs/MembersApi.md +++ b/docs/MembersApi.md @@ -4,15 +4,82 @@ All URIs are relative to *https://api.pandadoc.com* Method | HTTP request | Description ------------- | ------------- | ------------- -[**detailsCurrentMember**](MembersApi.md#detailsCurrentMember) | **GET** /public/v1/members/current | Current member details -[**detailsMember**](MembersApi.md#detailsMember) | **GET** /public/v1/members/{id} | Member details -[**listMembers**](MembersApi.md#listMembers) | **GET** /public/v1/members | List members +[**createMemberToken**](MembersApi.md#createMemberToken) | **POST** /public/v1/members/{member_id}/token | Create Member Token +[**detailsCurrentMember**](MembersApi.md#detailsCurrentMember) | **GET** /public/v1/members/current | Current Member Details +[**detailsMember**](MembersApi.md#detailsMember) | **GET** /public/v1/members/{id} | Member Details +[**listMembers**](MembersApi.md#listMembers) | **GET** /public/v1/members | List Members +# **createMemberToken** +> CreateMemberTokenResponse createMemberToken() + +> 🚧 > > This endpoint is only exposed upon request. Please reach out to your Account Manager to get access. > 📘 > > Make sure you\'re using Public API keys generated by Org Admin, otherwise you\'ll receive a 403 response. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.MembersApi(configuration); + +const body:pd_api.MembersApiCreateMemberTokenRequest = { + // string | Member id. + memberId: "radQBiBkU7MBk59NSgaGf5", + // CreateMemberTokenRequest (optional) + createMemberTokenRequest: { + lifetime: 3600, + }, +}; + +apiInstance.createMemberToken(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createMemberTokenRequest** | **CreateMemberTokenRequest**| | + **memberId** | [**string**] | Member id. | defaults to undefined + + +### Return type + +**CreateMemberTokenResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + # **detailsCurrentMember** > MemberDetailsResponse detailsCurrentMember() -A method to define to whom credentials belong +Returns the member details of the current user (the owner of the API key). **User** - is an account with a license in the Organization. **Member** - is a User with a predefined Role in the Workspace. | Parameter | Description | |---|---| | `user_id` | A unique identifier of the `user` in the **organization** | | `membership_id` | A unique identifier of the `user` in the **workspace** | | `email` | A user email address | | `first_name` | A user\'s first name | | `last_name` | A user\'s last name | | `is_active` | A boolean value that identifies if a member is active and not blocked | | `workspace` | A unique identifier of the user\'s current active workspace | | `workspace_name` | A name of the user\'s current active workspace | | `email_verified` | A boolean value that identifies if the email is verified | | `role` | A member\'s role in the workspace | | `user_license` | A user license in the organization: 
`Full (Standard)`; 
`Read-only`; 
`eSignature`; 
`Guest`; 
`Creator` | | `date_created` | A date when a member was added to the workspace | | `date_modified` | Last modified date of a member | ### Example @@ -67,7 +134,7 @@ This endpoint does not need any parameter. # **detailsMember** > MemberDetailsResponse detailsMember() -A method to retrieve a member's details by id +A method to retrieve a member\'s details by ID. **User** - is an account with a license in the Organization. **Member** - is a User with a predefined Role in the Workspace. | Parameter | Description | |---|---| | `user_id` | A unique identifier of the `user` in the **organization** | | `membership_id` | A unique identifier of the `user` in the **workspace** | | `email` | A user email address | | `first_name` | A user\'s first name | | `last_name` | A user\'s last name | | `is_active` | A boolean value that identifies if a member is active and not blocked | | `workspace` | A unique identifier of the user\'s current active workspace | | `workspace_name` | A name of the user\'s current active workspace | | `email_verified` | A boolean value that identifies if the email is verified | | `role` | A member\'s role in the workspace | | `user_license` | A user license in the organization: 
`Full (Standard)`; 
`Read-only`; 
`eSignature`; 
`Guest`; 
`Creator` | | `date_created` | A date when a member was added to the workspace | | `date_modified` | Last modified date of a member | ### Example @@ -83,7 +150,7 @@ const configuration = pd_api.createConfiguration( const apiInstance = new pd_api.MembersApi(configuration); const body:pd_api.MembersApiDetailsMemberRequest = { - // string | Membership id + // string | Membership id. id: "radQBiBkU7MBk59NSgaGf5", }; @@ -97,7 +164,7 @@ apiInstance.detailsMember(body).then((data) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | [**string**] | Membership id | defaults to undefined + **id** | [**string**] | Membership id. | defaults to undefined ### Return type @@ -119,8 +186,8 @@ Name | Type | Description | Notes |-------------|-------------|------------------| **200** | OK | - | **400** | Bad Request | - | -**401** | Bad Request | - | -**403** | Authentication error | - | +**401** | Authentication error | - | +**403** | Permission error | - | **429** | Too Many Requests | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) @@ -128,7 +195,7 @@ Name | Type | Description | Notes # **listMembers** > MemberListResponse listMembers() -Retrieve all members details of the workspace +Retrieve all members details of the workspace implied by the OAuth token or API key.\\ For each member, the `workspace` parameter shows their active workspace, that is the workspace they are currently working in.\\ This means the `workspace` value can differ from the workspace implied by your API key. ### Example diff --git a/docs/NotaryApi.md b/docs/NotaryApi.md new file mode 100644 index 0000000..5d41968 --- /dev/null +++ b/docs/NotaryApi.md @@ -0,0 +1,279 @@ +# .NotaryApi + +All URIs are relative to *https://api.pandadoc.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createNotarizationRequest**](NotaryApi.md#createNotarizationRequest) | **POST** /public/v2/notary/notarization-requests | Create Notarization Request +[**deleteNotarizationRequest**](NotaryApi.md#deleteNotarizationRequest) | **DELETE** /public/v2/notary/notarization-requests/{session_request_id} | Delete Notarization Request +[**listNotaries**](NotaryApi.md#listNotaries) | **GET** /public/v2/notary/notaries | List Notaries +[**notarizationRequestDetails**](NotaryApi.md#notarizationRequestDetails) | **GET** /public/v2/notary/notarization-requests/{session_request_id} | Notarization Request Details + + +# **createNotarizationRequest** +> CreateNotarizationResponse createNotarizationRequest(createNotarizationRequest) + +Create a notarization request to connect with a notary and complete online notarizations for your signers within minutes. > 🚧 **Important:** This endpoint supports only documents in draft status. ## Prerequisites > 🚧 Before you start > > Ensure the following before creating a notarization request: > > - Install the Notary On-Demand or Notary add-on > - Create a document for notarization and get its `document_id`. To create a document, use the [Create Document from Template](https://developers.pandadoc.com/reference/create-document-from-pandadoc-template) or [Create Document from File Upload](https://developers.pandadoc.com/reference/create-document-from-pdf) endpoint. ## Request Details For the notarization request, include in the request body: - `document_id` - At least one `invitees`, specifying their `email`, `first_name`, and `last_name` - Optionally, include a `message` for your signers - Optionally, using `disable_invitees_notifications` you can disable all notifications for invitees including email with invitation for notarization. This is useful when you are using alternative delivery methods. - If in-house notary must be assigned to this request, include the `notary` object with the notary\'s `id`, `scheduled_at` timestamp, and an optional `message` for the notary After the API call is executed, your signers will receive an email invitation for notarization. Alternatively, you can directly share the `notarization_link` with your signers, which is available in the 201 response body. Upon successful notarization, you will receive an email with a link to the notarized document. ## Usage Tips > 📘 Best Practices > > - Ensure that signers are added as both invitees in the request body and recipients in the document to avoid inconveniences during notary sessions > - Signers will receive an email with a notary link upon a successful API call; this link is also in the 201 response > - In case if notary is not specified in the request, signers will use the link to connect with commissioned online notaries, available Mon-Fri, 9 AM - 9 PM Central Time, typically responding within 2 minutes > - If notary is specified, signers will use the link to connect with your in-house notary at the scheduled time ## Limits A maximum of 100 API calls per minute is permitted. Exceeding this limit triggers a 429 Too Many Requests error. ## Troubleshooting **Solutions for 4xx Response Codes:** - **403 Forbidden (Inactive Add-on)**: Ensure the Notary On-Demand or Notary add-on is installed - **403 Forbidden (Transactions Limit)**: Purchase additional transactions either through the Notary UI or by contacting the Sales team - **429 Too Many Requests**: If you hit the limit, hold your API calls, then send them after waiting for the retry time > 📘 To learn more about PandaDoc Notary On-Demand, visit our [website](https://notary.pandadoc.com/notary-on-demand/). + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.NotaryApi(configuration); + +const body:pd_api.NotaryApiCreateNotarizationRequestRequest = { + // CreateNotarizationRequest + createNotarizationRequest: { + documentId: "8DstGmLJDBXBKrh3wnqzpe", + disableInviteesNotifications: true, + invitation: { + message: "Some message", + invitees: [ + { + email: "email@gmail.com", + firstName: "John", + lastName: "Smith", + }, + ], + }, + notary: { + id: "nyAnVpY7pZ23FBve8s9xgk", + scheduledAt: new Date('2025-09-01T11:00:00Z'), + message: "Please review the document before the scheduled session", + }, + }, +}; + +apiInstance.createNotarizationRequest(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createNotarizationRequest** | **CreateNotarizationRequest**| | + + +### Return type + +**CreateNotarizationResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Notarization request has been created successfully | - | +**403** | Permission error | - | +**429** | Too many requests error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **deleteNotarizationRequest** +> void deleteNotarizationRequest() + +Use this method to delete a notarization request. Once notarization request is deleted it cannot be restored. > 🚧 Notarization Request status > > You can only delete a notarization request in status \'SENT\', \'WAITING_FOR_NOTARY\' or \'INCOMPLETE\'. > If the notarization request is in any other status, the request will return a 400 Bad Request error. By default all invitees will receive email notification about deletion of the notarization request. If you want to disable this notification, you can use the `disable_invitees_notifications` parameter when creating request (see [Create Notarization Request](https://developers.pandadoc.com/reference/create-notarization-request)). + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.NotaryApi(configuration); + +const body:pd_api.NotaryApiDeleteNotarizationRequestRequest = { + // string | Notarization Request ID. + sessionRequestId: "0b2256a2-5803-4ae9-b1b8-595f48e37173", +}; + +apiInstance.deleteNotarizationRequest(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sessionRequestId** | [**string**] | Notarization Request ID. | defaults to undefined + + +### Return type + +**void** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**400** | Bad Request error | - | +**403** | Permission error | - | +**404** | Not found error | - | +**429** | Too many requests error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **listNotaries** +> ListNotariesResponse listNotaries() + +Retrieve a list of notaries associated with your organization. ## Important Notes - At the moment, notaries can be added to organization only manually through the PandaDoc Notary UI. - Organization must have Notary addon enabled to use this endpoint + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.NotaryApi(configuration); + +const body:pd_api.NotaryApiListNotariesRequest = { + // Array<'INVITED' | 'UNDER_REVIEW' | 'ACTIVE' | 'REJECTED' | 'INACTIVE'> | Filter by status (comma-separated values supported). Valid values are INVITED, UNDER_REVIEW, ACTIVE, REJECTED, INACTIVE (optional) + status: ["ACTIVE","UNDER_REVIEW"], + // Array | Filter by commission state (comma-separated values supported) (optional) + commissionState: ["California","Arizona"], + // number | Number of results to skip (optional) + offset: 0, + // number | Maximum number of results to return (optional) + limit: 50, + // 'email' | '-email' | 'status' | '-status' | 'name' | '-name' | Sort by name, email, or status (default is email). Use a - prefix for descending order (e.g., -email) (optional) + orderBy: "email", +}; + +apiInstance.listNotaries(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | **Array<'INVITED' | 'UNDER_REVIEW' | 'ACTIVE' | 'REJECTED' | 'INACTIVE'>** | Filter by status (comma-separated values supported). Valid values are INVITED, UNDER_REVIEW, ACTIVE, REJECTED, INACTIVE | (optional) defaults to undefined + **commissionState** | **Array<string>** | Filter by commission state (comma-separated values supported) | (optional) defaults to undefined + **offset** | [**number**] | Number of results to skip | (optional) defaults to 0 + **limit** | [**number**] | Maximum number of results to return | (optional) defaults to 50 + **orderBy** | [**'email' | '-email' | 'status' | '-status' | 'name' | '-name'**]**Array<'email' | '-email' | 'status' | '-status' | 'name' | '-name'>** | Sort by name, email, or status (default is email). Use a - prefix for descending order (e.g., -email) | (optional) defaults to 'email' + + +### Return type + +**ListNotariesResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | List of notaries retrieved successfully | - | +**400** | Bad Request error | - | +**403** | Permission error | - | +**429** | Too many requests error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **notarizationRequestDetails** +> NotarizationRequestDetailsResponse notarizationRequestDetails() + +Get details about a notarization request by its `id`. Details include: - Basic notarization request information (status, creator, invitees). - Signed documents information with links for downloading. - Notarization session recording information with link for downloading. - Timestamps associated with a notarization request. ## Available Notarization Request Statuses The following is a complete list of all possible notarization request statuses returned: | Notarization Request Status | Status Description | | :-------------------------- | :----------------------------------------------------------------------------------------------------------------- | | SENT | Notarization request has been created. Invitees are notified and can start the process of finding a notary. | | WAITING_FOR_NOTARY | One of the invitees initialised the process of finding a notary. | | ACCEPTED | Notarization request has been accepted by the notary. At this time nobody has joined the notarization session yet. | | LIVE | Notarization session has started. | | COMPLETED | Notarization session is finished. Documents have been successfully signed and ready for downloading. | | INCOMPLETE | Notarization session has started but was not completed successfully. | ## Signed documents Signed documents are the documents that were successfully signed during the notarization session. The signed document\'s info is available only if the notarization request has `COMPLETED` status, otherwise the returned list will be empty. In case you uploaded several documents for notarization then the `signed_documents` list will contain links for downloading for each document separately (with `SINGLE` document type) and link for the combined document (with `COMBINED` document type accordingly). ## Recording Recording is the video of the notarization session. The recording info is available only if the notarization request has `COMPLETED` status and recording is available, otherwise the returned object will be empty. > 📘 Links expire in 1 hour > > **Note**: The signed document and recording links expire in 1 hour. After this time it will be not possible to download files using the returned urls. In this case you need to call endpoint again since each request generates a new link. ## Limits A maximum of 100 API calls per minute is permitted. Exceeding this limit triggers a 429 Too Many Requests error. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.NotaryApi(configuration); + +const body:pd_api.NotaryApiNotarizationRequestDetailsRequest = { + // string | Notarization Request ID. + sessionRequestId: "0b2256a2-5803-4ae9-b1b8-595f48e37173", +}; + +apiInstance.notarizationRequestDetails(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sessionRequestId** | [**string**] | Notarization Request ID. | defaults to undefined + + +### Return type + +**NotarizationRequestDetailsResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Details about notarization request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/OAuth20AuthenticationApi.md b/docs/OAuth20AuthenticationApi.md index 32f85ad..d1b8ba3 100644 --- a/docs/OAuth20AuthenticationApi.md +++ b/docs/OAuth20AuthenticationApi.md @@ -10,6 +10,7 @@ Method | HTTP request | Description # **accessToken** > OAuth2AccessTokenResponse accessToken() +Create or refresh an access token to make requests on behalf of a user. This endpoint is used to obtain an `access_token` and `refresh_token` for the first time, and to refresh the `access_token` when it expires. This endpoint is part of OAuth 2.0 implementation. You need to configure OAuth App to obtain `client_id` and `client_secret`. Read more about [OAuth 2.0 implementation](https://developers.pandadoc.com/reference/authentication-process). Make sure you\'re sending the header `Content-Type: application/x-www-form-urlencoded`. ## Create Access Token As a result of the OAuth 2.0 user authentication process, you should get a `code` that can be exchanged for an `access_token`. Use this endpoint to do this exchange, and to refresh the token later. > 🚧 Invalid Grant? > > If you receive an `invalid grant` response it is likely because you used the same `code` more than once from the [Authorize a PandaDoc User](ref:authorize-a-user) step above. The `code` parameter is generated for one-time use. A new `code` value must be generated if you wish to change API users, permissions, or simply generate a new `code` value for the same PandaDoc user. > 📘 expires_in > > `expires_in` is based in seconds. Currently, a token expires in 31535999 seconds = 1 year. ## Refresh Access Token Eventually, `access_token` expires and accessing an API method returns **401 unauthorized**. Your application needs to refresh the OAuth2 token with the stored `refresh_token` returned when initially creating an access token. Once refreshed, calls on behalf of the originally authorized user can resume immediately. Use the newly returned `access_token` for all future API requests. > 🚧 Invalid Grant? > > If you receive an `invalid grant` response, it is likely because your `refresh_token` is invalid. ### Example @@ -63,7 +64,7 @@ Name | Type | Description | Notes ### Authorization -[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) +No authorization required ### HTTP request headers diff --git a/docs/ProductCatalogApi.md b/docs/ProductCatalogApi.md new file mode 100644 index 0000000..a55134d --- /dev/null +++ b/docs/ProductCatalogApi.md @@ -0,0 +1,415 @@ +# .ProductCatalogApi + +All URIs are relative to *https://api.pandadoc.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createCatalogItem**](ProductCatalogApi.md#createCatalogItem) | **POST** /public/v2/product-catalog/items | Create Catalog Item +[**deleteCatalogItem**](ProductCatalogApi.md#deleteCatalogItem) | **DELETE** /public/v2/product-catalog/items/{item_uuid} | Delete Catalog Item +[**getCatalogItem**](ProductCatalogApi.md#getCatalogItem) | **GET** /public/v2/product-catalog/items/{item_uuid} | Catalog Item Details +[**searchCatalogItems**](ProductCatalogApi.md#searchCatalogItems) | **GET** /public/v2/product-catalog/items/search | List Catalog Items Search +[**updateCatalogItem**](ProductCatalogApi.md#updateCatalogItem) | **PATCH** /public/v2/product-catalog/items/{item_uuid} | Update Catalog Item + + +# **createCatalogItem** +> ProductCatalogItemResponse createCatalogItem(productCatalogItemRequest) + +Create a new catalog item. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.ProductCatalogApi(configuration); + +const body:pd_api.ProductCatalogApiCreateCatalogItemRequest = { + // ProductCatalogItemRequest + productCatalogItemRequest: { + title: "title_example", + categoryId: "categoryId_example", + sku: "sku_example", + description: "description_example", + type: "regular", + bundleItems: [ + { + quantity: 1, + itemOrUuid: null, + }, + ], + images: [ + { + isMain: true, + order: 3.14, + src: "src_example", + }, + ], + customFields: [ + { + name: "name_example", + value: "value_example", + }, + ], + priceConfiguration: { + currency: "USD", + price: 59.99, + cost: 3.14, + billingType: "billingType_example", + billingCycle: "billingCycle_example", + tiers: [ + { + value: 9.99, + minQty: 1, + }, + ], + pricingMethod: 0, + }, + }, +}; + +apiInstance.createCatalogItem(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **productCatalogItemRequest** | **ProductCatalogItemRequest**| | + + +### Return type + +**ProductCatalogItemResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully created a new catalog item | - | +**403** | Permission error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **deleteCatalogItem** +> void deleteCatalogItem() + +Delete catalog item. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.ProductCatalogApi(configuration); + +const body:pd_api.ProductCatalogApiDeleteCatalogItemRequest = { + // string | Catalog item UUID + itemUuid: "2e39c7e0-acb0-4ff2-b4cd-ea3141f95db8", +}; + +apiInstance.deleteCatalogItem(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **itemUuid** | [**string**] | Catalog item UUID | defaults to undefined + + +### Return type + +**void** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | No content | - | +**403** | Permission error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **getCatalogItem** +> ProductCatalogItemResponse getCatalogItem() + +Get catalog item. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.ProductCatalogApi(configuration); + +const body:pd_api.ProductCatalogApiGetCatalogItemRequest = { + // string | Catalog item UUID + itemUuid: "2e39c7e0-acb0-4ff2-b4cd-ea3141f95db8", +}; + +apiInstance.getCatalogItem(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **itemUuid** | [**string**] | Catalog item UUID | defaults to undefined + + +### Return type + +**ProductCatalogItemResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Get Catalog Item | - | +**403** | Permission error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **searchCatalogItems** +> ListCatalogItemsSearchResponse searchCatalogItems() + +This method searches for items in your [product catalog](https://support.pandadoc.com/en/articles/9714691-product-catalog). Use the `query` parameter to search in title, SKU, description, category name, custom fields name and value. You can also search for items by their type, billing type, and category id. Order search results, in both ascending and descending order, by these item properties: - SKU - Name - Price - Modification date Use the `exclude_uuids` parameter to exclude particular uuids from the search request. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.ProductCatalogApi(configuration); + +const body:pd_api.ProductCatalogApiSearchCatalogItemsRequest = { + // number | Page number. (optional) + page: 1, + // number | Items per page. (optional) + perPage: 10, + // string | Search query. Searches the following fields: Title, SKU, description, category name, custom fields name and value. (optional) + query: "coffee", + // 'sku' | '-sku' | 'title' | '-title' | 'price' | '-price' | 'date_modified' | '-date_modified' | Ordering principle for displaying search results. (optional) + orderBy: "-date_modified", + // Array | Filter by catalog item types. (optional) + types: [ + "["regular"]", + ], + // Array<'one_time' | 'recurring'> | Filter by billing types. (optional) + billingTypes: ["one_time"], + // Array | A list of item uuids to be excluded from search. (optional) + excludeUuids: ["1725f759-3a1c-64e3-2daa-f67eafa589d7","06cb0ce9-094b-1f38-2fe6-0a9d226cd22c"], + // string | Category id. (optional) + categoryId: "06cb0ce9-094b-1f38-2fe6-0a9d226cd22c", + // boolean (optional) + noCategory: true, +}; + +apiInstance.searchCatalogItems(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | [**number**] | Page number. | (optional) defaults to undefined + **perPage** | [**number**] | Items per page. | (optional) defaults to undefined + **query** | [**string**] | Search query. Searches the following fields: Title, SKU, description, category name, custom fields name and value. | (optional) defaults to undefined + **orderBy** | [**'sku' | '-sku' | 'title' | '-title' | 'price' | '-price' | 'date_modified' | '-date_modified'**]**Array<'sku' | '-sku' | 'title' | '-title' | 'price' | '-price' | 'date_modified' | '-date_modified'>** | Ordering principle for displaying search results. | (optional) defaults to undefined + **types** | **Array<ProductCatalogTypeEnum>** | Filter by catalog item types. | (optional) defaults to undefined + **billingTypes** | **Array<'one_time' | 'recurring'>** | Filter by billing types. | (optional) defaults to undefined + **excludeUuids** | **Array<string>** | A list of item uuids to be excluded from search. | (optional) defaults to undefined + **categoryId** | [**string**] | Category id. | (optional) defaults to undefined + **noCategory** | [**boolean**] | | (optional) defaults to undefined + + +### Return type + +**ListCatalogItemsSearchResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Paginated catalog items | - | +**400** | Bad Request error | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**429** | Too many requests error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **updateCatalogItem** +> ProductCatalogItemResponse updateCatalogItem(productCatalogItemPatchRequest) + +Update catalog item. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.ProductCatalogApi(configuration); + +const body:pd_api.ProductCatalogApiUpdateCatalogItemRequest = { + // string | Catalog item UUID + itemUuid: "2e39c7e0-acb0-4ff2-b4cd-ea3141f95db8", + // ProductCatalogItemPatchRequest + productCatalogItemPatchRequest: { + title: "title_example", + categoryId: "categoryId_example", + type: "regular", + bundleItems: [ + { + quantity: 1, + itemOrUuid: null, + }, + ], + productVariant: { + sku: "sku_example", + description: "description_example", + images: [ + { + isMain: true, + order: 3.14, + src: "src_example", + }, + ], + customFields: [ + { + name: "name_example", + value: "value_example", + }, + ], + priceConfiguration: { + currency: "USD", + price: 59.99, + cost: 3.14, + billingType: "billingType_example", + billingCycle: "billingCycle_example", + tiers: [ + { + value: 9.99, + minQty: 1, + }, + ], + pricingMethod: 0, + }, + }, + }, +}; + +apiInstance.updateCatalogItem(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **productCatalogItemPatchRequest** | **ProductCatalogItemPatchRequest**| | + **itemUuid** | [**string**] | Catalog item UUID | defaults to undefined + + +### Return type + +**ProductCatalogItemResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Update Catalog item | - | +**403** | Permission error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/QuotesApi.md b/docs/QuotesApi.md index f0d44c4..855c316 100644 --- a/docs/QuotesApi.md +++ b/docs/QuotesApi.md @@ -10,6 +10,7 @@ Method | HTTP request | Description # **quoteUpdate** > QuoteResponse quoteUpdate(quoteUpdateRequest) +This operation updates the details of a specific quote within a document by specifying the document ID and quote ID. ### Example @@ -64,6 +65,12 @@ const body:pd_api.QuotesApiQuoteUpdateRequest = { customColumns: { "key": "key_example", }, + externalColumns: { + "key": "key_example", + }, + textColumns: { + "key": "key_example", + }, discounts: { "key": { type: "percent", diff --git a/docs/SectionsApi.md b/docs/SectionsApi.md deleted file mode 100644 index c1b7e93..0000000 --- a/docs/SectionsApi.md +++ /dev/null @@ -1,375 +0,0 @@ -# .SectionsApi - -All URIs are relative to *https://api.pandadoc.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**listSections**](SectionsApi.md#listSections) | **GET** /public/v1/documents/{document_id}/sections | List sections -[**sectionDetails**](SectionsApi.md#sectionDetails) | **GET** /public/v1/documents/{document_id}/sections/uploads/{upload_id} | Section details -[**sectionInfo**](SectionsApi.md#sectionInfo) | **GET** /public/v1/documents/{document_id}/sections/{section_id} | Section Info -[**uploadSection**](SectionsApi.md#uploadSection) | **POST** /public/v1/documents/{document_id}/sections/uploads | Upload section - - -# **listSections** -> UploadSectionListResponse listSections() - - -### Example - - -```typescript -import * as pd_api from 'pandadoc-node-client'; - -// replace it with your API key -const API_KEY = "YOUR_API_KEY"; -const configuration = pd_api.createConfiguration( - { authMethods: {apiKey: `API-Key ${API_KEY}`} } -); -const apiInstance = new pd_api.SectionsApi(configuration); - -const body:pd_api.SectionsApiListSectionsRequest = { - // string | Document ID - documentId: "BhVzRcxH9Z2LgfPPGXFUBa", -}; - -apiInstance.listSections(body).then((data) => { - console.log('API called successfully. Returned data: %o', data); -}).catch((error) => console.error(error)); -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **documentId** | [**string**] | Document ID | defaults to undefined - - -### Return type - -**UploadSectionListResponse** - -### Authorization - -[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | Bad Request | - | -**401** | Authentication error | - | -**403** | Permission error | - | -**429** | Too Many Requests | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - -# **sectionDetails** -> UploadSectionStatusResponse sectionDetails() - - -### Example - - -```typescript -import * as pd_api from 'pandadoc-node-client'; - -// replace it with your API key -const API_KEY = "YOUR_API_KEY"; -const configuration = pd_api.createConfiguration( - { authMethods: {apiKey: `API-Key ${API_KEY}`} } -); -const apiInstance = new pd_api.SectionsApi(configuration); - -const body:pd_api.SectionsApiSectionDetailsRequest = { - // string | Document ID - documentId: "BhVzRcxH9Z2LgfPPGXFUBa", - // string | Upload ID - uploadId: "LQ6cUT7xevPLUEgJeF8Zrm", -}; - -apiInstance.sectionDetails(body).then((data) => { - console.log('API called successfully. Returned data: %o', data); -}).catch((error) => console.error(error)); -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **documentId** | [**string**] | Document ID | defaults to undefined - **uploadId** | [**string**] | Upload ID | defaults to undefined - - -### Return type - -**UploadSectionStatusResponse** - -### Authorization - -[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**401** | Authentication error | - | -**403** | Permission error | - | -**404** | Not found | - | -**409** | Conflict | - | -**429** | Too Many Requests | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - -# **sectionInfo** -> SectionInfoResponse sectionInfo() - - -### Example - - -```typescript -import * as pd_api from 'pandadoc-node-client'; - -// replace it with your API key -const API_KEY = "YOUR_API_KEY"; -const configuration = pd_api.createConfiguration( - { authMethods: {apiKey: `API-Key ${API_KEY}`} } -); -const apiInstance = new pd_api.SectionsApi(configuration); - -const body:pd_api.SectionsApiSectionInfoRequest = { - // string | Document ID - documentId: "BhVzRcxH9Z2LgfPPGXFUBa", - // string | Section ID - sectionId: "LQ6cUT7xevPLUEgJeF8Zrm", -}; - -apiInstance.sectionInfo(body).then((data) => { - console.log('API called successfully. Returned data: %o', data); -}).catch((error) => console.error(error)); -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **documentId** | [**string**] | Document ID | defaults to undefined - **sectionId** | [**string**] | Section ID | defaults to undefined - - -### Return type - -**SectionInfoResponse** - -### Authorization - -[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**401** | Authentication error | - | -**403** | Permission error | - | -**404** | Not found | - | -**409** | Conflict | - | -**429** | Too Many Requests | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - -# **uploadSection** -> UploadSectionResponse uploadSection(uploadSectionRequest) - - -### Example - - -```typescript -import * as pd_api from 'pandadoc-node-client'; - -// replace it with your API key -const API_KEY = "YOUR_API_KEY"; -const configuration = pd_api.createConfiguration( - { authMethods: {apiKey: `API-Key ${API_KEY}`} } -); -const apiInstance = new pd_api.SectionsApi(configuration); - -const body:pd_api.SectionsApiUploadSectionRequest = { - // string | Document ID - documentId: "BhVzRcxH9Z2LgfPPGXFUBa", - // UploadSectionRequest | Use a PandaDoc template or an existing PDF to upload a section. See the creation request examples [by template](/schemas/UploadSectionByTemplateRequest) and [by pdf](/schemas/UploadSectionByPdfRequest) - uploadSectionRequest: { - name: "API Sample Section from PandaDoc Template", - templateUuid: "hryJY9mqYZHjQCYQuSjRQg", - recipients: [ - { - email: "josh@example.com", - phone: "+14842634627", - deliveryMethods: { - email: true, - sms: false, - }, - firstName: "Josh", - lastName: "Ron", - role: "user", - signingOrder: 1, - redirect: { - isEnabled: true, - url: "https://example.com", - }, - }, - ], - tokens: [ - { - name: "Favorite.Pet", - value: "Panda", - }, - ], - fields: {}, - tags: ["created_via_api","test_document"], - pricingTables: [ - { - name: "Pricing Table 1", - dataMerge: true, - options: {}, - sections: [ - { - title: "Sample Section", - _default: true, - multichoiceEnabled: false, - rows: [ - { - options: { - qtyEditable: true, - optionalSelected: true, - optional: true, - }, - data: {}, - customFields: {}, - }, - ], - }, - ], - }, - ], - contentPlaceholders: [ - { - blockId: "Content Placeholder 1", - contentLibraryItems: [ - { - id: "hryJY9mqYZHjQCYQuSjRQg", - pricingTables: [ - { - name: "Pricing Table 1", - dataMerge: true, - options: {}, - sections: [ - { - title: "Sample Section", - _default: true, - multichoiceEnabled: false, - rows: [ - { - options: { - qtyEditable: true, - optionalSelected: true, - optional: true, - }, - data: {}, - customFields: {}, - }, - ], - }, - ], - }, - ], - fields: {}, - recipients: [ - { - email: "josh@example.com", - phone: "+14842634627", - deliveryMethods: { - email: true, - sms: false, - }, - firstName: "Josh", - lastName: "Ron", - role: "user", - signingOrder: 1, - redirect: { - isEnabled: true, - url: "https://example.com", - }, - }, - ], - }, - ], - }, - ], - url: "https://s3.amazonaws.com/pd-static-content/public-docs/pandadoc-panda-bear.png", - parseFormFields: true, - }, - // 'document' | 'upload' | Determines how the fields are mapped when creating a section. * document: Default value. The fields of the entire document are updated. * upload: Only the fields from the created section are updated. The merge field is appended with the upload ID. (optional) - mergeFieldScope: "document", -}; - -apiInstance.uploadSection(body).then((data) => { - console.log('API called successfully. Returned data: %o', data); -}).catch((error) => console.error(error)); -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **uploadSectionRequest** | **UploadSectionRequest**| Use a PandaDoc template or an existing PDF to upload a section. See the creation request examples [by template](/schemas/UploadSectionByTemplateRequest) and [by pdf](/schemas/UploadSectionByPdfRequest) | - **documentId** | [**string**] | Document ID | defaults to undefined - **mergeFieldScope** | [**'document' | 'upload'**]**Array<'document' | 'upload'>** | Determines how the fields are mapped when creating a section. * document: Default value. The fields of the entire document are updated. * upload: Only the fields from the created section are updated. The merge field is appended with the upload ID. | (optional) defaults to undefined - - -### Return type - -**UploadSectionResponse** - -### Authorization - -[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) - -### HTTP request headers - - - **Content-Type**: application/json, multipart/form-data - - **Accept**: application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | OK | - | -**400** | Bad Request | - | -**401** | Authentication error | - | -**429** | Too Many Requests | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateSettingsApi.md b/docs/TemplateSettingsApi.md new file mode 100644 index 0000000..ce3c11d --- /dev/null +++ b/docs/TemplateSettingsApi.md @@ -0,0 +1,129 @@ +# .TemplateSettingsApi + +All URIs are relative to *https://api.pandadoc.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**templateSettingsGet**](TemplateSettingsApi.md#templateSettingsGet) | **GET** /public/v2/templates/{template_id}/settings | Get template settings +[**templateSettingsUpdate**](TemplateSettingsApi.md#templateSettingsUpdate) | **PATCH** /public/v2/templates/{template_id}/settings | Update template settings + + +# **templateSettingsGet** +> TemplateSettingsResponse templateSettingsGet() + +Retrieves the settings for a specified template. Only the language field is currently supported. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.TemplateSettingsApi(configuration); + +const body:pd_api.TemplateSettingsApiTemplateSettingsGetRequest = { + // string | Unique identifier of the template to retrieve settings for. + templateId: "BhVzRcxH9Z2LgfPPGXFUBa", +}; + +apiInstance.templateSettingsGet(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **templateId** | [**string**] | Unique identifier of the template to retrieve settings for. | defaults to undefined + + +### Return type + +**TemplateSettingsResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully retrieved template settings. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **templateSettingsUpdate** +> TemplateSettingsResponse templateSettingsUpdate(updateTemplateSettingsRequest) + +Updates the settings for a specified template. Only the language field is currently supported. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.TemplateSettingsApi(configuration); + +const body:pd_api.TemplateSettingsApiTemplateSettingsUpdateRequest = { + // string | Unique identifier of the template to update settings for. + templateId: "BhVzRcxH9Z2LgfPPGXFUBa", + // UpdateTemplateSettingsRequest + updateTemplateSettingsRequest: { + language: "en-US", + }, +}; + +apiInstance.templateSettingsUpdate(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **updateTemplateSettingsRequest** | **UpdateTemplateSettingsRequest**| | + **templateId** | [**string**] | Unique identifier of the template to update settings for. | defaults to undefined + + +### Return type + +**TemplateSettingsResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully updated template settings. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/TemplatesApi.md b/docs/TemplatesApi.md index 679c3db..2b510c2 100644 --- a/docs/TemplatesApi.md +++ b/docs/TemplatesApi.md @@ -4,11 +4,213 @@ All URIs are relative to *https://api.pandadoc.com* Method | HTTP request | Description ------------- | ------------- | ------------- +[**createTemplate**](TemplatesApi.md#createTemplate) | **POST** /public/v1/templates | Create Template +[**createTemplateEditingSession**](TemplatesApi.md#createTemplateEditingSession) | **POST** /public/v1/templates/{id}/editing-sessions | Create Template Editing Session +[**createTemplateWithUpload**](TemplatesApi.md#createTemplateWithUpload) | **POST** /public/v1/templates?upload | Create Template from File Upload [**deleteTemplate**](TemplatesApi.md#deleteTemplate) | **DELETE** /public/v1/templates/{id} | Delete Template -[**detailsTemplate**](TemplatesApi.md#detailsTemplate) | **GET** /public/v1/templates/{id}/details | Details Template +[**detailsTemplate**](TemplatesApi.md#detailsTemplate) | **GET** /public/v1/templates/{id}/details | Template Details [**listTemplates**](TemplatesApi.md#listTemplates) | **GET** /public/v1/templates | List Templates +[**statusTemplate**](TemplatesApi.md#statusTemplate) | **GET** /public/v1/templates/{id} | Template Status +[**updateTemplate**](TemplatesApi.md#updateTemplate) | **PATCH** /public/v1/templates/{id} | Template Update +# **createTemplate** +> TemplateCreateResponse createTemplate(createTemplateFromUrlRequest) + +This operation allows you to create a new template by providing the necessary template details. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.TemplatesApi(configuration); + +const body:pd_api.TemplatesApiCreateTemplateRequest = { + // CreateTemplateFromUrlRequest + createTemplateFromUrlRequest: null, + // Array<'content_date_modified'> | A comma-separated list of additional fields to include in the response. (optional) + fields: ["content_date_modified"], +}; + +apiInstance.createTemplate(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createTemplateFromUrlRequest** | **CreateTemplateFromUrlRequest**| | + **fields** | **Array<'content_date_modified'>** | A comma-separated list of additional fields to include in the response. | (optional) defaults to undefined + + +### Return type + +**TemplateCreateResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | OK | - | +**400** | Bad Request | - | +**401** | Authentication error | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **createTemplateEditingSession** +> CreateTemplateEditingSession201Response createTemplateEditingSession(editingSessionRequest) + +Creates a new editing session for the Embedded Editor. The response includes an E-Token, which is required to open the template. #### Limitations - **Single Active Session per User-Template Pair** Only one editing session can be active at a time for a specific user and template. Creating a new session for the same user-template pair will automatically invalidate the previous one. - **Weekly Session Cap** A maximum of **250** editing sessions can be created for a single template per week. Any attempt to exceed this limit will result in a `403 Forbidden` error. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.TemplatesApi(configuration); + +const body:pd_api.TemplatesApiCreateTemplateEditingSessionRequest = { + // string | Template ID + id: "a53a2f96b91d47f99ee33f", + // EditingSessionRequest + editingSessionRequest: { + email: "john.doe@pandadoc.com", + lifetime: 3600, + }, +}; + +apiInstance.createTemplateEditingSession(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **editingSessionRequest** | **EditingSessionRequest**| | + **id** | [**string**] | Template ID | defaults to undefined + + +### Return type + +**CreateTemplateEditingSession201Response** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Template Editing Session created | - | +**400** | Bad request | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **createTemplateWithUpload** +> TemplateCreateResponse createTemplateWithUpload() + +This asynchronous endpoint allows users to create a new template by uploading a file. The uploaded file is processed in the background to generate the template. The maximum allowable file size for upload is 100 MB. Field tags and form fields are not supported yet. Once the file is uploaded, the processing will happen asynchronously, and users need to check [the status of the template](https://developers.pandadoc.com/reference/template-status) creation. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.TemplatesApi(configuration); + +const body:pd_api.TemplatesApiCreateTemplateWithUploadRequest = { + // Array<'content_date_modified'> | A comma-separated list of additional fields to include in the response. (optional) + fields: ["content_date_modified"], + // HttpFile | Binary PDF/DocX/RTF File. (optional) + file: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' }, + // CreateTemplateRequest | JSON as a multipart/form-data string. (optional) + data: null, +}; + +apiInstance.createTemplateWithUpload(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | **Array<'content_date_modified'>** | A comma-separated list of additional fields to include in the response. | (optional) defaults to undefined + **file** | [**HttpFile**] | Binary PDF/DocX/RTF File. | (optional) defaults to undefined + **data** | **CreateTemplateRequest** | JSON as a multipart/form-data string. | (optional) defaults to undefined + + +### Return type + +**TemplateCreateResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | OK | - | +**400** | Bad Request | - | +**401** | Authentication error | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + # **deleteTemplate** > void deleteTemplate() @@ -74,7 +276,7 @@ Name | Type | Description | Notes # **detailsTemplate** > TemplateDetailsResponse detailsTemplate() -Return detailed data about a template. +Get details about a template by `id`. Details include: - Basic template information (name, author, etc) - Roles - All fields with values - All tokens with values - Pricing information (pricing tables, products, quotes) - Template metadata - Template tags - Content placeholders - Modification timestamps. Note that `date_modified` means any changes associated with the template roles, while `content_date_modified` logs any changes in the template content. ### Example @@ -91,7 +293,7 @@ const apiInstance = new pd_api.TemplatesApi(configuration); const body:pd_api.TemplatesApiDetailsTemplateRequest = { // string | Template ID - id: "EE8yUNg5HztqVAuH85He8V", + id: "vibuun3DXG8QDDLfXm27Ne", }; apiInstance.detailsTemplate(body).then((data) => { @@ -135,7 +337,7 @@ Name | Type | Description | Notes # **listTemplates** > TemplateListResponse listTemplates() -Optionally, filter by a search query or tags. +Retrieves a list of templates. You can filter results by a search query, tags, or fields. ### Example @@ -151,26 +353,24 @@ const configuration = pd_api.createConfiguration( const apiInstance = new pd_api.TemplatesApi(configuration); const body:pd_api.TemplatesApiListTemplatesRequest = { - // string | Optional search query. Filter by template name. (optional) + // string | Search query. Filter by template name. (optional) q: "Sample onboarding template", // boolean | Returns only the shared templates. (optional) - shared: true, - // boolean | Optional. Returns only the deleted templates. (optional) - deleted: true, - // number | Optionally, specify how many templates to return. Default is 50 templates, maximum is 100 templates. (optional) + shared: false, + // boolean | Returns only the deleted templates. (optional) + deleted: false, + // number | Specify how many templates to return. (optional) count: 10, - // number | Optionally, specify which page of the dataset to return. (optional) + // number | Specify which page of the dataset to return. (optional) page: 1, - // string | Optionally, specify template ID. (optional) + // string | Specify template ID. (optional) id: "e9LxBesSL73AeZMzeYdfvV", // string | UUID of the folder where the templates are stored. (optional) folderUuid: "xDKHoJ8DkwhiTQSUzNveCJ", - // Array | Optional search tag. Filter by template tag. (optional) - tag: [ - "tag_example", - ], - // string | A comma-separated list of additional fields to include in the response. Each field must be a valid template property. Currently, only one additional field, `content_date_modified`, is supported. For example, `GET /templates?fields=content_date_modified`. (optional) - fields: "fields_example", + // Array | Search tag. Filter by template tag. (optional) + tag: ["onboarding"], + // Array<'content_date_modified'> | A comma-separated list of additional fields to include in the response. (optional) + fields: ["content_date_modified"], }; apiInstance.listTemplates(body).then((data) => { @@ -183,15 +383,15 @@ apiInstance.listTemplates(body).then((data) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **q** | [**string**] | Optional search query. Filter by template name. | (optional) defaults to undefined + **q** | [**string**] | Search query. Filter by template name. | (optional) defaults to undefined **shared** | [**boolean**] | Returns only the shared templates. | (optional) defaults to undefined - **deleted** | [**boolean**] | Optional. Returns only the deleted templates. | (optional) defaults to undefined - **count** | [**number**] | Optionally, specify how many templates to return. Default is 50 templates, maximum is 100 templates. | (optional) defaults to undefined - **page** | [**number**] | Optionally, specify which page of the dataset to return. | (optional) defaults to undefined - **id** | [**string**] | Optionally, specify template ID. | (optional) defaults to undefined + **deleted** | [**boolean**] | Returns only the deleted templates. | (optional) defaults to undefined + **count** | [**number**] | Specify how many templates to return. | (optional) defaults to 50 + **page** | [**number**] | Specify which page of the dataset to return. | (optional) defaults to undefined + **id** | [**string**] | Specify template ID. | (optional) defaults to undefined **folderUuid** | [**string**] | UUID of the folder where the templates are stored. | (optional) defaults to undefined - **tag** | **Array<string>** | Optional search tag. Filter by template tag. | (optional) defaults to undefined - **fields** | [**string**] | A comma-separated list of additional fields to include in the response. Each field must be a valid template property. Currently, only one additional field, `content_date_modified`, is supported. For example, `GET /templates?fields=content_date_modified`. | (optional) defaults to undefined + **tag** | **Array<string>** | Search tag. Filter by template tag. | (optional) defaults to undefined + **fields** | **Array<'content_date_modified'>** | A comma-separated list of additional fields to include in the response. | (optional) defaults to undefined ### Return type @@ -217,3 +417,136 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +# **statusTemplate** +> TemplateStatusResponse statusTemplate() + +## Available Template Statuses The following is a complete list of all possible template statuses returned: | Template Status | Status Description | | :------------------- | :-------------------------------------------------------------------------------------------------------------------------------------- | | `template.UPLOADED` | The template upload process has been initiated and is currently in progress. It will soon transition to the `template.PROCESSED` state. | | `template.PROCESSED` | The template has been successfully uploaded and created. At this stage, all aspects of the template are editable. | | `template.ERROR` | The template upload process has failed. Please refer to the error details in the response for more information. | + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.TemplatesApi(configuration); + +const body:pd_api.TemplatesApiStatusTemplateRequest = { + // string | Template ID + id: "vibuun3DXG8QDDLfXm27Ne", +}; + +apiInstance.statusTemplate(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | [**string**] | Template ID | defaults to undefined + + +### Return type + +**TemplateStatusResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **updateTemplate** +> void updateTemplate(templateUpdateRequest) + +> 🚧 Template status > > You can only update a template in the PROCESSED status (`template.PROCESSED`). > > After creating a new template, it usually retains a `template.uploaded` status for 3-5 seconds while the template syncs across PandaDoc servers. When the template is available for further API calls, the template moves to the `template.PROCESSED` state. Use [Template Status](https://developers.pandadoc.com/reference/template-status) or Webhooks to check template status. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.TemplatesApi(configuration); + +const body:pd_api.TemplatesApiUpdateTemplateRequest = { + // string | Template ID + id: "BhVzRcxH9Z2LgfPPGXFUBa", + // TemplateUpdateRequest + templateUpdateRequest: { + tokens: [ + { + name: "Favorite.Pet", + value: "Panda", + }, + ], + }, +}; + +apiInstance.updateTemplate(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **templateUpdateRequest** | **TemplateUpdateRequest**| | + **id** | [**string**] | Template ID | defaults to undefined + + +### Return type + +**void** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**400** | Bad Request | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/UserAndWorkspaceManagementApi.md b/docs/UserAndWorkspaceManagementApi.md index 67402d1..e344d88 100644 --- a/docs/UserAndWorkspaceManagementApi.md +++ b/docs/UserAndWorkspaceManagementApi.md @@ -4,14 +4,20 @@ All URIs are relative to *https://api.pandadoc.com* Method | HTTP request | Description ------------- | ------------- | ------------- -[**addMember**](UserAndWorkspaceManagementApi.md#addMember) | **POST** /public/v1/workspaces/{workspace_id}/members | Add member +[**addMember**](UserAndWorkspaceManagementApi.md#addMember) | **POST** /public/v1/workspaces/{workspace_id}/members | Add Member to Workspace +[**createApiKey**](UserAndWorkspaceManagementApi.md#createApiKey) | **POST** /public/v1/workspaces/{workspace_id}/api-keys | Create API Key [**createUser**](UserAndWorkspaceManagementApi.md#createUser) | **POST** /public/v1/users | Create User [**createWorkspace**](UserAndWorkspaceManagementApi.md#createWorkspace) | **POST** /public/v1/workspaces | Create Workspace +[**deactivateWorkspace**](UserAndWorkspaceManagementApi.md#deactivateWorkspace) | **POST** /public/v1/workspaces/{workspace_id}/deactivate | Deactivate Workspace +[**getWorkspacesList**](UserAndWorkspaceManagementApi.md#getWorkspacesList) | **GET** /public/v1/workspaces | List Workspaces +[**listUsers**](UserAndWorkspaceManagementApi.md#listUsers) | **GET** /public/v1/users | List Users +[**removeMember**](UserAndWorkspaceManagementApi.md#removeMember) | **DELETE** /public/v1/workspaces/{workspace_id}/members/{member_id} | Remove Member from Workspace # **addMember** > AddMemberResponse addMember(addMemberRequest) +Add an existing user to a workspace. - You must be an organization admin or a workspace admin to add members. ### Example @@ -32,12 +38,12 @@ const body:pd_api.UserAndWorkspaceManagementApiAddMemberRequest = { // AddMemberRequest addMemberRequest: { userId: "2eWSKSvVqmuVCnuUK3iWwD", - role: "Admin", + role: "Member", }, // boolean | Send a confirmation email to the user that was added to workspace(s). (optional) notifyUser: true, // boolean | Send a confirmation email to all workspace admins indicating that the user has been added to the workspace. (optional) - notifyWsAdmins: true, + notifyWsAdmins: false, }; apiInstance.addMember(body).then((data) => { @@ -82,9 +88,77 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +# **createApiKey** +> CreateApiKeyResponse createApiKey(createApiKeyRequest) + +Generate a new API key for the workspace. Check out [API Key Authentication article](https://developers.pandadoc.com/reference/api-key-authentication-process) for detailed API Keys description. > 📘 > - Only an **Org Admin** can generate an API keys. > - To make another user a key\'s owner, pass `user_id` of this user. The user should has an **Admin** role in the workspace. > - Generating a new key invalidates existing key with the same type. Using this request, you can deactivate the key you\'re using for the request. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.UserAndWorkspaceManagementApi(configuration); + +const body:pd_api.UserAndWorkspaceManagementApiCreateApiKeyRequest = { + // string | Workspace id. + workspaceId: "BhVzRcxH9Z2LgfPPGXFUBa", + // CreateApiKeyRequest + createApiKeyRequest: { + userId: "2eWSKSvVqmuVCnuUK3iWwD", + type: "sandbox", + }, +}; + +apiInstance.createApiKey(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createApiKeyRequest** | **CreateApiKeyRequest**| | + **workspaceId** | [**string**] | Workspace id. | defaults to undefined + + +### Return type + +**CreateApiKeyResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + # **createUser** > CreateUserResponse createUser(createUserRequest) +Create users, and assign them roles, licenses, and workspaces. - You must be an organization admin to create users. - We check that the user email domain matches your organization domain. - We check that the user email and phone number have a valid format. ### Example @@ -111,7 +185,7 @@ const body:pd_api.UserAndWorkspaceManagementApiCreateUserRequest = { workspaces: [ { workspaceId: "2eWSKSvVqmuVCnuUK3iWwD", - role: "Admin", + role: "Member", }, ], license: "Full", @@ -119,7 +193,7 @@ const body:pd_api.UserAndWorkspaceManagementApiCreateUserRequest = { // boolean | Send a confirmation email to the user that was added to workspace(s). (optional) notifyUser: true, // boolean | Send a confirmation email to all workspace admins indicating that the user has been added to the workspace. (optional) - notifyWsAdmins: true, + notifyWsAdmins: false, }; apiInstance.createUser(body).then((data) => { @@ -166,6 +240,7 @@ Name | Type | Description | Notes # **createWorkspace** > CreateWorkspaceResponse createWorkspace(createWorkspaceRequest) +Create a workspace in your organization. - You need to be an Org Admin to create a workspace. - You will be added to the new workspace with an Admin role. ### Example @@ -225,3 +300,260 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +# **deactivateWorkspace** +> any deactivateWorkspace() + +Deactivate the workspace, remove all the members from it and make it unavailable. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.UserAndWorkspaceManagementApi(configuration); + +const body:pd_api.UserAndWorkspaceManagementApiDeactivateWorkspaceRequest = { + // string + workspaceId: "BhVzRcxH9Z2LgfPPGXFUBa", + // any (optional) + body: {}, +}; + +apiInstance.deactivateWorkspace(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **any**| | + **workspaceId** | [**string**] | | defaults to undefined + + +### Return type + +**any** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Workspace was deactivated successfully. | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **getWorkspacesList** +> ListWorkspacesResponse getWorkspacesList() + +Get a list of all the active workspaces in the organization. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.UserAndWorkspaceManagementApi(configuration); + +const body:pd_api.UserAndWorkspaceManagementApiGetWorkspacesListRequest = { + // number | Number of elements in page. (optional) + count: 10, + // number | Page number. (optional) + page: 1, +}; + +apiInstance.getWorkspacesList(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **count** | [**number**] | Number of elements in page. | (optional) defaults to 50 + **page** | [**number**] | Page number. | (optional) defaults to 1 + + +### Return type + +**ListWorkspacesResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Page of workspaces | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **listUsers** +> ListUsersResponse listUsers() + +Get a list of all users with membership in your organization, with their contact information, license type, and workspace roles. You must be an organization admin to list users. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.UserAndWorkspaceManagementApi(configuration); + +const body:pd_api.UserAndWorkspaceManagementApiListUsersRequest = { + // number | Number of elements in page. (optional) + count: 10, + // number | Page number. (optional) + page: 1, + // boolean | Filter option - show users with removed memberships. (optional) + showRemoved: false, +}; + +apiInstance.listUsers(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **count** | [**number**] | Number of elements in page. | (optional) defaults to 50 + **page** | [**number**] | Page number. | (optional) defaults to 1 + **showRemoved** | [**boolean**] | Filter option - show users with removed memberships. | (optional) defaults to true + + +### Return type + +**ListUsersResponse** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Page of users. | - | +**401** | Authentication error | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +# **removeMember** +> void removeMember() + +This operation removes a specified member from a workspace by providing the workspace ID and member ID. + +### Example + + +```typescript +import * as pd_api from 'pandadoc-node-client'; + +// replace it with your API key +const API_KEY = "YOUR_API_KEY"; +const configuration = pd_api.createConfiguration( + { authMethods: {apiKey: `API-Key ${API_KEY}`} } +); +const apiInstance = new pd_api.UserAndWorkspaceManagementApi(configuration); + +const body:pd_api.UserAndWorkspaceManagementApiRemoveMemberRequest = { + // string | Workspace id + workspaceId: "BhVzRcxH9Z2LgfPPGXFUBa", + // string | Member id + memberId: "nPh2PDhFdDqAES9k64h9qX", +}; + +apiInstance.removeMember(body).then((data) => { + console.log('API called successfully. Returned data: %o', data); +}).catch((error) => console.error(error)); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workspaceId** | [**string**] | Workspace id | defaults to undefined + **memberId** | [**string**] | Member id | defaults to undefined + + +### Return type + +**void** + +### Authorization + +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | +**400** | Bad Request | - | +**401** | Authentication error | - | +**403** | Permission error | - | +**404** | Bad Request | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/WebhookEventsApi.md b/docs/WebhookEventsApi.md index 9235182..0df803a 100644 --- a/docs/WebhookEventsApi.md +++ b/docs/WebhookEventsApi.md @@ -4,13 +4,14 @@ All URIs are relative to *https://api.pandadoc.com* Method | HTTP request | Description ------------- | ------------- | ------------- -[**detailsWebhookEvent**](WebhookEventsApi.md#detailsWebhookEvent) | **GET** /public/v1/webhook-events/{id} | Get webhook event by uuid -[**listWebhookEvent**](WebhookEventsApi.md#listWebhookEvent) | **GET** /public/v1/webhook-events | Get webhook event page +[**detailsWebhookEvent**](WebhookEventsApi.md#detailsWebhookEvent) | **GET** /public/v1/webhook-events/{id} | Webhook Event Details +[**listWebhookEvent**](WebhookEventsApi.md#listWebhookEvent) | **GET** /public/v1/webhook-events | List Webhook Events # **detailsWebhookEvent** > WebhookEventDetailsResponse detailsWebhookEvent() +This operation fetches detailed information about a specific webhook event using its unique identifier. ### Example @@ -26,8 +27,8 @@ const configuration = pd_api.createConfiguration( const apiInstance = new pd_api.WebhookEventsApi(configuration); const body:pd_api.WebhookEventsApiDetailsWebhookEventRequest = { - // string | Webhook event uuid - id: "id_example", + // string | Webhook event uuid. + id: "8b61d111-5e0b-406d-a150-e8305fc7e97a", }; apiInstance.detailsWebhookEvent(body).then((data) => { @@ -40,7 +41,7 @@ apiInstance.detailsWebhookEvent(body).then((data) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | [**string**] | Webhook event uuid | defaults to undefined + **id** | [**string**] | Webhook event uuid. | defaults to undefined ### Return type @@ -60,7 +61,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Get webhook event by uuid | - | +**200** | Get webhook event by uuid. | - | **401** | Authentication error | - | **429** | Too Many Requests | - | @@ -69,6 +70,7 @@ Name | Type | Description | Notes # **listWebhookEvent** > WebhookEventPageResponse listWebhookEvent() +This operation retrieves a paginated list of all webhook events. ### Example @@ -84,25 +86,25 @@ const configuration = pd_api.createConfiguration( const apiInstance = new pd_api.WebhookEventsApi(configuration); const body:pd_api.WebhookEventsApiListWebhookEventRequest = { - // number | Number of element in page - count: 0, - // number | Page number - page: 0, - // Date | Filter option: all events from specified timestamp (optional) - since: new Date('1970-01-01T00:00:00.00Z'), - // Date | Filter option: all events up to specified timestamp (optional) - to: new Date('1970-01-01T00:00:00.00Z'), - // Array | Filter option: all events of type (optional) + // number | Specify how many event results to return. + count: 10, + // number | Specify which page of the dataset to return. + page: 1, + // Date | Return results where the event creation time is greater than or equal to this value. (optional) + since: new Date('2022-06-01T00:00:00Z'), + // Date | Return results where the event creation time is less than this value. (optional) + to: new Date('2022-06-30T23:59:59Z'), + // Array | Returns results by the specified event types. (optional) type: [ - "document_state_changed", + "["recipient_completed"]", ], - // Array | Filter option: all events of http status code (optional) + // Array | Returns results with the specified HTTP status codes. (optional) httpStatusCode: [ - 400, + [400], ], - // Array | Filter option: all events with following error (optional) + // Array | Returns results with the following errors. (optional) error: [ - "TIMEOUT_ERROR", + "["INTERNAL_ERROR","NOT_VALID_URL"]", ], }; @@ -116,13 +118,13 @@ apiInstance.listWebhookEvent(body).then((data) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **count** | [**number**] | Number of element in page | defaults to undefined - **page** | [**number**] | Page number | defaults to undefined - **since** | [**Date**] | Filter option: all events from specified timestamp | (optional) defaults to undefined - **to** | [**Date**] | Filter option: all events up to specified timestamp | (optional) defaults to undefined - **type** | **Array<WebhookEventTriggerEnum>** | Filter option: all events of type | (optional) defaults to undefined - **httpStatusCode** | **Array<WebhookEventHttpStatusCodeGroupEnum>** | Filter option: all events of http status code | (optional) defaults to undefined - **error** | **Array<WebhookEventErrorEnum>** | Filter option: all events with following error | (optional) defaults to undefined + **count** | [**number**] | Specify how many event results to return. | defaults to undefined + **page** | [**number**] | Specify which page of the dataset to return. | defaults to undefined + **since** | [**Date**] | Return results where the event creation time is greater than or equal to this value. | (optional) defaults to undefined + **to** | [**Date**] | Return results where the event creation time is less than this value. | (optional) defaults to undefined + **type** | **Array<WebhookEventTriggerEnum>** | Returns results by the specified event types. | (optional) defaults to undefined + **httpStatusCode** | **Array<WebhookEventHttpStatusCodeGroupEnum>** | Returns results with the specified HTTP status codes. | (optional) defaults to undefined + **error** | **Array<WebhookEventErrorEnum>** | Returns results with the following errors. | (optional) defaults to undefined ### Return type @@ -142,7 +144,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Page of webhook events | - | +**200** | Page of webhook events. | - | **401** | Authentication error | - | **429** | Too Many Requests | - | diff --git a/docs/WebhookSubscriptionsApi.md b/docs/WebhookSubscriptionsApi.md index d6f07e5..1cb31fa 100644 --- a/docs/WebhookSubscriptionsApi.md +++ b/docs/WebhookSubscriptionsApi.md @@ -4,17 +4,18 @@ All URIs are relative to *https://api.pandadoc.com* Method | HTTP request | Description ------------- | ------------- | ------------- -[**createWebhookSubscription**](WebhookSubscriptionsApi.md#createWebhookSubscription) | **POST** /public/v1/webhook-subscriptions | Create webhook subscription -[**deleteWebhookSubscription**](WebhookSubscriptionsApi.md#deleteWebhookSubscription) | **DELETE** /public/v1/webhook-subscriptions/{id} | Delete webhook subscription -[**detailsWebhookSubscription**](WebhookSubscriptionsApi.md#detailsWebhookSubscription) | **GET** /public/v1/webhook-subscriptions/{id} | Get webhook subscription by uuid -[**listWebhookSubscriptions**](WebhookSubscriptionsApi.md#listWebhookSubscriptions) | **GET** /public/v1/webhook-subscriptions | Get all webhook subscriptions -[**updateWebhookSubscription**](WebhookSubscriptionsApi.md#updateWebhookSubscription) | **PATCH** /public/v1/webhook-subscriptions/{id} | Update webhook subscription -[**updateWebhookSubscriptionSharedKey**](WebhookSubscriptionsApi.md#updateWebhookSubscriptionSharedKey) | **PATCH** /public/v1/webhook-subscriptions/{id}/shared-key | Regenerate webhook subscription shared key +[**createWebhookSubscription**](WebhookSubscriptionsApi.md#createWebhookSubscription) | **POST** /public/v1/webhook-subscriptions | Create Webhook Subscription +[**deleteWebhookSubscription**](WebhookSubscriptionsApi.md#deleteWebhookSubscription) | **DELETE** /public/v1/webhook-subscriptions/{id} | Delete Webhook Subscription +[**detailsWebhookSubscription**](WebhookSubscriptionsApi.md#detailsWebhookSubscription) | **GET** /public/v1/webhook-subscriptions/{id} | Webhook Subscription Details +[**listWebhookSubscriptions**](WebhookSubscriptionsApi.md#listWebhookSubscriptions) | **GET** /public/v1/webhook-subscriptions | List Webhook Subscriptions +[**updateWebhookSubscription**](WebhookSubscriptionsApi.md#updateWebhookSubscription) | **PATCH** /public/v1/webhook-subscriptions/{id} | Update Webhook Subscription +[**updateWebhookSubscriptionSharedKey**](WebhookSubscriptionsApi.md#updateWebhookSubscriptionSharedKey) | **PATCH** /public/v1/webhook-subscriptions/{id}/shared-key | Update Webhook Subscription Shared Key # **createWebhookSubscription** > WebhookSubscriptionItemResponse createWebhookSubscription(webhookSubscriptionCreateRequest) +This operation creates a new webhook subscription by specifying its details. ### Example @@ -34,6 +35,7 @@ const body:pd_api.WebhookSubscriptionsApiCreateWebhookSubscriptionRequest = { webhookSubscriptionCreateRequest: { name: "My Subscription", url: "https://example.com", + active: true, payload: [ "pricing", ], @@ -84,6 +86,7 @@ Name | Type | Description | Notes # **deleteWebhookSubscription** > void deleteWebhookSubscription() +This operation deletes a specific webhook subscription identified by its UUID. ### Example @@ -99,8 +102,8 @@ const configuration = pd_api.createConfiguration( const apiInstance = new pd_api.WebhookSubscriptionsApi(configuration); const body:pd_api.WebhookSubscriptionsApiDeleteWebhookSubscriptionRequest = { - // string | Webhook subscription uuid - id: "id_example", + // string | Webhook subscription uuid. + id: "d173751d-0057-4d5c-ab75-49a670a4ca68", }; apiInstance.deleteWebhookSubscription(body).then((data) => { @@ -113,7 +116,7 @@ apiInstance.deleteWebhookSubscription(body).then((data) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | [**string**] | Webhook subscription uuid | defaults to undefined + **id** | [**string**] | Webhook subscription uuid. | defaults to undefined ### Return type @@ -144,6 +147,7 @@ Name | Type | Description | Notes # **detailsWebhookSubscription** > WebhookSubscriptionItemResponse detailsWebhookSubscription() +Get webhook subscription by uuid ### Example @@ -160,7 +164,7 @@ const apiInstance = new pd_api.WebhookSubscriptionsApi(configuration); const body:pd_api.WebhookSubscriptionsApiDetailsWebhookSubscriptionRequest = { // string | Webhook subscription uuid - id: "id_example", + id: "4fb6506c-02a0-427e-b445-b9e9ff0c822f", }; apiInstance.detailsWebhookSubscription(body).then((data) => { @@ -204,6 +208,7 @@ Name | Type | Description | Notes # **listWebhookSubscriptions** > WebhookSubscriptionListResponse listWebhookSubscriptions() +This operation fetches a paginated list of webhook subscriptions. ### Example @@ -256,6 +261,7 @@ This endpoint does not need any parameter. # **updateWebhookSubscription** > WebhookSubscriptionItemResponse updateWebhookSubscription(webhookSubscriptionPatchRequest) +This operation updates the details of a webhook subscription. ### Example @@ -272,7 +278,7 @@ const apiInstance = new pd_api.WebhookSubscriptionsApi(configuration); const body:pd_api.WebhookSubscriptionsApiUpdateWebhookSubscriptionRequest = { // string | Webhook subscription uuid - id: "id_example", + id: "d173751d-0057-4d5c-ab75-49a670a4ca68", // WebhookSubscriptionPatchRequest webhookSubscriptionPatchRequest: { name: "My Subscription", @@ -330,6 +336,7 @@ Name | Type | Description | Notes # **updateWebhookSubscriptionSharedKey** > WebhookSubscriptionSharedKeyResponse updateWebhookSubscriptionSharedKey() +This operation regenerates the shared key for a specific webhook subscription identified by its UUID. ### Example @@ -346,7 +353,7 @@ const apiInstance = new pd_api.WebhookSubscriptionsApi(configuration); const body:pd_api.WebhookSubscriptionsApiUpdateWebhookSubscriptionSharedKeyRequest = { // string | Webhook subscription uuid - id: "id_example", + id: "d173751d-0057-4d5c-ab75-49a670a4ca68", }; apiInstance.updateWebhookSubscriptionSharedKey(body).then((data) => { diff --git a/examples/createDocumentFromPandadocTemplateAndSend.ts b/examples/createDocumentFromPandadocTemplateAndSend.ts index 820f4b1..8d9c92f 100644 --- a/examples/createDocumentFromPandadocTemplateAndSend.ts +++ b/examples/createDocumentFromPandadocTemplateAndSend.ts @@ -81,6 +81,8 @@ async function createDocumentFromPandadocTemplate( lastName: "Ron", role: "user", signingOrder: 1, + type: pd_api.CreateDocumentActorTypeEnum.Recipient, + name: "", }, ], tokens: [ diff --git a/examples/createDocumentFromPdfUrlAndSend.ts b/examples/createDocumentFromPdfUrlAndSend.ts index 284eb63..2ffd0d6 100644 --- a/examples/createDocumentFromPdfUrlAndSend.ts +++ b/examples/createDocumentFromPdfUrlAndSend.ts @@ -22,12 +22,16 @@ async function createDocumentFromPdfUrl( lastName: "Ron", role: "user", signingOrder: 1, + type: pd_api.CreateDocumentActorTypeEnum.Recipient, + name: "", }, { email: "john@example.com", firstName: "John", lastName: "Doe", signingOrder: 2, + type: pd_api.CreateDocumentActorTypeEnum.Recipient, + name: "", }, ], fields: { diff --git a/package.json b/package.json index 66e9be5..c141716 100644 --- a/package.json +++ b/package.json @@ -1,35 +1,46 @@ { "name": "pandadoc-node-client", - "version": "6.2.0", + "version": "7.0.0-rc.1", "description": "The Official PandaDoc Node client SDK", "author": "PandaDoc", + "repository": { + "type": "git", + "url": "https://github.com/PandaDoc/pandadoc-api-node-client.git" + }, + "bugs": { + "url": "https://github.com/PandaDoc/pandadoc-api-node-client/issues" + }, + "homepage": "https://github.com/PandaDoc/pandadoc-api-node-client#readme", "keywords": [ "PandaDoc", "SDK" ], "license": "MIT", - "files": ["dist/**/*"], "main": "./dist/index.js", - "typings": "./dist/index.d.ts", - "repository": "git+https://github.com/PandaDoc/pandadoc-api-node-client.git", - "bugs": { - "url": "https://github.com/PandaDoc/pandadoc-api-node-client/issues" + "type": "commonjs", + "exports": { + ".": { + "require": "./dist/index.js", + "types": "./dist/index.d.ts" + } }, - "homepage": "https://github.com/PandaDoc/pandadoc-api-node-client#readme", + "files": [ + "dist" + ], + "typings": "./dist/index.d.ts", "scripts": { "build": "tsc", "prepare": "npm run build" }, "dependencies": { - "node-fetch": "^2.6.0", - "@types/node-fetch": "^2.5.7", - "@types/node": "*", - "form-data": "^2.5.0", + "node-fetch": "^2.7.0", + "@types/node-fetch": "^2.6.13", + "@types/node": "^16.18.126", + "form-data": "^4.0.4", "btoa": "^1.2.1", - "es6-promise": "^4.2.4", - "url-parse": "^1.4.3" + "es6-promise": "^4.2.4" }, "devDependencies": { "typescript": "^4.0" } -} \ No newline at end of file +} diff --git a/src/.gitattributes b/src/.gitattributes new file mode 100644 index 0000000..7bf5a17 --- /dev/null +++ b/src/.gitattributes @@ -0,0 +1,8 @@ +**/* linguist-generated +*.md linguist-documentation + +.gitattributes text +.gitattributes export-ignore + +.gitignore text +.gitignore export-ignore diff --git a/src/apis/APILogsApi.ts b/src/apis/APILogsApi.ts index f05af80..cd85f8f 100644 --- a/src/apis/APILogsApi.ts +++ b/src/apis/APILogsApi.ts @@ -1,17 +1,25 @@ // TODO: better import syntax? -import {BaseAPIRequestFactory, RequiredError} from './baseapi'; +import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; -import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import { readRawBodyAndParse, tryParseRawBody } from '../pandadoc/httpErrorBody'; import {SecurityAuthentication} from '../auth/auth'; import { APILogDetailsResponse } from '../models/APILogDetailsResponse'; import { APILogListResponse } from '../models/APILogListResponse'; +import { ApiLogEnvironmentTypeEnum } from '../models/ApiLogEnvironmentTypeEnum'; +import { ApiLogMethodEnum } from '../models/ApiLogMethodEnum'; +import { ApiLogStatusEnum } from '../models/ApiLogStatusEnum'; +import { ListDocuments401Response } from '../models/ListDocuments401Response'; +import { ListDocuments429Response } from '../models/ListDocuments429Response'; +import { StatusDocument404Response } from '../models/StatusDocument404Response'; +import { UpdateDocument400Response } from '../models/UpdateDocument400Response'; /** * no description @@ -20,7 +28,7 @@ export class APILogsApiRequestFactory extends BaseAPIRequestFactory { /** * Returns details of the specific API log event. - * Details API Log + * API Log Details * @param id Log event id. */ public async detailsLog(id: string, _options?: Configuration): Promise { @@ -53,7 +61,7 @@ export class APILogsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -62,18 +70,18 @@ export class APILogsApiRequestFactory extends BaseAPIRequestFactory { } /** - * Get the list of all logs within the selected workspace. Optionally filter by date, page, and `#` of items per page. + * Get the list of all logs within the selected workspace.\\ Optionally filter by date, page, and `#` of items per page. * List API Log * @param since Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \"-90d\" (for past 90 days). * @param to Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \"-10d\" (for past 10 days) or a special \"now\" value. * @param count The amount of items on each page. - * @param page Page number of the results returned. - * @param statuses Returns only the predefined status codes. Allows 1xx, 2xx, 3xx, 4xx, and 5xx. + * @param page Returns page of the results by number. + * @param statuses Returns only the predefined status codes. * @param methods Returns only the predefined HTTP methods. Allows GET, POST, PUT, PATCH, and DELETE. * @param search Returns the results containing a string. * @param environmentType Returns logs for production/sandbox. */ - public async listLogs(since?: string, to?: string, count?: number, page?: number, statuses?: Array<100 | 200 | 300 | 400 | 500>, methods?: Array<'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'>, search?: string, environmentType?: 'PRODUCTION' | 'SANDBOX', _options?: Configuration): Promise { + public async listLogs(since?: string, to?: string, count?: number, page?: number, statuses?: Array, methods?: Array, search?: string, environmentType?: ApiLogEnvironmentTypeEnum, _options?: Configuration): Promise { let _config = _options || this.configuration; @@ -113,12 +121,18 @@ export class APILogsApiRequestFactory extends BaseAPIRequestFactory { // Query Params if (statuses !== undefined) { - requestContext.setQueryParam("statuses", ObjectSerializer.serialize(statuses, "Array<100 | 200 | 300 | 400 | 500>", "")); + const serializedParams = ObjectSerializer.serialize(statuses, "Array", ""); + for (const serializedParam of serializedParams) { + requestContext.appendQueryParam("statuses", serializedParam); + } } // Query Params if (methods !== undefined) { - requestContext.setQueryParam("methods", ObjectSerializer.serialize(methods, "Array<'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'>", "")); + const serializedParams = ObjectSerializer.serialize(methods, "Array", ""); + for (const serializedParam of serializedParams) { + requestContext.appendQueryParam("methods", serializedParam); + } } // Query Params @@ -128,7 +142,7 @@ export class APILogsApiRequestFactory extends BaseAPIRequestFactory { // Query Params if (environmentType !== undefined) { - requestContext.setQueryParam("environment_type", ObjectSerializer.serialize(environmentType, "'PRODUCTION' | 'SANDBOX'", "")); + requestContext.setQueryParam("environment_type", ObjectSerializer.serialize(environmentType, "ApiLogEnvironmentTypeEnum", "")); } @@ -144,7 +158,7 @@ export class APILogsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -163,35 +177,38 @@ export class APILogsApiResponseProcessor { * @params response Response returned by the server for a request to detailsLog * @throws ApiException if the response code was not in [200, 299] */ - public async detailsLog(response: ResponseContext): Promise { + public async detailsLogWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: APILogDetailsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "APILogDetailsResponse", "" ) as APILogDetailsResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -200,10 +217,17 @@ export class APILogsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "APILogDetailsResponse", "" ) as APILogDetailsResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -213,35 +237,38 @@ export class APILogsApiResponseProcessor { * @params response Response returned by the server for a request to listLogs * @throws ApiException if the response code was not in [200, 299] */ - public async listLogs(response: ResponseContext): Promise { + public async listLogsWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: APILogListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "APILogListResponse", "" ) as APILogListResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -250,10 +277,18 @@ export class APILogsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "APILogListResponse", "" ) as APILogListResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } } + diff --git a/src/apis/CommunicationPreferencesApi.ts b/src/apis/CommunicationPreferencesApi.ts new file mode 100644 index 0000000..0b0737f --- /dev/null +++ b/src/apis/CommunicationPreferencesApi.ts @@ -0,0 +1,147 @@ +// TODO: better import syntax? +import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; +import {Configuration} from '../configuration'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; +import * as FormData from "form-data"; +import { URLSearchParams } from 'url'; +import {ObjectSerializer} from '../models/ObjectSerializer'; +import {ApiException} from './exception'; +import {canConsumeForm, isCodeInRange} from '../util'; +import { readRawBodyAndParse, tryParseRawBody } from '../pandadoc/httpErrorBody'; +import {SecurityAuthentication} from '../auth/auth'; + + +import { ListDocuments401Response } from '../models/ListDocuments401Response'; +import { ListDocuments403Response } from '../models/ListDocuments403Response'; +import { ListDocuments429Response } from '../models/ListDocuments429Response'; +import { ListSmsOptOutChangelogResponse } from '../models/ListSmsOptOutChangelogResponse'; +import { UpdateDocument400Response } from '../models/UpdateDocument400Response'; + +/** + * no description + */ +export class CommunicationPreferencesApiRequestFactory extends BaseAPIRequestFactory { + + /** + * Retrieves a list of the most recent SMS opt-out changes for each phone numbers used in your workspace. > 📘 You can filter results by time range using `timestamp_from` and `timestamp_to`. + * Recent SMS Opt-out + * @param timestampFrom The start of the timestamp. If no timestamp is provided, 1 hour before the current time will be used. + * @param timestampTo The end of the timestamp range. If no timestamp is provided the current time will be used. + */ + public async listRecentSmsOptOuts(timestampFrom?: Date, timestampTo?: Date, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + + + // Path Params + const localVarPath = '/public/v1/sms-opt-outs'; + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + // Query Params + if (timestampFrom !== undefined) { + requestContext.setQueryParam("timestamp_from", ObjectSerializer.serialize(timestampFrom, "Date", "date-time")); + } + + // Query Params + if (timestampTo !== undefined) { + requestContext.setQueryParam("timestamp_to", ObjectSerializer.serialize(timestampTo, "Date", "date-time")); + } + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + +} + +export class CommunicationPreferencesApiResponseProcessor { + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listRecentSmsOptOuts + * @throws ApiException if the response code was not in [200, 299] + */ + public async listRecentSmsOptOutsWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: ListSmsOptOutChangelogResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ListSmsOptOutChangelogResponse", "" + ) as ListSmsOptOutChangelogResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("400", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ListSmsOptOutChangelogResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ListSmsOptOutChangelogResponse", "" + ) as ListSmsOptOutChangelogResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + +} + diff --git a/src/apis/ContactsApi.ts b/src/apis/ContactsApi.ts index c8feae3..02f8b26 100644 --- a/src/apis/ContactsApi.ts +++ b/src/apis/ContactsApi.ts @@ -1,12 +1,13 @@ // TODO: better import syntax? -import {BaseAPIRequestFactory, RequiredError} from './baseapi'; +import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; -import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import { readRawBodyAndParse, tryParseRawBody } from '../pandadoc/httpErrorBody'; import {SecurityAuthentication} from '../auth/auth'; @@ -14,6 +15,10 @@ import { ContactCreateRequest } from '../models/ContactCreateRequest'; import { ContactDetailsResponse } from '../models/ContactDetailsResponse'; import { ContactListResponse } from '../models/ContactListResponse'; import { ContactUpdateRequest } from '../models/ContactUpdateRequest'; +import { CreateDocument400Response } from '../models/CreateDocument400Response'; +import { ListDocuments401Response } from '../models/ListDocuments401Response'; +import { ListDocuments429Response } from '../models/ListDocuments429Response'; +import { UpdateDocument400Response } from '../models/UpdateDocument400Response'; /** * no description @@ -21,6 +26,7 @@ import { ContactUpdateRequest } from '../models/ContactUpdateRequest'; export class ContactsApiRequestFactory extends BaseAPIRequestFactory { /** + * This method adds a contact into a contacts list. * Create contact * @param contactCreateRequest */ @@ -64,7 +70,7 @@ export class ContactsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -73,7 +79,8 @@ export class ContactsApiRequestFactory extends BaseAPIRequestFactory { } /** - * Delete contact by id + * This method deletes a contact. + * Delete Contact * @param id Contact id. */ public async deleteContact(id: string, _options?: Configuration): Promise { @@ -106,7 +113,7 @@ export class ContactsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -115,7 +122,8 @@ export class ContactsApiRequestFactory extends BaseAPIRequestFactory { } /** - * Get contact details by id + * Returns contact details by its ID. + * Contact Details * @param id Contact id. */ public async detailsContact(id: string, _options?: Configuration): Promise { @@ -148,7 +156,7 @@ export class ContactsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -157,6 +165,7 @@ export class ContactsApiRequestFactory extends BaseAPIRequestFactory { } /** + * This method returns a list of contacts associated with a workspace. * List contacts * @param email Optional search parameter. Filter results by exact match. */ @@ -189,7 +198,7 @@ export class ContactsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -198,7 +207,8 @@ export class ContactsApiRequestFactory extends BaseAPIRequestFactory { } /** - * Update contact by id + * This method updates a contact details. + * Update Contact * @param id Contact id. * @param contactUpdateRequest */ @@ -249,7 +259,7 @@ export class ContactsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -268,35 +278,38 @@ export class ContactsApiResponseProcessor { * @params response Response returned by the server for a request to createContact * @throws ApiException if the response code was not in [200, 299] */ - public async createContact(response: ResponseContext): Promise { + public async createContactWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("201", response.httpStatusCode)) { const body: ContactDetailsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "ContactDetailsResponse", "" ) as ContactDetailsResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: CreateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "CreateDocument400Response", "" + ) as CreateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -305,10 +318,17 @@ export class ContactsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "ContactDetailsResponse", "" ) as ContactDetailsResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -318,38 +338,42 @@ export class ContactsApiResponseProcessor { * @params response Response returned by the server for a request to deleteContact * @throws ApiException if the response code was not in [200, 299] */ - public async deleteContact(response: ResponseContext): Promise { + public async deleteContactWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("204", response.httpStatusCode)) { - return; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, undefined); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -358,10 +382,17 @@ export class ContactsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "void", "" ) as void; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -371,42 +402,46 @@ export class ContactsApiResponseProcessor { * @params response Response returned by the server for a request to detailsContact * @throws ApiException if the response code was not in [200, 299] */ - public async detailsContact(response: ResponseContext): Promise { + public async detailsContactWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: ContactDetailsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "ContactDetailsResponse", "" ) as ContactDetailsResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -415,10 +450,17 @@ export class ContactsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "ContactDetailsResponse", "" ) as ContactDetailsResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -428,42 +470,46 @@ export class ContactsApiResponseProcessor { * @params response Response returned by the server for a request to listContacts * @throws ApiException if the response code was not in [200, 299] */ - public async listContacts(response: ResponseContext): Promise { + public async listContactsWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: ContactListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "ContactListResponse", "" ) as ContactListResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -472,10 +518,17 @@ export class ContactsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "ContactListResponse", "" ) as ContactListResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -485,35 +538,38 @@ export class ContactsApiResponseProcessor { * @params response Response returned by the server for a request to updateContact * @throws ApiException if the response code was not in [200, 299] */ - public async updateContact(response: ResponseContext): Promise { + public async updateContactWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: ContactDetailsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "ContactDetailsResponse", "" ) as ContactDetailsResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: CreateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "CreateDocument400Response", "" + ) as CreateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -522,10 +578,18 @@ export class ContactsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "ContactDetailsResponse", "" ) as ContactDetailsResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } } + diff --git a/src/apis/ContentLibraryItemsApi.ts b/src/apis/ContentLibraryItemsApi.ts index 298496a..fbae265 100644 --- a/src/apis/ContentLibraryItemsApi.ts +++ b/src/apis/ContentLibraryItemsApi.ts @@ -1,17 +1,27 @@ // TODO: better import syntax? -import {BaseAPIRequestFactory, RequiredError} from './baseapi'; +import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; -import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import { readRawBodyAndParse, tryParseRawBody } from '../pandadoc/httpErrorBody'; import {SecurityAuthentication} from '../auth/auth'; +import { ContentLibraryItemCreateFromUrlRequest } from '../models/ContentLibraryItemCreateFromUrlRequest'; +import { ContentLibraryItemCreateRequest } from '../models/ContentLibraryItemCreateRequest'; import { ContentLibraryItemListResponse } from '../models/ContentLibraryItemListResponse'; import { ContentLibraryItemResponse } from '../models/ContentLibraryItemResponse'; +import { ContentLibraryResponse } from '../models/ContentLibraryResponse'; +import { CreateDocument400Response } from '../models/CreateDocument400Response'; +import { ListDocuments401Response } from '../models/ListDocuments401Response'; +import { ListDocuments403Response } from '../models/ListDocuments403Response'; +import { ListDocuments429Response } from '../models/ListDocuments429Response'; +import { StatusDocument404Response } from '../models/StatusDocument404Response'; +import { UpdateDocument400Response } from '../models/UpdateDocument400Response'; /** * no description @@ -19,8 +29,131 @@ import { ContentLibraryItemResponse } from '../models/ContentLibraryItemResponse export class ContentLibraryItemsApiRequestFactory extends BaseAPIRequestFactory { /** - * Return detailed data about a content library item. - * Details Content Library Item + * This API endpoint allows users to create an empty item in the content library. No actual content or data is required to be provided in the initial creation. + * Create Content Library Item + * @param contentLibraryItemCreateFromUrlRequest + */ + public async createContentLibraryItem(contentLibraryItemCreateFromUrlRequest: ContentLibraryItemCreateFromUrlRequest, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'contentLibraryItemCreateFromUrlRequest' is not null or undefined + if (contentLibraryItemCreateFromUrlRequest === null || contentLibraryItemCreateFromUrlRequest === undefined) { + throw new RequiredError("ContentLibraryItemsApi", "createContentLibraryItem", "contentLibraryItemCreateFromUrlRequest"); + } + + + // Path Params + const localVarPath = '/public/v1/content-library-items'; + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(contentLibraryItemCreateFromUrlRequest, "ContentLibraryItemCreateFromUrlRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * This asynchronous endpoint allows users to create a new CLI by uploading a file. The uploaded file is processed in the background to generate the CLI. The maximum allowable file size for upload is 100 MB. Field tags and form fields are not supported yet. Once the file is uploaded, the processing will happen asynchronously, and users need to check the status of the CLI creation. + * Create Content Library Item from File Upload + * @param file Binary PDF File + * @param data JSON as a multipart/form-data request. + */ + public async createContentLibraryItemFromUpload(file?: HttpFile, data?: ContentLibraryItemCreateRequest, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + + + // Path Params + const localVarPath = '/public/v1/content-library-items?upload'; + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + // Form Params + const useForm = canConsumeForm([ + 'multipart/form-data', + ]); + + let localVarFormParams + if (useForm) { + localVarFormParams = new FormData(); + } else { + localVarFormParams = new URLSearchParams(); + } + + if (file !== undefined) { + // TODO: replace .append with .set + if (localVarFormParams instanceof FormData) { + localVarFormParams.append('file', file.data, file.name); + } + } + if (data !== undefined) { + // TODO: replace .append with .set + localVarFormParams.append('data', data as any); + } + + requestContext.setBody(localVarFormParams); + + if(!useForm) { + const contentType = ObjectSerializer.getPreferredMediaType([ + "multipart/form-data" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + } + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Retrieve detailed information about a specific content library item using its ID. The details include: - **Roles** - **All fields with values** - **All tokens with values** - **Pricing information (pricing tables, products, etc)** - **Metadata** - **Tags** - **Modification Timestamps**: note that `date_modified` means any changes associated with the CLI, while `content_date_modified` logs any changes in CLI content. + * Content Library Item Details * @param id Content Library Item ID */ public async detailsContentLibraryItem(id: string, _options?: Configuration): Promise { @@ -53,7 +186,7 @@ export class ContentLibraryItemsApiRequestFactory extends BaseAPIRequestFactory await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -62,7 +195,7 @@ export class ContentLibraryItemsApiRequestFactory extends BaseAPIRequestFactory } /** - * Optionally filter by a search query or tags. + * The endpoint retrieves items from the content library in PandaDoc. This endpoint supports filtering options to narrow down the results, allowing users to search by query, tags, folder, and more. > ### ⚠️ Please avoid empty values for the parameters > API returns \"400\" error when any of the parameters has an empty value. Please remove such a parameter from the request or add a value. * List Content Library Item * @param q Search query. Filter by content library item name. * @param id Specify content library item ID. @@ -137,7 +270,50 @@ export class ContentLibraryItemsApiRequestFactory extends BaseAPIRequestFactory await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Requesting the CLI status helps verify that a CLI is in the expected state before invoking additional API methods. ## Available CLI Statuses The following is a complete list of all possible CLI statuses returned: | CLI Status | Status Description | |-----------------|--------------------| | `cli.UPLOADED` | The CLI upload process has been initiated and is currently in progress. It will soon transition to the `cli.PROCESSED` state. | | `cli.PROCESSED` | The CLI has been successfully uploaded and created. At this stage, all aspects of the CLI are editable. | | `cli.ERROR` | The CLI upload process has failed. Please refer to the error details in the response for more information. | + * Content Library Item Status + * @param id Content Library Item ID + */ + public async statusContentLibraryItem(id: string, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError("ContentLibraryItemsApi", "statusContentLibraryItem", "id"); + } + + + // Path Params + const localVarPath = '/public/v1/content-library-items/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -149,6 +325,142 @@ export class ContentLibraryItemsApiRequestFactory extends BaseAPIRequestFactory export class ContentLibraryItemsApiResponseProcessor { + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createContentLibraryItem + * @throws ApiException if the response code was not in [200, 299] + */ + public async createContentLibraryItemWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("201", response.httpStatusCode)) { + const body: ContentLibraryResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ContentLibraryResponse", "" + ) as ContentLibraryResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("400", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: CreateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "CreateDocument400Response", "" + ) as CreateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ContentLibraryResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ContentLibraryResponse", "" + ) as ContentLibraryResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createContentLibraryItemFromUpload + * @throws ApiException if the response code was not in [200, 299] + */ + public async createContentLibraryItemFromUploadWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("201", response.httpStatusCode)) { + const body: ContentLibraryResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ContentLibraryResponse", "" + ) as ContentLibraryResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("400", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: CreateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "CreateDocument400Response", "" + ) as CreateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ContentLibraryResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ContentLibraryResponse", "" + ) as ContentLibraryResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -156,42 +468,46 @@ export class ContentLibraryItemsApiResponseProcessor { * @params response Response returned by the server for a request to detailsContentLibraryItem * @throws ApiException if the response code was not in [200, 299] */ - public async detailsContentLibraryItem(response: ResponseContext): Promise { + public async detailsContentLibraryItemWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: ContentLibraryItemResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "ContentLibraryItemResponse", "" ) as ContentLibraryItemResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -200,10 +516,17 @@ export class ContentLibraryItemsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "ContentLibraryItemResponse", "" ) as ContentLibraryItemResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -213,35 +536,38 @@ export class ContentLibraryItemsApiResponseProcessor { * @params response Response returned by the server for a request to listContentLibraryItems * @throws ApiException if the response code was not in [200, 299] */ - public async listContentLibraryItems(response: ResponseContext): Promise { + public async listContentLibraryItemsWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: ContentLibraryItemListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "ContentLibraryItemListResponse", "" ) as ContentLibraryItemListResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -250,10 +576,86 @@ export class ContentLibraryItemsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "ContentLibraryItemListResponse", "" ) as ContentLibraryItemListResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to statusContentLibraryItem + * @throws ApiException if the response code was not in [200, 299] + */ + public async statusContentLibraryItemWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: ContentLibraryResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ContentLibraryResponse", "" + ) as ContentLibraryResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("404", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ContentLibraryResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ContentLibraryResponse", "" + ) as ContentLibraryResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } } + diff --git a/src/apis/DocumentAttachmentsApi.ts b/src/apis/DocumentAttachmentsApi.ts index 5b85489..b6f736c 100644 --- a/src/apis/DocumentAttachmentsApi.ts +++ b/src/apis/DocumentAttachmentsApi.ts @@ -1,16 +1,23 @@ // TODO: better import syntax? -import {BaseAPIRequestFactory, RequiredError} from './baseapi'; +import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; -import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import { readRawBodyAndParse, tryParseRawBody } from '../pandadoc/httpErrorBody'; import {SecurityAuthentication} from '../auth/auth'; +import { ChangeDocumentStatus409Response } from '../models/ChangeDocumentStatus409Response'; +import { CreateDocument400Response } from '../models/CreateDocument400Response'; +import { DocumentAttachmentRequest } from '../models/DocumentAttachmentRequest'; import { DocumentAttachmentResponse } from '../models/DocumentAttachmentResponse'; +import { ListDocuments401Response } from '../models/ListDocuments401Response'; +import { ListDocuments429Response } from '../models/ListDocuments429Response'; +import { StatusDocument404Response } from '../models/StatusDocument404Response'; /** * no description @@ -19,13 +26,11 @@ export class DocumentAttachmentsApiRequestFactory extends BaseAPIRequestFactory /** * Creates an attachment for a particular document - * Document Attachment Create + * Create Document Attachment * @param id Document UUID - * @param file Binary file to be attached to a document - * @param source URL link to the file to be attached to a document - * @param name Optional name to set for uploaded file + * @param documentAttachmentRequest */ - public async createDocumentAttachment(id: string, file?: HttpFile, source?: string, name?: string, _options?: Configuration): Promise { + public async createDocumentAttachment(id: string, documentAttachmentRequest: DocumentAttachmentRequest, _options?: Configuration): Promise { let _config = _options || this.configuration; // verify required parameter 'id' is not null or undefined @@ -34,7 +39,10 @@ export class DocumentAttachmentsApiRequestFactory extends BaseAPIRequestFactory } - + // verify required parameter 'documentAttachmentRequest' is not null or undefined + if (documentAttachmentRequest === null || documentAttachmentRequest === undefined) { + throw new RequiredError("DocumentAttachmentsApi", "createDocumentAttachment", "documentAttachmentRequest"); + } // Path Params @@ -45,6 +53,64 @@ export class DocumentAttachmentsApiRequestFactory extends BaseAPIRequestFactory const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(documentAttachmentRequest, "DocumentAttachmentRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Creates an attachment for a particular document + * Create Document Attachment From Upload + * @param id Document UUID + * @param file Binary file to be attached to a document + * @param name Optional name to set for uploaded file + */ + public async createDocumentAttachmentFromFileUpload(id: string, file?: HttpFile, name?: string, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError("DocumentAttachmentsApi", "createDocumentAttachmentFromFileUpload", "id"); + } + + + + + // Path Params + const localVarPath = '/public/v1/documents/{id}/attachments?upload' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + // Form Params const useForm = canConsumeForm([ 'multipart/form-data', @@ -63,10 +129,6 @@ export class DocumentAttachmentsApiRequestFactory extends BaseAPIRequestFactory localVarFormParams.append('file', file.data, file.name); } } - if (source !== undefined) { - // TODO: replace .append with .set - localVarFormParams.append('source', source as any); - } if (name !== undefined) { // TODO: replace .append with .set localVarFormParams.append('name', name as any); @@ -93,7 +155,7 @@ export class DocumentAttachmentsApiRequestFactory extends BaseAPIRequestFactory await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -102,10 +164,10 @@ export class DocumentAttachmentsApiRequestFactory extends BaseAPIRequestFactory } /** - * Deletes specific document's attachment - * Document Attachment Delete - * @param id Document UUID - * @param attachmentId Attachment UUID + * Deletes an attachment from the document. + * Delete Document Attachment + * @param id Document UUID. + * @param attachmentId Attachment UUID. */ public async deleteDocumentAttachment(id: string, attachmentId: string, _options?: Configuration): Promise { let _config = _options || this.configuration; @@ -144,7 +206,7 @@ export class DocumentAttachmentsApiRequestFactory extends BaseAPIRequestFactory await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -153,10 +215,10 @@ export class DocumentAttachmentsApiRequestFactory extends BaseAPIRequestFactory } /** - * Returns details of the specific document's attachment + * Returns details of the specific document\'s attachment. * Document Attachment Details - * @param id Document UUID - * @param attachmentId Attachment UUID + * @param id Document UUID. + * @param attachmentId Attachment UUID. */ public async detailsDocumentAttachment(id: string, attachmentId: string, _options?: Configuration): Promise { let _config = _options || this.configuration; @@ -195,7 +257,7 @@ export class DocumentAttachmentsApiRequestFactory extends BaseAPIRequestFactory await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -204,10 +266,10 @@ export class DocumentAttachmentsApiRequestFactory extends BaseAPIRequestFactory } /** - * Returns document attachment file for download - * Document Attachment Download - * @param id Document UUID - * @param attachmentId Attachment UUID + * Download an attachment by ID. + * Download Document Attachment + * @param id Document UUID. + * @param attachmentId Attachment UUID. */ public async downloadDocumentAttachment(id: string, attachmentId: string, _options?: Configuration): Promise { let _config = _options || this.configuration; @@ -246,7 +308,7 @@ export class DocumentAttachmentsApiRequestFactory extends BaseAPIRequestFactory await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -255,8 +317,8 @@ export class DocumentAttachmentsApiRequestFactory extends BaseAPIRequestFactory } /** - * Return list of objects attached to particular document - * Document Attachment List + * Returns a list of attachments associated with a specified document. + * List Document Attachments * @param id Document UUID */ public async listDocumentAttachments(id: string, _options?: Configuration): Promise { @@ -289,7 +351,7 @@ export class DocumentAttachmentsApiRequestFactory extends BaseAPIRequestFactory await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -308,42 +370,114 @@ export class DocumentAttachmentsApiResponseProcessor { * @params response Response returned by the server for a request to createDocumentAttachment * @throws ApiException if the response code was not in [200, 299] */ - public async createDocumentAttachment(response: ResponseContext): Promise { + public async createDocumentAttachmentWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: DocumentAttachmentResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "DocumentAttachmentResponse", "" ) as DocumentAttachmentResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: CreateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "CreateDocument400Response", "" + ) as CreateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: DocumentAttachmentResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + "DocumentAttachmentResponse", "" + ) as DocumentAttachmentResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createDocumentAttachmentFromFileUpload + * @throws ApiException if the response code was not in [200, 299] + */ + public async createDocumentAttachmentFromFileUploadWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: DocumentAttachmentResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "DocumentAttachmentResponse", "" + ) as DocumentAttachmentResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("400", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: CreateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "CreateDocument400Response", "" + ) as CreateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("404", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -352,10 +486,17 @@ export class DocumentAttachmentsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "DocumentAttachmentResponse", "" ) as DocumentAttachmentResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -365,31 +506,34 @@ export class DocumentAttachmentsApiResponseProcessor { * @params response Response returned by the server for a request to deleteDocumentAttachment * @throws ApiException if the response code was not in [200, 299] */ - public async deleteDocumentAttachment(response: ResponseContext): Promise { + public async deleteDocumentAttachmentWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("204", response.httpStatusCode)) { - return; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, undefined); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -398,10 +542,17 @@ export class DocumentAttachmentsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "void", "" ) as void; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -411,42 +562,46 @@ export class DocumentAttachmentsApiResponseProcessor { * @params response Response returned by the server for a request to detailsDocumentAttachment * @throws ApiException if the response code was not in [200, 299] */ - public async detailsDocumentAttachment(response: ResponseContext): Promise { + public async detailsDocumentAttachmentWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: DocumentAttachmentResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "DocumentAttachmentResponse", "" ) as DocumentAttachmentResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("409", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(409, "Conflict", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ChangeDocumentStatus409Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ChangeDocumentStatus409Response", "" + ) as ChangeDocumentStatus409Response; + throw new ApiException(response.httpStatusCode, "Conflict", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -455,10 +610,17 @@ export class DocumentAttachmentsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "DocumentAttachmentResponse", "" ) as DocumentAttachmentResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -468,39 +630,43 @@ export class DocumentAttachmentsApiResponseProcessor { * @params response Response returned by the server for a request to downloadDocumentAttachment * @throws ApiException if the response code was not in [200, 299] */ - public async downloadDocumentAttachment(response: ResponseContext): Promise { + public async downloadDocumentAttachmentWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: HttpFile = await response.getBodyAsFile() as any as HttpFile; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "binary" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "binary" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "binary" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "binary" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("409", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "binary" - ) as any; - throw new ApiException(409, "Conflict", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ChangeDocumentStatus409Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ChangeDocumentStatus409Response", "binary" + ) as ChangeDocumentStatus409Response; + throw new ApiException(response.httpStatusCode, "Conflict", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "binary" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "binary" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -509,10 +675,17 @@ export class DocumentAttachmentsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "HttpFile", "binary" ) as HttpFile; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -522,42 +695,46 @@ export class DocumentAttachmentsApiResponseProcessor { * @params response Response returned by the server for a request to listDocumentAttachments * @throws ApiException if the response code was not in [200, 299] */ - public async listDocumentAttachments(response: ResponseContext): Promise > { + public async listDocumentAttachmentsWithHttpInfo(response: ResponseContext): Promise >> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: Array = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "Array", "" ) as Array; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("409", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(409, "Conflict", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ChangeDocumentStatus409Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ChangeDocumentStatus409Response", "" + ) as ChangeDocumentStatus409Response; + throw new ApiException(response.httpStatusCode, "Conflict", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -566,10 +743,18 @@ export class DocumentAttachmentsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "Array", "" ) as Array; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } } + diff --git a/src/apis/DocumentAuditTrailApi.ts b/src/apis/DocumentAuditTrailApi.ts new file mode 100644 index 0000000..603ee0c --- /dev/null +++ b/src/apis/DocumentAuditTrailApi.ts @@ -0,0 +1,119 @@ +// TODO: better import syntax? +import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; +import {Configuration} from '../configuration'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; +import * as FormData from "form-data"; +import { URLSearchParams } from 'url'; +import {ObjectSerializer} from '../models/ObjectSerializer'; +import {ApiException} from './exception'; +import {canConsumeForm, isCodeInRange} from '../util'; +import { readRawBodyAndParse, tryParseRawBody } from '../pandadoc/httpErrorBody'; +import {SecurityAuthentication} from '../auth/auth'; + + +import { DocumentAuditTrailResponse } from '../models/DocumentAuditTrailResponse'; + +/** + * no description + */ +export class DocumentAuditTrailApiRequestFactory extends BaseAPIRequestFactory { + + /** + * Retrieves the full audit trail for a specified document. The audit trail includes detailed user actions such as sending, viewing, signing, and editing, along with metadata like timestamps, IP addresses, and user identity. This endpoint is accessible to authorized workspace administrators only. + * List Document Audit Trail + * @param documentId Unique identifier of the document to retrieve the audit trail for. + * @param limit Maximum number of items to return. + * @param offset Number of items to skip before starting to collect the result set. + */ + public async listDocumentAuditTrail(documentId: string, limit?: number, offset?: number, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'documentId' is not null or undefined + if (documentId === null || documentId === undefined) { + throw new RequiredError("DocumentAuditTrailApi", "listDocumentAuditTrail", "documentId"); + } + + + + + // Path Params + const localVarPath = '/public/v2/documents/{document_id}/audit-trail' + .replace('{' + 'document_id' + '}', encodeURIComponent(String(documentId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + // Query Params + if (limit !== undefined) { + requestContext.setQueryParam("limit", ObjectSerializer.serialize(limit, "number", "")); + } + + // Query Params + if (offset !== undefined) { + requestContext.setQueryParam("offset", ObjectSerializer.serialize(offset, "number", "")); + } + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + +} + +export class DocumentAuditTrailApiResponseProcessor { + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listDocumentAuditTrail + * @throws ApiException if the response code was not in [200, 299] + */ + public async listDocumentAuditTrailWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: DocumentAuditTrailResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "DocumentAuditTrailResponse", "" + ) as DocumentAuditTrailResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: DocumentAuditTrailResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "DocumentAuditTrailResponse", "" + ) as DocumentAuditTrailResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + +} + diff --git a/src/apis/DocumentFieldsApi.ts b/src/apis/DocumentFieldsApi.ts new file mode 100644 index 0000000..a2c0fad --- /dev/null +++ b/src/apis/DocumentFieldsApi.ts @@ -0,0 +1,273 @@ +// TODO: better import syntax? +import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; +import {Configuration} from '../configuration'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; +import * as FormData from "form-data"; +import { URLSearchParams } from 'url'; +import {ObjectSerializer} from '../models/ObjectSerializer'; +import {ApiException} from './exception'; +import {canConsumeForm, isCodeInRange} from '../util'; +import { readRawBodyAndParse, tryParseRawBody } from '../pandadoc/httpErrorBody'; +import {SecurityAuthentication} from '../auth/auth'; + + +import { ChangeDocumentStatus409Response } from '../models/ChangeDocumentStatus409Response'; +import { CreateDocument400Response } from '../models/CreateDocument400Response'; +import { CreateDocumentFieldsRequest } from '../models/CreateDocumentFieldsRequest'; +import { CreateDocumentFieldsResponse } from '../models/CreateDocumentFieldsResponse'; +import { ListDocumentFieldsResponse } from '../models/ListDocumentFieldsResponse'; +import { ListDocuments401Response } from '../models/ListDocuments401Response'; +import { ListDocuments429Response } from '../models/ListDocuments429Response'; +import { StatusDocument404Response } from '../models/StatusDocument404Response'; + +/** + * no description + */ +export class DocumentFieldsApiRequestFactory extends BaseAPIRequestFactory { + + /** + * Creates fields for a particular document. For CFR11-compliant workspaces (21 CFR Part 11), signature fields must have a minimum size of 108×33. + * Create Document Fields + * @param id Document UUID. + * @param createDocumentFieldsRequest + */ + public async createDocumentFields(id: string, createDocumentFieldsRequest: CreateDocumentFieldsRequest, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError("DocumentFieldsApi", "createDocumentFields", "id"); + } + + + // verify required parameter 'createDocumentFieldsRequest' is not null or undefined + if (createDocumentFieldsRequest === null || createDocumentFieldsRequest === undefined) { + throw new RequiredError("DocumentFieldsApi", "createDocumentFields", "createDocumentFieldsRequest"); + } + + + // Path Params + const localVarPath = '/public/v1/documents/{id}/fields' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(createDocumentFieldsRequest, "CreateDocumentFieldsRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Return the list of fields for a particular document. + * List Document Fields + * @param id Document UUID. + */ + public async listDocumentFields(id: string, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError("DocumentFieldsApi", "listDocumentFields", "id"); + } + + + // Path Params + const localVarPath = '/public/v1/documents/{id}/fields' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + +} + +export class DocumentFieldsApiResponseProcessor { + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createDocumentFields + * @throws ApiException if the response code was not in [200, 299] + */ + public async createDocumentFieldsWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: CreateDocumentFieldsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "CreateDocumentFieldsResponse", "" + ) as CreateDocumentFieldsResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("400", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: CreateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "CreateDocument400Response", "" + ) as CreateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("404", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: CreateDocumentFieldsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "CreateDocumentFieldsResponse", "" + ) as CreateDocumentFieldsResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listDocumentFields + * @throws ApiException if the response code was not in [200, 299] + */ + public async listDocumentFieldsWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: ListDocumentFieldsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ListDocumentFieldsResponse", "" + ) as ListDocumentFieldsResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("404", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("409", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ChangeDocumentStatus409Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ChangeDocumentStatus409Response", "" + ) as ChangeDocumentStatus409Response; + throw new ApiException(response.httpStatusCode, "Conflict", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ListDocumentFieldsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ListDocumentFieldsResponse", "" + ) as ListDocumentFieldsResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + +} + diff --git a/src/apis/DocumentLinkToCRMApi.ts b/src/apis/DocumentLinkToCRMApi.ts new file mode 100644 index 0000000..7bb8112 --- /dev/null +++ b/src/apis/DocumentLinkToCRMApi.ts @@ -0,0 +1,578 @@ +// TODO: better import syntax? +import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; +import {Configuration} from '../configuration'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; +import * as FormData from "form-data"; +import { URLSearchParams } from 'url'; +import {ObjectSerializer} from '../models/ObjectSerializer'; +import {ApiException} from './exception'; +import {canConsumeForm, isCodeInRange} from '../util'; +import { readRawBodyAndParse, tryParseRawBody } from '../pandadoc/httpErrorBody'; +import {SecurityAuthentication} from '../auth/auth'; + + +import { ChangeDocumentStatus409Response } from '../models/ChangeDocumentStatus409Response'; +import { LinkedObjectCreateRequest } from '../models/LinkedObjectCreateRequest'; +import { LinkedObjectCreateResponse } from '../models/LinkedObjectCreateResponse'; +import { LinkedObjectListResponse } from '../models/LinkedObjectListResponse'; +import { ListDocuments401Response } from '../models/ListDocuments401Response'; +import { ListDocuments403Response } from '../models/ListDocuments403Response'; +import { ListDocuments429Response } from '../models/ListDocuments429Response'; +import { ListDocumentsByLinkedObjectsResponseInner } from '../models/ListDocumentsByLinkedObjectsResponseInner'; +import { StatusDocument404Response } from '../models/StatusDocument404Response'; +import { UpdateDocument400Response } from '../models/UpdateDocument400Response'; + +/** + * no description + */ +export class DocumentLinkToCRMApiRequestFactory extends BaseAPIRequestFactory { + + /** + * Create a linked object in the document. > 🚧 > > You can only link each document to each CRM once. This ensures the consistent functionality of the [two-way CRM sync](https://support.pandadoc.com/en/articles/9714877-hubspot-crm#h_3a3344e8-2a6e-4fd8-86be-0da8c121e4ac). > > You can, however, link one document to several external systems. + * Create Linked Object + * @param id Specify document ID. + * @param linkedObjectCreateRequest + */ + public async createLinkedObject(id: string, linkedObjectCreateRequest: LinkedObjectCreateRequest, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError("DocumentLinkToCRMApi", "createLinkedObject", "id"); + } + + + // verify required parameter 'linkedObjectCreateRequest' is not null or undefined + if (linkedObjectCreateRequest === null || linkedObjectCreateRequest === undefined) { + throw new RequiredError("DocumentLinkToCRMApi", "createLinkedObject", "linkedObjectCreateRequest"); + } + + + // Path Params + const localVarPath = '/public/v1/documents/{id}/linked-objects' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(linkedObjectCreateRequest, "LinkedObjectCreateRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Delete a linked object associated with a document. + * Delete Linked Object + * @param id Specify document ID. + * @param linkedObjectId Specify linked object ID. + */ + public async deleteLinkedObject(id: string, linkedObjectId: string, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError("DocumentLinkToCRMApi", "deleteLinkedObject", "id"); + } + + + // verify required parameter 'linkedObjectId' is not null or undefined + if (linkedObjectId === null || linkedObjectId === undefined) { + throw new RequiredError("DocumentLinkToCRMApi", "deleteLinkedObject", "linkedObjectId"); + } + + + // Path Params + const localVarPath = '/public/v1/documents/{id}/linked-objects/{linked_object_id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))) + .replace('{' + 'linked_object_id' + '}', encodeURIComponent(String(linkedObjectId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Get a list of documents connected to a linked object - an entity from an integration. + * List Documents by Linked Object + * @param entityId You can get entity id from your integration, for example, from a url of a HubSpot deal. + * @param entityType See the available entity types: https://developers.pandadoc.com/reference/link-service#examples-of-the-most-popular-crms + * @param provider See the available providers: https://developers.pandadoc.com/reference/link-service#examples-of-the-most-popular-crms + * @param orderBy + * @param ownerIds + */ + public async listDocumentsByLinkedObject(entityId: string, entityType: string, provider: string, orderBy?: string, ownerIds?: Array, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'entityId' is not null or undefined + if (entityId === null || entityId === undefined) { + throw new RequiredError("DocumentLinkToCRMApi", "listDocumentsByLinkedObject", "entityId"); + } + + + // verify required parameter 'entityType' is not null or undefined + if (entityType === null || entityType === undefined) { + throw new RequiredError("DocumentLinkToCRMApi", "listDocumentsByLinkedObject", "entityType"); + } + + + // verify required parameter 'provider' is not null or undefined + if (provider === null || provider === undefined) { + throw new RequiredError("DocumentLinkToCRMApi", "listDocumentsByLinkedObject", "provider"); + } + + + + + // Path Params + const localVarPath = '/public/v1/documents/linked-objects'; + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + // Query Params + if (entityId !== undefined) { + requestContext.setQueryParam("entity_id", ObjectSerializer.serialize(entityId, "string", "")); + } + + // Query Params + if (entityType !== undefined) { + requestContext.setQueryParam("entity_type", ObjectSerializer.serialize(entityType, "string", "")); + } + + // Query Params + if (provider !== undefined) { + requestContext.setQueryParam("provider", ObjectSerializer.serialize(provider, "string", "")); + } + + // Query Params + if (orderBy !== undefined) { + requestContext.setQueryParam("order_by", ObjectSerializer.serialize(orderBy, "string", "")); + } + + // Query Params + if (ownerIds !== undefined) { + const serializedParams = ObjectSerializer.serialize(ownerIds, "Array", ""); + for (const serializedParam of serializedParams) { + requestContext.appendQueryParam("owner_ids", serializedParam); + } + } + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Get a list of linked objects for the document. + * List Linked Objects + * @param id Specify document ID. + */ + public async listLinkedObjects(id: string, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError("DocumentLinkToCRMApi", "listLinkedObjects", "id"); + } + + + // Path Params + const localVarPath = '/public/v1/documents/{id}/linked-objects' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + +} + +export class DocumentLinkToCRMApiResponseProcessor { + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createLinkedObject + * @throws ApiException if the response code was not in [200, 299] + */ + public async createLinkedObjectWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: LinkedObjectCreateResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "LinkedObjectCreateResponse", "" + ) as LinkedObjectCreateResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("400", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("404", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: LinkedObjectCreateResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "LinkedObjectCreateResponse", "" + ) as LinkedObjectCreateResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteLinkedObject + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteLinkedObjectWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("204", response.httpStatusCode)) { + return new HttpInfo(response.httpStatusCode, response.headers, response.body, undefined); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("404", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("409", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ChangeDocumentStatus409Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ChangeDocumentStatus409Response", "" + ) as ChangeDocumentStatus409Response; + throw new ApiException(response.httpStatusCode, "Conflict", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: void = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "void", "" + ) as void; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listDocumentsByLinkedObject + * @throws ApiException if the response code was not in [200, 299] + */ + public async listDocumentsByLinkedObjectWithHttpInfo(response: ResponseContext): Promise >> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: Array = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "Array", "" + ) as Array; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("404", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("409", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ChangeDocumentStatus409Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ChangeDocumentStatus409Response", "" + ) as ChangeDocumentStatus409Response; + throw new ApiException(response.httpStatusCode, "Conflict", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: Array = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "Array", "" + ) as Array; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listLinkedObjects + * @throws ApiException if the response code was not in [200, 299] + */ + public async listLinkedObjectsWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: LinkedObjectListResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "LinkedObjectListResponse", "" + ) as LinkedObjectListResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("404", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("409", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ChangeDocumentStatus409Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ChangeDocumentStatus409Response", "" + ) as ChangeDocumentStatus409Response; + throw new ApiException(response.httpStatusCode, "Conflict", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: LinkedObjectListResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "LinkedObjectListResponse", "" + ) as LinkedObjectListResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + +} + diff --git a/src/apis/DocumentRecipientsApi.ts b/src/apis/DocumentRecipientsApi.ts index 7ea9c17..a216c7b 100644 --- a/src/apis/DocumentRecipientsApi.ts +++ b/src/apis/DocumentRecipientsApi.ts @@ -1,18 +1,24 @@ // TODO: better import syntax? -import {BaseAPIRequestFactory, RequiredError} from './baseapi'; +import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; -import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import { readRawBodyAndParse, tryParseRawBody } from '../pandadoc/httpErrorBody'; import {SecurityAuthentication} from '../auth/auth'; import { DocumentRecipientCreateRequest } from '../models/DocumentRecipientCreateRequest'; import { DocumentRecipientEditRequest } from '../models/DocumentRecipientEditRequest'; import { DocumentRecipientResponse } from '../models/DocumentRecipientResponse'; +import { ListDocuments401Response } from '../models/ListDocuments401Response'; +import { ListDocuments403Response } from '../models/ListDocuments403Response'; +import { ListDocuments429Response } from '../models/ListDocuments429Response'; +import { StatusDocument404Response } from '../models/StatusDocument404Response'; +import { UpdateDocument400Response } from '../models/UpdateDocument400Response'; /** * no description @@ -20,7 +26,7 @@ import { DocumentRecipientResponse } from '../models/DocumentRecipientResponse'; export class DocumentRecipientsApiRequestFactory extends BaseAPIRequestFactory { /** - * Adds recipient as CC to document + * Add a CC recipient to a document. > 🚧 Before you start > > To add a CC recipient, please ensure that: > > - You have the \'Can Manage Recipients\' permission. > - This recipient is already created in your contacts. If not, add them using the [Create Contact](https://developers.pandadoc.com/reference/create-contact) endpoint. To add a new CC recipient to a document, two parameters must be included in the request body: - `kind`: Set this parameter to `contact` to specify an individual contact. - `id`: Input the ID of the desired contact. To retrieve the contact\'s ID, use the [List Contacts](https://developers.pandadoc.com/reference/list-contacts) endpoint to access a list of all contacts, and then locate the desired contact by searching using the name or email address within the returned list. ### Document status You can add CC recipients in any document status except for the \'Expired\' (`document.voided`) and \'Declined\' (`document.declined`). > 📘 Email notification to access the document > > **Note**: When a document is in one of the following statuses: \'Sent\' (`document.sent`), \'Viewed\' (`document.viewed`), \'Completed\' (`document.completed`), \'Waiting for Payment\' (`document.waiting_pay`), or \'Paid\' (`document.paid`), any added CC recipient will receive an instant notification at their email address, allowing them access to the document. * Add Document Recipient * @param id Document UUID * @param documentRecipientCreateRequest @@ -72,7 +78,7 @@ export class DocumentRecipientsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -81,7 +87,7 @@ export class DocumentRecipientsApiRequestFactory extends BaseAPIRequestFactory { } /** - * Deleted recipient from document + * Remove a recipient from a document. > 🚧 Before you start > > Please ensure that you have the \'Can Manage Recipients\' permission. To remove a recipient from a document, you must specify their ID in the path parameter (note that this is different from their contact\'s ID). The recipient\'s ID can be retrieved via the [Document Details](https://developers.pandadoc.com/reference/document-details) endpoint. ### Document status - Removing a signer is only possible when the document is in the \'Draft\' (`document.draft`) status and this action will unassign all fields associated with that signer. - Removing a CC recipient is allowed in any document status except for the \'Expired\' (`document.voided`) and \'Declined\' (`document.declined`). If a CC recipient is removed, their access will be revoked. * Delete Document Recipient * @param id Document UUID * @param recipientId Recipient UUID @@ -123,7 +129,7 @@ export class DocumentRecipientsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -132,10 +138,10 @@ export class DocumentRecipientsApiRequestFactory extends BaseAPIRequestFactory { } /** - * Edit document recipient's details - * Edit Document Recipient - * @param id Document UUID - * @param recipientId Recipient UUID + * Modify recipient\'s personal details. > 🚧 Before you start > > To edit a recipient, please ensure that you have the \'Can Edit Document\' permission. Use this endpoint to easily fix typos in a recipient\'s name or email, or to change any other recipient information in a sent document. > 📘 Please note that changes made to a recipient within a document will also update their `Contact` information. However, these changes will not update information about this recipient in other documents where they have already been added. ### Document status - You can edit a signer in the following document statuses: - \'Draft\' (`document.draft`), - \'Waiting Approval\' (`document.waiting_approval`), - \'Approved\' (`document.approved`), - \'Rejected\' (`document.rejected`), - \'Sent\' (`document.sent`), - \'Viewed\' (`document.viewed`), but only until they have signed the document. - You can edit a CC recipient in any document status **except**: - \'Expired\' (`document.voided`), - \'Declined\' (`document.declined`). > 📘 Updating a recipient\'s email after sending a document > > **Note**: If you update a recipient\'s email address after sending a document, they will receive an instant notification at the new email address, allowing them access to the document. Access via the previous email will be revoked. ### Restrictions for updating a recipient\'s email - You cannot change emails of PandaDoc users. - You cannot use the email addresses of existing contacts. If you need to use an email from an existing contact, use the [Change Signer](https://developers.pandadoc.com/reference/change-signer) endpoint to replace a signer with this contact. + * Update Document Recipient + * @param id Document UUID. + * @param recipientId Recipient UUID. * @param documentRecipientEditRequest */ public async editDocumentRecipient(id: string, recipientId: string, documentRecipientEditRequest: DocumentRecipientEditRequest, _options?: Configuration): Promise { @@ -192,7 +198,7 @@ export class DocumentRecipientsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -201,8 +207,8 @@ export class DocumentRecipientsApiRequestFactory extends BaseAPIRequestFactory { } /** - * Replace document recipient with another contact - * Reassign Document Recipient + * Reassign fields to another signer. > 🚧 Before you start > > To change a signer in a document, please ensure that: > > - You have the \'Can Manage Recipients\' permission. > - New signer is already created in your contacts. If not, add them using the [Create Contact](https://developers.pandadoc.com/reference/create-contact) endpoint. You can reassign fields to another signer before the original signer has signed the document. You can choose any person except those recipients who have already signed the document. The endpoint path includes the `recipient_id` of the original signer and the request body must include the following two parameters: - `kind`: Set this parameter to `contact` to specify an individual contact. - `id`: Input the ID of the contact you want to use as a replacement for the original signer. To retrieve the contact\'s ID, use the [List Contacts](https://developers.pandadoc.com/reference/list-contacts) endpoint to access a list of all contacts, and then locate the desired contact by searching using the name or email address within the returned list. Once you execute the call to change the signer, the original signer will be entirely removed from the document. If you wish to retain the original signer as a CC recipient, you can re-add them using the [Add CC Recipient](https://developers.pandadoc.com/reference/add-new-recipient-cc) endpoint. > 🚧 Pre-filled fields > > If you change the signer in a document that has already been sent, the signer\'s pre-filled fields will be completely reset. In the \'Draft\' (`document.draft`) status, pre-filled fields will remain. + * Change Signer (Reassign Document Recipient) * @param id Document UUID * @param recipientId Recipient UUID * @param documentRecipientCreateRequest @@ -261,7 +267,7 @@ export class DocumentRecipientsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -280,49 +286,54 @@ export class DocumentRecipientsApiResponseProcessor { * @params response Response returned by the server for a request to addDocumentRecipient * @throws ApiException if the response code was not in [200, 299] */ - public async addDocumentRecipient(response: ResponseContext): Promise { + public async addDocumentRecipientWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: DocumentRecipientResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "DocumentRecipientResponse", "" ) as DocumentRecipientResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -331,10 +342,17 @@ export class DocumentRecipientsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "DocumentRecipientResponse", "" ) as DocumentRecipientResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -344,38 +362,42 @@ export class DocumentRecipientsApiResponseProcessor { * @params response Response returned by the server for a request to deleteDocumentRecipient * @throws ApiException if the response code was not in [200, 299] */ - public async deleteDocumentRecipient(response: ResponseContext): Promise { + public async deleteDocumentRecipientWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("204", response.httpStatusCode)) { - return; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, undefined); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -384,10 +406,17 @@ export class DocumentRecipientsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "void", "" ) as void; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -397,45 +426,50 @@ export class DocumentRecipientsApiResponseProcessor { * @params response Response returned by the server for a request to editDocumentRecipient * @throws ApiException if the response code was not in [200, 299] */ - public async editDocumentRecipient(response: ResponseContext): Promise { + public async editDocumentRecipientWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("204", response.httpStatusCode)) { - return; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, undefined); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -444,10 +478,17 @@ export class DocumentRecipientsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "void", "" ) as void; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -457,49 +498,54 @@ export class DocumentRecipientsApiResponseProcessor { * @params response Response returned by the server for a request to reassignDocumentRecipient * @throws ApiException if the response code was not in [200, 299] */ - public async reassignDocumentRecipient(response: ResponseContext): Promise { + public async reassignDocumentRecipientWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: DocumentRecipientResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "DocumentRecipientResponse", "" ) as DocumentRecipientResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -508,10 +554,18 @@ export class DocumentRecipientsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "DocumentRecipientResponse", "" ) as DocumentRecipientResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } } + diff --git a/src/apis/DocumentRemindersApi.ts b/src/apis/DocumentRemindersApi.ts new file mode 100644 index 0000000..b414367 --- /dev/null +++ b/src/apis/DocumentRemindersApi.ts @@ -0,0 +1,550 @@ +// TODO: better import syntax? +import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; +import {Configuration} from '../configuration'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; +import * as FormData from "form-data"; +import { URLSearchParams } from 'url'; +import {ObjectSerializer} from '../models/ObjectSerializer'; +import {ApiException} from './exception'; +import {canConsumeForm, isCodeInRange} from '../util'; +import { readRawBodyAndParse, tryParseRawBody } from '../pandadoc/httpErrorBody'; +import {SecurityAuthentication} from '../auth/auth'; + + +import { AutoReminders } from '../models/AutoReminders'; +import { DocumentAutoRemindersResponse } from '../models/DocumentAutoRemindersResponse'; +import { DocumentAutoRemindersResponse400 } from '../models/DocumentAutoRemindersResponse400'; +import { DocumentSendManualReminder200Response } from '../models/DocumentSendManualReminder200Response'; +import { DocumentSendManualReminder409Response } from '../models/DocumentSendManualReminder409Response'; +import { DocumentSendManualReminderRequest } from '../models/DocumentSendManualReminderRequest'; +import { ListDocuments401Response } from '../models/ListDocuments401Response'; +import { ListDocuments403Response } from '../models/ListDocuments403Response'; +import { ListDocuments429Response } from '../models/ListDocuments429Response'; +import { StatusDocument404Response } from '../models/StatusDocument404Response'; +import { StatusDocumentAutoReminder400Response } from '../models/StatusDocumentAutoReminder400Response'; +import { UpdateDocumentAutoRemindersRequest } from '../models/UpdateDocumentAutoRemindersRequest'; +import { UpdateDocumentAutoRemindersResponse } from '../models/UpdateDocumentAutoRemindersResponse'; + +/** + * no description + */ +export class DocumentRemindersApiRequestFactory extends BaseAPIRequestFactory { + + /** + * Sends manual reminders to one or more recipients of a specified document. + * Send Manual Reminder + * @param documentId The UUID of the document. + * @param documentSendManualReminderRequest + */ + public async createManualReminder(documentId: string, documentSendManualReminderRequest: DocumentSendManualReminderRequest, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'documentId' is not null or undefined + if (documentId === null || documentId === undefined) { + throw new RequiredError("DocumentRemindersApi", "createManualReminder", "documentId"); + } + + + // verify required parameter 'documentSendManualReminderRequest' is not null or undefined + if (documentSendManualReminderRequest === null || documentSendManualReminderRequest === undefined) { + throw new RequiredError("DocumentRemindersApi", "createManualReminder", "documentSendManualReminderRequest"); + } + + + // Path Params + const localVarPath = '/public/v1/documents/{document_id}/send-reminder' + .replace('{' + 'document_id' + '}', encodeURIComponent(String(documentId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(documentSendManualReminderRequest, "DocumentSendManualReminderRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Retrieves the current auto reminder configuration for a specified document. + * Document Auto Reminder Settings + * @param documentId The UUID of the document. + */ + public async getDocumentAutoReminderSettings(documentId: string, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'documentId' is not null or undefined + if (documentId === null || documentId === undefined) { + throw new RequiredError("DocumentRemindersApi", "getDocumentAutoReminderSettings", "documentId"); + } + + + // Path Params + const localVarPath = '/public/v1/documents/{document_id}/auto-reminders' + .replace('{' + 'document_id' + '}', encodeURIComponent(String(documentId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Retrieves the current auto reminder status per recipient for a specified document. Recipients who could not receive reminders due to validations (recipient groups, non-signers, etc.) will be skipped and not included in the response. + * Document Auto Reminder Status + * @param documentId The UUID of the document. + */ + public async statusDocumentAutoReminder(documentId: string, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'documentId' is not null or undefined + if (documentId === null || documentId === undefined) { + throw new RequiredError("DocumentRemindersApi", "statusDocumentAutoReminder", "documentId"); + } + + + // Path Params + const localVarPath = '/public/v1/documents/{document_id}/auto-reminders/status' + .replace('{' + 'document_id' + '}', encodeURIComponent(String(documentId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Configures automatic reminders for document recipients. These reminders are sent after the document\'s initial dispatch. Settings include enabling reminders, delivery method (email/SMS), initial delay, and recurrence frequency. + * Update Document Auto Reminder Settings + * @param documentId The UUID of the document. + * @param updateDocumentAutoRemindersRequest + */ + public async updateDocumentAutoReminderSettings(documentId: string, updateDocumentAutoRemindersRequest: UpdateDocumentAutoRemindersRequest, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'documentId' is not null or undefined + if (documentId === null || documentId === undefined) { + throw new RequiredError("DocumentRemindersApi", "updateDocumentAutoReminderSettings", "documentId"); + } + + + // verify required parameter 'updateDocumentAutoRemindersRequest' is not null or undefined + if (updateDocumentAutoRemindersRequest === null || updateDocumentAutoRemindersRequest === undefined) { + throw new RequiredError("DocumentRemindersApi", "updateDocumentAutoReminderSettings", "updateDocumentAutoRemindersRequest"); + } + + + // Path Params + const localVarPath = '/public/v1/documents/{document_id}/auto-reminders' + .replace('{' + 'document_id' + '}', encodeURIComponent(String(documentId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PATCH); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(updateDocumentAutoRemindersRequest, "UpdateDocumentAutoRemindersRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + +} + +export class DocumentRemindersApiResponseProcessor { + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createManualReminder + * @throws ApiException if the response code was not in [200, 299] + */ + public async createManualReminderWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: DocumentSendManualReminder200Response = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "DocumentSendManualReminder200Response", "" + ) as DocumentSendManualReminder200Response; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("404", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("409", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: DocumentSendManualReminder409Response = ObjectSerializer.deserialize( + rawBodyParsed, + "DocumentSendManualReminder409Response", "" + ) as DocumentSendManualReminder409Response; + throw new ApiException(response.httpStatusCode, "Returned when a manual reminder cannot be sent due to the document\'s current status. This occurs when: - The document has not been sent yet. - The document is in a final state (e.g., completed, paid, declined, or expired). - The document is in \"suggesting mode,\" during which reminders are disabled. ", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: DocumentSendManualReminder200Response = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "DocumentSendManualReminder200Response", "" + ) as DocumentSendManualReminder200Response; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getDocumentAutoReminderSettings + * @throws ApiException if the response code was not in [200, 299] + */ + public async getDocumentAutoReminderSettingsWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: AutoReminders = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "AutoReminders", "" + ) as AutoReminders; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("400", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: DocumentAutoRemindersResponse400 = ObjectSerializer.deserialize( + rawBodyParsed, + "DocumentAutoRemindersResponse400", "" + ) as DocumentAutoRemindersResponse400; + throw new ApiException(response.httpStatusCode, "Returned when auto reminder settings could not be retrieved from the document. This occurs when document is in a final state (e.g., completed, paid, declined, or expired). ", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("404", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: AutoReminders = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "AutoReminders", "" + ) as AutoReminders; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to statusDocumentAutoReminder + * @throws ApiException if the response code was not in [200, 299] + */ + public async statusDocumentAutoReminderWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: DocumentAutoRemindersResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "DocumentAutoRemindersResponse", "" + ) as DocumentAutoRemindersResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("400", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocumentAutoReminder400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocumentAutoReminder400Response", "" + ) as StatusDocumentAutoReminder400Response; + throw new ApiException(response.httpStatusCode, "Returned when auto reminder status could not be retrieved due to the document\'s current status or reminders configuration. This occurs when: - The document has not been sent yet. - The document is in a final state (e.g., completed, paid, declined, or expired). - The auto reminders are disabled in the document settings. ", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("404", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: DocumentAutoRemindersResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "DocumentAutoRemindersResponse", "" + ) as DocumentAutoRemindersResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to updateDocumentAutoReminderSettings + * @throws ApiException if the response code was not in [200, 299] + */ + public async updateDocumentAutoReminderSettingsWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: UpdateDocumentAutoRemindersResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "UpdateDocumentAutoRemindersResponse", "" + ) as UpdateDocumentAutoRemindersResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("400", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: DocumentAutoRemindersResponse400 = ObjectSerializer.deserialize( + rawBodyParsed, + "DocumentAutoRemindersResponse400", "" + ) as DocumentAutoRemindersResponse400; + throw new ApiException(response.httpStatusCode, "Returned when auto reminder settings could not be retrieved from the document. This occurs when document is in a final state (e.g., completed, paid, declined, or expired). ", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("404", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: UpdateDocumentAutoRemindersResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "UpdateDocumentAutoRemindersResponse", "" + ) as UpdateDocumentAutoRemindersResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + +} + diff --git a/src/apis/DocumentSectionsBundlesApi.ts b/src/apis/DocumentSectionsBundlesApi.ts new file mode 100644 index 0000000..a3b319e --- /dev/null +++ b/src/apis/DocumentSectionsBundlesApi.ts @@ -0,0 +1,790 @@ +// TODO: better import syntax? +import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; +import {Configuration} from '../configuration'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; +import * as FormData from "form-data"; +import { URLSearchParams } from 'url'; +import {ObjectSerializer} from '../models/ObjectSerializer'; +import {ApiException} from './exception'; +import {canConsumeForm, isCodeInRange} from '../util'; +import { readRawBodyAndParse, tryParseRawBody } from '../pandadoc/httpErrorBody'; +import {SecurityAuthentication} from '../auth/auth'; + + +import { ChangeDocumentStatus409Response } from '../models/ChangeDocumentStatus409Response'; +import { CreateDocument400Response } from '../models/CreateDocument400Response'; +import { ListDocuments401Response } from '../models/ListDocuments401Response'; +import { ListDocuments403Response } from '../models/ListDocuments403Response'; +import { ListDocuments429Response } from '../models/ListDocuments429Response'; +import { SectionInfoResponse } from '../models/SectionInfoResponse'; +import { StatusDocument404Response } from '../models/StatusDocument404Response'; +import { UpdateDocument400Response } from '../models/UpdateDocument400Response'; +import { UploadSectionListResponse } from '../models/UploadSectionListResponse'; +import { UploadSectionRequest } from '../models/UploadSectionRequest'; +import { UploadSectionResponse } from '../models/UploadSectionResponse'; +import { UploadSectionStatusResponse } from '../models/UploadSectionStatusResponse'; + +/** + * no description + */ +export class DocumentSectionsBundlesApiRequestFactory extends BaseAPIRequestFactory { + + /** + * Removes selected section from the document. + * Delete Document Section + * @param documentId Specify document ID. + * @param sectionId Specify section ID. + */ + public async deleteSection(documentId: string, sectionId: string, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'documentId' is not null or undefined + if (documentId === null || documentId === undefined) { + throw new RequiredError("DocumentSectionsBundlesApi", "deleteSection", "documentId"); + } + + + // verify required parameter 'sectionId' is not null or undefined + if (sectionId === null || sectionId === undefined) { + throw new RequiredError("DocumentSectionsBundlesApi", "deleteSection", "sectionId"); + } + + + // Path Params + const localVarPath = '/public/v1/documents/{document_id}/sections/{section_id}' + .replace('{' + 'document_id' + '}', encodeURIComponent(String(documentId))) + .replace('{' + 'section_id' + '}', encodeURIComponent(String(sectionId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Retrieve information about the sections within a document. + * List Document Sections + * @param documentId Document ID + */ + public async listSections(documentId: string, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'documentId' is not null or undefined + if (documentId === null || documentId === undefined) { + throw new RequiredError("DocumentSectionsBundlesApi", "listSections", "documentId"); + } + + + // Path Params + const localVarPath = '/public/v1/documents/{document_id}/sections' + .replace('{' + 'document_id' + '}', encodeURIComponent(String(documentId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Receive the upload status of the document and sections by their `upload_id`. Requesting document section upload status is useful to ensure a document section upload is in the expected state before calling additional API methods. In response, you receive an array with `sections_uuid`. You can receive information about each section using the [Document Section Info](https://developers.pandadoc.com/reference/document-section-info) endpoint. ```json \"section_uuids\": [ \"H8T8CJofGY6JwTsWsPuDEF\", \"8MwLaU4SaZywqLiDk26mDF\" ] ``` ## Available Document Section Upload Statuses The following is a complete list of all possible document statuses returned: | Document Status | Status Description | | :----------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `document_sections_upload.UPLOADED` | The document section upload process has just been created. It is in processing and will be in `document_sections_upload.PROCESSED` state momentarily. | | `document_sections_upload.PROCESSED` | The document sections upload is processed and the sections are already created in the document. All aspects of the document sections can be edited in this state. | | `document_sections_upload.ERROR` | Document section upload procces has been failed. For more information check error details in the response. | + * Document Section Upload Status + * @param documentId Document ID. + * @param uploadId Upload ID. + */ + public async sectionDetails(documentId: string, uploadId: string, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'documentId' is not null or undefined + if (documentId === null || documentId === undefined) { + throw new RequiredError("DocumentSectionsBundlesApi", "sectionDetails", "documentId"); + } + + + // verify required parameter 'uploadId' is not null or undefined + if (uploadId === null || uploadId === undefined) { + throw new RequiredError("DocumentSectionsBundlesApi", "sectionDetails", "uploadId"); + } + + + // Path Params + const localVarPath = '/public/v1/documents/{document_id}/sections/uploads/{upload_id}' + .replace('{' + 'document_id' + '}', encodeURIComponent(String(documentId))) + .replace('{' + 'upload_id' + '}', encodeURIComponent(String(uploadId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Receive information about each section. + * Document Section Details + * @param documentId Document ID. + * @param sectionId Section ID. + */ + public async sectionInfo(documentId: string, sectionId: string, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'documentId' is not null or undefined + if (documentId === null || documentId === undefined) { + throw new RequiredError("DocumentSectionsBundlesApi", "sectionInfo", "documentId"); + } + + + // verify required parameter 'sectionId' is not null or undefined + if (sectionId === null || sectionId === undefined) { + throw new RequiredError("DocumentSectionsBundlesApi", "sectionInfo", "sectionId"); + } + + + // Path Params + const localVarPath = '/public/v1/documents/{document_id}/sections/{section_id}' + .replace('{' + 'document_id' + '}', encodeURIComponent(String(documentId))) + .replace('{' + 'section_id' + '}', encodeURIComponent(String(sectionId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * With this endpoint, you can add a new section to an existing PandaDoc document (create a bundle). You can upload a section to the document using a PandaDoc template or a file by URL. > ⏱️ Document Section creation is a non-blocking (asynchronous) operation > > The document creation process may take some time. > > With a successful request, you receive a response with the created upload ID and status `document_sections_upload.uploaded`. After processing completes on our servers, usually a few seconds, the document moves to the `document_sections_upload.PROCESSED` status. ## Using a PandaDoc template
> 🚧 Current Version Limitations > > Images in sections are currently not supported. > 📘 Pricing tables note > > Each pricing table must have a unique name to populate it with data correctly. A PandaDoc template is a document template created and edited in the PandaDoc web application. Our [help center](https://support.pandadoc.com/en/articles/9714616-save-time-with-a-reusable-template) has further information on PandaDoc templates. If you don\'t have any PandaDoc Template yet, you can easily create one by clicking [Copy a Sample PandaDoc template](https://app.pandadoc.com/get-this-template/?pt=public_template&pub=eiC3a6qBVfEfbw7VCYgaeN). This will open the PandaDoc application in a new tab, copy the sample template into your account, and create a new document from the template.
## Using a File by URL
Using this endpoint you can add a section to the existing document. The section is created from a file you upload. The file can be a PDF, DocX, or RTF. > 📘 We\'ve prepared two samples that you can use to test the request. > Download them here: > > - [Download a Sample PDF with Form Fields](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) > - [Download a Sample PDF with Field Tags](https://5132871.fs1.hubspotusercontent-na1.net/hubfs/5132871/SamplePandaDocPdf_FieldTags_updated.pdf) > ❗️ Limitations > > * This method does not support multiple documents. > * The maximum supported file size is 50 MB. API returns \"413 Request entity too large\" in case of bigger files. > * PandaDoc does not support creating document from a PDF with encrypted files (to check whether a file is encrypted or not, try Get info -> Secure: Password Encrypted). ### PDF Form Fields PandaDoc recognizes PDF form fields. To enable this feature, pass the optional `parse_form_fields` value as `true` when making a create document section API call. We support Text fields, Dropdowns, and Signature fields. If you would like to pass additional parameters to configure PDF form fields, use the PDF field name as an optId. You can use a PDF editor such as Adobe Acrobat, Foxit to get and edit field names in your PDF. [**Download a Sample PDF with Form Fields**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) ### PDF/DocX/RTF Field Tags This parsing format allows a word processor such as [Microsoft Word](https://support.office.com/en-us/article/Save-as-PDF-d85416c5-7d77-4fd6-a216-6f4bf7c7c110?ui=en-US&rs=en-US&ad=US) or [Google Docs](https://support.google.com/drive/answer/2423534?co=GENIE.Platform%3DDesktop&hl=en) to prepare a document and save it in PDF, DocX or RTF format. Within the text, PandaDoc parses field tags. A field tag starts and ends with brackets. The field tag includes basic information on how to create a form field in the PandaDoc document. The request JSON object `optId` can also extend this information for even greater control. Here is an example of how the field tag in a PDF/DocX/RTF is converted to a text field in the PandaDoc document: ![](https://files.readme.io/38afedf-ex3.png \"ex3.png\") [**Download a Sample PDF with Field Tags**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FieldTags.pdf) #### PDF Field Tag Key ![](https://files.readme.io/a81fbf1-field-tag-structure.png \"field-tag-structure.png\") | Number | Key | Description | Example | | :----- | :---------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------- | | 1 | `fieldType` | Field type from the table documented below | `signature`, or `s` for shorthand | | 2 | `*` | Optional `*` denotes the field is not required | `*` | | 3 | `role` | Role name. Associate the field tag with a recipient role. Roles must be assigned to recipients in the request body. In this case we are using role `s1` to keep the length short and denote the concept of \"signer 1\". `s1` would be the value passed as role in a recipient JSON object. | `s1` | | 4 | `optId` | Optional field Id. Specify more information about the field tag within the post request by using this id. | `sigBox17` | | 5 | `_____` | Use underscores to widen the field if desired. The form fields in PandaDoc will scale to the length and size of your field tag. | `_____` | > 🚧 Role names restrictions > > Underscores are not supported in role names for a file with a Field Tag. #### PDF/DocX/RTF Field Tag Supported Types | Field Type | Short Notation | Is PandaDoc Field | | :---------- | :------------- | :---------------- | | `textfield` | `t` | Field | | `checkbox` | `c` | Field | | `signature` | `s` | Field | | `date` | `d` | Field | | `initials` | `i` | Field | | `dropdown` | `dd` | Field | ```json Field Tags Example \"fields\": { \"textfield\": { \"value\": \"Jane\", \"role\": \"user\" }, \"dropdown\": { \"value\": \"opt1\", \"role\": \"user\", \"options\":[ \"opt1\", \"opt2\", \"opt3\" ] }, \"checkbox\": { \"value\": true, \"role\": \"user\" }, \"date\":{ \"value\": \"2022-05-20\", \"role\": \"user\" }, \"signature\": { \"value\": \"\", \"role\": \"user\" } } ``` > 📘 Fields in PandaDoc > > The following article explains how to use Fields: [Everything you need to know about Fields](https://support.pandadoc.com/en/articles/9714583-fields) ### Signing order Set a signing order for document section sections created from a file. ```json \"recipients\": [ { \"email\": \"josh@example.com\", \"first_name\": \"Josh\", \"last_name\": \"Ron\", \"role\": \"user\", \"signing_order\": 1 } ] ``` > 📘 Signing order in PandaDoc > > The following article explains how to use signing order: [How to use signing order](https://support.pandadoc.com/en/articles/9714771-signing-order) ### Error handling | Error description | Type | Root cause | |---|---|---| | Document version 1 is not supported. | Validation errors: Form fields | The creation document section is supported only for document version 2 | | PDF content hasn\'t been processed: document is broken or locked | Processing errors: Failed to process document content | Document converter service can’t process PDF. This may be caused by locked PDF or if it’s broken. | | Error occurred while parsing PDF field tags. Please try PDF flattening or reach out to support | Processing errors: Field tag / Form field validation error | Doc converter managed to parse PDF and extract tags, but at least 1 of them is invalid (having negative position, for example). Usually we recommend PDF flattening and it helps | | No role=\'{role}\' for field tag specified in `recipients` found, roles passed were {roles} | Validation errors: Field tags | Role is invalid. When the role specified in field tag is empty or wasn’t provided in a payload for any recipient | | All field tags within PDF must be declared within `fields`  object of the JSON Payload. No field with optId=\'{optid}\' found in fields object, fields passed were {optids} | Validation errors: Field tags | Label is invalid. Occurs when **optId** specified in field tag is empty or no field with **name = optId** was provided in a payload | | One of field tags in PDF with type=\'{field}\' doesn\'t have a role | Validation errors: Field tags | Field tag in PDF has no role. One of field tags in PDF with type=% doesn\'t have a role. | | Role for form field with name=\'{role}\' is not provided in payload | Validation errors: Form fields | Role for form field with ‘name’ is not provided. Occurs when `role` for form field with name=%s  is not provided in payload | | Field for form field with name=\'{name}\' is not specified in payload, available names are {names} | Validation errors: Form fields | Field ‘name’ is not specified in payload. Occurs when no field with name = form field name was provided in a payload | | No role=\'{role}\' for form field specified in \'recipients\' found, roles passed were {roles}\" | Validation errors: Form fields | Failed to resolve field actor for `role` in form field with ‘name’.   Occurs when role from the form field is not found in recipient’s from payload | | Failed to download file from link {url}. | Source errors | Error on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload | | Failed to download file from link {url} (status code: {status code}) | Source errors | Error with HTTP status code on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload - remote server responded with the HTTP status code | | Content type=\'{type}\' is not supported, available types are {types} | Source errors | Content type is not supported.  Content type should be one of the following: PDF, ZIP, doc, docx, RTF | | The maximum file size is exceeded, limit is {limit} MB | Source errors | The file size has exceeded the allowed limits. An error occurred while trying to download a file that is too large (limit is 50M) |
+ * Create Document Section + * @param documentId Document ID + * @param uploadSectionRequest + * @param mergeFieldScope Determines how the fields are mapped when creating a section. * document: Default value. The fields of the entire document are updated. * upload: Only the fields from the created section are updated. The merge field is appended with the upload ID. + */ + public async uploadSection(documentId: string, uploadSectionRequest: UploadSectionRequest, mergeFieldScope?: 'document' | 'upload', _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'documentId' is not null or undefined + if (documentId === null || documentId === undefined) { + throw new RequiredError("DocumentSectionsBundlesApi", "uploadSection", "documentId"); + } + + + // verify required parameter 'uploadSectionRequest' is not null or undefined + if (uploadSectionRequest === null || uploadSectionRequest === undefined) { + throw new RequiredError("DocumentSectionsBundlesApi", "uploadSection", "uploadSectionRequest"); + } + + + + // Path Params + const localVarPath = '/public/v1/documents/{document_id}/sections/uploads' + .replace('{' + 'document_id' + '}', encodeURIComponent(String(documentId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + // Query Params + if (mergeFieldScope !== undefined) { + requestContext.setQueryParam("merge_field_scope", ObjectSerializer.serialize(mergeFieldScope, "'document' | 'upload'", "")); + } + + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(uploadSectionRequest, "UploadSectionRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * With this endpoint, you can add a new section to an existing PandaDoc document (create a bundle). The section is created from a file you upload. The file can be a PDF, DocX, or RTF. > 📘 We\'ve prepared two samples that you can use to test the request. > Download them here: > > - [Download a Sample PDF with Form Fields](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) > - [Download a Sample PDF with Field Tags](https://5132871.fs1.hubspotusercontent-na1.net/hubfs/5132871/SamplePandaDocPdf_FieldTags_updated.pdf) > 🚧 Usage specifics > > 1. This method uses a `multipart/form-data` request type instead of the `application/json` typically found in the PandaDoc API. This is to accommodate the upload of the included document. > 2. You can send a URL instead of a file in the document creation request. > In this case, you need to use the `application/json` content type and add the URL parameter in the body request. As an example, see [Create from public PDF](https://developers.pandadoc.com/docs/create-and-send-a-document-from-a-publicly-available-pdf) guide for more details. > 3. A file you upload is not stored in your PandaDoc account, so you have to upload it with every request. > ❗️ Limitations > > 1. This method does not support multiple documents. > 2. The maximum supported file size is 50 MB. API returns \"413 Request entity too large\" in case of bigger files. > 3. PandaDoc does not support creating document from a PDF with encrypted files (to check whether a file is encrypted or not, try Get info -> Secure: Password Encrypted). > ⏱️ Document Section creation is a non-blocking (asynchronous) operation > > The document creation process may take some time. > > With a successful request, you receive a response with the created upload ID and status `document_sections_upload.uploaded`. After processing completes on our servers, usually a few seconds, the document moves to the `document_sections_upload.PROCESSED` status. ## PDF Form Fields PandaDoc recognizes PDF form fields. To enable this feature, pass the optional `parse_form_fields` value as `true` when making a create document section API call. We support Text fields, Dropdowns, and Signature fields. If you would like to pass additional parameters to configure PDF form fields, use the PDF field name as an optId. You can use a PDF editor such as Adobe Acrobat, Foxit to get and edit field names in your PDF. [**Download a Sample PDF with Form Fields**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) ## PDF/DocX/RTF Field Tags This parsing format allows a word processor such as [Microsoft Word](https://support.office.com/en-us/article/Save-as-PDF-d85416c5-7d77-4fd6-a216-6f4bf7c7c110?ui=en-US&rs=en-US&ad=US) or [Google Docs](https://support.google.com/drive/answer/2423534?co=GENIE.Platform%3DDesktop&hl=en) to prepare a document and save it in PDF, DocX or RTF format. Within the text, PandaDoc parses field tags. A field tag starts and ends with brackets. The field tag includes basic information on how to create a form field in the PandaDoc document. The request JSON object `optId` can also extend this information for even greater control. Here is an example of how the field tag in a PDF/DocX/RTF is converted to a text field in the PandaDoc document: ![](https://files.readme.io/38afedf-ex3.png \"ex3.png\") [**Download a Sample PDF with Field Tags**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FieldTags.pdf)
### PDF Field Tag Key ![](https://files.readme.io/a81fbf1-field-tag-structure.png \"field-tag-structure.png\") | Number | Key | Description | Example | | :----- | :---------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------- | | 1 | `fieldType` | Field type from the table documented below | `signature`, or `s` for shorthand | | 2 | `*` | Optional `*` denotes the field is not required | `*` | | 3 | `role` | Role name. Associate the field tag with a recipient role. Roles must be assigned to recipients in the request body. In this case we are using role `s1` to keep the length short and denote the concept of \"signer 1\". `s1` would be the value passed as role in a recipient JSON object. | `s1` | | 4 | `optId` | Optional field Id. Specify more information about the field tag within the post request by using this id. | `sigBox17` | | 5 | `_____` | Use underscores to widen the field if desired. The form fields in PandaDoc will scale to the length and size of your field tag. | `_____` | > 🚧 Role names restrictions > > Underscores are not supported in role names for a file with a Field Tag. ### PDF/DocX/RTF Field Tag Supported Types | Field Type | Short Notation | Is PandaDoc Field | | :---------- | :------------- | :---------------- | | `textfield` | `t` | Field | | `checkbox` | `c` | Field | | `signature` | `s` | Field | | `date` | `d` | Field | | `initials` | `i` | Field | | `dropdown` | `dd` | Field | > 📘 Fields in PandaDoc > > The following article explains how to use Fields: [Everything you need to know about Fields](https://support.pandadoc.com/en/articles/9714583-fields) ```json Field Tags Example \"fields\": { \"textfield\": { \"value\": \"Jane\", \"role\": \"user\" }, \"dropdown\": { \"value\": \"opt1\", \"role\": \"user\", \"options\":[ \"opt1\", \"opt2\", \"opt3\" ] }, \"checkbox\": { \"value\": true, \"role\": \"user\" }, \"date\":{ \"value\": \"2022-05-20\", \"role\": \"user\" }, \"signature\": { \"value\": \"\", \"role\": \"user\" } } ```
## Signing order Set a signing order for document section sections created from a file. ```json \"recipients\": [ { \"email\": \"josh@example.com\", \"first_name\": \"Josh\", \"last_name\": \"Ron\", \"role\": \"user\", \"signing_order\": 1 } ] ``` ## Error handling | Error description | Type | Root cause | |---|---|---| | Document version 1 is not supported. | Validation errors: Form fields | The creation document section is supported only for document version 2 | | PDF content hasn\'t been processed: document is broken or locked | Processing errors: Failed to process document content | Document converter service can’t process PDF. This may be caused by locked PDF or if it’s broken. | | Error occurred while parsing PDF field tags. Please try PDF flattening or reach out to support | Processing errors: Field tag / Form field validation error | Doc converter managed to parse PDF and extract tags, but at least 1 of them is invalid (having negative position, for example). Usually we recommend PDF flattening and it helps | | No role=\'{role}\' for field tag specified in `recipients` found, roles passed were {roles} | Validation errors: Field tags | Role is invalid. When the role specified in field tag is empty or wasn’t provided in a payload for any recipient | | All field tags within PDF must be declared within `fields`  object of the JSON Payload. No field with optId=\'{optid}\' found in fields object, fields passed were {optids} | Validation errors: Field tags | Label is invalid. Occurs when **optId** specified in field tag is empty or no field with **name = optId** was provided in a payload | | One of field tags in PDF with type=\'{field}\' doesn\'t have a role | Validation errors: Field tags | Field tag in PDF has no role. One of field tags in PDF with type=% doesn\'t have a role. | | Role for form field with name=\'{role}\' is not provided in payload | Validation errors: Form fields | Role for form field with ‘name’ is not provided. Occurs when `role` for form field with name=%s  is not provided in payload | | Field for form field with name=\'{name}\' is not specified in payload, available names are {names} | Validation errors: Form fields | Field ‘name’ is not specified in payload. Occurs when no field with name = form field name was provided in a payload | | No role=\'{role}\' for form field specified in \'recipients\' found, roles passed were {roles}\" | Validation errors: Form fields | Failed to resolve field actor for `role` in form field with ‘name’.   Occurs when role from the form field is not found in recipient’s from payload | | Failed to download file from link {url}. | Source errors | Error on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload | | Failed to download file from link {url} (status code: {status code}) | Source errors | Error with HTTP status code on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload - remote server responded with the HTTP status code | | Content type=\'{type}\' is not supported, available types are {types} | Source errors | Content type is not supported.  Content type should be one of the following: PDF, ZIP, doc, docx, RTF | | The maximum file size is exceeded, limit is {limit} MB | Source errors | The file size has exceeded the allowed limits. An error occurred while trying to download a file that is too large (limit is 50M) | + * Create Document Section from File Upload + * @param documentId Document ID + * @param mergeFieldScope Determines how the fields are mapped when creating a section. * document: Default value. The fields of the entire document are updated. * upload: Only the fields from the created section are updated. The merge field is appended with the upload ID. + * @param file Binary PDF/DocX/RTF File. + * @param data JSON as a multipart/form-data string. + */ + public async uploadSectionWithUpload(documentId: string, mergeFieldScope?: 'document' | 'upload', file?: HttpFile, data?: UploadSectionRequest, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'documentId' is not null or undefined + if (documentId === null || documentId === undefined) { + throw new RequiredError("DocumentSectionsBundlesApi", "uploadSectionWithUpload", "documentId"); + } + + + + + + // Path Params + const localVarPath = '/public/v1/documents/{document_id}/sections/uploads?upload' + .replace('{' + 'document_id' + '}', encodeURIComponent(String(documentId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + // Query Params + if (mergeFieldScope !== undefined) { + requestContext.setQueryParam("merge_field_scope", ObjectSerializer.serialize(mergeFieldScope, "'document' | 'upload'", "")); + } + + // Form Params + const useForm = canConsumeForm([ + 'multipart/form-data', + ]); + + let localVarFormParams + if (useForm) { + localVarFormParams = new FormData(); + } else { + localVarFormParams = new URLSearchParams(); + } + + if (file !== undefined) { + // TODO: replace .append with .set + if (localVarFormParams instanceof FormData) { + localVarFormParams.append('file', file.data, file.name); + } + } + if (data !== undefined) { + // TODO: replace .append with .set + localVarFormParams.append('data', data as any); + } + + requestContext.setBody(localVarFormParams); + + if(!useForm) { + const contentType = ObjectSerializer.getPreferredMediaType([ + "multipart/form-data" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + } + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + +} + +export class DocumentSectionsBundlesApiResponseProcessor { + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteSection + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteSectionWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("204", response.httpStatusCode)) { + return new HttpInfo(response.httpStatusCode, response.headers, response.body, undefined); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("404", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: void = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "void", "" + ) as void; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listSections + * @throws ApiException if the response code was not in [200, 299] + */ + public async listSectionsWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: UploadSectionListResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "UploadSectionListResponse", "" + ) as UploadSectionListResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("400", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: UploadSectionListResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "UploadSectionListResponse", "" + ) as UploadSectionListResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to sectionDetails + * @throws ApiException if the response code was not in [200, 299] + */ + public async sectionDetailsWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: UploadSectionStatusResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "UploadSectionStatusResponse", "" + ) as UploadSectionStatusResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("404", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("409", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ChangeDocumentStatus409Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ChangeDocumentStatus409Response", "" + ) as ChangeDocumentStatus409Response; + throw new ApiException(response.httpStatusCode, "Conflict", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: UploadSectionStatusResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "UploadSectionStatusResponse", "" + ) as UploadSectionStatusResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to sectionInfo + * @throws ApiException if the response code was not in [200, 299] + */ + public async sectionInfoWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: SectionInfoResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SectionInfoResponse", "" + ) as SectionInfoResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("404", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("409", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ChangeDocumentStatus409Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ChangeDocumentStatus409Response", "" + ) as ChangeDocumentStatus409Response; + throw new ApiException(response.httpStatusCode, "Conflict", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: SectionInfoResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SectionInfoResponse", "" + ) as SectionInfoResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to uploadSection + * @throws ApiException if the response code was not in [200, 299] + */ + public async uploadSectionWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("201", response.httpStatusCode)) { + const body: UploadSectionResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "UploadSectionResponse", "" + ) as UploadSectionResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("400", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: CreateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "CreateDocument400Response", "" + ) as CreateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: UploadSectionResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "UploadSectionResponse", "" + ) as UploadSectionResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to uploadSectionWithUpload + * @throws ApiException if the response code was not in [200, 299] + */ + public async uploadSectionWithUploadWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("201", response.httpStatusCode)) { + const body: UploadSectionResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "UploadSectionResponse", "" + ) as UploadSectionResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("400", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: CreateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "CreateDocument400Response", "" + ) as CreateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: UploadSectionResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "UploadSectionResponse", "" + ) as UploadSectionResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + +} + diff --git a/src/apis/DocumentSettingsApi.ts b/src/apis/DocumentSettingsApi.ts new file mode 100644 index 0000000..a196b16 --- /dev/null +++ b/src/apis/DocumentSettingsApi.ts @@ -0,0 +1,203 @@ +// TODO: better import syntax? +import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; +import {Configuration} from '../configuration'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; +import * as FormData from "form-data"; +import { URLSearchParams } from 'url'; +import {ObjectSerializer} from '../models/ObjectSerializer'; +import {ApiException} from './exception'; +import {canConsumeForm, isCodeInRange} from '../util'; +import { readRawBodyAndParse, tryParseRawBody } from '../pandadoc/httpErrorBody'; +import {SecurityAuthentication} from '../auth/auth'; + + +import { DocumentSettingsResponse } from '../models/DocumentSettingsResponse'; +import { UpdateDocumentSettingsRequest } from '../models/UpdateDocumentSettingsRequest'; + +/** + * no description + */ +export class DocumentSettingsApiRequestFactory extends BaseAPIRequestFactory { + + /** + * Retrieves the settings for a specified document. Supported fields: language, qualified_electronic_signature, expires_in (in days). + * Get document settings + * @param documentId Unique identifier of the document to retrieve settings for. + */ + public async documentSettingsGet(documentId: string, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'documentId' is not null or undefined + if (documentId === null || documentId === undefined) { + throw new RequiredError("DocumentSettingsApi", "documentSettingsGet", "documentId"); + } + + + // Path Params + const localVarPath = '/public/v2/documents/{document_id}/settings' + .replace('{' + 'document_id' + '}', encodeURIComponent(String(documentId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Updates the settings for a specified document. Supported fields: language, qualified_electronic_signature, expires_in (in days). + * Update document settings + * @param documentId Unique identifier of the document to update settings for. + * @param updateDocumentSettingsRequest + */ + public async documentSettingsUpdate(documentId: string, updateDocumentSettingsRequest: UpdateDocumentSettingsRequest, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'documentId' is not null or undefined + if (documentId === null || documentId === undefined) { + throw new RequiredError("DocumentSettingsApi", "documentSettingsUpdate", "documentId"); + } + + + // verify required parameter 'updateDocumentSettingsRequest' is not null or undefined + if (updateDocumentSettingsRequest === null || updateDocumentSettingsRequest === undefined) { + throw new RequiredError("DocumentSettingsApi", "documentSettingsUpdate", "updateDocumentSettingsRequest"); + } + + + // Path Params + const localVarPath = '/public/v2/documents/{document_id}/settings' + .replace('{' + 'document_id' + '}', encodeURIComponent(String(documentId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PATCH); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(updateDocumentSettingsRequest, "UpdateDocumentSettingsRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + +} + +export class DocumentSettingsApiResponseProcessor { + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to documentSettingsGet + * @throws ApiException if the response code was not in [200, 299] + */ + public async documentSettingsGetWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: DocumentSettingsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "DocumentSettingsResponse", "" + ) as DocumentSettingsResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: DocumentSettingsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "DocumentSettingsResponse", "" + ) as DocumentSettingsResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to documentSettingsUpdate + * @throws ApiException if the response code was not in [200, 299] + */ + public async documentSettingsUpdateWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: DocumentSettingsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "DocumentSettingsResponse", "" + ) as DocumentSettingsResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: DocumentSettingsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "DocumentSettingsResponse", "" + ) as DocumentSettingsResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + +} + diff --git a/src/apis/DocumentsApi.ts b/src/apis/DocumentsApi.ts index 222044a..804e7bf 100644 --- a/src/apis/DocumentsApi.ts +++ b/src/apis/DocumentsApi.ts @@ -1,22 +1,33 @@ // TODO: better import syntax? -import {BaseAPIRequestFactory, RequiredError} from './baseapi'; +import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; -import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import { readRawBodyAndParse, tryParseRawBody } from '../pandadoc/httpErrorBody'; import {SecurityAuthentication} from '../auth/auth'; +import { AppendCLIDataRequest } from '../models/AppendCLIDataRequest'; +import { AppendCLIDataResponse } from '../models/AppendCLIDataResponse'; +import { ChangeDocumentStatus409Response } from '../models/ChangeDocumentStatus409Response'; +import { CreateDocument400Response } from '../models/CreateDocument400Response'; +import { CreateDocumentEditingSession201Response } from '../models/CreateDocumentEditingSession201Response'; +import { DeleteNotarizationRequest404Response } from '../models/DeleteNotarizationRequest404Response'; +import { DocumentCreateByPdfRequest } from '../models/DocumentCreateByPdfRequest'; import { DocumentCreateLinkRequest } from '../models/DocumentCreateLinkRequest'; import { DocumentCreateLinkResponse } from '../models/DocumentCreateLinkResponse'; import { DocumentCreateRequest } from '../models/DocumentCreateRequest'; import { DocumentCreateResponse } from '../models/DocumentCreateResponse'; import { DocumentDetailsResponse } from '../models/DocumentDetailsResponse'; +import { DocumentDocxExport } from '../models/DocumentDocxExport'; +import { DocumentESignDisclosure } from '../models/DocumentESignDisclosure'; import { DocumentListResponse } from '../models/DocumentListResponse'; import { DocumentOrderingFieldsEnum } from '../models/DocumentOrderingFieldsEnum'; +import { DocumentRevertToDraftResponse } from '../models/DocumentRevertToDraftResponse'; import { DocumentSendRequest } from '../models/DocumentSendRequest'; import { DocumentSendResponse } from '../models/DocumentSendResponse'; import { DocumentStatusChangeRequest } from '../models/DocumentStatusChangeRequest'; @@ -25,9 +36,17 @@ import { DocumentStatusResponse } from '../models/DocumentStatusResponse'; import { DocumentTransferAllOwnershipRequest } from '../models/DocumentTransferAllOwnershipRequest'; import { DocumentTransferOwnershipRequest } from '../models/DocumentTransferOwnershipRequest'; import { DocumentUpdateRequest } from '../models/DocumentUpdateRequest'; -import { LinkedObjectCreateRequest } from '../models/LinkedObjectCreateRequest'; -import { LinkedObjectCreateResponse } from '../models/LinkedObjectCreateResponse'; -import { LinkedObjectListResponse } from '../models/LinkedObjectListResponse'; +import { DocxExportTaskResponse } from '../models/DocxExportTaskResponse'; +import { EditingSessionRequest } from '../models/EditingSessionRequest'; +import { ListDocuments400Response } from '../models/ListDocuments400Response'; +import { ListDocuments401Response } from '../models/ListDocuments401Response'; +import { ListDocuments403Response } from '../models/ListDocuments403Response'; +import { ListDocuments429Response } from '../models/ListDocuments429Response'; +import { ListNotaries403Response } from '../models/ListNotaries403Response'; +import { ListNotaries429Response } from '../models/ListNotaries429Response'; +import { SearchCatalogItems401Response } from '../models/SearchCatalogItems401Response'; +import { StatusDocument404Response } from '../models/StatusDocument404Response'; +import { UpdateDocument400Response } from '../models/UpdateDocument400Response'; /** * no description @@ -35,7 +54,69 @@ import { LinkedObjectListResponse } from '../models/LinkedObjectListResponse'; export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { /** - * Document status change + * Appends a Content Library Item (CLI) to a document and provides a name mapping for its content blocks. + * Append Content Library Item to a document + * @param id Specify document id. + * @param appendCLIDataRequest + */ + public async appendContentLibraryItemToDocument(id: string, appendCLIDataRequest: AppendCLIDataRequest, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError("DocumentsApi", "appendContentLibraryItemToDocument", "id"); + } + + + // verify required parameter 'appendCLIDataRequest' is not null or undefined + if (appendCLIDataRequest === null || appendCLIDataRequest === undefined) { + throw new RequiredError("DocumentsApi", "appendContentLibraryItemToDocument", "appendCLIDataRequest"); + } + + + // Path Params + const localVarPath = '/public/v1/documents/{id}/append-content-library-item' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(appendCLIDataRequest, "AppendCLIDataRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * PandaDoc has eight document statuses, but you can manually set your document status to only four: ### Document statuses - Completed - `document.completed` - API code `2` - Expired - `document.voided` - code `11` - Paid - `document.paid` - code `10`. **Important**: You can only set it if you have a payment app connected. - Declined - `document.declined` - code `12` > 🚧 Pass a numeric code for the corresponding document status, for example, `2` for `document.completed`. Find more details in [\\[Editor 2.0\\] Manually change document status](https://support.pandadoc.com/en/articles/9714842-manually-change-document-status) topic. | Current Status | To Completed: | To Expired: | To Paid: | To Declined: | |----------------|---------------|-------------|----------|--------------| | Draft | YES | NO | YES | YES | | Approved | NO | NO | NO | NO | | Sent | YES | YES | NO | YES | | Viewed | YES | YES | NO | YES | | Completed (Auto) | NO | NO | NO | YES | | Waithing for payment | NO | NO | YES | YES | | Paid | NO | NO | NO | NO | | Expired | YES | NO | YES | YES | | Declined | YES | NO | YES | NO | > ✅ - from `document.voided` to `document.paid` > > ❌ - from `document.paid` to `document.voided` + * Document Status Change * @param id Specify document ID. * @param documentStatusChangeRequest */ @@ -65,9 +146,7 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ - "application/json", - - "multipart/form-data" + "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( @@ -88,7 +167,85 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * PandaDoc has eight document statuses, but you can manually set your document status to only four: ### Document statuses - Completed - `document.completed` - API code `2` - Expired - `document.voided` - code `11` - Paid - `document.paid` - code `10`. **Important**: You can only set it if you have a payment app connected. - Declined - `document.declined` - code `12` > 🚧 Pass a numeric code for the corresponding document status, for example, `2` for `document.completed`. Find more details in [\\[Editor 2.0\\] Manually change document status](https://support.pandadoc.com/en/articles/9714842-manually-change-document-status) topic. | Current Status | To Completed: | To Expired: | To Paid: | To Declined: | |----------------|---------------|-------------|----------|--------------| | Draft | YES | NO | YES | YES | | Approved | NO | NO | NO | NO | | Sent | YES | YES | NO | YES | | Viewed | YES | YES | NO | YES | | Completed (Auto) | NO | NO | NO | YES | | Waithing for payment | NO | NO | YES | YES | | Paid | NO | NO | NO | NO | | Expired | YES | NO | YES | YES | | Declined | YES | NO | YES | NO | > ✅ - from `document.voided` to `document.paid` > > ❌ - from `document.paid` to `document.voided` + * Document Status Change with Upload + * @param id Specify document ID. + * @param file Binary attachment file + * @param data JSON as a multipart/form-data string. + */ + public async changeDocumentStatusWithUpload(id: string, file?: HttpFile, data?: DocumentStatusChangeRequest, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError("DocumentsApi", "changeDocumentStatusWithUpload", "id"); + } + + + + + // Path Params + const localVarPath = '/public/v1/documents/{id}/status?upload' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PATCH); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + // Form Params + const useForm = canConsumeForm([ + 'multipart/form-data', + ]); + + let localVarFormParams + if (useForm) { + localVarFormParams = new FormData(); + } else { + localVarFormParams = new URLSearchParams(); + } + + if (file !== undefined) { + // TODO: replace .append with .set + if (localVarFormParams instanceof FormData) { + localVarFormParams.append('file', file.data, file.name); + } + } + if (data !== undefined) { + // TODO: replace .append with .set + localVarFormParams.append('data', data as any); + } + + requestContext.setBody(localVarFormParams); + + if(!useForm) { + const contentType = ObjectSerializer.getPreferredMediaType([ + "multipart/form-data" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + } + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -97,11 +254,13 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { } /** - * Create document - * @param documentCreateRequest Use a PandaDoc template or an existing PDF to create a document. See the creation request examples [by template](/schemas/DocumentCreateByTemplateRequest) and [by pdf](/schemas/DocumentCreateByPdfRequest) - * @param editorVer Set this parameter as `ev1` if you want to create a document from PDF with Classic Editor when both editors are enabled for the workspace. + * ## Create from a template > See the [Create document from template](https://developers.pandadoc.com/docs/create-document-from-template) tutorial for details on how to use this endpoint, as well as a sample template. ## Create from a URL > See the [Create from public PDF](https://developers.pandadoc.com/docs/create-and-send-a-document-from-a-publicly-available-pdf) guide for info about roles and fields, as well as PDF examples. + * Create Document + * @param documentCreateRequest + * @param editorVer Set this parameter as `ev1` if you want to create a document from PDF with Classic Editor when both editors are enabled for the workspace. (@deprecated) + * @param useFormFieldProperties Set this parameter as `yes` or `1` or `true` (only when upload pdf with form fields) if you want to respect form fields properties, like `required`. */ - public async createDocument(documentCreateRequest: DocumentCreateRequest, editorVer?: string, _options?: Configuration): Promise { + public async createDocument(documentCreateRequest: DocumentCreateRequest, editorVer?: string, useFormFieldProperties?: string, _options?: Configuration): Promise { let _config = _options || this.configuration; // verify required parameter 'documentCreateRequest' is not null or undefined @@ -111,6 +270,7 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { + // Path Params const localVarPath = '/public/v1/documents'; @@ -123,12 +283,15 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { requestContext.setQueryParam("editor_ver", ObjectSerializer.serialize(editorVer, "string", "")); } + // Query Params + if (useFormFieldProperties !== undefined) { + requestContext.setQueryParam("use_form_field_properties", ObjectSerializer.serialize(useFormFieldProperties, "string", "")); + } + // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ - "application/json", - - "multipart/form-data" + "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( @@ -149,7 +312,7 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -158,27 +321,28 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { } /** - * Create a Document Link + * Creates a new editing session for the Embedded Editor. The response includes an E-Token, which is required to open the document. > 🚧 **Important:** The Embedded Editor can only open documents that have a `draft` status. #### Limitations - **Single Active Session per User-Document Pair** Only one editing session can be active at a time for a specific user and document. Creating a new session for the same user-document pair will automatically invalidate the previous one. - **Weekly Session Cap** A maximum of **250** editing sessions can be created for a single document per week. Any attempt to exceed this limit will result in a `403 Forbidden` error. + * Create Document Editing Session * @param id Document ID - * @param documentCreateLinkRequest + * @param editingSessionRequest */ - public async createDocumentLink(id: string, documentCreateLinkRequest: DocumentCreateLinkRequest, _options?: Configuration): Promise { + public async createDocumentEditingSession(id: string, editingSessionRequest: EditingSessionRequest, _options?: Configuration): Promise { let _config = _options || this.configuration; // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { - throw new RequiredError("DocumentsApi", "createDocumentLink", "id"); + throw new RequiredError("DocumentsApi", "createDocumentEditingSession", "id"); } - // verify required parameter 'documentCreateLinkRequest' is not null or undefined - if (documentCreateLinkRequest === null || documentCreateLinkRequest === undefined) { - throw new RequiredError("DocumentsApi", "createDocumentLink", "documentCreateLinkRequest"); + // verify required parameter 'editingSessionRequest' is not null or undefined + if (editingSessionRequest === null || editingSessionRequest === undefined) { + throw new RequiredError("DocumentsApi", "createDocumentEditingSession", "editingSessionRequest"); } // Path Params - const localVarPath = '/public/v1/documents/{id}/session' + const localVarPath = '/public/v1/documents/{id}/editing-sessions' .replace('{' + 'id' + '}', encodeURIComponent(String(id))); // Make Request Context @@ -192,7 +356,7 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( - ObjectSerializer.serialize(documentCreateLinkRequest, "DocumentCreateLinkRequest", ""), + ObjectSerializer.serialize(editingSessionRequest, "EditingSessionRequest", ""), contentType ); requestContext.setBody(serializedBody); @@ -209,7 +373,7 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -218,27 +382,112 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { } /** - * Create Linked Object - * @param id Specify document ID. - * @param linkedObjectCreateRequest + * ## Create from an upload > See the [Create from PDF](https://developers.pandadoc.com/docs/create-document-from-file) tutorial for the usage specifics and sample PDF files. **Note**: A file you upload is not stored in your PandaDoc account, so you have to upload it with every request. + * Create Document from File Upload + * @param editorVer Set this parameter as `ev1` if you want to create a document from PDF with Classic Editor when both editors are enabled for the workspace. (@deprecated) + * @param useFormFieldProperties Set this parameter as `yes` or `1` or `true` (only when upload pdf with form fields) if you want to respect form fields properties, like `required`. + * @param file Binary PDF File + * @param data */ - public async createLinkedObject(id: string, linkedObjectCreateRequest: LinkedObjectCreateRequest, _options?: Configuration): Promise { + public async createDocumentFromUpload(editorVer?: string, useFormFieldProperties?: string, file?: HttpFile, data?: DocumentCreateByPdfRequest, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + + + + + // Path Params + const localVarPath = '/public/v1/documents?upload'; + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + // Query Params + if (editorVer !== undefined) { + requestContext.setQueryParam("editor_ver", ObjectSerializer.serialize(editorVer, "string", "")); + } + + // Query Params + if (useFormFieldProperties !== undefined) { + requestContext.setQueryParam("use_form_field_properties", ObjectSerializer.serialize(useFormFieldProperties, "string", "")); + } + + // Form Params + const useForm = canConsumeForm([ + 'multipart/form-data', + ]); + + let localVarFormParams + if (useForm) { + localVarFormParams = new FormData(); + } else { + localVarFormParams = new URLSearchParams(); + } + + if (file !== undefined) { + // TODO: replace .append with .set + if (localVarFormParams instanceof FormData) { + localVarFormParams.append('file', file.data, file.name); + } + } + if (data !== undefined) { + // TODO: replace .append with .set + localVarFormParams.append('data', data as any); + } + + requestContext.setBody(localVarFormParams); + + if(!useForm) { + const contentType = ObjectSerializer.getPreferredMediaType([ + "multipart/form-data" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + } + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Creates a document session for a recipient to view and sign a document. > 📘 How to create an Embedded Sign session > For more information on how to create an Embedded Sign session, see the [Embedded Signing](https://developers.pandadoc.com/docs/embedded-signing) documentation. + * Create Document Session for Embedded Sign + * @param id Document ID + * @param documentCreateLinkRequest + */ + public async createDocumentLink(id: string, documentCreateLinkRequest: DocumentCreateLinkRequest, _options?: Configuration): Promise { let _config = _options || this.configuration; // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { - throw new RequiredError("DocumentsApi", "createLinkedObject", "id"); + throw new RequiredError("DocumentsApi", "createDocumentLink", "id"); } - // verify required parameter 'linkedObjectCreateRequest' is not null or undefined - if (linkedObjectCreateRequest === null || linkedObjectCreateRequest === undefined) { - throw new RequiredError("DocumentsApi", "createLinkedObject", "linkedObjectCreateRequest"); + // verify required parameter 'documentCreateLinkRequest' is not null or undefined + if (documentCreateLinkRequest === null || documentCreateLinkRequest === undefined) { + throw new RequiredError("DocumentsApi", "createDocumentLink", "documentCreateLinkRequest"); } // Path Params - const localVarPath = '/public/v1/documents/{id}/linked-objects' + const localVarPath = '/public/v1/documents/{id}/session' .replace('{' + 'id' + '}', encodeURIComponent(String(id))); // Make Request Context @@ -252,7 +501,7 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( - ObjectSerializer.serialize(linkedObjectCreateRequest, "LinkedObjectCreateRequest", ""), + ObjectSerializer.serialize(documentCreateLinkRequest, "DocumentCreateLinkRequest", ""), contentType ); requestContext.setBody(serializedBody); @@ -269,7 +518,7 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -278,24 +527,25 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { } /** - * Delete document by id - * @param id Document ID + * > ⏱️ Export as DOCX is a non-blocking (asynchronous) operation > The document generation process may take some time. > With a successful request, you receive a response with task ID, status **created** and document id. After process completes, usually in a few minutes, the task status moves to the **done** state. > You can download documents up to 300 pages. For documents of 301+ pages, you will receive an error “400: The number of pages more then limit 300” + * [Beta] Create DOCX Export Task + * @param documentId Specify document id. */ - public async deleteDocument(id: string, _options?: Configuration): Promise { + public async createExportDocxTask(documentId: string, _options?: Configuration): Promise { let _config = _options || this.configuration; - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new RequiredError("DocumentsApi", "deleteDocument", "id"); + // verify required parameter 'documentId' is not null or undefined + if (documentId === null || documentId === undefined) { + throw new RequiredError("DocumentsApi", "createExportDocxTask", "documentId"); } // Path Params - const localVarPath = '/public/v1/documents/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + const localVarPath = '/public/beta/documents/{document_id}/docx-export-tasks' + .replace('{' + 'document_id' + '}', encodeURIComponent(String(documentId))); // Make Request Context - const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE); + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") @@ -311,7 +561,7 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -320,29 +570,22 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { } /** - * Delete Linked Object - * @param id Specify document ID. - * @param linkedObjectId Specify linked object ID. + * Delete a document by ID. + * Delete Document + * @param id Document ID */ - public async deleteLinkedObject(id: string, linkedObjectId: string, _options?: Configuration): Promise { + public async deleteDocument(id: string, _options?: Configuration): Promise { let _config = _options || this.configuration; // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { - throw new RequiredError("DocumentsApi", "deleteLinkedObject", "id"); - } - - - // verify required parameter 'linkedObjectId' is not null or undefined - if (linkedObjectId === null || linkedObjectId === undefined) { - throw new RequiredError("DocumentsApi", "deleteLinkedObject", "linkedObjectId"); + throw new RequiredError("DocumentsApi", "deleteDocument", "id"); } // Path Params - const localVarPath = '/public/v1/documents/{id}/linked-objects/{linked_object_id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))) - .replace('{' + 'linked_object_id' + '}', encodeURIComponent(String(linkedObjectId))); + const localVarPath = '/public/v1/documents/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE); @@ -361,7 +604,7 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -370,7 +613,8 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { } /** - * Document details + * Return detailed data about a document. Use Document Status for getting just a basic info and status. Get details about a document by its `id`. Details include: - Basic document information (name, document state, owner, sender, grand total, etc.) - Recipients (completion status, signing order, etc.) - Fields with values (incl. Collect Files field) - Tokens (variables) with values - Pricing information (pricing tables, products, quotes, etc.) - Content block names for table, image, and text blocks (tables, images, texts) - Metadata - Tags - Linked objects - [Approval flow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) (if present) - Timestamps associated with a document. Note that `date_modified` means any changes associated with the recipients and document status, while `content_date_modified` reflects any changes in the document content. + * Document Details * @param id Document ID */ public async detailsDocument(id: string, _options?: Configuration): Promise { @@ -403,7 +647,7 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -412,6 +656,50 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { } /** + * Retrieves the current version of eSign disclosure text for a specified document. + * Document eSign disclosure + * @param documentId The UUID of the document. + */ + public async documentESignDisclosure(documentId: string, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'documentId' is not null or undefined + if (documentId === null || documentId === undefined) { + throw new RequiredError("DocumentsApi", "documentESignDisclosure", "documentId"); + } + + + // Path Params + const localVarPath = '/public/v1/documents/{document_id}/esign-disclosure' + .replace('{' + 'document_id' + '}', encodeURIComponent(String(documentId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * This operation allows you to move a document to a folder by specifying the document ID and folder ID. * Document move to folder * @param id Specify document ID. * @param folderId Specify folder ID. @@ -453,7 +741,7 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -462,13 +750,57 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { } /** - * Document download + * Revert your document back to draft to continue editing it. > 📘 Returning to Draft works for any document status except Removed. ## After you move your document to the Draft status - `Signature` and `Initials` fields are cleared. All other fields stay filled in. - Recipients are **not** notified that the document is back in Draft. - You\'ll need to resend the document so that recipients can sign the updated version. + * Move Document to Draft + * @param id Specify document ID. + */ + public async documentRevertToDraft(id: string, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError("DocumentsApi", "documentRevertToDraft", "id"); + } + + + // Path Params + const localVarPath = '/public/v1/documents/{id}/draft' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Download documents as a PDF. + * Document Download * @param id Specify document ID. * @param watermarkColor HEX code (for example `#FF5733`). * @param watermarkFontSize Font size of the watermark. * @param watermarkOpacity In range 0.0-1.0 * @param watermarkText Specify watermark text. - * @param separateFiles Set as `true` if you want to receive a zip file with all documents in separate when document transaction contains more than 1. + * @param separateFiles Download document bundle as a zip-archive of separate PDFs (1 file per section). */ public async downloadDocument(id: string, watermarkColor?: string, watermarkFontSize?: number, watermarkOpacity?: number, watermarkText?: string, separateFiles?: boolean, _options?: Configuration): Promise { let _config = _options || this.configuration; @@ -530,7 +862,7 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -539,10 +871,10 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { } /** - * Download a signed PDF of a completed document - * Download document protected + * Download a completed document as a verifiable PDF (Download Protected Document) > 🚧 Production key only > > This endpoint only works with a Production key. You\'ll get a 401 Unauthorized error when trying to use a Sandbox key. Download a signed PDF of a completed document + * Download Completed Document * @param id Specify document ID. - * @param separateFiles Set as `true` if you want to receive a zip file with all documents in separate when document transaction contains more than 1. + * @param separateFiles Download document bundle as a zip-archive of separate PDFs (1 file per section). */ public async downloadProtectedDocument(id: string, separateFiles?: boolean, _options?: Configuration): Promise { let _config = _options || this.configuration; @@ -580,7 +912,7 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -589,30 +921,82 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { } /** - * List documents - * @param completedFrom Return results where the `date_completed` field (ISO 8601) is greater than or equal to this value. - * @param completedTo Return results where the `date_completed` field (ISO 8601) is less than or equal to this value. - * @param contactId Returns results where 'contact_id' is present in document as recipient or approver - * @param count Specify how many document results to return. Default is 50 documents, maximum is 100 documents. - * @param createdFrom Return results where the `date_created` field (ISO 8601) is greater than or equal to this value. - * @param createdTo Return results where the `date_created` field (ISO 8601) is less than this value. + * > 📘 This endpoint returns the current state of a DOCX export task for a document. > The endpoint supports downloading only multiple files if the document contains several sections. Downloading as a single file in this case is not possible. + * [Beta] DOCX Export Task + * @param documentId Specify document id. + * @param taskId Specify Task id. + */ + public async getDocxExportTask(documentId: string, taskId: string, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'documentId' is not null or undefined + if (documentId === null || documentId === undefined) { + throw new RequiredError("DocumentsApi", "getDocxExportTask", "documentId"); + } + + + // verify required parameter 'taskId' is not null or undefined + if (taskId === null || taskId === undefined) { + throw new RequiredError("DocumentsApi", "getDocxExportTask", "taskId"); + } + + + // Path Params + const localVarPath = '/public/beta/documents/{document_id}/docx-export-tasks/{task_id}' + .replace('{' + 'document_id' + '}', encodeURIComponent(String(documentId))) + .replace('{' + 'task_id' + '}', encodeURIComponent(String(taskId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * This endpoint will let you list and search for the documents. ### [Here](https://developers.pandadoc.com/docs/list-search-documents-api) you can find how to filter, search and order documents. + * List Documents + * @param templateId Filters by parent template. This Parameter can\'t be used with form_id. + * @param formId Filters by parent form. This parameter can\'t be used with template_id. + * @param folderUuid Filters by the folder where the documents are stored. + * @param contactId Filters by recipient or approver with this \'contact_id\'. + * @param count Limits the size of the response. Default is 50 documents, maximum is 100 documents. + * @param page Paginates the search result. Increase value to get the next page of results. + * @param orderBy Defines the sorting of the result. Use `date_created` for ASC and `-date_created` for DESC sorting. + * @param createdFrom Limits results to the documents with the `date_created` greater than or equal to this value. + * @param createdTo Limits results to the documents with the `date_created` less than this value. * @param deleted Returns only the deleted documents. * @param id - * @param folderUuid The UUID of the folder where the documents are stored. - * @param formId Specify the form used for documents creation. This parameter can't be used with template_id. - * @param membershipId Returns results where 'membership_id' is present in document as owner (should be member uuid) - * @param metadata Specify metadata to filter by in the format of `metadata_{metadata-key}={metadata-value}` such as `metadata_opportunity_id=2181432`. The `metadata_` prefix is always required. - * @param modifiedFrom Return results where the `date_modified` field (iso-8601) is greater than or equal to this value. - * @param modifiedTo Return results where the `date_modified` field (iso-8601) is less than this value. - * @param orderBy Specify the order of documents to return. Use `value` (for example, `date_created`) for ASC and `-value` (for example, `-date_created`) for DESC. - * @param page Specify which page of the dataset to return. - * @param q Search query. Filter by document reference number (this token is stored on the template level) or name. - * @param status Specify the status of documents to return. * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review - * @param statusNe Specify the status of documents to return (exclude). * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review - * @param tag Search tag. Filter by document tag. - * @param templateId Specify the template used for documents creation. Parameter can't be used with form_id. + * @param completedFrom Limits results to the documents with the `date_completed` greater than or equal to this value. + * @param completedTo Limits results to the documents with the `date_completed` less than this value. + * @param membershipId Filter documents by the owner\'s \'membership_id\'. + * @param metadata Filters documents by metadata. Pass metadata in the format of `metadata_{metadata-key}={metadata-value}` such as `metadata_opportunity_id=2181432`. The `metadata_` prefix is always required. + * @param modifiedFrom Limits results to the documents with the `date_modified` greater than or equal to this value. + * @param modifiedTo Limits results to the documents with the `date_modified` less than this value. + * @param q Filters documents by name or reference number (stored on the template level). + * @param status Filters documents by the status. * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review + * @param statusNe Exludes documents with this status. * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review + * @param tag Filters documents by tag. */ - public async listDocuments(completedFrom?: string, completedTo?: string, contactId?: string, count?: number, createdFrom?: string, createdTo?: string, deleted?: boolean, id?: string, folderUuid?: string, formId?: string, membershipId?: string, metadata?: Array, modifiedFrom?: string, modifiedTo?: string, orderBy?: DocumentOrderingFieldsEnum, page?: number, q?: string, status?: DocumentStatusRequestEnum, statusNe?: DocumentStatusRequestEnum, tag?: string, templateId?: string, _options?: Configuration): Promise { + public async listDocuments(templateId?: string, formId?: string, folderUuid?: string, contactId?: string, count?: number, page?: number, orderBy?: DocumentOrderingFieldsEnum, createdFrom?: string, createdTo?: string, deleted?: boolean, id?: string, completedFrom?: string, completedTo?: string, membershipId?: string, metadata?: Array, modifiedFrom?: string, modifiedTo?: string, q?: string, status?: DocumentStatusRequestEnum, statusNe?: DocumentStatusRequestEnum, tag?: string, _options?: Configuration): Promise { let _config = _options || this.configuration; @@ -644,13 +1028,18 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") // Query Params - if (completedFrom !== undefined) { - requestContext.setQueryParam("completed_from", ObjectSerializer.serialize(completedFrom, "string", "datetime")); + if (templateId !== undefined) { + requestContext.setQueryParam("template_id", ObjectSerializer.serialize(templateId, "string", "")); } // Query Params - if (completedTo !== undefined) { - requestContext.setQueryParam("completed_to", ObjectSerializer.serialize(completedTo, "string", "datetime")); + if (formId !== undefined) { + requestContext.setQueryParam("form_id", ObjectSerializer.serialize(formId, "string", "")); + } + + // Query Params + if (folderUuid !== undefined) { + requestContext.setQueryParam("folder_uuid", ObjectSerializer.serialize(folderUuid, "string", "")); } // Query Params @@ -663,6 +1052,16 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { requestContext.setQueryParam("count", ObjectSerializer.serialize(count, "number", "")); } + // Query Params + if (page !== undefined) { + requestContext.setQueryParam("page", ObjectSerializer.serialize(page, "number", "")); + } + + // Query Params + if (orderBy !== undefined) { + requestContext.setQueryParam("order_by", ObjectSerializer.serialize(orderBy, "DocumentOrderingFieldsEnum", "")); + } + // Query Params if (createdFrom !== undefined) { requestContext.setQueryParam("created_from", ObjectSerializer.serialize(createdFrom, "string", "datetime")); @@ -684,13 +1083,13 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { } // Query Params - if (folderUuid !== undefined) { - requestContext.setQueryParam("folder_uuid", ObjectSerializer.serialize(folderUuid, "string", "")); + if (completedFrom !== undefined) { + requestContext.setQueryParam("completed_from", ObjectSerializer.serialize(completedFrom, "string", "datetime")); } // Query Params - if (formId !== undefined) { - requestContext.setQueryParam("form_id", ObjectSerializer.serialize(formId, "string", "")); + if (completedTo !== undefined) { + requestContext.setQueryParam("completed_to", ObjectSerializer.serialize(completedTo, "string", "datetime")); } // Query Params @@ -700,7 +1099,10 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { // Query Params if (metadata !== undefined) { - requestContext.setQueryParam("metadata", ObjectSerializer.serialize(metadata, "Array", "")); + const serializedParams = ObjectSerializer.serialize(metadata, "Array", ""); + for (const serializedParam of serializedParams) { + requestContext.appendQueryParam("metadata", serializedParam); + } } // Query Params @@ -713,16 +1115,6 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { requestContext.setQueryParam("modified_to", ObjectSerializer.serialize(modifiedTo, "string", "datetime")); } - // Query Params - if (orderBy !== undefined) { - requestContext.setQueryParam("order_by", ObjectSerializer.serialize(orderBy, "DocumentOrderingFieldsEnum", "")); - } - - // Query Params - if (page !== undefined) { - requestContext.setQueryParam("page", ObjectSerializer.serialize(page, "number", "")); - } - // Query Params if (q !== undefined) { requestContext.setQueryParam("q", ObjectSerializer.serialize(q, "string", "")); @@ -743,11 +1135,6 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { requestContext.setQueryParam("tag", ObjectSerializer.serialize(tag, "string", "")); } - // Query Params - if (templateId !== undefined) { - requestContext.setQueryParam("template_id", ObjectSerializer.serialize(templateId, "string", "")); - } - let authMethod: SecurityAuthentication | undefined; // Apply auth methods @@ -761,49 +1148,7 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default - if (defaultAuth?.applySecurityAuthentication) { - await defaultAuth?.applySecurityAuthentication(requestContext); - } - - return requestContext; - } - - /** - * List Linked Objects - * @param id Specify document ID. - */ - public async listLinkedObjects(id: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new RequiredError("DocumentsApi", "listLinkedObjects", "id"); - } - - - // Path Params - const localVarPath = '/public/v1/documents/{id}/linked-objects' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - - // Make Request Context - const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); - requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - - - let authMethod: SecurityAuthentication | undefined; - // Apply auth methods - authMethod = _config.authMethods["apiKey"] - if (authMethod?.applySecurityAuthentication) { - await authMethod?.applySecurityAuthentication(requestContext); - } - // Apply auth methods - authMethod = _config.authMethods["oauth2"] - if (authMethod?.applySecurityAuthentication) { - await authMethod?.applySecurityAuthentication(requestContext); - } - - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -812,6 +1157,7 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { } /** + * > 🚧 Using the Sandbox Key > > When you use a [sandbox API key](https://developers.pandadoc.com/reference/sandbox-key) during the free trial period, the sender and recipient email addresses must be from the same organisation (email domain). ## Document State - You can only send a document in the `document.draft` status. - After creating a new document, it usually retains a `document.uploaded` status for 3-5 seconds while the document syncs across PandaDoc servers. When the document is available for further API calls, it moves to the `document.draft` state. Use [Document Status](/reference/document-status) or [Webhooks](/reference/on-document-status-change) to check document status. - Moving a document to the `document.sent` status finalizes the document structure, before recipients can complete it. - If a template used for the document creation has an approval workflow turned on, the sent document moves to the `document.waiting_approval` status. Once the document is approved, you need to make the call again to move the document to `document.sent` status. ## Send and Silence Notifications - By default, PandaDoc sends a notification email to the recipient, as well as notifications the sender has configured. You may disable all notifications for recipients by passing `silent: true`. This is useful when you are using alternative delivery methods such as linking to the document or embedding the document. - The `silent: true` parameter disables sent, viewed, comment and completed document email notifications. \"Document Approval\" notification won\'t be affected by this parameter. - If you pass `silent: false`, the document is going to be delivered by email and/or SMS. ![Example email. Branding can be changed in workspace settings](https://files.readme.io/cc5a03e-email2.png) ## Select Approver from Group If you have previously set up an approval workflow with selectable groups on the UI, you can select a particular approver from this group. Learn more about [selectable groups](https://support.pandadoc.com/en/articles/9714799-approval-workflow#h_01H4GNY5GSGG38BPYY46XV7GB4). To set an approver, we recommend to follow these steps: 1. Run the [Document Details](https://developers.pandadoc.com/reference/document-details) request. 2. Copy the `steps` part from the `approval_execution` section of the response into the `selected_approvers` field of the Send Document payload. 3. Modify your payload according to business needs: set `is_selected` to true for one approver. > 📘 **Note**: You can change the selected approver only if you revert your document back to the `document.draft` status. * Send Document * @param id Document ID * @param documentSendRequest @@ -863,7 +1209,7 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -872,7 +1218,8 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { } /** - * Document status + * It is useful to request document status to ensure a document is in the expected state before calling additional API methods. ### Required Document Statuses Here are some common methods and the `document.status` required to proceed: | API Method | Required Document State | | :------------------- | :---------------------- | | Send A Document | `document.draft` | | Get Document Details | `document.draft` | | Embed A Document | `document.sent` | | Download A Document | `document.completed` | > 📘 Polling vs Webhooks > > If you are using the `GET` document status endpoint for [**polling**](https://en.wikipedia.org/wiki/Polling_(computer_science)), we also support and recommend using **webhooks** for event-driven needs: ### Available Document Statuses The following is a complete list of all possible document statuses returned: | Document Status | Status Description | | :-------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `document.uploaded` | The document has just been created or uploaded. It is in processing and will be in `document.draft` state soon. | | `document.error` | The document creation has failed. This status is terminal, you should stop polling after getting it. | `document.draft` | The document is in a draft state. All aspects of the document can be edited in this state. Our API does not support edits after the document has been created, but it can still be edited manually on | | `document.sent` | The document has been \"sealed\" and optionally sent. No further document edits can occur except for document recipient(s) filling out or signing the document. | | `document.viewed` | Document recipient(s) have viewed the sent document. | | `document.waiting_approval` | The document has an [automatic approval workflow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) and has not yet been approved. | | `document.rejected` | The document has an [automatic approval workflow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) and was rejected. | | `document.approved` | The document has an [automatic approval workflow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) and was approved. | | `document.waiting_pay` | The document has a [Stripe payment](https://support.pandadoc.com/en/articles/9714942-stripe-checkout-payments) option and is awaiting payment. | | `document.paid` | The document has a [Stripe payment](https://support.pandadoc.com/en/articles/9714942-stripe-checkout-payments) option and was paid. | | `document.completed` | The document has been completed by all recipients. | | `document.voided` | The document expired and is no longer available for completion or signature. | | `document.declined` | The document was [manually marked](https://support.pandadoc.com/en/articles/9714842-manually-change-document-status) as \"Declined\" | | `document.external_review` | The document is reviewed by it\'s recipient using Suggest Edit feature | + * Document Status * @param id Specify document ID. */ public async statusDocument(id: string, _options?: Configuration): Promise { @@ -905,7 +1252,7 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -914,6 +1261,7 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { } /** + * This method transfers ownership of all documents from one member to another. * Transfer all documents ownership * @param documentTransferAllOwnershipRequest */ @@ -957,7 +1305,7 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -966,6 +1314,7 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { } /** + * This operation allows transferring the ownership of a document to another user by specifying the document ID and membership ID. * Update document ownership * @param id Specify document ID. * @param documentTransferOwnershipRequest @@ -1017,7 +1366,7 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -1026,7 +1375,8 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { } /** - * Update Document only in the draft status + * Use the PATCH method to update a PandaDoc document. > 🚧 Document status > > You can only update a document in the Draft status (`document.draft`). > > After creating a new document, it usually retains a `document.uploaded` status for 3-5 seconds while the document syncs across PandaDoc servers. When the document is available for further API calls, the document moves to the `document.draft` state. Use [Document Status](https://developers.pandadoc.com/reference/document-status) or Webhooks to check document status. + * Update Document * @param id Document ID * @param documentUpdateRequest */ @@ -1077,18 +1427,94 @@ export class DocumentsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } - return requestContext; + return requestContext; + } + +} + +export class DocumentsApiResponseProcessor { + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to appendContentLibraryItemToDocument + * @throws ApiException if the response code was not in [200, 299] + */ + public async appendContentLibraryItemToDocumentWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("201", response.httpStatusCode)) { + const body: AppendCLIDataResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "AppendCLIDataResponse", "" + ) as AppendCLIDataResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("404", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("409", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ChangeDocumentStatus409Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ChangeDocumentStatus409Response", "" + ) as ChangeDocumentStatus409Response; + throw new ApiException(response.httpStatusCode, "Conflict", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: AppendCLIDataResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "AppendCLIDataResponse", "" + ) as AppendCLIDataResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } -} - -export class DocumentsApiResponseProcessor { - /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -1096,45 +1522,122 @@ export class DocumentsApiResponseProcessor { * @params response Response returned by the server for a request to changeDocumentStatus * @throws ApiException if the response code was not in [200, 299] */ - public async changeDocumentStatus(response: ResponseContext): Promise { + public async changeDocumentStatusWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("204", response.httpStatusCode)) { - return; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, undefined); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("409", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(409, "Conflict", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ChangeDocumentStatus409Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ChangeDocumentStatus409Response", "" + ) as ChangeDocumentStatus409Response; + throw new ApiException(response.httpStatusCode, "Conflict", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: void = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + "void", "" + ) as void; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to changeDocumentStatusWithUpload + * @throws ApiException if the response code was not in [200, 299] + */ + public async changeDocumentStatusWithUploadWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("204", response.httpStatusCode)) { + return new HttpInfo(response.httpStatusCode, response.headers, response.body, undefined); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("404", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("409", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ChangeDocumentStatus409Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ChangeDocumentStatus409Response", "" + ) as ChangeDocumentStatus409Response; + throw new ApiException(response.httpStatusCode, "Conflict", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1143,10 +1646,17 @@ export class DocumentsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "void", "" ) as void; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -1156,35 +1666,182 @@ export class DocumentsApiResponseProcessor { * @params response Response returned by the server for a request to createDocument * @throws ApiException if the response code was not in [200, 299] */ - public async createDocument(response: ResponseContext): Promise { + public async createDocumentWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("201", response.httpStatusCode)) { const body: DocumentCreateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "DocumentCreateResponse", "" ) as DocumentCreateResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: CreateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "CreateDocument400Response", "" + ) as CreateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: DocumentCreateResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "DocumentCreateResponse", "" + ) as DocumentCreateResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createDocumentEditingSession + * @throws ApiException if the response code was not in [200, 299] + */ + public async createDocumentEditingSessionWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("201", response.httpStatusCode)) { + const body: CreateDocumentEditingSession201Response = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + "CreateDocumentEditingSession201Response", "" + ) as CreateDocumentEditingSession201Response; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("400", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad request", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("404", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: CreateDocumentEditingSession201Response = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "CreateDocumentEditingSession201Response", "" + ) as CreateDocumentEditingSession201Response; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createDocumentFromUpload + * @throws ApiException if the response code was not in [200, 299] + */ + public async createDocumentFromUploadWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("201", response.httpStatusCode)) { + const body: DocumentCreateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + "DocumentCreateResponse", "" + ) as DocumentCreateResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("400", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: CreateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "CreateDocument400Response", "" + ) as CreateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1193,10 +1850,17 @@ export class DocumentsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "DocumentCreateResponse", "" ) as DocumentCreateResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -1206,49 +1870,54 @@ export class DocumentsApiResponseProcessor { * @params response Response returned by the server for a request to createDocumentLink * @throws ApiException if the response code was not in [200, 299] */ - public async createDocumentLink(response: ResponseContext): Promise { + public async createDocumentLinkWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("201", response.httpStatusCode)) { const body: DocumentCreateLinkResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "DocumentCreateLinkResponse", "" ) as DocumentCreateLinkResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1257,74 +1926,85 @@ export class DocumentsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "DocumentCreateLinkResponse", "" ) as DocumentCreateLinkResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to createLinkedObject + * @params response Response returned by the server for a request to createExportDocxTask * @throws ApiException if the response code was not in [200, 299] */ - public async createLinkedObject(response: ResponseContext): Promise { + public async createExportDocxTaskWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { - const body: LinkedObjectCreateResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "LinkedObjectCreateResponse", "" - ) as LinkedObjectCreateResponse; - return body; - } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( + const body: DocumentDocxExport = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + "DocumentDocxExport", "" + ) as DocumentDocxExport; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: SearchCatalogItems401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "SearchCatalogItems401Response", "" + ) as SearchCatalogItems401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListNotaries403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListNotaries403Response", "" + ) as ListNotaries403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: DeleteNotarizationRequest404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "DeleteNotarizationRequest404Response", "" + ) as DeleteNotarizationRequest404Response; + throw new ApiException(response.httpStatusCode, "Not found error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListNotaries429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListNotaries429Response", "" + ) as ListNotaries429Response; + throw new ApiException(response.httpStatusCode, "Too many requests error", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: LinkedObjectCreateResponse = ObjectSerializer.deserialize( + const body: DocumentDocxExport = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LinkedObjectCreateResponse", "" - ) as LinkedObjectCreateResponse; - return body; + "DocumentDocxExport", "" + ) as DocumentDocxExport; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -1334,17 +2014,18 @@ export class DocumentsApiResponseProcessor { * @params response Response returned by the server for a request to deleteDocument * @throws ApiException if the response code was not in [200, 299] */ - public async deleteDocument(response: ResponseContext): Promise { + public async deleteDocumentWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("204", response.httpStatusCode)) { - return; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, undefined); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1353,134 +2034,161 @@ export class DocumentsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "void", "" ) as void; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to deleteLinkedObject + * @params response Response returned by the server for a request to detailsDocument * @throws ApiException if the response code was not in [200, 299] */ - public async deleteLinkedObject(response: ResponseContext): Promise { + public async detailsDocumentWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); - if (isCodeInRange("204", response.httpStatusCode)) { - return; + if (isCodeInRange("200", response.httpStatusCode)) { + const body: DocumentDetailsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "DocumentDetailsResponse", "" + ) as DocumentDetailsResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("409", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(409, "Conflict", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ChangeDocumentStatus409Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ChangeDocumentStatus409Response", "" + ) as ChangeDocumentStatus409Response; + throw new ApiException(response.httpStatusCode, "Conflict", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: void = ObjectSerializer.deserialize( + const body: DocumentDetailsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "void", "" - ) as void; - return body; + "DocumentDetailsResponse", "" + ) as DocumentDetailsResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to detailsDocument + * @params response Response returned by the server for a request to documentESignDisclosure * @throws ApiException if the response code was not in [200, 299] */ - public async detailsDocument(response: ResponseContext): Promise { + public async documentESignDisclosureWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { - const body: DocumentDetailsResponse = ObjectSerializer.deserialize( + const body: DocumentESignDisclosure = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "DocumentDetailsResponse", "" - ) as DocumentDetailsResponse; - return body; + "DocumentESignDisclosure", "" + ) as DocumentESignDisclosure; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); - } - if (isCodeInRange("409", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(409, "Conflict", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: DocumentDetailsResponse = ObjectSerializer.deserialize( + const body: DocumentESignDisclosure = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "DocumentDetailsResponse", "" - ) as DocumentDetailsResponse; - return body; + "DocumentESignDisclosure", "" + ) as DocumentESignDisclosure; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -1490,38 +2198,42 @@ export class DocumentsApiResponseProcessor { * @params response Response returned by the server for a request to documentMoveToFolder * @throws ApiException if the response code was not in [200, 299] */ - public async documentMoveToFolder(response: ResponseContext): Promise { + public async documentMoveToFolderWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("204", response.httpStatusCode)) { - return; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, undefined); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1530,10 +2242,53 @@ export class DocumentsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "void", "" ) as void; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to documentRevertToDraft + * @throws ApiException if the response code was not in [200, 299] + */ + public async documentRevertToDraftWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: DocumentRevertToDraftResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "DocumentRevertToDraftResponse", "" + ) as DocumentRevertToDraftResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: DocumentRevertToDraftResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "DocumentRevertToDraftResponse", "" + ) as DocumentRevertToDraftResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -1543,53 +2298,59 @@ export class DocumentsApiResponseProcessor { * @params response Response returned by the server for a request to downloadDocument * @throws ApiException if the response code was not in [200, 299] */ - public async downloadDocument(response: ResponseContext): Promise { + public async downloadDocumentWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: HttpFile = await response.getBodyAsFile() as any as HttpFile; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "binary" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "binary" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "binary" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "binary" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "binary" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "binary" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "binary" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "binary" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("409", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "binary" - ) as any; - throw new ApiException(409, "Conflict", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ChangeDocumentStatus409Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ChangeDocumentStatus409Response", "binary" + ) as ChangeDocumentStatus409Response; + throw new ApiException(response.httpStatusCode, "Conflict", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "binary" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "binary" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1598,10 +2359,17 @@ export class DocumentsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "HttpFile", "binary" ) as HttpFile; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -1611,46 +2379,51 @@ export class DocumentsApiResponseProcessor { * @params response Response returned by the server for a request to downloadProtectedDocument * @throws ApiException if the response code was not in [200, 299] */ - public async downloadProtectedDocument(response: ResponseContext): Promise { + public async downloadProtectedDocumentWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: HttpFile = await response.getBodyAsFile() as any as HttpFile; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "binary" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "binary" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "binary" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "binary" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "binary" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "binary" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("409", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "binary" - ) as any; - throw new ApiException(409, "Conflict", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ChangeDocumentStatus409Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ChangeDocumentStatus409Response", "binary" + ) as ChangeDocumentStatus409Response; + throw new ApiException(response.httpStatusCode, "Conflict", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "binary" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "binary" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1659,131 +2432,153 @@ export class DocumentsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "HttpFile", "binary" ) as HttpFile; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to listDocuments + * @params response Response returned by the server for a request to getDocxExportTask * @throws ApiException if the response code was not in [200, 299] */ - public async listDocuments(response: ResponseContext): Promise { + public async getDocxExportTaskWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { - const body: DocumentListResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "DocumentListResponse", "" - ) as DocumentListResponse; - return body; - } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( + const body: DocxExportTaskResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + "DocxExportTaskResponse", "" + ) as DocxExportTaskResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: SearchCatalogItems401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "SearchCatalogItems401Response", "" + ) as SearchCatalogItems401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListNotaries403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListNotaries403Response", "" + ) as ListNotaries403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("404", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: DeleteNotarizationRequest404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "DeleteNotarizationRequest404Response", "" + ) as DeleteNotarizationRequest404Response; + throw new ApiException(response.httpStatusCode, "Not found error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListNotaries429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListNotaries429Response", "" + ) as ListNotaries429Response; + throw new ApiException(response.httpStatusCode, "Too many requests error", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: DocumentListResponse = ObjectSerializer.deserialize( + const body: DocxExportTaskResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "DocumentListResponse", "" - ) as DocumentListResponse; - return body; + "DocxExportTaskResponse", "" + ) as DocxExportTaskResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to listLinkedObjects + * @params response Response returned by the server for a request to listDocuments * @throws ApiException if the response code was not in [200, 299] */ - public async listLinkedObjects(response: ResponseContext): Promise { + public async listDocumentsWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { - const body: LinkedObjectListResponse = ObjectSerializer.deserialize( + const body: DocumentListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LinkedObjectListResponse", "" - ) as LinkedObjectListResponse; - return body; + "DocumentListResponse", "" + ) as DocumentListResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("400", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments400Response", "" + ) as ListDocuments400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); - } - if (isCodeInRange("409", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(409, "Conflict", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: LinkedObjectListResponse = ObjectSerializer.deserialize( + const body: DocumentListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LinkedObjectListResponse", "" - ) as LinkedObjectListResponse; - return body; + "DocumentListResponse", "" + ) as DocumentListResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -1793,49 +2588,54 @@ export class DocumentsApiResponseProcessor { * @params response Response returned by the server for a request to sendDocument * @throws ApiException if the response code was not in [200, 299] */ - public async sendDocument(response: ResponseContext): Promise { + public async sendDocumentWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: DocumentSendResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "DocumentSendResponse", "" ) as DocumentSendResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("409", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(409, "Conflict", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ChangeDocumentStatus409Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ChangeDocumentStatus409Response", "" + ) as ChangeDocumentStatus409Response; + throw new ApiException(response.httpStatusCode, "Conflict", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1844,10 +2644,17 @@ export class DocumentsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "DocumentSendResponse", "" ) as DocumentSendResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -1857,42 +2664,46 @@ export class DocumentsApiResponseProcessor { * @params response Response returned by the server for a request to statusDocument * @throws ApiException if the response code was not in [200, 299] */ - public async statusDocument(response: ResponseContext): Promise { + public async statusDocumentWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: DocumentStatusResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "DocumentStatusResponse", "" ) as DocumentStatusResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1901,10 +2712,17 @@ export class DocumentsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "DocumentStatusResponse", "" ) as DocumentStatusResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -1914,38 +2732,42 @@ export class DocumentsApiResponseProcessor { * @params response Response returned by the server for a request to transferAllDocumentsOwnership * @throws ApiException if the response code was not in [200, 299] */ - public async transferAllDocumentsOwnership(response: ResponseContext): Promise { + public async transferAllDocumentsOwnershipWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("204", response.httpStatusCode)) { - return; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, undefined); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1954,10 +2776,17 @@ export class DocumentsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "void", "" ) as void; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -1967,45 +2796,50 @@ export class DocumentsApiResponseProcessor { * @params response Response returned by the server for a request to transferDocumentOwnership * @throws ApiException if the response code was not in [200, 299] */ - public async transferDocumentOwnership(response: ResponseContext): Promise { + public async transferDocumentOwnershipWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("204", response.httpStatusCode)) { - return; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, undefined); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("409", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(409, "Conflict", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ChangeDocumentStatus409Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ChangeDocumentStatus409Response", "" + ) as ChangeDocumentStatus409Response; + throw new ApiException(response.httpStatusCode, "Conflict", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2014,10 +2848,17 @@ export class DocumentsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "void", "" ) as void; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -2027,45 +2868,50 @@ export class DocumentsApiResponseProcessor { * @params response Response returned by the server for a request to updateDocument * @throws ApiException if the response code was not in [200, 299] */ - public async updateDocument(response: ResponseContext): Promise { + public async updateDocumentWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("204", response.httpStatusCode)) { - return; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, undefined); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2074,10 +2920,18 @@ export class DocumentsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "void", "" ) as void; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } } + diff --git a/src/apis/FoldersAPIApi.ts b/src/apis/FoldersApi.ts similarity index 58% rename from src/apis/FoldersAPIApi.ts rename to src/apis/FoldersApi.ts index a807441..2739b69 100644 --- a/src/apis/FoldersAPIApi.ts +++ b/src/apis/FoldersApi.ts @@ -1,33 +1,39 @@ // TODO: better import syntax? -import {BaseAPIRequestFactory, RequiredError} from './baseapi'; +import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; -import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import { readRawBodyAndParse, tryParseRawBody } from '../pandadoc/httpErrorBody'; import {SecurityAuthentication} from '../auth/auth'; +import { CreateDocument400Response } from '../models/CreateDocument400Response'; import { DocumentsFolderCreateRequest } from '../models/DocumentsFolderCreateRequest'; import { DocumentsFolderCreateResponse } from '../models/DocumentsFolderCreateResponse'; import { DocumentsFolderListResponse } from '../models/DocumentsFolderListResponse'; import { DocumentsFolderRenameRequest } from '../models/DocumentsFolderRenameRequest'; import { DocumentsFolderRenameResponse } from '../models/DocumentsFolderRenameResponse'; +import { ListDocuments401Response } from '../models/ListDocuments401Response'; +import { ListDocuments429Response } from '../models/ListDocuments429Response'; +import { StatusDocument404Response } from '../models/StatusDocument404Response'; import { TemplatesFolderCreateRequest } from '../models/TemplatesFolderCreateRequest'; import { TemplatesFolderCreateResponse } from '../models/TemplatesFolderCreateResponse'; import { TemplatesFolderListResponse } from '../models/TemplatesFolderListResponse'; import { TemplatesFolderRenameRequest } from '../models/TemplatesFolderRenameRequest'; import { TemplatesFolderRenameResponse } from '../models/TemplatesFolderRenameResponse'; +import { UpdateDocument400Response } from '../models/UpdateDocument400Response'; /** * no description */ -export class FoldersAPIApiRequestFactory extends BaseAPIRequestFactory { +export class FoldersApiRequestFactory extends BaseAPIRequestFactory { /** - * Create a new folder to store your documents. + * Create a new folder to store your documents. For the full list of folder operations and their limitations, see [Organize Documents and Folders](https://developers.pandadoc.com/docs/organize-folders). * Create Documents Folder * @param documentsFolderCreateRequest */ @@ -36,7 +42,7 @@ export class FoldersAPIApiRequestFactory extends BaseAPIRequestFactory { // verify required parameter 'documentsFolderCreateRequest' is not null or undefined if (documentsFolderCreateRequest === null || documentsFolderCreateRequest === undefined) { - throw new RequiredError("FoldersAPIApi", "createDocumentFolder", "documentsFolderCreateRequest"); + throw new RequiredError("FoldersApi", "createDocumentFolder", "documentsFolderCreateRequest"); } @@ -71,7 +77,7 @@ export class FoldersAPIApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -80,7 +86,7 @@ export class FoldersAPIApiRequestFactory extends BaseAPIRequestFactory { } /** - * Create a new folder to store your templates. + * Create a new folder to store your templates. For the full list of folder operations and their limitations, see [Organize Templates and Folders](https://developers.pandadoc.com/docs/organize-folders). * Create Templates Folder * @param templatesFolderCreateRequest */ @@ -89,7 +95,7 @@ export class FoldersAPIApiRequestFactory extends BaseAPIRequestFactory { // verify required parameter 'templatesFolderCreateRequest' is not null or undefined if (templatesFolderCreateRequest === null || templatesFolderCreateRequest === undefined) { - throw new RequiredError("FoldersAPIApi", "createTemplateFolder", "templatesFolderCreateRequest"); + throw new RequiredError("FoldersApi", "createTemplateFolder", "templatesFolderCreateRequest"); } @@ -124,7 +130,7 @@ export class FoldersAPIApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -133,10 +139,10 @@ export class FoldersAPIApiRequestFactory extends BaseAPIRequestFactory { } /** - * Get the list of folders that contain Documents in your account. + * Get the list of folders which contain Documents in your account. > 📘 > > The root folder is not listed in the response. For the full list of folder operations and their limitations, see [Organize Documents and Folders](https://developers.pandadoc.com/docs/organize-folders). * List Documents Folders * @param parentUuid The UUID of the folder containing folders. To list the folders located in the root folder, remove this parameter in the request. - * @param count Optionally, specify how many folders to return. Default is 50 folders, maximum is 100 folders. + * @param count Optionally, specify how many folders to return. * @param page Optionally, specify which page of the dataset to return. */ public async listDocumentFolders(parentUuid?: string, count?: number, page?: number, _options?: Configuration): Promise { @@ -180,7 +186,7 @@ export class FoldersAPIApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -189,10 +195,10 @@ export class FoldersAPIApiRequestFactory extends BaseAPIRequestFactory { } /** - * Get the list of folders that contain Templates in your account. + * Get the list of folders that contain Templates in your account. > 📘 > > The root folder is not listed in the response. For the full list of folder operations and their limitations, see [Organize Templates and Folders](https://developers.pandadoc.com/docs/organize-folders). * List Templates Folders * @param parentUuid The UUID of the folder containing folders. To list the folders located in the root folder, remove this parameter in the request. - * @param count Optionally, specify how many folders to return. Default is 50 folders, maximum is 100 folders. + * @param count Optionally, specify how many folders to return. * @param page Optionally, specify which page of the dataset to return. */ public async listTemplateFolders(parentUuid?: string, count?: number, page?: number, _options?: Configuration): Promise { @@ -236,7 +242,7 @@ export class FoldersAPIApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -245,7 +251,7 @@ export class FoldersAPIApiRequestFactory extends BaseAPIRequestFactory { } /** - * Rename Documents Folder. + * Rename Documents Folder. For the full list of folder operations and their limitations, see [Organize Documents and Folders](https://developers.pandadoc.com/docs/organize-folders). * Rename Documents Folder * @param id The UUID of the folder that you are renaming. * @param documentsFolderRenameRequest @@ -255,13 +261,13 @@ export class FoldersAPIApiRequestFactory extends BaseAPIRequestFactory { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { - throw new RequiredError("FoldersAPIApi", "renameDocumentFolder", "id"); + throw new RequiredError("FoldersApi", "renameDocumentFolder", "id"); } // verify required parameter 'documentsFolderRenameRequest' is not null or undefined if (documentsFolderRenameRequest === null || documentsFolderRenameRequest === undefined) { - throw new RequiredError("FoldersAPIApi", "renameDocumentFolder", "documentsFolderRenameRequest"); + throw new RequiredError("FoldersApi", "renameDocumentFolder", "documentsFolderRenameRequest"); } @@ -297,7 +303,7 @@ export class FoldersAPIApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -306,7 +312,7 @@ export class FoldersAPIApiRequestFactory extends BaseAPIRequestFactory { } /** - * Rename a templates folder. + * Rename a templates folder. For the full list of folder operations and their limitations, see [Organize Templates and Folders](https://developers.pandadoc.com/docs/organize-folders). * Rename Templates Folder * @param id The UUID of the folder which you are renaming. * @param templatesFolderRenameRequest @@ -316,13 +322,13 @@ export class FoldersAPIApiRequestFactory extends BaseAPIRequestFactory { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { - throw new RequiredError("FoldersAPIApi", "renameTemplateFolder", "id"); + throw new RequiredError("FoldersApi", "renameTemplateFolder", "id"); } // verify required parameter 'templatesFolderRenameRequest' is not null or undefined if (templatesFolderRenameRequest === null || templatesFolderRenameRequest === undefined) { - throw new RequiredError("FoldersAPIApi", "renameTemplateFolder", "templatesFolderRenameRequest"); + throw new RequiredError("FoldersApi", "renameTemplateFolder", "templatesFolderRenameRequest"); } @@ -358,7 +364,7 @@ export class FoldersAPIApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -368,7 +374,7 @@ export class FoldersAPIApiRequestFactory extends BaseAPIRequestFactory { } -export class FoldersAPIApiResponseProcessor { +export class FoldersApiResponseProcessor { /** * Unwraps the actual response sent by the server from the response context and deserializes the response content @@ -377,35 +383,38 @@ export class FoldersAPIApiResponseProcessor { * @params response Response returned by the server for a request to createDocumentFolder * @throws ApiException if the response code was not in [200, 299] */ - public async createDocumentFolder(response: ResponseContext): Promise { + public async createDocumentFolderWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("201", response.httpStatusCode)) { const body: DocumentsFolderCreateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "DocumentsFolderCreateResponse", "" ) as DocumentsFolderCreateResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: CreateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "CreateDocument400Response", "" + ) as CreateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -414,10 +423,17 @@ export class FoldersAPIApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "DocumentsFolderCreateResponse", "" ) as DocumentsFolderCreateResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -427,35 +443,38 @@ export class FoldersAPIApiResponseProcessor { * @params response Response returned by the server for a request to createTemplateFolder * @throws ApiException if the response code was not in [200, 299] */ - public async createTemplateFolder(response: ResponseContext): Promise { + public async createTemplateFolderWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("201", response.httpStatusCode)) { const body: TemplatesFolderCreateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "TemplatesFolderCreateResponse", "" ) as TemplatesFolderCreateResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: CreateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "CreateDocument400Response", "" + ) as CreateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -464,10 +483,17 @@ export class FoldersAPIApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "TemplatesFolderCreateResponse", "" ) as TemplatesFolderCreateResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -477,35 +503,38 @@ export class FoldersAPIApiResponseProcessor { * @params response Response returned by the server for a request to listDocumentFolders * @throws ApiException if the response code was not in [200, 299] */ - public async listDocumentFolders(response: ResponseContext): Promise { + public async listDocumentFoldersWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: DocumentsFolderListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "DocumentsFolderListResponse", "" ) as DocumentsFolderListResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -514,10 +543,17 @@ export class FoldersAPIApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "DocumentsFolderListResponse", "" ) as DocumentsFolderListResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -527,35 +563,38 @@ export class FoldersAPIApiResponseProcessor { * @params response Response returned by the server for a request to listTemplateFolders * @throws ApiException if the response code was not in [200, 299] */ - public async listTemplateFolders(response: ResponseContext): Promise { + public async listTemplateFoldersWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: TemplatesFolderListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "TemplatesFolderListResponse", "" ) as TemplatesFolderListResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -564,10 +603,17 @@ export class FoldersAPIApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "TemplatesFolderListResponse", "" ) as TemplatesFolderListResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -577,42 +623,46 @@ export class FoldersAPIApiResponseProcessor { * @params response Response returned by the server for a request to renameDocumentFolder * @throws ApiException if the response code was not in [200, 299] */ - public async renameDocumentFolder(response: ResponseContext): Promise { + public async renameDocumentFolderWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: DocumentsFolderRenameResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "DocumentsFolderRenameResponse", "" ) as DocumentsFolderRenameResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: CreateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "CreateDocument400Response", "" + ) as CreateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -621,10 +671,17 @@ export class FoldersAPIApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "DocumentsFolderRenameResponse", "" ) as DocumentsFolderRenameResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -634,42 +691,46 @@ export class FoldersAPIApiResponseProcessor { * @params response Response returned by the server for a request to renameTemplateFolder * @throws ApiException if the response code was not in [200, 299] */ - public async renameTemplateFolder(response: ResponseContext): Promise { + public async renameTemplateFolderWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: TemplatesFolderRenameResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "TemplatesFolderRenameResponse", "" ) as TemplatesFolderRenameResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: CreateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "CreateDocument400Response", "" + ) as CreateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -678,10 +739,18 @@ export class FoldersAPIApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "TemplatesFolderRenameResponse", "" ) as TemplatesFolderRenameResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } } + diff --git a/src/apis/FormsApi.ts b/src/apis/FormsApi.ts index 890d5f6..251ebd5 100644 --- a/src/apis/FormsApi.ts +++ b/src/apis/FormsApi.ts @@ -1,16 +1,21 @@ // TODO: better import syntax? -import {BaseAPIRequestFactory, RequiredError} from './baseapi'; +import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; -import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import { readRawBodyAndParse, tryParseRawBody } from '../pandadoc/httpErrorBody'; import {SecurityAuthentication} from '../auth/auth'; import { FormListResponse } from '../models/FormListResponse'; +import { ListDocuments401Response } from '../models/ListDocuments401Response'; +import { ListDocuments403Response } from '../models/ListDocuments403Response'; +import { ListDocuments429Response } from '../models/ListDocuments429Response'; +import { UpdateDocument400Response } from '../models/UpdateDocument400Response'; /** * no description @@ -18,13 +23,13 @@ import { FormListResponse } from '../models/FormListResponse'; export class FormsApiRequestFactory extends BaseAPIRequestFactory { /** - * List forms. - * Forms - * @param count Optionally, specify how many forms to return. Default is 50 forms, maximum is 100 forms. - * @param page Optionally, specify which page of the dataset to return. - * @param status Optionally, specify which status of the forms dataset to return. - * @param orderBy Optionally, specify the form dataset order to return. - * @param asc Optionally, specify sorting the result-set in ascending or descending order. + * Retrieve a paginated list of forms with optional filtering and sorting options. + * List Forms + * @param count Specify how many forms to return. Default is 50 forms, maximum is 100 forms. + * @param page Specify which page of the dataset to return. + * @param status Specify which status of the forms dataset to return. + * @param orderBy Specify the form dataset order to return. + * @param asc Specify sorting the result-set in ascending or descending order. * @param name Specify the form name. */ public async listForm(count?: number, page?: number, status?: Array<'draft' | 'active' | 'disabled'>, orderBy?: 'name' | 'responses' | 'status' | 'created_date' | 'modified_date', asc?: boolean, name?: string, _options?: Configuration): Promise { @@ -55,7 +60,10 @@ export class FormsApiRequestFactory extends BaseAPIRequestFactory { // Query Params if (status !== undefined) { - requestContext.setQueryParam("status", ObjectSerializer.serialize(status, "Array<'draft' | 'active' | 'disabled'>", "")); + const serializedParams = ObjectSerializer.serialize(status, "Array<'draft' | 'active' | 'disabled'>", ""); + for (const serializedParam of serializedParams) { + requestContext.appendQueryParam("status", serializedParam); + } } // Query Params @@ -86,7 +94,7 @@ export class FormsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -105,35 +113,46 @@ export class FormsApiResponseProcessor { * @params response Response returned by the server for a request to listForm * @throws ApiException if the response code was not in [200, 299] */ - public async listForm(response: ResponseContext): Promise { + public async listFormWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: FormListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "FormListResponse", "" ) as FormListResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -142,10 +161,18 @@ export class FormsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "FormListResponse", "" ) as FormListResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } } + diff --git a/src/apis/MembersApi.ts b/src/apis/MembersApi.ts index ab1d237..d7b9ffe 100644 --- a/src/apis/MembersApi.ts +++ b/src/apis/MembersApi.ts @@ -1,17 +1,24 @@ // TODO: better import syntax? -import {BaseAPIRequestFactory, RequiredError} from './baseapi'; +import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; -import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import { readRawBodyAndParse, tryParseRawBody } from '../pandadoc/httpErrorBody'; import {SecurityAuthentication} from '../auth/auth'; +import { CreateMemberTokenRequest } from '../models/CreateMemberTokenRequest'; +import { CreateMemberTokenResponse } from '../models/CreateMemberTokenResponse'; +import { ListDocuments401Response } from '../models/ListDocuments401Response'; +import { ListDocuments403Response } from '../models/ListDocuments403Response'; +import { ListDocuments429Response } from '../models/ListDocuments429Response'; import { MemberDetailsResponse } from '../models/MemberDetailsResponse'; import { MemberListResponse } from '../models/MemberListResponse'; +import { UpdateDocument400Response } from '../models/UpdateDocument400Response'; /** * no description @@ -19,8 +26,64 @@ import { MemberListResponse } from '../models/MemberListResponse'; export class MembersApiRequestFactory extends BaseAPIRequestFactory { /** - * A method to define to whom credentials belong - * Current member details + * > 🚧 > > This endpoint is only exposed upon request. Please reach out to your Account Manager to get access. > 📘 > > Make sure you\'re using Public API keys generated by Org Admin, otherwise you\'ll receive a 403 response. + * Create Member Token + * @param memberId Member id. + * @param createMemberTokenRequest + */ + public async createMemberToken(memberId: string, createMemberTokenRequest?: CreateMemberTokenRequest, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'memberId' is not null or undefined + if (memberId === null || memberId === undefined) { + throw new RequiredError("MembersApi", "createMemberToken", "memberId"); + } + + + + // Path Params + const localVarPath = '/public/v1/members/{member_id}/token' + .replace('{' + 'member_id' + '}', encodeURIComponent(String(memberId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(createMemberTokenRequest, "CreateMemberTokenRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Returns the member details of the current user (the owner of the API key). **User** - is an account with a license in the Organization. **Member** - is a User with a predefined Role in the Workspace. | Parameter | Description | |---|---| | `user_id` | A unique identifier of the `user` in the **organization** | | `membership_id` | A unique identifier of the `user` in the **workspace** | | `email` | A user email address | | `first_name` | A user\'s first name | | `last_name` | A user\'s last name | | `is_active` | A boolean value that identifies if a member is active and not blocked | | `workspace` | A unique identifier of the user\'s current active workspace | | `workspace_name` | A name of the user\'s current active workspace | | `email_verified` | A boolean value that identifies if the email is verified | | `role` | A member\'s role in the workspace | | `user_license` | A user license in the organization: 
`Full (Standard)`; 
`Read-only`; 
`eSignature`; 
`Guest`; 
`Creator` | | `date_created` | A date when a member was added to the workspace | | `date_modified` | Last modified date of a member | + * Current Member Details */ public async detailsCurrentMember(_options?: Configuration): Promise { let _config = _options || this.configuration; @@ -45,7 +108,7 @@ export class MembersApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -54,9 +117,9 @@ export class MembersApiRequestFactory extends BaseAPIRequestFactory { } /** - * A method to retrieve a member's details by id - * Member details - * @param id Membership id + * A method to retrieve a member\'s details by ID. **User** - is an account with a license in the Organization. **Member** - is a User with a predefined Role in the Workspace. | Parameter | Description | |---|---| | `user_id` | A unique identifier of the `user` in the **organization** | | `membership_id` | A unique identifier of the `user` in the **workspace** | | `email` | A user email address | | `first_name` | A user\'s first name | | `last_name` | A user\'s last name | | `is_active` | A boolean value that identifies if a member is active and not blocked | | `workspace` | A unique identifier of the user\'s current active workspace | | `workspace_name` | A name of the user\'s current active workspace | | `email_verified` | A boolean value that identifies if the email is verified | | `role` | A member\'s role in the workspace | | `user_license` | A user license in the organization: 
`Full (Standard)`; 
`Read-only`; 
`eSignature`; 
`Guest`; 
`Creator` | | `date_created` | A date when a member was added to the workspace | | `date_modified` | Last modified date of a member | + * Member Details + * @param id Membership id. */ public async detailsMember(id: string, _options?: Configuration): Promise { let _config = _options || this.configuration; @@ -88,7 +151,7 @@ export class MembersApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -97,8 +160,8 @@ export class MembersApiRequestFactory extends BaseAPIRequestFactory { } /** - * Retrieve all members details of the workspace - * List members + * Retrieve all members details of the workspace implied by the OAuth token or API key.\\ For each member, the `workspace` parameter shows their active workspace, that is the workspace they are currently working in.\\ This means the `workspace` value can differ from the workspace implied by your API key. + * List Members */ public async listMembers(_options?: Configuration): Promise { let _config = _options || this.configuration; @@ -123,7 +186,7 @@ export class MembersApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -135,6 +198,74 @@ export class MembersApiRequestFactory extends BaseAPIRequestFactory { export class MembersApiResponseProcessor { + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createMemberToken + * @throws ApiException if the response code was not in [200, 299] + */ + public async createMemberTokenWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: CreateMemberTokenResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "CreateMemberTokenResponse", "" + ) as CreateMemberTokenResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("400", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: CreateMemberTokenResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "CreateMemberTokenResponse", "" + ) as CreateMemberTokenResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -142,42 +273,46 @@ export class MembersApiResponseProcessor { * @params response Response returned by the server for a request to detailsCurrentMember * @throws ApiException if the response code was not in [200, 299] */ - public async detailsCurrentMember(response: ResponseContext): Promise { + public async detailsCurrentMemberWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: MemberDetailsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "MemberDetailsResponse", "" ) as MemberDetailsResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -186,10 +321,17 @@ export class MembersApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "MemberDetailsResponse", "" ) as MemberDetailsResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -199,42 +341,46 @@ export class MembersApiResponseProcessor { * @params response Response returned by the server for a request to detailsMember * @throws ApiException if the response code was not in [200, 299] */ - public async detailsMember(response: ResponseContext): Promise { + public async detailsMemberWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: MemberDetailsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "MemberDetailsResponse", "" ) as MemberDetailsResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -243,10 +389,17 @@ export class MembersApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "MemberDetailsResponse", "" ) as MemberDetailsResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -256,42 +409,46 @@ export class MembersApiResponseProcessor { * @params response Response returned by the server for a request to listMembers * @throws ApiException if the response code was not in [200, 299] */ - public async listMembers(response: ResponseContext): Promise { + public async listMembersWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: MemberListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "MemberListResponse", "" ) as MemberListResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -300,10 +457,18 @@ export class MembersApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "MemberListResponse", "" ) as MemberListResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } } + diff --git a/src/apis/NotaryApi.ts b/src/apis/NotaryApi.ts new file mode 100644 index 0000000..b00698b --- /dev/null +++ b/src/apis/NotaryApi.ts @@ -0,0 +1,460 @@ +// TODO: better import syntax? +import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; +import {Configuration} from '../configuration'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; +import * as FormData from "form-data"; +import { URLSearchParams } from 'url'; +import {ObjectSerializer} from '../models/ObjectSerializer'; +import {ApiException} from './exception'; +import {canConsumeForm, isCodeInRange} from '../util'; +import { readRawBodyAndParse, tryParseRawBody } from '../pandadoc/httpErrorBody'; +import {SecurityAuthentication} from '../auth/auth'; + + +import { CreateNotarizationRequest } from '../models/CreateNotarizationRequest'; +import { CreateNotarizationResponse } from '../models/CreateNotarizationResponse'; +import { DeleteNotarizationRequest404Response } from '../models/DeleteNotarizationRequest404Response'; +import { ListNotaries400Response } from '../models/ListNotaries400Response'; +import { ListNotaries403Response } from '../models/ListNotaries403Response'; +import { ListNotaries429Response } from '../models/ListNotaries429Response'; +import { ListNotariesResponse } from '../models/ListNotariesResponse'; +import { NotarizationRequestDetailsResponse } from '../models/NotarizationRequestDetailsResponse'; + +/** + * no description + */ +export class NotaryApiRequestFactory extends BaseAPIRequestFactory { + + /** + * Create a notarization request to connect with a notary and complete online notarizations for your signers within minutes. > 🚧 **Important:** This endpoint supports only documents in draft status. ## Prerequisites > 🚧 Before you start > > Ensure the following before creating a notarization request: > > - Install the Notary On-Demand or Notary add-on > - Create a document for notarization and get its `document_id`. To create a document, use the [Create Document from Template](https://developers.pandadoc.com/reference/create-document-from-pandadoc-template) or [Create Document from File Upload](https://developers.pandadoc.com/reference/create-document-from-pdf) endpoint. ## Request Details For the notarization request, include in the request body: - `document_id` - At least one `invitees`, specifying their `email`, `first_name`, and `last_name` - Optionally, include a `message` for your signers - Optionally, using `disable_invitees_notifications` you can disable all notifications for invitees including email with invitation for notarization. This is useful when you are using alternative delivery methods. - If in-house notary must be assigned to this request, include the `notary` object with the notary\'s `id`, `scheduled_at` timestamp, and an optional `message` for the notary After the API call is executed, your signers will receive an email invitation for notarization. Alternatively, you can directly share the `notarization_link` with your signers, which is available in the 201 response body. Upon successful notarization, you will receive an email with a link to the notarized document. ## Usage Tips > 📘 Best Practices > > - Ensure that signers are added as both invitees in the request body and recipients in the document to avoid inconveniences during notary sessions > - Signers will receive an email with a notary link upon a successful API call; this link is also in the 201 response > - In case if notary is not specified in the request, signers will use the link to connect with commissioned online notaries, available Mon-Fri, 9 AM - 9 PM Central Time, typically responding within 2 minutes > - If notary is specified, signers will use the link to connect with your in-house notary at the scheduled time ## Limits A maximum of 100 API calls per minute is permitted. Exceeding this limit triggers a 429 Too Many Requests error. ## Troubleshooting **Solutions for 4xx Response Codes:** - **403 Forbidden (Inactive Add-on)**: Ensure the Notary On-Demand or Notary add-on is installed - **403 Forbidden (Transactions Limit)**: Purchase additional transactions either through the Notary UI or by contacting the Sales team - **429 Too Many Requests**: If you hit the limit, hold your API calls, then send them after waiting for the retry time > 📘 To learn more about PandaDoc Notary On-Demand, visit our [website](https://notary.pandadoc.com/notary-on-demand/). + * Create Notarization Request + * @param createNotarizationRequest + */ + public async createNotarizationRequest(createNotarizationRequest: CreateNotarizationRequest, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'createNotarizationRequest' is not null or undefined + if (createNotarizationRequest === null || createNotarizationRequest === undefined) { + throw new RequiredError("NotaryApi", "createNotarizationRequest", "createNotarizationRequest"); + } + + + // Path Params + const localVarPath = '/public/v2/notary/notarization-requests'; + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(createNotarizationRequest, "CreateNotarizationRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Use this method to delete a notarization request. Once notarization request is deleted it cannot be restored. > 🚧 Notarization Request status > > You can only delete a notarization request in status \'SENT\', \'WAITING_FOR_NOTARY\' or \'INCOMPLETE\'. > If the notarization request is in any other status, the request will return a 400 Bad Request error. By default all invitees will receive email notification about deletion of the notarization request. If you want to disable this notification, you can use the `disable_invitees_notifications` parameter when creating request (see [Create Notarization Request](https://developers.pandadoc.com/reference/create-notarization-request)). + * Delete Notarization Request + * @param sessionRequestId Notarization Request ID. + */ + public async deleteNotarizationRequest(sessionRequestId: string, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'sessionRequestId' is not null or undefined + if (sessionRequestId === null || sessionRequestId === undefined) { + throw new RequiredError("NotaryApi", "deleteNotarizationRequest", "sessionRequestId"); + } + + + // Path Params + const localVarPath = '/public/v2/notary/notarization-requests/{session_request_id}' + .replace('{' + 'session_request_id' + '}', encodeURIComponent(String(sessionRequestId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Retrieve a list of notaries associated with your organization. ## Important Notes - At the moment, notaries can be added to organization only manually through the PandaDoc Notary UI. - Organization must have Notary addon enabled to use this endpoint + * List Notaries + * @param status Filter by status (comma-separated values supported). Valid values are INVITED, UNDER_REVIEW, ACTIVE, REJECTED, INACTIVE + * @param commissionState Filter by commission state (comma-separated values supported) + * @param offset Number of results to skip + * @param limit Maximum number of results to return + * @param orderBy Sort by name, email, or status (default is email). Use a - prefix for descending order (e.g., -email) + */ + public async listNotaries(status?: Array<'INVITED' | 'UNDER_REVIEW' | 'ACTIVE' | 'REJECTED' | 'INACTIVE'>, commissionState?: Array, offset?: number, limit?: number, orderBy?: 'email' | '-email' | 'status' | '-status' | 'name' | '-name', _options?: Configuration): Promise { + let _config = _options || this.configuration; + + + + + + + // Path Params + const localVarPath = '/public/v2/notary/notaries'; + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + // Query Params + if (status !== undefined) { + const serializedParams = ObjectSerializer.serialize(status, "Array<'INVITED' | 'UNDER_REVIEW' | 'ACTIVE' | 'REJECTED' | 'INACTIVE'>", ""); + for (const serializedParam of serializedParams) { + requestContext.appendQueryParam("status", serializedParam); + } + } + + // Query Params + if (commissionState !== undefined) { + const serializedParams = ObjectSerializer.serialize(commissionState, "Array", ""); + for (const serializedParam of serializedParams) { + requestContext.appendQueryParam("commission_state", serializedParam); + } + } + + // Query Params + if (offset !== undefined) { + requestContext.setQueryParam("offset", ObjectSerializer.serialize(offset, "number", "")); + } + + // Query Params + if (limit !== undefined) { + requestContext.setQueryParam("limit", ObjectSerializer.serialize(limit, "number", "")); + } + + // Query Params + if (orderBy !== undefined) { + requestContext.setQueryParam("order_by", ObjectSerializer.serialize(orderBy, "'email' | '-email' | 'status' | '-status' | 'name' | '-name'", "")); + } + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Get details about a notarization request by its `id`. Details include: - Basic notarization request information (status, creator, invitees). - Signed documents information with links for downloading. - Notarization session recording information with link for downloading. - Timestamps associated with a notarization request. ## Available Notarization Request Statuses The following is a complete list of all possible notarization request statuses returned: | Notarization Request Status | Status Description | | :-------------------------- | :----------------------------------------------------------------------------------------------------------------- | | SENT | Notarization request has been created. Invitees are notified and can start the process of finding a notary. | | WAITING_FOR_NOTARY | One of the invitees initialised the process of finding a notary. | | ACCEPTED | Notarization request has been accepted by the notary. At this time nobody has joined the notarization session yet. | | LIVE | Notarization session has started. | | COMPLETED | Notarization session is finished. Documents have been successfully signed and ready for downloading. | | INCOMPLETE | Notarization session has started but was not completed successfully. | ## Signed documents Signed documents are the documents that were successfully signed during the notarization session. The signed document\'s info is available only if the notarization request has `COMPLETED` status, otherwise the returned list will be empty. In case you uploaded several documents for notarization then the `signed_documents` list will contain links for downloading for each document separately (with `SINGLE` document type) and link for the combined document (with `COMBINED` document type accordingly). ## Recording Recording is the video of the notarization session. The recording info is available only if the notarization request has `COMPLETED` status and recording is available, otherwise the returned object will be empty. > 📘 Links expire in 1 hour > > **Note**: The signed document and recording links expire in 1 hour. After this time it will be not possible to download files using the returned urls. In this case you need to call endpoint again since each request generates a new link. ## Limits A maximum of 100 API calls per minute is permitted. Exceeding this limit triggers a 429 Too Many Requests error. + * Notarization Request Details + * @param sessionRequestId Notarization Request ID. + */ + public async notarizationRequestDetails(sessionRequestId: string, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'sessionRequestId' is not null or undefined + if (sessionRequestId === null || sessionRequestId === undefined) { + throw new RequiredError("NotaryApi", "notarizationRequestDetails", "sessionRequestId"); + } + + + // Path Params + const localVarPath = '/public/v2/notary/notarization-requests/{session_request_id}' + .replace('{' + 'session_request_id' + '}', encodeURIComponent(String(sessionRequestId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + +} + +export class NotaryApiResponseProcessor { + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createNotarizationRequest + * @throws ApiException if the response code was not in [200, 299] + */ + public async createNotarizationRequestWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("201", response.httpStatusCode)) { + const body: CreateNotarizationResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "CreateNotarizationResponse", "" + ) as CreateNotarizationResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListNotaries403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListNotaries403Response", "" + ) as ListNotaries403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListNotaries429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListNotaries429Response", "" + ) as ListNotaries429Response; + throw new ApiException(response.httpStatusCode, "Too many requests error", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: CreateNotarizationResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "CreateNotarizationResponse", "" + ) as CreateNotarizationResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteNotarizationRequest + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteNotarizationRequestWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("204", response.httpStatusCode)) { + return new HttpInfo(response.httpStatusCode, response.headers, response.body, undefined); + } + if (isCodeInRange("400", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListNotaries400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListNotaries400Response", "" + ) as ListNotaries400Response; + throw new ApiException(response.httpStatusCode, "Bad Request error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListNotaries403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListNotaries403Response", "" + ) as ListNotaries403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("404", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: DeleteNotarizationRequest404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "DeleteNotarizationRequest404Response", "" + ) as DeleteNotarizationRequest404Response; + throw new ApiException(response.httpStatusCode, "Not found error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListNotaries429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListNotaries429Response", "" + ) as ListNotaries429Response; + throw new ApiException(response.httpStatusCode, "Too many requests error", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: void = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "void", "" + ) as void; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listNotaries + * @throws ApiException if the response code was not in [200, 299] + */ + public async listNotariesWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: ListNotariesResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ListNotariesResponse", "" + ) as ListNotariesResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("400", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListNotaries400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListNotaries400Response", "" + ) as ListNotaries400Response; + throw new ApiException(response.httpStatusCode, "Bad Request error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListNotaries403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListNotaries403Response", "" + ) as ListNotaries403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListNotaries429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListNotaries429Response", "" + ) as ListNotaries429Response; + throw new ApiException(response.httpStatusCode, "Too many requests error", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ListNotariesResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ListNotariesResponse", "" + ) as ListNotariesResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to notarizationRequestDetails + * @throws ApiException if the response code was not in [200, 299] + */ + public async notarizationRequestDetailsWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: NotarizationRequestDetailsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "NotarizationRequestDetailsResponse", "" + ) as NotarizationRequestDetailsResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: NotarizationRequestDetailsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "NotarizationRequestDetailsResponse", "" + ) as NotarizationRequestDetailsResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + +} + diff --git a/src/apis/OAuth20AuthenticationApi.ts b/src/apis/OAuth20AuthenticationApi.ts index 6d1f985..483f023 100644 --- a/src/apis/OAuth20AuthenticationApi.ts +++ b/src/apis/OAuth20AuthenticationApi.ts @@ -1,15 +1,17 @@ // TODO: better import syntax? -import {BaseAPIRequestFactory, RequiredError} from './baseapi'; +import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; -import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import { readRawBodyAndParse, tryParseRawBody } from '../pandadoc/httpErrorBody'; import {SecurityAuthentication} from '../auth/auth'; +import { AccessToken400Response } from '../models/AccessToken400Response'; import { OAuth2AccessTokenResponse } from '../models/OAuth2AccessTokenResponse'; /** @@ -18,6 +20,7 @@ import { OAuth2AccessTokenResponse } from '../models/OAuth2AccessTokenResponse'; export class OAuth20AuthenticationApiRequestFactory extends BaseAPIRequestFactory { /** + * Create or refresh an access token to make requests on behalf of a user. This endpoint is used to obtain an `access_token` and `refresh_token` for the first time, and to refresh the `access_token` when it expires. This endpoint is part of OAuth 2.0 implementation. You need to configure OAuth App to obtain `client_id` and `client_secret`. Read more about [OAuth 2.0 implementation](https://developers.pandadoc.com/reference/authentication-process). Make sure you\'re sending the header `Content-Type: application/x-www-form-urlencoded`. ## Create Access Token As a result of the OAuth 2.0 user authentication process, you should get a `code` that can be exchanged for an `access_token`. Use this endpoint to do this exchange, and to refresh the token later. > 🚧 Invalid Grant? > > If you receive an `invalid grant` response it is likely because you used the same `code` more than once from the [Authorize a PandaDoc User](ref:authorize-a-user) step above. The `code` parameter is generated for one-time use. A new `code` value must be generated if you wish to change API users, permissions, or simply generate a new `code` value for the same PandaDoc user. > 📘 expires_in > > `expires_in` is based in seconds. Currently, a token expires in 31535999 seconds = 1 year. ## Refresh Access Token Eventually, `access_token` expires and accessing an API method returns **401 unauthorized**. Your application needs to refresh the OAuth2 token with the stored `refresh_token` returned when initially creating an access token. Once refreshed, calls on behalf of the originally authorized user can resume immediately. Use the newly returned `access_token` for all future API requests. > 🚧 Invalid Grant? > > If you receive an `invalid grant` response, it is likely because your `refresh_token` is invalid. * Create/Refresh Access Token * @param grantType This value must be set to `refresh_token`. * @param clientId Client ID that is automatically generated after application creation in the Developer Dashboard. @@ -88,19 +91,8 @@ export class OAuth20AuthenticationApiRequestFactory extends BaseAPIRequestFactor requestContext.setHeaderParam("Content-Type", contentType); } - let authMethod: SecurityAuthentication | undefined; - // Apply auth methods - authMethod = _config.authMethods["apiKey"] - if (authMethod?.applySecurityAuthentication) { - await authMethod?.applySecurityAuthentication(requestContext); - } - // Apply auth methods - authMethod = _config.authMethods["oauth2"] - if (authMethod?.applySecurityAuthentication) { - await authMethod?.applySecurityAuthentication(requestContext); - } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -119,21 +111,22 @@ export class OAuth20AuthenticationApiResponseProcessor { * @params response Response returned by the server for a request to accessToken * @throws ApiException if the response code was not in [200, 299] */ - public async accessToken(response: ResponseContext): Promise { + public async accessTokenWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: OAuth2AccessTokenResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "OAuth2AccessTokenResponse", "" ) as OAuth2AccessTokenResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: AccessToken400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "AccessToken400Response", "" + ) as AccessToken400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -142,10 +135,18 @@ export class OAuth20AuthenticationApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "OAuth2AccessTokenResponse", "" ) as OAuth2AccessTokenResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } } + diff --git a/src/apis/ProductCatalogApi.ts b/src/apis/ProductCatalogApi.ts new file mode 100644 index 0000000..d56f282 --- /dev/null +++ b/src/apis/ProductCatalogApi.ts @@ -0,0 +1,581 @@ +// TODO: better import syntax? +import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; +import {Configuration} from '../configuration'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; +import * as FormData from "form-data"; +import { URLSearchParams } from 'url'; +import {ObjectSerializer} from '../models/ObjectSerializer'; +import {ApiException} from './exception'; +import {canConsumeForm, isCodeInRange} from '../util'; +import { readRawBodyAndParse, tryParseRawBody } from '../pandadoc/httpErrorBody'; +import {SecurityAuthentication} from '../auth/auth'; + + +import { ListCatalogItemsSearchResponse } from '../models/ListCatalogItemsSearchResponse'; +import { ListNotaries400Response } from '../models/ListNotaries400Response'; +import { ListNotaries403Response } from '../models/ListNotaries403Response'; +import { ListNotaries429Response } from '../models/ListNotaries429Response'; +import { ProductCatalogItemPatchRequest } from '../models/ProductCatalogItemPatchRequest'; +import { ProductCatalogItemRequest } from '../models/ProductCatalogItemRequest'; +import { ProductCatalogItemResponse } from '../models/ProductCatalogItemResponse'; +import { ProductCatalogTypeEnum } from '../models/ProductCatalogTypeEnum'; +import { SearchCatalogItems401Response } from '../models/SearchCatalogItems401Response'; + +/** + * no description + */ +export class ProductCatalogApiRequestFactory extends BaseAPIRequestFactory { + + /** + * Create a new catalog item. + * Create Catalog Item + * @param productCatalogItemRequest + */ + public async createCatalogItem(productCatalogItemRequest: ProductCatalogItemRequest, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'productCatalogItemRequest' is not null or undefined + if (productCatalogItemRequest === null || productCatalogItemRequest === undefined) { + throw new RequiredError("ProductCatalogApi", "createCatalogItem", "productCatalogItemRequest"); + } + + + // Path Params + const localVarPath = '/public/v2/product-catalog/items'; + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(productCatalogItemRequest, "ProductCatalogItemRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Delete catalog item. + * Delete Catalog Item + * @param itemUuid Catalog item UUID + */ + public async deleteCatalogItem(itemUuid: string, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'itemUuid' is not null or undefined + if (itemUuid === null || itemUuid === undefined) { + throw new RequiredError("ProductCatalogApi", "deleteCatalogItem", "itemUuid"); + } + + + // Path Params + const localVarPath = '/public/v2/product-catalog/items/{item_uuid}' + .replace('{' + 'item_uuid' + '}', encodeURIComponent(String(itemUuid))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Get catalog item. + * Catalog Item Details + * @param itemUuid Catalog item UUID + */ + public async getCatalogItem(itemUuid: string, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'itemUuid' is not null or undefined + if (itemUuid === null || itemUuid === undefined) { + throw new RequiredError("ProductCatalogApi", "getCatalogItem", "itemUuid"); + } + + + // Path Params + const localVarPath = '/public/v2/product-catalog/items/{item_uuid}' + .replace('{' + 'item_uuid' + '}', encodeURIComponent(String(itemUuid))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * This method searches for items in your [product catalog](https://support.pandadoc.com/en/articles/9714691-product-catalog). Use the `query` parameter to search in title, SKU, description, category name, custom fields name and value. You can also search for items by their type, billing type, and category id. Order search results, in both ascending and descending order, by these item properties: - SKU - Name - Price - Modification date Use the `exclude_uuids` parameter to exclude particular uuids from the search request. + * List Catalog Items Search + * @param page Page number. + * @param perPage Items per page. + * @param query Search query. Searches the following fields: Title, SKU, description, category name, custom fields name and value. + * @param orderBy Ordering principle for displaying search results. + * @param types Filter by catalog item types. + * @param billingTypes Filter by billing types. + * @param excludeUuids A list of item uuids to be excluded from search. + * @param categoryId Category id. + * @param noCategory + */ + public async searchCatalogItems(page?: number, perPage?: number, query?: string, orderBy?: 'sku' | '-sku' | 'title' | '-title' | 'price' | '-price' | 'date_modified' | '-date_modified', types?: Array, billingTypes?: Array<'one_time' | 'recurring'>, excludeUuids?: Array, categoryId?: string, noCategory?: boolean, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + + + + + + + + + + // Path Params + const localVarPath = '/public/v2/product-catalog/items/search'; + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + // Query Params + if (page !== undefined) { + requestContext.setQueryParam("page", ObjectSerializer.serialize(page, "number", "")); + } + + // Query Params + if (perPage !== undefined) { + requestContext.setQueryParam("per_page", ObjectSerializer.serialize(perPage, "number", "")); + } + + // Query Params + if (query !== undefined) { + requestContext.setQueryParam("query", ObjectSerializer.serialize(query, "string", "")); + } + + // Query Params + if (orderBy !== undefined) { + requestContext.setQueryParam("order_by", ObjectSerializer.serialize(orderBy, "'sku' | '-sku' | 'title' | '-title' | 'price' | '-price' | 'date_modified' | '-date_modified'", "")); + } + + // Query Params + if (types !== undefined) { + const serializedParams = ObjectSerializer.serialize(types, "Array", ""); + for (const serializedParam of serializedParams) { + requestContext.appendQueryParam("types", serializedParam); + } + } + + // Query Params + if (billingTypes !== undefined) { + const serializedParams = ObjectSerializer.serialize(billingTypes, "Array<'one_time' | 'recurring'>", ""); + for (const serializedParam of serializedParams) { + requestContext.appendQueryParam("billing_types", serializedParam); + } + } + + // Query Params + if (excludeUuids !== undefined) { + const serializedParams = ObjectSerializer.serialize(excludeUuids, "Array", ""); + for (const serializedParam of serializedParams) { + requestContext.appendQueryParam("exclude_uuids", serializedParam); + } + } + + // Query Params + if (categoryId !== undefined) { + requestContext.setQueryParam("category_id", ObjectSerializer.serialize(categoryId, "string", "")); + } + + // Query Params + if (noCategory !== undefined) { + requestContext.setQueryParam("no_category", ObjectSerializer.serialize(noCategory, "boolean", "")); + } + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Update catalog item. + * Update Catalog Item + * @param itemUuid Catalog item UUID + * @param productCatalogItemPatchRequest + */ + public async updateCatalogItem(itemUuid: string, productCatalogItemPatchRequest: ProductCatalogItemPatchRequest, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'itemUuid' is not null or undefined + if (itemUuid === null || itemUuid === undefined) { + throw new RequiredError("ProductCatalogApi", "updateCatalogItem", "itemUuid"); + } + + + // verify required parameter 'productCatalogItemPatchRequest' is not null or undefined + if (productCatalogItemPatchRequest === null || productCatalogItemPatchRequest === undefined) { + throw new RequiredError("ProductCatalogApi", "updateCatalogItem", "productCatalogItemPatchRequest"); + } + + + // Path Params + const localVarPath = '/public/v2/product-catalog/items/{item_uuid}' + .replace('{' + 'item_uuid' + '}', encodeURIComponent(String(itemUuid))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PATCH); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(productCatalogItemPatchRequest, "ProductCatalogItemPatchRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + +} + +export class ProductCatalogApiResponseProcessor { + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createCatalogItem + * @throws ApiException if the response code was not in [200, 299] + */ + public async createCatalogItemWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: ProductCatalogItemResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ProductCatalogItemResponse", "" + ) as ProductCatalogItemResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListNotaries403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListNotaries403Response", "" + ) as ListNotaries403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ProductCatalogItemResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ProductCatalogItemResponse", "" + ) as ProductCatalogItemResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteCatalogItem + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteCatalogItemWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + return new HttpInfo(response.httpStatusCode, response.headers, response.body, undefined); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListNotaries403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListNotaries403Response", "" + ) as ListNotaries403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: void = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "void", "" + ) as void; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getCatalogItem + * @throws ApiException if the response code was not in [200, 299] + */ + public async getCatalogItemWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: ProductCatalogItemResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ProductCatalogItemResponse", "" + ) as ProductCatalogItemResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListNotaries403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListNotaries403Response", "" + ) as ListNotaries403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ProductCatalogItemResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ProductCatalogItemResponse", "" + ) as ProductCatalogItemResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to searchCatalogItems + * @throws ApiException if the response code was not in [200, 299] + */ + public async searchCatalogItemsWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: ListCatalogItemsSearchResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ListCatalogItemsSearchResponse", "" + ) as ListCatalogItemsSearchResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("400", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListNotaries400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListNotaries400Response", "" + ) as ListNotaries400Response; + throw new ApiException(response.httpStatusCode, "Bad Request error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: SearchCatalogItems401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "SearchCatalogItems401Response", "" + ) as SearchCatalogItems401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListNotaries403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListNotaries403Response", "" + ) as ListNotaries403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListNotaries429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListNotaries429Response", "" + ) as ListNotaries429Response; + throw new ApiException(response.httpStatusCode, "Too many requests error", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ListCatalogItemsSearchResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ListCatalogItemsSearchResponse", "" + ) as ListCatalogItemsSearchResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to updateCatalogItem + * @throws ApiException if the response code was not in [200, 299] + */ + public async updateCatalogItemWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: ProductCatalogItemResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ProductCatalogItemResponse", "" + ) as ProductCatalogItemResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListNotaries403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListNotaries403Response", "" + ) as ListNotaries403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ProductCatalogItemResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ProductCatalogItemResponse", "" + ) as ProductCatalogItemResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + +} + diff --git a/src/apis/QuotesApi.ts b/src/apis/QuotesApi.ts index dbf0741..2aa011e 100644 --- a/src/apis/QuotesApi.ts +++ b/src/apis/QuotesApi.ts @@ -1,17 +1,23 @@ // TODO: better import syntax? -import {BaseAPIRequestFactory, RequiredError} from './baseapi'; +import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; -import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import { readRawBodyAndParse, tryParseRawBody } from '../pandadoc/httpErrorBody'; import {SecurityAuthentication} from '../auth/auth'; +import { ChangeDocumentStatus409Response } from '../models/ChangeDocumentStatus409Response'; +import { ListDocuments401Response } from '../models/ListDocuments401Response'; +import { ListDocuments403Response } from '../models/ListDocuments403Response'; +import { ListDocuments429Response } from '../models/ListDocuments429Response'; import { QuoteResponse } from '../models/QuoteResponse'; import { QuoteUpdateRequest } from '../models/QuoteUpdateRequest'; +import { StatusDocument404Response } from '../models/StatusDocument404Response'; /** * no description @@ -19,6 +25,7 @@ import { QuoteUpdateRequest } from '../models/QuoteUpdateRequest'; export class QuotesApiRequestFactory extends BaseAPIRequestFactory { /** + * This operation updates the details of a specific quote within a document by specifying the document ID and quote ID. * Quote update * @param documentId Document ID * @param quoteId Quote ID @@ -78,7 +85,7 @@ export class QuotesApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -97,49 +104,54 @@ export class QuotesApiResponseProcessor { * @params response Response returned by the server for a request to quoteUpdate * @throws ApiException if the response code was not in [200, 299] */ - public async quoteUpdate(response: ResponseContext): Promise { + public async quoteUpdateWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: QuoteResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "QuoteResponse", "" ) as QuoteResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("409", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(409, "Conflict", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ChangeDocumentStatus409Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ChangeDocumentStatus409Response", "" + ) as ChangeDocumentStatus409Response; + throw new ApiException(response.httpStatusCode, "Conflict", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -148,10 +160,18 @@ export class QuotesApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "QuoteResponse", "" ) as QuoteResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } } + diff --git a/src/apis/SectionsApi.ts b/src/apis/SectionsApi.ts deleted file mode 100644 index 1cb7f88..0000000 --- a/src/apis/SectionsApi.ts +++ /dev/null @@ -1,474 +0,0 @@ -// TODO: better import syntax? -import {BaseAPIRequestFactory, RequiredError} from './baseapi'; -import {Configuration} from '../configuration'; -import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; -import * as FormData from "form-data"; -import { URLSearchParams } from 'url'; -import {ObjectSerializer} from '../models/ObjectSerializer'; -import {ApiException} from './exception'; -import {canConsumeForm, isCodeInRange} from '../util'; -import {SecurityAuthentication} from '../auth/auth'; - - -import { SectionInfoResponse } from '../models/SectionInfoResponse'; -import { UploadSectionListResponse } from '../models/UploadSectionListResponse'; -import { UploadSectionRequest } from '../models/UploadSectionRequest'; -import { UploadSectionResponse } from '../models/UploadSectionResponse'; -import { UploadSectionStatusResponse } from '../models/UploadSectionStatusResponse'; - -/** - * no description - */ -export class SectionsApiRequestFactory extends BaseAPIRequestFactory { - - /** - * List sections - * @param documentId Document ID - */ - public async listSections(documentId: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; - - // verify required parameter 'documentId' is not null or undefined - if (documentId === null || documentId === undefined) { - throw new RequiredError("SectionsApi", "listSections", "documentId"); - } - - - // Path Params - const localVarPath = '/public/v1/documents/{document_id}/sections' - .replace('{' + 'document_id' + '}', encodeURIComponent(String(documentId))); - - // Make Request Context - const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); - requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - - - let authMethod: SecurityAuthentication | undefined; - // Apply auth methods - authMethod = _config.authMethods["apiKey"] - if (authMethod?.applySecurityAuthentication) { - await authMethod?.applySecurityAuthentication(requestContext); - } - // Apply auth methods - authMethod = _config.authMethods["oauth2"] - if (authMethod?.applySecurityAuthentication) { - await authMethod?.applySecurityAuthentication(requestContext); - } - - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default - if (defaultAuth?.applySecurityAuthentication) { - await defaultAuth?.applySecurityAuthentication(requestContext); - } - - return requestContext; - } - - /** - * Section details - * @param documentId Document ID - * @param uploadId Upload ID - */ - public async sectionDetails(documentId: string, uploadId: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; - - // verify required parameter 'documentId' is not null or undefined - if (documentId === null || documentId === undefined) { - throw new RequiredError("SectionsApi", "sectionDetails", "documentId"); - } - - - // verify required parameter 'uploadId' is not null or undefined - if (uploadId === null || uploadId === undefined) { - throw new RequiredError("SectionsApi", "sectionDetails", "uploadId"); - } - - - // Path Params - const localVarPath = '/public/v1/documents/{document_id}/sections/uploads/{upload_id}' - .replace('{' + 'document_id' + '}', encodeURIComponent(String(documentId))) - .replace('{' + 'upload_id' + '}', encodeURIComponent(String(uploadId))); - - // Make Request Context - const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); - requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - - - let authMethod: SecurityAuthentication | undefined; - // Apply auth methods - authMethod = _config.authMethods["apiKey"] - if (authMethod?.applySecurityAuthentication) { - await authMethod?.applySecurityAuthentication(requestContext); - } - // Apply auth methods - authMethod = _config.authMethods["oauth2"] - if (authMethod?.applySecurityAuthentication) { - await authMethod?.applySecurityAuthentication(requestContext); - } - - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default - if (defaultAuth?.applySecurityAuthentication) { - await defaultAuth?.applySecurityAuthentication(requestContext); - } - - return requestContext; - } - - /** - * Section Info - * @param documentId Document ID - * @param sectionId Section ID - */ - public async sectionInfo(documentId: string, sectionId: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; - - // verify required parameter 'documentId' is not null or undefined - if (documentId === null || documentId === undefined) { - throw new RequiredError("SectionsApi", "sectionInfo", "documentId"); - } - - - // verify required parameter 'sectionId' is not null or undefined - if (sectionId === null || sectionId === undefined) { - throw new RequiredError("SectionsApi", "sectionInfo", "sectionId"); - } - - - // Path Params - const localVarPath = '/public/v1/documents/{document_id}/sections/{section_id}' - .replace('{' + 'document_id' + '}', encodeURIComponent(String(documentId))) - .replace('{' + 'section_id' + '}', encodeURIComponent(String(sectionId))); - - // Make Request Context - const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); - requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - - - let authMethod: SecurityAuthentication | undefined; - // Apply auth methods - authMethod = _config.authMethods["apiKey"] - if (authMethod?.applySecurityAuthentication) { - await authMethod?.applySecurityAuthentication(requestContext); - } - // Apply auth methods - authMethod = _config.authMethods["oauth2"] - if (authMethod?.applySecurityAuthentication) { - await authMethod?.applySecurityAuthentication(requestContext); - } - - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default - if (defaultAuth?.applySecurityAuthentication) { - await defaultAuth?.applySecurityAuthentication(requestContext); - } - - return requestContext; - } - - /** - * Upload section - * @param documentId Document ID - * @param uploadSectionRequest Use a PandaDoc template or an existing PDF to upload a section. See the creation request examples [by template](/schemas/UploadSectionByTemplateRequest) and [by pdf](/schemas/UploadSectionByPdfRequest) - * @param mergeFieldScope Determines how the fields are mapped when creating a section. * document: Default value. The fields of the entire document are updated. * upload: Only the fields from the created section are updated. The merge field is appended with the upload ID. - */ - public async uploadSection(documentId: string, uploadSectionRequest: UploadSectionRequest, mergeFieldScope?: 'document' | 'upload', _options?: Configuration): Promise { - let _config = _options || this.configuration; - - // verify required parameter 'documentId' is not null or undefined - if (documentId === null || documentId === undefined) { - throw new RequiredError("SectionsApi", "uploadSection", "documentId"); - } - - - // verify required parameter 'uploadSectionRequest' is not null or undefined - if (uploadSectionRequest === null || uploadSectionRequest === undefined) { - throw new RequiredError("SectionsApi", "uploadSection", "uploadSectionRequest"); - } - - - - // Path Params - const localVarPath = '/public/v1/documents/{document_id}/sections/uploads' - .replace('{' + 'document_id' + '}', encodeURIComponent(String(documentId))); - - // Make Request Context - const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); - requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - - // Query Params - if (mergeFieldScope !== undefined) { - requestContext.setQueryParam("merge_field_scope", ObjectSerializer.serialize(mergeFieldScope, "'document' | 'upload'", "")); - } - - - // Body Params - const contentType = ObjectSerializer.getPreferredMediaType([ - "application/json", - - "multipart/form-data" - ]); - requestContext.setHeaderParam("Content-Type", contentType); - const serializedBody = ObjectSerializer.stringify( - ObjectSerializer.serialize(uploadSectionRequest, "UploadSectionRequest", ""), - contentType - ); - requestContext.setBody(serializedBody); - - let authMethod: SecurityAuthentication | undefined; - // Apply auth methods - authMethod = _config.authMethods["apiKey"] - if (authMethod?.applySecurityAuthentication) { - await authMethod?.applySecurityAuthentication(requestContext); - } - // Apply auth methods - authMethod = _config.authMethods["oauth2"] - if (authMethod?.applySecurityAuthentication) { - await authMethod?.applySecurityAuthentication(requestContext); - } - - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default - if (defaultAuth?.applySecurityAuthentication) { - await defaultAuth?.applySecurityAuthentication(requestContext); - } - - return requestContext; - } - -} - -export class SectionsApiResponseProcessor { - - /** - * Unwraps the actual response sent by the server from the response context and deserializes the response content - * to the expected objects - * - * @params response Response returned by the server for a request to listSections - * @throws ApiException if the response code was not in [200, 299] - */ - public async listSections(response: ResponseContext): Promise { - const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); - if (isCodeInRange("200", response.httpStatusCode)) { - const body: UploadSectionListResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "UploadSectionListResponse", "" - ) as UploadSectionListResponse; - return body; - } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); - } - if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); - } - - // Work around for missing responses in specification, e.g. for petstore.yaml - if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: UploadSectionListResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "UploadSectionListResponse", "" - ) as UploadSectionListResponse; - return body; - } - - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); - } - - /** - * Unwraps the actual response sent by the server from the response context and deserializes the response content - * to the expected objects - * - * @params response Response returned by the server for a request to sectionDetails - * @throws ApiException if the response code was not in [200, 299] - */ - public async sectionDetails(response: ResponseContext): Promise { - const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); - if (isCodeInRange("200", response.httpStatusCode)) { - const body: UploadSectionStatusResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "UploadSectionStatusResponse", "" - ) as UploadSectionStatusResponse; - return body; - } - if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); - } - if (isCodeInRange("409", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(409, "Conflict", body, response.headers); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); - } - - // Work around for missing responses in specification, e.g. for petstore.yaml - if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: UploadSectionStatusResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "UploadSectionStatusResponse", "" - ) as UploadSectionStatusResponse; - return body; - } - - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); - } - - /** - * Unwraps the actual response sent by the server from the response context and deserializes the response content - * to the expected objects - * - * @params response Response returned by the server for a request to sectionInfo - * @throws ApiException if the response code was not in [200, 299] - */ - public async sectionInfo(response: ResponseContext): Promise { - const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); - if (isCodeInRange("200", response.httpStatusCode)) { - const body: SectionInfoResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "SectionInfoResponse", "" - ) as SectionInfoResponse; - return body; - } - if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); - } - if (isCodeInRange("409", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(409, "Conflict", body, response.headers); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); - } - - // Work around for missing responses in specification, e.g. for petstore.yaml - if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: SectionInfoResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "SectionInfoResponse", "" - ) as SectionInfoResponse; - return body; - } - - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); - } - - /** - * Unwraps the actual response sent by the server from the response context and deserializes the response content - * to the expected objects - * - * @params response Response returned by the server for a request to uploadSection - * @throws ApiException if the response code was not in [200, 299] - */ - public async uploadSection(response: ResponseContext): Promise { - const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); - if (isCodeInRange("201", response.httpStatusCode)) { - const body: UploadSectionResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "UploadSectionResponse", "" - ) as UploadSectionResponse; - return body; - } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); - } - if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); - } - - // Work around for missing responses in specification, e.g. for petstore.yaml - if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: UploadSectionResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "UploadSectionResponse", "" - ) as UploadSectionResponse; - return body; - } - - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); - } - -} diff --git a/src/apis/TemplateSettingsApi.ts b/src/apis/TemplateSettingsApi.ts new file mode 100644 index 0000000..9495dfd --- /dev/null +++ b/src/apis/TemplateSettingsApi.ts @@ -0,0 +1,203 @@ +// TODO: better import syntax? +import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; +import {Configuration} from '../configuration'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; +import * as FormData from "form-data"; +import { URLSearchParams } from 'url'; +import {ObjectSerializer} from '../models/ObjectSerializer'; +import {ApiException} from './exception'; +import {canConsumeForm, isCodeInRange} from '../util'; +import { readRawBodyAndParse, tryParseRawBody } from '../pandadoc/httpErrorBody'; +import {SecurityAuthentication} from '../auth/auth'; + + +import { TemplateSettingsResponse } from '../models/TemplateSettingsResponse'; +import { UpdateTemplateSettingsRequest } from '../models/UpdateTemplateSettingsRequest'; + +/** + * no description + */ +export class TemplateSettingsApiRequestFactory extends BaseAPIRequestFactory { + + /** + * Retrieves the settings for a specified template. Only the language field is currently supported. + * Get template settings + * @param templateId Unique identifier of the template to retrieve settings for. + */ + public async templateSettingsGet(templateId: string, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'templateId' is not null or undefined + if (templateId === null || templateId === undefined) { + throw new RequiredError("TemplateSettingsApi", "templateSettingsGet", "templateId"); + } + + + // Path Params + const localVarPath = '/public/v2/templates/{template_id}/settings' + .replace('{' + 'template_id' + '}', encodeURIComponent(String(templateId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Updates the settings for a specified template. Only the language field is currently supported. + * Update template settings + * @param templateId Unique identifier of the template to update settings for. + * @param updateTemplateSettingsRequest + */ + public async templateSettingsUpdate(templateId: string, updateTemplateSettingsRequest: UpdateTemplateSettingsRequest, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'templateId' is not null or undefined + if (templateId === null || templateId === undefined) { + throw new RequiredError("TemplateSettingsApi", "templateSettingsUpdate", "templateId"); + } + + + // verify required parameter 'updateTemplateSettingsRequest' is not null or undefined + if (updateTemplateSettingsRequest === null || updateTemplateSettingsRequest === undefined) { + throw new RequiredError("TemplateSettingsApi", "templateSettingsUpdate", "updateTemplateSettingsRequest"); + } + + + // Path Params + const localVarPath = '/public/v2/templates/{template_id}/settings' + .replace('{' + 'template_id' + '}', encodeURIComponent(String(templateId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PATCH); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(updateTemplateSettingsRequest, "UpdateTemplateSettingsRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + +} + +export class TemplateSettingsApiResponseProcessor { + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to templateSettingsGet + * @throws ApiException if the response code was not in [200, 299] + */ + public async templateSettingsGetWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: TemplateSettingsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TemplateSettingsResponse", "" + ) as TemplateSettingsResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: TemplateSettingsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TemplateSettingsResponse", "" + ) as TemplateSettingsResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to templateSettingsUpdate + * @throws ApiException if the response code was not in [200, 299] + */ + public async templateSettingsUpdateWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: TemplateSettingsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TemplateSettingsResponse", "" + ) as TemplateSettingsResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: TemplateSettingsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TemplateSettingsResponse", "" + ) as TemplateSettingsResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + +} + diff --git a/src/apis/TemplatesApi.ts b/src/apis/TemplatesApi.ts index 8a86ec4..f5e1591 100644 --- a/src/apis/TemplatesApi.ts +++ b/src/apis/TemplatesApi.ts @@ -1,23 +1,235 @@ // TODO: better import syntax? -import {BaseAPIRequestFactory, RequiredError} from './baseapi'; +import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; -import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import { readRawBodyAndParse, tryParseRawBody } from '../pandadoc/httpErrorBody'; import {SecurityAuthentication} from '../auth/auth'; +import { CreateDocument400Response } from '../models/CreateDocument400Response'; +import { CreateTemplateEditingSession201Response } from '../models/CreateTemplateEditingSession201Response'; +import { CreateTemplateFromUrlRequest } from '../models/CreateTemplateFromUrlRequest'; +import { CreateTemplateRequest } from '../models/CreateTemplateRequest'; +import { EditingSessionRequest } from '../models/EditingSessionRequest'; +import { ListDocuments401Response } from '../models/ListDocuments401Response'; +import { ListDocuments403Response } from '../models/ListDocuments403Response'; +import { ListDocuments429Response } from '../models/ListDocuments429Response'; +import { StatusDocument404Response } from '../models/StatusDocument404Response'; +import { TemplateCreateResponse } from '../models/TemplateCreateResponse'; import { TemplateDetailsResponse } from '../models/TemplateDetailsResponse'; import { TemplateListResponse } from '../models/TemplateListResponse'; +import { TemplateStatusResponse } from '../models/TemplateStatusResponse'; +import { TemplateUpdateRequest } from '../models/TemplateUpdateRequest'; +import { UpdateDocument400Response } from '../models/UpdateDocument400Response'; /** * no description */ export class TemplatesApiRequestFactory extends BaseAPIRequestFactory { + /** + * This operation allows you to create a new template by providing the necessary template details. + * Create Template + * @param createTemplateFromUrlRequest + * @param fields A comma-separated list of additional fields to include in the response. + */ + public async createTemplate(createTemplateFromUrlRequest: CreateTemplateFromUrlRequest, fields?: Array<'content_date_modified'>, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'createTemplateFromUrlRequest' is not null or undefined + if (createTemplateFromUrlRequest === null || createTemplateFromUrlRequest === undefined) { + throw new RequiredError("TemplatesApi", "createTemplate", "createTemplateFromUrlRequest"); + } + + + + // Path Params + const localVarPath = '/public/v1/templates'; + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + // Query Params + if (fields !== undefined) { + requestContext.setQueryParam("fields", ObjectSerializer.serialize(fields, "Array<'content_date_modified'>", "")); + } + + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(createTemplateFromUrlRequest, "CreateTemplateFromUrlRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Creates a new editing session for the Embedded Editor. The response includes an E-Token, which is required to open the template. #### Limitations - **Single Active Session per User-Template Pair** Only one editing session can be active at a time for a specific user and template. Creating a new session for the same user-template pair will automatically invalidate the previous one. - **Weekly Session Cap** A maximum of **250** editing sessions can be created for a single template per week. Any attempt to exceed this limit will result in a `403 Forbidden` error. + * Create Template Editing Session + * @param id Template ID + * @param editingSessionRequest + */ + public async createTemplateEditingSession(id: string, editingSessionRequest: EditingSessionRequest, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError("TemplatesApi", "createTemplateEditingSession", "id"); + } + + + // verify required parameter 'editingSessionRequest' is not null or undefined + if (editingSessionRequest === null || editingSessionRequest === undefined) { + throw new RequiredError("TemplatesApi", "createTemplateEditingSession", "editingSessionRequest"); + } + + + // Path Params + const localVarPath = '/public/v1/templates/{id}/editing-sessions' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(editingSessionRequest, "EditingSessionRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * This asynchronous endpoint allows users to create a new template by uploading a file. The uploaded file is processed in the background to generate the template. The maximum allowable file size for upload is 100 MB. Field tags and form fields are not supported yet. Once the file is uploaded, the processing will happen asynchronously, and users need to check [the status of the template](https://developers.pandadoc.com/reference/template-status) creation. + * Create Template from File Upload + * @param fields A comma-separated list of additional fields to include in the response. + * @param file Binary PDF/DocX/RTF File. + * @param data JSON as a multipart/form-data string. + */ + public async createTemplateWithUpload(fields?: Array<'content_date_modified'>, file?: HttpFile, data?: CreateTemplateRequest, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + + + + // Path Params + const localVarPath = '/public/v1/templates?upload'; + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + // Query Params + if (fields !== undefined) { + requestContext.setQueryParam("fields", ObjectSerializer.serialize(fields, "Array<'content_date_modified'>", "")); + } + + // Form Params + const useForm = canConsumeForm([ + 'multipart/form-data', + ]); + + let localVarFormParams + if (useForm) { + localVarFormParams = new FormData(); + } else { + localVarFormParams = new URLSearchParams(); + } + + if (file !== undefined) { + // TODO: replace .append with .set + if (localVarFormParams instanceof FormData) { + localVarFormParams.append('file', file.data, file.name); + } + } + if (data !== undefined) { + // TODO: replace .append with .set + localVarFormParams.append('data', data as any); + } + + requestContext.setBody(localVarFormParams); + + if(!useForm) { + const contentType = ObjectSerializer.getPreferredMediaType([ + "multipart/form-data" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + } + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + /** * Delete a template * Delete Template @@ -53,7 +265,7 @@ export class TemplatesApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -62,8 +274,8 @@ export class TemplatesApiRequestFactory extends BaseAPIRequestFactory { } /** - * Return detailed data about a template. - * Details Template + * Get details about a template by `id`. Details include: - Basic template information (name, author, etc) - Roles - All fields with values - All tokens with values - Pricing information (pricing tables, products, quotes) - Template metadata - Template tags - Content placeholders - Modification timestamps. Note that `date_modified` means any changes associated with the template roles, while `content_date_modified` logs any changes in the template content. + * Template Details * @param id Template ID */ public async detailsTemplate(id: string, _options?: Configuration): Promise { @@ -96,7 +308,7 @@ export class TemplatesApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -105,19 +317,19 @@ export class TemplatesApiRequestFactory extends BaseAPIRequestFactory { } /** - * Optionally, filter by a search query or tags. + * Retrieves a list of templates. You can filter results by a search query, tags, or fields. * List Templates - * @param q Optional search query. Filter by template name. + * @param q Search query. Filter by template name. * @param shared Returns only the shared templates. - * @param deleted Optional. Returns only the deleted templates. - * @param count Optionally, specify how many templates to return. Default is 50 templates, maximum is 100 templates. - * @param page Optionally, specify which page of the dataset to return. - * @param id Optionally, specify template ID. + * @param deleted Returns only the deleted templates. + * @param count Specify how many templates to return. + * @param page Specify which page of the dataset to return. + * @param id Specify template ID. * @param folderUuid UUID of the folder where the templates are stored. - * @param tag Optional search tag. Filter by template tag. - * @param fields A comma-separated list of additional fields to include in the response. Each field must be a valid template property. Currently, only one additional field, `content_date_modified`, is supported. For example, `GET /templates?fields=content_date_modified`. + * @param tag Search tag. Filter by template tag. + * @param fields A comma-separated list of additional fields to include in the response. */ - public async listTemplates(q?: string, shared?: boolean, deleted?: boolean, count?: number, page?: number, id?: string, folderUuid?: string, tag?: Array, fields?: string, _options?: Configuration): Promise { + public async listTemplates(q?: string, shared?: boolean, deleted?: boolean, count?: number, page?: number, id?: string, folderUuid?: string, tag?: Array, fields?: Array<'content_date_modified'>, _options?: Configuration): Promise { let _config = _options || this.configuration; @@ -173,12 +385,15 @@ export class TemplatesApiRequestFactory extends BaseAPIRequestFactory { // Query Params if (tag !== undefined) { - requestContext.setQueryParam("tag", ObjectSerializer.serialize(tag, "Array", "")); + const serializedParams = ObjectSerializer.serialize(tag, "Array", ""); + for (const serializedParam of serializedParams) { + requestContext.appendQueryParam("tag", serializedParam); + } } // Query Params if (fields !== undefined) { - requestContext.setQueryParam("fields", ObjectSerializer.serialize(fields, "string", "")); + requestContext.setQueryParam("fields", ObjectSerializer.serialize(fields, "Array<'content_date_modified'>", "")); } @@ -194,7 +409,111 @@ export class TemplatesApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * ## Available Template Statuses The following is a complete list of all possible template statuses returned: | Template Status | Status Description | | :------------------- | :-------------------------------------------------------------------------------------------------------------------------------------- | | `template.UPLOADED` | The template upload process has been initiated and is currently in progress. It will soon transition to the `template.PROCESSED` state. | | `template.PROCESSED` | The template has been successfully uploaded and created. At this stage, all aspects of the template are editable. | | `template.ERROR` | The template upload process has failed. Please refer to the error details in the response for more information. | + * Template Status + * @param id Template ID + */ + public async statusTemplate(id: string, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError("TemplatesApi", "statusTemplate", "id"); + } + + + // Path Params + const localVarPath = '/public/v1/templates/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * > 🚧 Template status > > You can only update a template in the PROCESSED status (`template.PROCESSED`). > > After creating a new template, it usually retains a `template.uploaded` status for 3-5 seconds while the template syncs across PandaDoc servers. When the template is available for further API calls, the template moves to the `template.PROCESSED` state. Use [Template Status](https://developers.pandadoc.com/reference/template-status) or Webhooks to check template status. + * Template Update + * @param id Template ID + * @param templateUpdateRequest + */ + public async updateTemplate(id: string, templateUpdateRequest: TemplateUpdateRequest, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError("TemplatesApi", "updateTemplate", "id"); + } + + + // verify required parameter 'templateUpdateRequest' is not null or undefined + if (templateUpdateRequest === null || templateUpdateRequest === undefined) { + throw new RequiredError("TemplatesApi", "updateTemplate", "templateUpdateRequest"); + } + + + // Path Params + const localVarPath = '/public/v1/templates/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PATCH); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(templateUpdateRequest, "TemplateUpdateRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -210,48 +529,249 @@ export class TemplatesApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to deleteTemplate + * @params response Response returned by the server for a request to createTemplate * @throws ApiException if the response code was not in [200, 299] */ - public async deleteTemplate(response: ResponseContext): Promise { + public async createTemplateWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); - if (isCodeInRange("204", response.httpStatusCode)) { - return; + if (isCodeInRange("201", response.httpStatusCode)) { + const body: TemplateCreateResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TemplateCreateResponse", "" + ) as TemplateCreateResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: CreateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "CreateDocument400Response", "" + ) as CreateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: TemplateCreateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + "TemplateCreateResponse", "" + ) as TemplateCreateResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createTemplateEditingSession + * @throws ApiException if the response code was not in [200, 299] + */ + public async createTemplateEditingSessionWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("201", response.httpStatusCode)) { + const body: CreateTemplateEditingSession201Response = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + "CreateTemplateEditingSession201Response", "" + ) as CreateTemplateEditingSession201Response; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("400", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad request", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: CreateTemplateEditingSession201Response = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + "CreateTemplateEditingSession201Response", "" + ) as CreateTemplateEditingSession201Response; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createTemplateWithUpload + * @throws ApiException if the response code was not in [200, 299] + */ + public async createTemplateWithUploadWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("201", response.httpStatusCode)) { + const body: TemplateCreateResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TemplateCreateResponse", "" + ) as TemplateCreateResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("400", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: CreateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "CreateDocument400Response", "" + ) as CreateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: TemplateCreateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + "TemplateCreateResponse", "" + ) as TemplateCreateResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteTemplate + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteTemplateWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("204", response.httpStatusCode)) { + return new HttpInfo(response.httpStatusCode, response.headers, response.body, undefined); + } + if (isCodeInRange("400", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("404", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -260,10 +780,17 @@ export class TemplatesApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "void", "" ) as void; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -273,42 +800,46 @@ export class TemplatesApiResponseProcessor { * @params response Response returned by the server for a request to detailsTemplate * @throws ApiException if the response code was not in [200, 299] */ - public async detailsTemplate(response: ResponseContext): Promise { + public async detailsTemplateWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: TemplateDetailsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "TemplateDetailsResponse", "" ) as TemplateDetailsResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -317,10 +848,17 @@ export class TemplatesApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "TemplateDetailsResponse", "" ) as TemplateDetailsResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -330,28 +868,30 @@ export class TemplatesApiResponseProcessor { * @params response Response returned by the server for a request to listTemplates * @throws ApiException if the response code was not in [200, 299] */ - public async listTemplates(response: ResponseContext): Promise { + public async listTemplatesWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: TemplateListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "TemplateListResponse", "" ) as TemplateListResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -360,10 +900,158 @@ export class TemplatesApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "TemplateListResponse", "" ) as TemplateListResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to statusTemplate + * @throws ApiException if the response code was not in [200, 299] + */ + public async statusTemplateWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: TemplateStatusResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TemplateStatusResponse", "" + ) as TemplateStatusResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("404", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: TemplateStatusResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TemplateStatusResponse", "" + ) as TemplateStatusResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to updateTemplate + * @throws ApiException if the response code was not in [200, 299] + */ + public async updateTemplateWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("204", response.httpStatusCode)) { + return new HttpInfo(response.httpStatusCode, response.headers, response.body, undefined); + } + if (isCodeInRange("400", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("404", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: void = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "void", "" + ) as void; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } } + diff --git a/src/apis/UserAndWorkspaceManagementApi.ts b/src/apis/UserAndWorkspaceManagementApi.ts index 831b941..b593b17 100644 --- a/src/apis/UserAndWorkspaceManagementApi.ts +++ b/src/apis/UserAndWorkspaceManagementApi.ts @@ -1,21 +1,35 @@ // TODO: better import syntax? -import {BaseAPIRequestFactory, RequiredError} from './baseapi'; +import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; -import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import { readRawBodyAndParse, tryParseRawBody } from '../pandadoc/httpErrorBody'; import {SecurityAuthentication} from '../auth/auth'; +import { AddMember400Response } from '../models/AddMember400Response'; import { AddMemberRequest } from '../models/AddMemberRequest'; import { AddMemberResponse } from '../models/AddMemberResponse'; +import { CreateApiKeyRequest } from '../models/CreateApiKeyRequest'; +import { CreateApiKeyResponse } from '../models/CreateApiKeyResponse'; +import { CreateUser400Response } from '../models/CreateUser400Response'; import { CreateUserRequest } from '../models/CreateUserRequest'; import { CreateUserResponse } from '../models/CreateUserResponse'; import { CreateWorkspaceRequest } from '../models/CreateWorkspaceRequest'; import { CreateWorkspaceResponse } from '../models/CreateWorkspaceResponse'; +import { ListDocuments401Response } from '../models/ListDocuments401Response'; +import { ListDocuments403Response } from '../models/ListDocuments403Response'; +import { ListDocuments429Response } from '../models/ListDocuments429Response'; +import { ListUsersResponse } from '../models/ListUsersResponse'; +import { ListWorkspacesResponse } from '../models/ListWorkspacesResponse'; +import { RemoveMember400Response } from '../models/RemoveMember400Response'; +import { RemoveMember404Response } from '../models/RemoveMember404Response'; +import { StatusDocument404Response } from '../models/StatusDocument404Response'; +import { UpdateDocument400Response } from '../models/UpdateDocument400Response'; /** * no description @@ -23,7 +37,8 @@ import { CreateWorkspaceResponse } from '../models/CreateWorkspaceResponse'; export class UserAndWorkspaceManagementApiRequestFactory extends BaseAPIRequestFactory { /** - * Add member + * Add an existing user to a workspace. - You must be an organization admin or a workspace admin to add members. + * Add Member to Workspace * @param workspaceId * @param addMemberRequest * @param notifyUser Send a confirmation email to the user that was added to workspace(s). @@ -88,7 +103,7 @@ export class UserAndWorkspaceManagementApiRequestFactory extends BaseAPIRequestF await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -97,6 +112,68 @@ export class UserAndWorkspaceManagementApiRequestFactory extends BaseAPIRequestF } /** + * Generate a new API key for the workspace. Check out [API Key Authentication article](https://developers.pandadoc.com/reference/api-key-authentication-process) for detailed API Keys description. > 📘 > - Only an **Org Admin** can generate an API keys. > - To make another user a key\'s owner, pass `user_id` of this user. The user should has an **Admin** role in the workspace. > - Generating a new key invalidates existing key with the same type. Using this request, you can deactivate the key you\'re using for the request. + * Create API Key + * @param workspaceId Workspace id. + * @param createApiKeyRequest + */ + public async createApiKey(workspaceId: string, createApiKeyRequest: CreateApiKeyRequest, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'workspaceId' is not null or undefined + if (workspaceId === null || workspaceId === undefined) { + throw new RequiredError("UserAndWorkspaceManagementApi", "createApiKey", "workspaceId"); + } + + + // verify required parameter 'createApiKeyRequest' is not null or undefined + if (createApiKeyRequest === null || createApiKeyRequest === undefined) { + throw new RequiredError("UserAndWorkspaceManagementApi", "createApiKey", "createApiKeyRequest"); + } + + + // Path Params + const localVarPath = '/public/v1/workspaces/{workspace_id}/api-keys' + .replace('{' + 'workspace_id' + '}', encodeURIComponent(String(workspaceId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(createApiKeyRequest, "CreateApiKeyRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Create users, and assign them roles, licenses, and workspaces. - You must be an organization admin to create users. - We check that the user email domain matches your organization domain. - We check that the user email and phone number have a valid format. * Create User * @param createUserRequest * @param notifyUser Send a confirmation email to the user that was added to workspace(s). @@ -154,7 +231,7 @@ export class UserAndWorkspaceManagementApiRequestFactory extends BaseAPIRequestF await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -163,6 +240,7 @@ export class UserAndWorkspaceManagementApiRequestFactory extends BaseAPIRequestF } /** + * Create a workspace in your organization. - You need to be an Org Admin to create a workspace. - You will be added to the new workspace with an Admin role. * Create Workspace * @param createWorkspaceRequest */ @@ -206,7 +284,219 @@ export class UserAndWorkspaceManagementApiRequestFactory extends BaseAPIRequestF await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Deactivate the workspace, remove all the members from it and make it unavailable. + * Deactivate Workspace + * @param workspaceId + * @param body + */ + public async deactivateWorkspace(workspaceId: string, body?: any, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'workspaceId' is not null or undefined + if (workspaceId === null || workspaceId === undefined) { + throw new RequiredError("UserAndWorkspaceManagementApi", "deactivateWorkspace", "workspaceId"); + } + + + + // Path Params + const localVarPath = '/public/v1/workspaces/{workspace_id}/deactivate' + .replace('{' + 'workspace_id' + '}', encodeURIComponent(String(workspaceId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json" + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "any", ""), + contentType + ); + requestContext.setBody(serializedBody); + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Get a list of all the active workspaces in the organization. + * List Workspaces + * @param count Number of elements in page. + * @param page Page number. + */ + public async getWorkspacesList(count?: number, page?: number, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + + + // Path Params + const localVarPath = '/public/v1/workspaces'; + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + // Query Params + if (count !== undefined) { + requestContext.setQueryParam("count", ObjectSerializer.serialize(count, "number", "int32")); + } + + // Query Params + if (page !== undefined) { + requestContext.setQueryParam("page", ObjectSerializer.serialize(page, "number", "int32")); + } + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * Get a list of all users with membership in your organization, with their contact information, license type, and workspace roles. You must be an organization admin to list users. + * List Users + * @param count Number of elements in page. + * @param page Page number. + * @param showRemoved Filter option - show users with removed memberships. + */ + public async listUsers(count?: number, page?: number, showRemoved?: boolean, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + + + + // Path Params + const localVarPath = '/public/v1/users'; + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + // Query Params + if (count !== undefined) { + requestContext.setQueryParam("count", ObjectSerializer.serialize(count, "number", "int32")); + } + + // Query Params + if (page !== undefined) { + requestContext.setQueryParam("page", ObjectSerializer.serialize(page, "number", "int32")); + } + + // Query Params + if (showRemoved !== undefined) { + requestContext.setQueryParam("show_removed", ObjectSerializer.serialize(showRemoved, "boolean", "")); + } + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + + /** + * This operation removes a specified member from a workspace by providing the workspace ID and member ID. + * Remove Member from Workspace + * @param workspaceId Workspace id + * @param memberId Member id + */ + public async removeMember(workspaceId: string, memberId: string, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'workspaceId' is not null or undefined + if (workspaceId === null || workspaceId === undefined) { + throw new RequiredError("UserAndWorkspaceManagementApi", "removeMember", "workspaceId"); + } + + + // verify required parameter 'memberId' is not null or undefined + if (memberId === null || memberId === undefined) { + throw new RequiredError("UserAndWorkspaceManagementApi", "removeMember", "memberId"); + } + + + // Path Params + const localVarPath = '/public/v1/workspaces/{workspace_id}/members/{member_id}' + .replace('{' + 'workspace_id' + '}', encodeURIComponent(String(workspaceId))) + .replace('{' + 'member_id' + '}', encodeURIComponent(String(memberId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["apiKey"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + // Apply auth methods + authMethod = _config.authMethods["oauth2"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -225,49 +515,54 @@ export class UserAndWorkspaceManagementApiResponseProcessor { * @params response Response returned by the server for a request to addMember * @throws ApiException if the response code was not in [200, 299] */ - public async addMember(response: ResponseContext): Promise { + public async addMemberWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("201", response.httpStatusCode)) { const body: AddMemberResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "AddMemberResponse", "" ) as AddMemberResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: AddMember400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "AddMember400Response", "" + ) as AddMember400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -276,10 +571,85 @@ export class UserAndWorkspaceManagementApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "AddMemberResponse", "" ) as AddMemberResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createApiKey + * @throws ApiException if the response code was not in [200, 299] + */ + public async createApiKeyWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: CreateApiKeyResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "CreateApiKeyResponse", "" + ) as CreateApiKeyResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("400", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: CreateApiKeyResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "CreateApiKeyResponse", "" + ) as CreateApiKeyResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -289,49 +659,54 @@ export class UserAndWorkspaceManagementApiResponseProcessor { * @params response Response returned by the server for a request to createUser * @throws ApiException if the response code was not in [200, 299] */ - public async createUser(response: ResponseContext): Promise { + public async createUserWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("201", response.httpStatusCode)) { const body: CreateUserResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "CreateUserResponse", "" ) as CreateUserResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: CreateUser400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "CreateUser400Response", "" + ) as CreateUser400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -340,10 +715,17 @@ export class UserAndWorkspaceManagementApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "CreateUserResponse", "" ) as CreateUserResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -353,54 +735,318 @@ export class UserAndWorkspaceManagementApiResponseProcessor { * @params response Response returned by the server for a request to createWorkspace * @throws ApiException if the response code was not in [200, 299] */ - public async createWorkspace(response: ResponseContext): Promise { + public async createWorkspaceWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("201", response.httpStatusCode)) { const body: CreateWorkspaceResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "CreateWorkspaceResponse", "" ) as CreateWorkspaceResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("404", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: CreateWorkspaceResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "CreateWorkspaceResponse", "" + ) as CreateWorkspaceResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deactivateWorkspace + * @throws ApiException if the response code was not in [200, 299] + */ + public async deactivateWorkspaceWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { const body: any = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "any", "" ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body: any = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "any", "" ) as any; - throw new ApiException(404, "Not found", body, response.headers); + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getWorkspacesList + * @throws ApiException if the response code was not in [200, 299] + */ + public async getWorkspacesListWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: ListWorkspacesResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ListWorkspacesResponse", "" + ) as ListWorkspacesResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ListWorkspacesResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + "ListWorkspacesResponse", "" + ) as ListWorkspacesResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listUsers + * @throws ApiException if the response code was not in [200, 299] + */ + public async listUsersWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: ListUsersResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ListUsersResponse", "" + ) as ListUsersResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: CreateWorkspaceResponse = ObjectSerializer.deserialize( + const body: ListUsersResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "CreateWorkspaceResponse", "" - ) as CreateWorkspaceResponse; - return body; + "ListUsersResponse", "" + ) as ListUsersResponse; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to removeMember + * @throws ApiException if the response code was not in [200, 299] + */ + public async removeMemberWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("204", response.httpStatusCode)) { + return new HttpInfo(response.httpStatusCode, response.headers, response.body, undefined); + } + if (isCodeInRange("400", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: RemoveMember400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "RemoveMember400Response", "" + ) as RemoveMember400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("401", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("404", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: RemoveMember404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "RemoveMember404Response", "" + ) as RemoveMember404Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: void = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "void", "" + ) as void; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } } + diff --git a/src/apis/WebhookEventsApi.ts b/src/apis/WebhookEventsApi.ts index 25ae061..65a3022 100644 --- a/src/apis/WebhookEventsApi.ts +++ b/src/apis/WebhookEventsApi.ts @@ -1,15 +1,18 @@ // TODO: better import syntax? -import {BaseAPIRequestFactory, RequiredError} from './baseapi'; +import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; -import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import { readRawBodyAndParse, tryParseRawBody } from '../pandadoc/httpErrorBody'; import {SecurityAuthentication} from '../auth/auth'; +import { ListDocuments401Response } from '../models/ListDocuments401Response'; +import { ListDocuments429Response } from '../models/ListDocuments429Response'; import { WebhookEventDetailsResponse } from '../models/WebhookEventDetailsResponse'; import { WebhookEventErrorEnum } from '../models/WebhookEventErrorEnum'; import { WebhookEventHttpStatusCodeGroupEnum } from '../models/WebhookEventHttpStatusCodeGroupEnum'; @@ -22,8 +25,9 @@ import { WebhookEventTriggerEnum } from '../models/WebhookEventTriggerEnum'; export class WebhookEventsApiRequestFactory extends BaseAPIRequestFactory { /** - * Get webhook event by uuid - * @param id Webhook event uuid + * This operation fetches detailed information about a specific webhook event using its unique identifier. + * Webhook Event Details + * @param id Webhook event uuid. */ public async detailsWebhookEvent(id: string, _options?: Configuration): Promise { let _config = _options || this.configuration; @@ -55,7 +59,7 @@ export class WebhookEventsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -64,14 +68,15 @@ export class WebhookEventsApiRequestFactory extends BaseAPIRequestFactory { } /** - * Get webhook event page - * @param count Number of element in page - * @param page Page number - * @param since Filter option: all events from specified timestamp - * @param to Filter option: all events up to specified timestamp - * @param type Filter option: all events of type - * @param httpStatusCode Filter option: all events of http status code - * @param error Filter option: all events with following error + * This operation retrieves a paginated list of all webhook events. + * List Webhook Events + * @param count Specify how many event results to return. + * @param page Specify which page of the dataset to return. + * @param since Return results where the event creation time is greater than or equal to this value. + * @param to Return results where the event creation time is less than this value. + * @param type Returns results by the specified event types. + * @param httpStatusCode Returns results with the specified HTTP status codes. + * @param error Returns results with the following errors. */ public async listWebhookEvent(count: number, page: number, since?: Date, to?: Date, type?: Array, httpStatusCode?: Array, error?: Array, _options?: Configuration): Promise { let _config = _options || this.configuration; @@ -122,17 +127,26 @@ export class WebhookEventsApiRequestFactory extends BaseAPIRequestFactory { // Query Params if (type !== undefined) { - requestContext.setQueryParam("type", ObjectSerializer.serialize(type, "Array", "")); + const serializedParams = ObjectSerializer.serialize(type, "Array", ""); + for (const serializedParam of serializedParams) { + requestContext.appendQueryParam("type", serializedParam); + } } // Query Params if (httpStatusCode !== undefined) { - requestContext.setQueryParam("http_status_code", ObjectSerializer.serialize(httpStatusCode, "Array", "")); + const serializedParams = ObjectSerializer.serialize(httpStatusCode, "Array", ""); + for (const serializedParam of serializedParams) { + requestContext.appendQueryParam("http_status_code", serializedParam); + } } // Query Params if (error !== undefined) { - requestContext.setQueryParam("error", ObjectSerializer.serialize(error, "Array", "")); + const serializedParams = ObjectSerializer.serialize(error, "Array", ""); + for (const serializedParam of serializedParams) { + requestContext.appendQueryParam("error", serializedParam); + } } @@ -148,7 +162,7 @@ export class WebhookEventsApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -167,28 +181,30 @@ export class WebhookEventsApiResponseProcessor { * @params response Response returned by the server for a request to detailsWebhookEvent * @throws ApiException if the response code was not in [200, 299] */ - public async detailsWebhookEvent(response: ResponseContext): Promise { + public async detailsWebhookEventWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: WebhookEventDetailsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "WebhookEventDetailsResponse", "" ) as WebhookEventDetailsResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -197,10 +213,17 @@ export class WebhookEventsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "WebhookEventDetailsResponse", "" ) as WebhookEventDetailsResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -210,28 +233,30 @@ export class WebhookEventsApiResponseProcessor { * @params response Response returned by the server for a request to listWebhookEvent * @throws ApiException if the response code was not in [200, 299] */ - public async listWebhookEvent(response: ResponseContext): Promise { + public async listWebhookEventWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: WebhookEventPageResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "WebhookEventPageResponse", "" ) as WebhookEventPageResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -240,10 +265,18 @@ export class WebhookEventsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "WebhookEventPageResponse", "" ) as WebhookEventPageResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } } + diff --git a/src/apis/WebhookSubscriptionsApi.ts b/src/apis/WebhookSubscriptionsApi.ts index 1d22abf..b4a8fca 100644 --- a/src/apis/WebhookSubscriptionsApi.ts +++ b/src/apis/WebhookSubscriptionsApi.ts @@ -1,15 +1,21 @@ // TODO: better import syntax? -import {BaseAPIRequestFactory, RequiredError} from './baseapi'; +import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; -import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import { readRawBodyAndParse, tryParseRawBody } from '../pandadoc/httpErrorBody'; import {SecurityAuthentication} from '../auth/auth'; +import { ListDocuments401Response } from '../models/ListDocuments401Response'; +import { ListDocuments403Response } from '../models/ListDocuments403Response'; +import { ListDocuments429Response } from '../models/ListDocuments429Response'; +import { StatusDocument404Response } from '../models/StatusDocument404Response'; +import { UpdateDocument400Response } from '../models/UpdateDocument400Response'; import { WebhookSubscriptionCreateRequest } from '../models/WebhookSubscriptionCreateRequest'; import { WebhookSubscriptionItemResponse } from '../models/WebhookSubscriptionItemResponse'; import { WebhookSubscriptionListResponse } from '../models/WebhookSubscriptionListResponse'; @@ -22,7 +28,8 @@ import { WebhookSubscriptionSharedKeyResponse } from '../models/WebhookSubscript export class WebhookSubscriptionsApiRequestFactory extends BaseAPIRequestFactory { /** - * Create webhook subscription + * This operation creates a new webhook subscription by specifying its details. + * Create Webhook Subscription * @param webhookSubscriptionCreateRequest */ public async createWebhookSubscription(webhookSubscriptionCreateRequest: WebhookSubscriptionCreateRequest, _options?: Configuration): Promise { @@ -65,7 +72,7 @@ export class WebhookSubscriptionsApiRequestFactory extends BaseAPIRequestFactory await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -74,8 +81,9 @@ export class WebhookSubscriptionsApiRequestFactory extends BaseAPIRequestFactory } /** - * Delete webhook subscription - * @param id Webhook subscription uuid + * This operation deletes a specific webhook subscription identified by its UUID. + * Delete Webhook Subscription + * @param id Webhook subscription uuid. */ public async deleteWebhookSubscription(id: string, _options?: Configuration): Promise { let _config = _options || this.configuration; @@ -107,7 +115,7 @@ export class WebhookSubscriptionsApiRequestFactory extends BaseAPIRequestFactory await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -116,7 +124,8 @@ export class WebhookSubscriptionsApiRequestFactory extends BaseAPIRequestFactory } /** - * Get webhook subscription by uuid + * Get webhook subscription by uuid + * Webhook Subscription Details * @param id Webhook subscription uuid */ public async detailsWebhookSubscription(id: string, _options?: Configuration): Promise { @@ -149,7 +158,7 @@ export class WebhookSubscriptionsApiRequestFactory extends BaseAPIRequestFactory await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -158,7 +167,8 @@ export class WebhookSubscriptionsApiRequestFactory extends BaseAPIRequestFactory } /** - * Get all webhook subscriptions + * This operation fetches a paginated list of webhook subscriptions. + * List Webhook Subscriptions */ public async listWebhookSubscriptions(_options?: Configuration): Promise { let _config = _options || this.configuration; @@ -183,7 +193,7 @@ export class WebhookSubscriptionsApiRequestFactory extends BaseAPIRequestFactory await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -192,7 +202,8 @@ export class WebhookSubscriptionsApiRequestFactory extends BaseAPIRequestFactory } /** - * Update webhook subscription + * This operation updates the details of a webhook subscription. + * Update Webhook Subscription * @param id Webhook subscription uuid * @param webhookSubscriptionPatchRequest */ @@ -243,7 +254,7 @@ export class WebhookSubscriptionsApiRequestFactory extends BaseAPIRequestFactory await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -252,7 +263,8 @@ export class WebhookSubscriptionsApiRequestFactory extends BaseAPIRequestFactory } /** - * Regenerate webhook subscription shared key + * This operation regenerates the shared key for a specific webhook subscription identified by its UUID. + * Update Webhook Subscription Shared Key * @param id Webhook subscription uuid */ public async updateWebhookSubscriptionSharedKey(id: string, _options?: Configuration): Promise { @@ -285,7 +297,7 @@ export class WebhookSubscriptionsApiRequestFactory extends BaseAPIRequestFactory await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -304,42 +316,46 @@ export class WebhookSubscriptionsApiResponseProcessor { * @params response Response returned by the server for a request to createWebhookSubscription * @throws ApiException if the response code was not in [200, 299] */ - public async createWebhookSubscription(response: ResponseContext): Promise { + public async createWebhookSubscriptionWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("201", response.httpStatusCode)) { const body: WebhookSubscriptionItemResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "WebhookSubscriptionItemResponse", "" ) as WebhookSubscriptionItemResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -348,10 +364,17 @@ export class WebhookSubscriptionsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "WebhookSubscriptionItemResponse", "" ) as WebhookSubscriptionItemResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -361,38 +384,42 @@ export class WebhookSubscriptionsApiResponseProcessor { * @params response Response returned by the server for a request to deleteWebhookSubscription * @throws ApiException if the response code was not in [200, 299] */ - public async deleteWebhookSubscription(response: ResponseContext): Promise { + public async deleteWebhookSubscriptionWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("204", response.httpStatusCode)) { - return; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, undefined); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -401,10 +428,17 @@ export class WebhookSubscriptionsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "void", "" ) as void; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -414,42 +448,46 @@ export class WebhookSubscriptionsApiResponseProcessor { * @params response Response returned by the server for a request to detailsWebhookSubscription * @throws ApiException if the response code was not in [200, 299] */ - public async detailsWebhookSubscription(response: ResponseContext): Promise { + public async detailsWebhookSubscriptionWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: WebhookSubscriptionItemResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "WebhookSubscriptionItemResponse", "" ) as WebhookSubscriptionItemResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -458,10 +496,17 @@ export class WebhookSubscriptionsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "WebhookSubscriptionItemResponse", "" ) as WebhookSubscriptionItemResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -471,28 +516,30 @@ export class WebhookSubscriptionsApiResponseProcessor { * @params response Response returned by the server for a request to listWebhookSubscriptions * @throws ApiException if the response code was not in [200, 299] */ - public async listWebhookSubscriptions(response: ResponseContext): Promise { + public async listWebhookSubscriptionsWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: WebhookSubscriptionListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "WebhookSubscriptionListResponse", "" ) as WebhookSubscriptionListResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -501,10 +548,17 @@ export class WebhookSubscriptionsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "WebhookSubscriptionListResponse", "" ) as WebhookSubscriptionListResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -514,49 +568,54 @@ export class WebhookSubscriptionsApiResponseProcessor { * @params response Response returned by the server for a request to updateWebhookSubscription * @throws ApiException if the response code was not in [200, 299] */ - public async updateWebhookSubscription(response: ResponseContext): Promise { + public async updateWebhookSubscriptionWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: WebhookSubscriptionItemResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "WebhookSubscriptionItemResponse", "" ) as WebhookSubscriptionItemResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("400", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(400, "Bad Request", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: UpdateDocument400Response = ObjectSerializer.deserialize( + rawBodyParsed, + "UpdateDocument400Response", "" + ) as UpdateDocument400Response; + throw new ApiException(response.httpStatusCode, "Bad Request", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -565,10 +624,17 @@ export class WebhookSubscriptionsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "WebhookSubscriptionItemResponse", "" ) as WebhookSubscriptionItemResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } /** @@ -578,42 +644,46 @@ export class WebhookSubscriptionsApiResponseProcessor { * @params response Response returned by the server for a request to updateWebhookSubscriptionSharedKey * @throws ApiException if the response code was not in [200, 299] */ - public async updateWebhookSubscriptionSharedKey(response: ResponseContext): Promise { + public async updateWebhookSubscriptionSharedKeyWithHttpInfo(response: ResponseContext): Promise> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body: WebhookSubscriptionSharedKeyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "WebhookSubscriptionSharedKeyResponse", "" ) as WebhookSubscriptionSharedKeyResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(401, "Authentication error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments401Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments401Response", "" + ) as ListDocuments401Response; + throw new ApiException(response.httpStatusCode, "Authentication error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("403", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(403, "Permission error", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments403Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments403Response", "" + ) as ListDocuments403Response; + throw new ApiException(response.httpStatusCode, "Permission error", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("404", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(404, "Not found", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: StatusDocument404Response = ObjectSerializer.deserialize( + rawBodyParsed, + "StatusDocument404Response", "" + ) as StatusDocument404Response; + throw new ApiException(response.httpStatusCode, "Not found", body, response.headers, rawBody, rawBodyParsed); } if (isCodeInRange("429", response.httpStatusCode)) { - const body: any = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "any", "" - ) as any; - throw new ApiException(429, "Too Many Requests", body, response.headers); + const { rawBody, rawBodyParsed } = await readRawBodyAndParse(response, contentType); + const body: ListDocuments429Response = ObjectSerializer.deserialize( + rawBodyParsed, + "ListDocuments429Response", "" + ) as ListDocuments429Response; + throw new ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers, rawBody, rawBodyParsed); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -622,10 +692,18 @@ export class WebhookSubscriptionsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "WebhookSubscriptionSharedKeyResponse", "" ) as WebhookSubscriptionSharedKeyResponse; - return body; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } - throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + const rawBodyAny: string | Buffer | undefined = await response.getBodyAsAny(); + let rawBody: string | undefined = undefined; + let rawBodyParsed: any = rawBodyAny; + if (typeof rawBodyAny === "string") { + rawBody = rawBodyAny; + rawBodyParsed = tryParseRawBody(rawBodyAny, contentType); + } + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", rawBodyAny, response.headers, rawBody, rawBodyParsed); } } + diff --git a/src/apis/baseapi.ts b/src/apis/baseapi.ts index ce1e2db..4c47d7c 100644 --- a/src/apis/baseapi.ts +++ b/src/apis/baseapi.ts @@ -30,7 +30,7 @@ export class BaseAPIRequestFactory { * @extends {Error} */ export class RequiredError extends Error { - name: "RequiredError" = "RequiredError"; + override name: "RequiredError" = "RequiredError"; constructor(public api: string, public method: string, public field: string) { super("Required parameter " + field + " was null or undefined when calling " + api + "." + method + "."); } diff --git a/src/apis/exception.ts b/src/apis/exception.ts index 9365d33..776e913 100644 --- a/src/apis/exception.ts +++ b/src/apis/exception.ts @@ -8,8 +8,20 @@ * */ export class ApiException extends Error { - public constructor(public code: number, message: string, public body: T, public headers: { [key: string]: string; }) { + /** + * @param rawBody Raw response body string (when available). Useful when the OpenAPI schema does not model the error payload. + * @param rawBodyParsed Best-effort parsed representation of rawBody (e.g. JSON object) when available. + */ + public constructor( + public code: number, + message: string, + public body: T, + public headers: { [key: string]: string; }, + public rawBody?: string, + public rawBodyParsed?: any, + ) { super("HTTP-Code: " + code + "\nMessage: " + message + "\nBody: " + JSON.stringify(body) + "\nHeaders: " + - JSON.stringify(headers)) + JSON.stringify(headers)); } } + diff --git a/src/auth/auth.ts b/src/auth/auth.ts index bc54a8b..f28133b 100644 --- a/src/auth/auth.ts +++ b/src/auth/auth.ts @@ -1,6 +1,3 @@ -// typings for btoa are incorrect -//@ts-ignore -import * as btoa from "btoa"; import { RequestContext } from "../http/http"; /** @@ -64,7 +61,6 @@ export class Oauth2Authentication implements SecurityAuthentication { } } - export type AuthMethods = { "default"?: SecurityAuthentication, "apiKey"?: SecurityAuthentication, @@ -75,6 +71,7 @@ export type ApiKeyConfiguration = string; export type HttpBasicConfiguration = { "username": string, "password": string }; export type HttpBearerConfiguration = { tokenProvider: TokenProvider }; export type OAuth2Configuration = { accessToken: string }; +export type HttpSignatureConfiguration = unknown; // TODO: Implement export type AuthMethodsConfiguration = { "default"?: SecurityAuthentication, diff --git a/src/configuration.ts b/src/configuration.ts index b78d859..4e65472 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -4,42 +4,70 @@ import { IsomorphicFetchHttpLibrary as DefaultHttpLibrary } from "./http/isomorp import { BaseServerConfiguration, server1 } from "./servers"; import { configureAuthMethods, AuthMethods, AuthMethodsConfiguration } from "./auth/auth"; -export interface Configuration { +export interface Configuration { readonly baseServer: BaseServerConfiguration; readonly httpApi: HttpLibrary; - readonly middleware: Middleware[]; + readonly middleware: M[]; readonly authMethods: AuthMethods; } +// Additional option specific to middleware merge strategy +export interface MiddlewareMergeOptions { + // default is `"replace"` for backwards compatibility + middlewareMergeStrategy?: "replace" | "append" | "prepend"; +} + +// Unify configuration options using Partial plus extra merge strategy +export type ConfigurationOptions = Partial> & MiddlewareMergeOptions; + +// aliases for convenience +export type StandardConfigurationOptions = ConfigurationOptions; +export type PromiseConfigurationOptions = ConfigurationOptions; /** * Interface with which a configuration object can be configured. */ export interface ConfigurationParameters { /** - * Default server to use + * Default server to use - a list of available servers (according to the + * OpenAPI yaml definition) is included in the `servers` const in `./servers`. You can also + * create your own server with the `ServerConfiguration` class from the same + * file. */ baseServer?: BaseServerConfiguration; /** - * HTTP library to use e.g. IsomorphicFetch + * HTTP library to use e.g. IsomorphicFetch. This can usually be skipped as + * all generators come with a default library. + * If available, additional libraries can be imported from `./http/*` */ httpApi?: HttpLibrary; + /** - * The middlewares which will be applied to requests and responses + * The middlewares which will be applied to requests and responses. You can + * add any number of middleware components to modify requests before they + * are sent or before they are deserialized by implementing the `Middleware` + * interface defined in `./middleware` */ middleware?: Middleware[]; /** - * Configures all middlewares using the promise api instead of observables (which Middleware uses) + * Configures middleware functions that return promises instead of + * Observables (which are used by `middleware`). Otherwise allows for the + * same functionality as `middleware`, i.e., modifying requests before they + * are sent and before they are deserialized. */ promiseMiddleware?: PromiseMiddleware[]; /** - * Configuration for the available authentication methods + * Configuration for the available authentication methods (e.g., api keys) + * according to the OpenAPI yaml definition. For the definition, please refer to + * `./auth/auth` */ authMethods?: AuthMethodsConfiguration } /** - * Configuration factory function + * Provide your `ConfigurationParameters` to this function to get a `Configuration` + * object that can be used to configure your APIs (in the constructor or + * for each request individually). * * If a property is not included in conf, a default is used: * - baseServer: server1 @@ -63,4 +91,53 @@ export function createConfiguration(conf: ConfigurationParameters = {}): Configu ); } return configuration; -} \ No newline at end of file +} + +/** + * Merge configuration options into a configuration. + */ +export function mergeConfiguration(conf: Configuration, options?: ConfigurationOptions): Configuration { + if (!options) { + return conf; + } + return { + baseServer: options.baseServer || conf.baseServer, + httpApi: options.httpApi || conf.httpApi, + authMethods: options.authMethods || conf.authMethods, + middleware: mergeMiddleware(conf.middleware, options?.middleware, options?.middlewareMergeStrategy), + }; +} + +function mergeMiddleware(staticMiddleware: Middleware[], calltimeMiddleware?: Middleware[], strategy: "append" | "prepend" | "replace" = "replace") { + if (!calltimeMiddleware) { + return staticMiddleware; + } + switch(strategy) { + case "append": + return staticMiddleware.concat(calltimeMiddleware); + case "prepend": + return calltimeMiddleware.concat(staticMiddleware) + case "replace": + return calltimeMiddleware + default: + throw new Error(`Unrecognized middleware merge strategy '${strategy}'`) + } +} + +/** + * Convert Promise-based configuration options to Observable-based configuration options. + */ +export function wrapOptions(options?: PromiseConfigurationOptions): StandardConfigurationOptions | undefined { + if (options) { + return { + baseServer: options.baseServer, + httpApi: options.httpApi, + middleware: options.middleware?.map( + m => new PromiseMiddlewareWrapper(m) + ), + middlewareMergeStrategy: options.middlewareMergeStrategy, + authMethods: options.authMethods, + }; + } + return; +} diff --git a/src/http/http.ts b/src/http/http.ts index 15a808f..beb66c1 100644 --- a/src/http/http.ts +++ b/src/http/http.ts @@ -1,11 +1,8 @@ // TODO: evaluate if we can easily get rid of this library import * as FormData from "form-data"; -import { URLSearchParams } from 'url'; +import { URL, URLSearchParams } from 'url'; import * as http from 'http'; import * as https from 'https'; -// typings of url-parse are incorrect... -// @ts-ignore -import * as URLParse from "url-parse"; import { Observable, from } from '../rxjsStub'; export * from './isomorphic-fetch'; @@ -33,7 +30,6 @@ export type HttpFile = { name: string }; - export class HttpException extends Error { public constructor(msg: string) { super(msg); @@ -45,15 +41,25 @@ export class HttpException extends Error { */ export type RequestBody = undefined | string | FormData | URLSearchParams; +type Headers = Record; + +function ensureAbsoluteUrl(url: string) { + if (url.startsWith("http://") || url.startsWith("https://")) { + return url; + } + throw new Error("You need to define an absolute base url for the server."); +} + /** * Represents an HTTP request context */ export class RequestContext { - private headers: { [key: string]: string } = { - "User-Agent": "pandadoc_node_client/6.2.0", + private headers: Headers = { + "User-Agent": "pandadoc-node-client/7.0.0-rc.1", }; private body: RequestBody = undefined; - private url: URLParse; + private url: URL; + private signal: AbortSignal | undefined = undefined; private agent: http.Agent | https.Agent | undefined = undefined; /** @@ -63,43 +69,7 @@ export class RequestContext { * @param httpMethod http method */ public constructor(url: string, private httpMethod: HttpMethod) { - this.url = new URLParse(url, true); - } - - public queryStringify(query: any, prefix: string = '') { - function encodeInput(input: any) { - try { - return encodeURIComponent(input); - } catch (e) { - return null; - } - } - - const pairs: any[] = []; - - if ('string' !== typeof prefix) prefix = '?'; - - Object.keys(query).forEach((key) => { - let value = query[key]; - - // - // Edge cases where we actually want to encode the value to an empty - // string instead of the stringified value. - // - if (!value && (value === null || value === undefined || isNaN(value))) { - value = ''; - } - - if (Array.isArray(value)) { - value.forEach(subValue => { - pairs.push(encodeInput(key) + '=' + encodeInput(subValue)); - }); - return; - } - pairs.push(encodeInput(key) + '=' + encodeInput(value)); - }); - - return pairs.length ? prefix + pairs.join('&') : ''; + this.url = new URL(ensureAbsoluteUrl(url)); } /* @@ -107,7 +77,9 @@ export class RequestContext { * */ public getUrl(): string { - return this.url.toString(this.queryStringify); + return this.url.toString().endsWith("/") ? + this.url.toString().slice(0, -1) + : this.url.toString(); } /** @@ -115,7 +87,7 @@ export class RequestContext { * */ public setUrl(url: string) { - this.url = new URLParse(url, true); + this.url = new URL(ensureAbsoluteUrl(url)); } /** @@ -135,7 +107,7 @@ export class RequestContext { return this.httpMethod; } - public getHeaders(): { [key: string]: string } { + public getHeaders(): Headers { return this.headers; } @@ -143,10 +115,37 @@ export class RequestContext { return this.body; } - public setQueryParam(name: string, value: string) { - let queryObj = this.url.query; - queryObj[name] = value; - this.url.set("query", queryObj); + private stringifyQueryValue(value: any): string { + if (value === null || value === undefined) return ''; + if (typeof value === 'number' && Number.isNaN(value)) return ''; + return String(value); + } + + /** + * Sets a query param value. + * + * PandaDoc customization: allow arrays + null/undefined/NaN handling. + */ + public setQueryParam(name: string, value: any) { + if (Array.isArray(value)) { + this.url.searchParams.delete(name); + value.forEach((v) => this.url.searchParams.append(name, this.stringifyQueryValue(v))); + return; + } + this.url.searchParams.set(name, this.stringifyQueryValue(value)); + } + + /** + * Appends a query param value. + * + * PandaDoc customization: allow arrays + null/undefined/NaN handling. + */ + public appendQueryParam(name: string, value: any) { + if (Array.isArray(value)) { + value.forEach((v) => this.url.searchParams.append(name, this.stringifyQueryValue(v))); + return; + } + this.url.searchParams.append(name, this.stringifyQueryValue(value)); } /** @@ -164,6 +163,15 @@ export class RequestContext { this.headers[key] = value; } + public setSignal(signal: AbortSignal): void { + this.signal = signal; + } + + public getSignal(): AbortSignal | undefined { + return this.signal; + } + + public setAgent(agent: http.Agent | https.Agent) { this.agent = agent; } @@ -197,7 +205,7 @@ export class SelfDecodingBody implements ResponseBody { export class ResponseContext { public constructor( public httpStatusCode: number, - public headers: { [key: string]: string }, + public headers: Headers, public body: ResponseBody ) {} @@ -208,15 +216,18 @@ export class ResponseContext { * Parameter names are converted to lower case * The first parameter is returned with the key `""` */ - public getParsedHeader(headerName: string): { [parameter: string]: string } { - const result: { [parameter: string]: string } = {}; + public getParsedHeader(headerName: string): Headers { + const result: Headers = {}; if (!this.headers[headerName]) { return result; } - const parameters = this.headers[headerName].split(";"); + const parameters = this.headers[headerName]!.split(";"); for (const parameter of parameters) { let [key, value] = parameter.split("=", 2); + if (!key) { + continue; + } key = key.toLowerCase().trim(); if (value === undefined) { result[""] = key; @@ -268,4 +279,16 @@ export function wrapHttpLibrary(promiseHttpLibrary: PromiseHttpLibrary): HttpLib return from(promiseHttpLibrary.send(request)); } } -} \ No newline at end of file +} + +export class HttpInfo extends ResponseContext { + public constructor( + httpStatusCode: number, + headers: Headers, + body: ResponseBody, + public data: T, + ) { + super(httpStatusCode, headers, body); + } +} + diff --git a/src/http/isomorphic-fetch.ts b/src/http/isomorphic-fetch.ts index 26d267c..d7ce46e 100644 --- a/src/http/isomorphic-fetch.ts +++ b/src/http/isomorphic-fetch.ts @@ -12,6 +12,7 @@ export class IsomorphicFetchHttpLibrary implements HttpLibrary { method: method, body: body as any, headers: request.getHeaders(), + signal: request.getSignal(), agent: request.getAgent(), }).then((resp: any) => { const headers: { [name: string]: string } = {}; diff --git a/src/index.ts b/src/index.ts index e069379..587b4a7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,10 +2,12 @@ export * from "./http/http"; export * from "./auth/auth"; export * from "./models/all"; export { createConfiguration } from "./configuration" -export { Configuration } from "./configuration" +export type { Configuration, ConfigurationOptions, PromiseConfigurationOptions } from "./configuration" export * from "./apis/exception"; export * from "./servers"; +export { RequiredError } from "./apis/baseapi"; -export { PromiseMiddleware as Middleware } from './middleware'; -export { APILogsApiDetailsLogRequest, APILogsApiListLogsRequest, ObjectAPILogsApi as APILogsApi, ContactsApiCreateContactRequest, ContactsApiDeleteContactRequest, ContactsApiDetailsContactRequest, ContactsApiListContactsRequest, ContactsApiUpdateContactRequest, ObjectContactsApi as ContactsApi, ContentLibraryItemsApiDetailsContentLibraryItemRequest, ContentLibraryItemsApiListContentLibraryItemsRequest, ObjectContentLibraryItemsApi as ContentLibraryItemsApi, DocumentAttachmentsApiCreateDocumentAttachmentRequest, DocumentAttachmentsApiDeleteDocumentAttachmentRequest, DocumentAttachmentsApiDetailsDocumentAttachmentRequest, DocumentAttachmentsApiDownloadDocumentAttachmentRequest, DocumentAttachmentsApiListDocumentAttachmentsRequest, ObjectDocumentAttachmentsApi as DocumentAttachmentsApi, DocumentRecipientsApiAddDocumentRecipientRequest, DocumentRecipientsApiDeleteDocumentRecipientRequest, DocumentRecipientsApiEditDocumentRecipientRequest, DocumentRecipientsApiReassignDocumentRecipientRequest, ObjectDocumentRecipientsApi as DocumentRecipientsApi, DocumentsApiChangeDocumentStatusRequest, DocumentsApiCreateDocumentRequest, DocumentsApiCreateDocumentLinkRequest, DocumentsApiCreateLinkedObjectRequest, DocumentsApiDeleteDocumentRequest, DocumentsApiDeleteLinkedObjectRequest, DocumentsApiDetailsDocumentRequest, DocumentsApiDocumentMoveToFolderRequest, DocumentsApiDownloadDocumentRequest, DocumentsApiDownloadProtectedDocumentRequest, DocumentsApiListDocumentsRequest, DocumentsApiListLinkedObjectsRequest, DocumentsApiSendDocumentRequest, DocumentsApiStatusDocumentRequest, DocumentsApiTransferAllDocumentsOwnershipRequest, DocumentsApiTransferDocumentOwnershipRequest, DocumentsApiUpdateDocumentRequest, ObjectDocumentsApi as DocumentsApi, FoldersAPIApiCreateDocumentFolderRequest, FoldersAPIApiCreateTemplateFolderRequest, FoldersAPIApiListDocumentFoldersRequest, FoldersAPIApiListTemplateFoldersRequest, FoldersAPIApiRenameDocumentFolderRequest, FoldersAPIApiRenameTemplateFolderRequest, ObjectFoldersAPIApi as FoldersAPIApi, FormsApiListFormRequest, ObjectFormsApi as FormsApi, MembersApiDetailsCurrentMemberRequest, MembersApiDetailsMemberRequest, MembersApiListMembersRequest, ObjectMembersApi as MembersApi, OAuth20AuthenticationApiAccessTokenRequest, ObjectOAuth20AuthenticationApi as OAuth20AuthenticationApi, QuotesApiQuoteUpdateRequest, ObjectQuotesApi as QuotesApi, SectionsApiListSectionsRequest, SectionsApiSectionDetailsRequest, SectionsApiSectionInfoRequest, SectionsApiUploadSectionRequest, ObjectSectionsApi as SectionsApi, TemplatesApiDeleteTemplateRequest, TemplatesApiDetailsTemplateRequest, TemplatesApiListTemplatesRequest, ObjectTemplatesApi as TemplatesApi, UserAndWorkspaceManagementApiAddMemberRequest, UserAndWorkspaceManagementApiCreateUserRequest, UserAndWorkspaceManagementApiCreateWorkspaceRequest, ObjectUserAndWorkspaceManagementApi as UserAndWorkspaceManagementApi, WebhookEventsApiDetailsWebhookEventRequest, WebhookEventsApiListWebhookEventRequest, ObjectWebhookEventsApi as WebhookEventsApi, WebhookSubscriptionsApiCreateWebhookSubscriptionRequest, WebhookSubscriptionsApiDeleteWebhookSubscriptionRequest, WebhookSubscriptionsApiDetailsWebhookSubscriptionRequest, WebhookSubscriptionsApiListWebhookSubscriptionsRequest, WebhookSubscriptionsApiUpdateWebhookSubscriptionRequest, WebhookSubscriptionsApiUpdateWebhookSubscriptionSharedKeyRequest, ObjectWebhookSubscriptionsApi as WebhookSubscriptionsApi } from './types/ObjectParamAPI'; +export type { PromiseMiddleware as Middleware, Middleware as ObservableMiddleware } from './middleware'; +export { Observable } from './rxjsStub'; +export { type APILogsApiDetailsLogRequest, type APILogsApiListLogsRequest, ObjectAPILogsApi as APILogsApi, type CommunicationPreferencesApiListRecentSmsOptOutsRequest, ObjectCommunicationPreferencesApi as CommunicationPreferencesApi, type ContactsApiCreateContactRequest, type ContactsApiDeleteContactRequest, type ContactsApiDetailsContactRequest, type ContactsApiListContactsRequest, type ContactsApiUpdateContactRequest, ObjectContactsApi as ContactsApi, type ContentLibraryItemsApiCreateContentLibraryItemRequest, type ContentLibraryItemsApiCreateContentLibraryItemFromUploadRequest, type ContentLibraryItemsApiDetailsContentLibraryItemRequest, type ContentLibraryItemsApiListContentLibraryItemsRequest, type ContentLibraryItemsApiStatusContentLibraryItemRequest, ObjectContentLibraryItemsApi as ContentLibraryItemsApi, type DocumentAttachmentsApiCreateDocumentAttachmentRequest, type DocumentAttachmentsApiCreateDocumentAttachmentFromFileUploadRequest, type DocumentAttachmentsApiDeleteDocumentAttachmentRequest, type DocumentAttachmentsApiDetailsDocumentAttachmentRequest, type DocumentAttachmentsApiDownloadDocumentAttachmentRequest, type DocumentAttachmentsApiListDocumentAttachmentsRequest, ObjectDocumentAttachmentsApi as DocumentAttachmentsApi, type DocumentAuditTrailApiListDocumentAuditTrailRequest, ObjectDocumentAuditTrailApi as DocumentAuditTrailApi, type DocumentFieldsApiCreateDocumentFieldsRequest, type DocumentFieldsApiListDocumentFieldsRequest, ObjectDocumentFieldsApi as DocumentFieldsApi, type DocumentLinkToCRMApiCreateLinkedObjectRequest, type DocumentLinkToCRMApiDeleteLinkedObjectRequest, type DocumentLinkToCRMApiListDocumentsByLinkedObjectRequest, type DocumentLinkToCRMApiListLinkedObjectsRequest, ObjectDocumentLinkToCRMApi as DocumentLinkToCRMApi, type DocumentRecipientsApiAddDocumentRecipientRequest, type DocumentRecipientsApiDeleteDocumentRecipientRequest, type DocumentRecipientsApiEditDocumentRecipientRequest, type DocumentRecipientsApiReassignDocumentRecipientRequest, ObjectDocumentRecipientsApi as DocumentRecipientsApi, type DocumentRemindersApiCreateManualReminderRequest, type DocumentRemindersApiGetDocumentAutoReminderSettingsRequest, type DocumentRemindersApiStatusDocumentAutoReminderRequest, type DocumentRemindersApiUpdateDocumentAutoReminderSettingsRequest, ObjectDocumentRemindersApi as DocumentRemindersApi, type DocumentSectionsBundlesApiDeleteSectionRequest, type DocumentSectionsBundlesApiListSectionsRequest, type DocumentSectionsBundlesApiSectionDetailsRequest, type DocumentSectionsBundlesApiSectionInfoRequest, type DocumentSectionsBundlesApiUploadSectionRequest, type DocumentSectionsBundlesApiUploadSectionWithUploadRequest, ObjectDocumentSectionsBundlesApi as DocumentSectionsBundlesApi, type DocumentSettingsApiDocumentSettingsGetRequest, type DocumentSettingsApiDocumentSettingsUpdateRequest, ObjectDocumentSettingsApi as DocumentSettingsApi, type DocumentsApiAppendContentLibraryItemToDocumentRequest, type DocumentsApiChangeDocumentStatusRequest, type DocumentsApiChangeDocumentStatusWithUploadRequest, type DocumentsApiCreateDocumentRequest, type DocumentsApiCreateDocumentEditingSessionRequest, type DocumentsApiCreateDocumentFromUploadRequest, type DocumentsApiCreateDocumentLinkRequest, type DocumentsApiCreateExportDocxTaskRequest, type DocumentsApiDeleteDocumentRequest, type DocumentsApiDetailsDocumentRequest, type DocumentsApiDocumentESignDisclosureRequest, type DocumentsApiDocumentMoveToFolderRequest, type DocumentsApiDocumentRevertToDraftRequest, type DocumentsApiDownloadDocumentRequest, type DocumentsApiDownloadProtectedDocumentRequest, type DocumentsApiGetDocxExportTaskRequest, type DocumentsApiListDocumentsRequest, type DocumentsApiSendDocumentRequest, type DocumentsApiStatusDocumentRequest, type DocumentsApiTransferAllDocumentsOwnershipRequest, type DocumentsApiTransferDocumentOwnershipRequest, type DocumentsApiUpdateDocumentRequest, ObjectDocumentsApi as DocumentsApi, type FoldersApiCreateDocumentFolderRequest, type FoldersApiCreateTemplateFolderRequest, type FoldersApiListDocumentFoldersRequest, type FoldersApiListTemplateFoldersRequest, type FoldersApiRenameDocumentFolderRequest, type FoldersApiRenameTemplateFolderRequest, ObjectFoldersApi as FoldersApi, type FormsApiListFormRequest, ObjectFormsApi as FormsApi, type MembersApiCreateMemberTokenRequest, type MembersApiDetailsCurrentMemberRequest, type MembersApiDetailsMemberRequest, type MembersApiListMembersRequest, ObjectMembersApi as MembersApi, type NotaryApiCreateNotarizationRequestRequest, type NotaryApiDeleteNotarizationRequestRequest, type NotaryApiListNotariesRequest, type NotaryApiNotarizationRequestDetailsRequest, ObjectNotaryApi as NotaryApi, type OAuth20AuthenticationApiAccessTokenRequest, ObjectOAuth20AuthenticationApi as OAuth20AuthenticationApi, type ProductCatalogApiCreateCatalogItemRequest, type ProductCatalogApiDeleteCatalogItemRequest, type ProductCatalogApiGetCatalogItemRequest, type ProductCatalogApiSearchCatalogItemsRequest, type ProductCatalogApiUpdateCatalogItemRequest, ObjectProductCatalogApi as ProductCatalogApi, type QuotesApiQuoteUpdateRequest, ObjectQuotesApi as QuotesApi, type TemplateSettingsApiTemplateSettingsGetRequest, type TemplateSettingsApiTemplateSettingsUpdateRequest, ObjectTemplateSettingsApi as TemplateSettingsApi, type TemplatesApiCreateTemplateRequest, type TemplatesApiCreateTemplateEditingSessionRequest, type TemplatesApiCreateTemplateWithUploadRequest, type TemplatesApiDeleteTemplateRequest, type TemplatesApiDetailsTemplateRequest, type TemplatesApiListTemplatesRequest, type TemplatesApiStatusTemplateRequest, type TemplatesApiUpdateTemplateRequest, ObjectTemplatesApi as TemplatesApi, type UserAndWorkspaceManagementApiAddMemberRequest, type UserAndWorkspaceManagementApiCreateApiKeyRequest, type UserAndWorkspaceManagementApiCreateUserRequest, type UserAndWorkspaceManagementApiCreateWorkspaceRequest, type UserAndWorkspaceManagementApiDeactivateWorkspaceRequest, type UserAndWorkspaceManagementApiGetWorkspacesListRequest, type UserAndWorkspaceManagementApiListUsersRequest, type UserAndWorkspaceManagementApiRemoveMemberRequest, ObjectUserAndWorkspaceManagementApi as UserAndWorkspaceManagementApi, type WebhookEventsApiDetailsWebhookEventRequest, type WebhookEventsApiListWebhookEventRequest, ObjectWebhookEventsApi as WebhookEventsApi, type WebhookSubscriptionsApiCreateWebhookSubscriptionRequest, type WebhookSubscriptionsApiDeleteWebhookSubscriptionRequest, type WebhookSubscriptionsApiDetailsWebhookSubscriptionRequest, type WebhookSubscriptionsApiListWebhookSubscriptionsRequest, type WebhookSubscriptionsApiUpdateWebhookSubscriptionRequest, type WebhookSubscriptionsApiUpdateWebhookSubscriptionSharedKeyRequest, ObjectWebhookSubscriptionsApi as WebhookSubscriptionsApi } from './types/ObjectParamAPI'; diff --git a/src/middleware.ts b/src/middleware.ts index 524f93f..399e823 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -26,10 +26,7 @@ export interface Middleware { } export class PromiseMiddlewareWrapper implements Middleware { - - public constructor(private middleware: PromiseMiddleware) { - - } + public constructor(private middleware: PromiseMiddleware) {} pre(context: RequestContext): Observable { return from(this.middleware.pre(context)); @@ -38,7 +35,6 @@ export class PromiseMiddlewareWrapper implements Middleware { post(context: ResponseContext): Observable { return from(this.middleware.post(context)); } - } /** diff --git a/src/models/APILogDetailsResponse.ts b/src/models/APILogDetailsResponse.ts index 5146a84..dde75d4 100644 --- a/src/models/APILogDetailsResponse.ts +++ b/src/models/APILogDetailsResponse.ts @@ -17,11 +17,11 @@ export class APILogDetailsResponse { 'requestTime'?: string; 'responseTime'?: string; 'responseBody'?: any; - 'queryParamsString'?: string; - 'queryParamsObject'?: any; + 'queryParamsString'?: string | null; + 'queryParamsObject'?: any | null; 'requestBody'?: any; 'tokenType'?: string; - 'application'?: string; + 'application'?: string | null; 'key'?: string; 'requestId'?: string; 'userEmail'?: string; @@ -29,6 +29,8 @@ export class APILogDetailsResponse { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -134,4 +136,3 @@ export class APILogDetailsResponse { public constructor() { } } - diff --git a/src/models/APILogListResponse.ts b/src/models/APILogListResponse.ts index 50e13de..74e46c4 100644 --- a/src/models/APILogListResponse.ts +++ b/src/models/APILogListResponse.ts @@ -7,19 +7,21 @@ * Do not edit the class manually. */ -import { APILogListResponseResults } from './APILogListResponseResults'; +import { APILogListResponseResultsInner } from '../models/APILogListResponseResultsInner'; import { HttpFile } from '../http/http'; export class APILogListResponse { - 'results'?: Array; + 'results'?: Array; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "results", "baseName": "results", - "type": "Array", + "type": "Array", "format": "" } ]; @@ -30,4 +32,3 @@ export class APILogListResponse { public constructor() { } } - diff --git a/src/models/APILogListResponseResults.ts b/src/models/APILogListResponseResultsInner.ts similarity index 87% rename from src/models/APILogListResponseResults.ts rename to src/models/APILogListResponseResultsInner.ts index 7e7ce96..aed7793 100644 --- a/src/models/APILogListResponseResults.ts +++ b/src/models/APILogListResponseResultsInner.ts @@ -9,7 +9,7 @@ import { HttpFile } from '../http/http'; -export class APILogListResponseResults { +export class APILogListResponseResultsInner { 'id'?: string; 'url'?: string; 'status'?: number; @@ -18,6 +18,8 @@ export class APILogListResponseResults { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -51,10 +53,9 @@ export class APILogListResponseResults { } ]; static getAttributeTypeMap() { - return APILogListResponseResults.attributeTypeMap; + return APILogListResponseResultsInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/AccessToken400Response.ts b/src/models/AccessToken400Response.ts new file mode 100644 index 0000000..45f089e --- /dev/null +++ b/src/models/AccessToken400Response.ts @@ -0,0 +1,33 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class AccessToken400Response { + 'error'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "error", + "baseName": "error", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return AccessToken400Response.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/AddDsvNamedItemsRequest.ts b/src/models/AddDsvNamedItemsRequest.ts new file mode 100644 index 0000000..79b7b06 --- /dev/null +++ b/src/models/AddDsvNamedItemsRequest.ts @@ -0,0 +1,37 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AddDsvNamedItemsRequestItemsInner } from '../models/AddDsvNamedItemsRequestItemsInner'; +import { HttpFile } from '../http/http'; + +export class AddDsvNamedItemsRequest { + /** + * List of named items representing structural elements of the document. + */ + 'items': Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "items", + "baseName": "items", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return AddDsvNamedItemsRequest.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/AddDsvNamedItemsRequestItemsInner.ts b/src/models/AddDsvNamedItemsRequestItemsInner.ts new file mode 100644 index 0000000..05dead4 --- /dev/null +++ b/src/models/AddDsvNamedItemsRequestItemsInner.ts @@ -0,0 +1,56 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class AddDsvNamedItemsRequestItemsInner { + /** + * The display name of the item (e.g., \"Introduction\", \"Chapter 1\"). + */ + 'name': string; + /** + * Hierarchical level of the item. Level 0 is the highest (top-level), with increasing numbers for nested structures. + */ + 'level': number; + /** + * Internal reference or identifier for the page this item is associated with. + */ + 'pageName': string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "level", + "baseName": "level", + "type": "number", + "format": "" + }, + { + "name": "pageName", + "baseName": "page_name", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return AddDsvNamedItemsRequestItemsInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/AddDsvNamedItemsResponse.ts b/src/models/AddDsvNamedItemsResponse.ts new file mode 100644 index 0000000..a351c40 --- /dev/null +++ b/src/models/AddDsvNamedItemsResponse.ts @@ -0,0 +1,47 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AddDsvNamedItemsResponseResultsInner } from '../models/AddDsvNamedItemsResponseResultsInner'; +import { HttpFile } from '../http/http'; + +export class AddDsvNamedItemsResponse { + /** + * List of DSV named items that were created. + */ + 'results': Array; + /** + * Total number of items created. + */ + 'count': number; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "results", + "baseName": "results", + "type": "Array", + "format": "" + }, + { + "name": "count", + "baseName": "count", + "type": "number", + "format": "integer" + } ]; + + static getAttributeTypeMap() { + return AddDsvNamedItemsResponse.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/AddDsvNamedItemsResponseResultsInner.ts b/src/models/AddDsvNamedItemsResponseResultsInner.ts new file mode 100644 index 0000000..c55bff2 --- /dev/null +++ b/src/models/AddDsvNamedItemsResponseResultsInner.ts @@ -0,0 +1,76 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class AddDsvNamedItemsResponseResultsInner { + /** + * Unique identifier for the created DSV item. + */ + 'id': string; + /** + * The display name of the item. + */ + 'name': string; + /** + * The hierarchy level of the item. + */ + 'level': number; + /** + * Internal reference name for the page. + */ + 'pageName': string; + /** + * UUID of the associated page. + */ + 'pageUuid': string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "uuid" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "level", + "baseName": "level", + "type": "number", + "format": "" + }, + { + "name": "pageName", + "baseName": "page_name", + "type": "string", + "format": "" + }, + { + "name": "pageUuid", + "baseName": "page_uuid", + "type": "string", + "format": "uuid" + } ]; + + static getAttributeTypeMap() { + return AddDsvNamedItemsResponseResultsInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/AddMember400Response.ts b/src/models/AddMember400Response.ts new file mode 100644 index 0000000..3fa679b --- /dev/null +++ b/src/models/AddMember400Response.ts @@ -0,0 +1,40 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class AddMember400Response { + 'type'?: string; + 'detail'?: any; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "type", + "baseName": "type", + "type": "string", + "format": "" + }, + { + "name": "detail", + "baseName": "detail", + "type": "any", + "format": "" + } ]; + + static getAttributeTypeMap() { + return AddMember400Response.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/AddMemberRequest.ts b/src/models/AddMemberRequest.ts index a65206a..cab581e 100644 --- a/src/models/AddMemberRequest.ts +++ b/src/models/AddMemberRequest.ts @@ -7,14 +7,20 @@ * Do not edit the class manually. */ +import { WorkspaceMemberRoleEnum } from '../models/WorkspaceMemberRoleEnum'; import { HttpFile } from '../http/http'; export class AddMemberRequest { + /** + * User id. + */ 'userId': string; - 'role': AddMemberRequestRoleEnum; + 'role': WorkspaceMemberRoleEnum; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "userId", @@ -25,7 +31,7 @@ export class AddMemberRequest { { "name": "role", "baseName": "role", - "type": "AddMemberRequestRoleEnum", + "type": "WorkspaceMemberRoleEnum", "format": "" } ]; @@ -38,5 +44,3 @@ export class AddMemberRequest { } -export type AddMemberRequestRoleEnum = "Admin" | "Manager" | "Member" | "Collaborator" ; - diff --git a/src/models/AddMemberResponse.ts b/src/models/AddMemberResponse.ts index 5192549..6475b27 100644 --- a/src/models/AddMemberResponse.ts +++ b/src/models/AddMemberResponse.ts @@ -7,18 +7,21 @@ * Do not edit the class manually. */ +import { WorkspaceMemberRoleEnum } from '../models/WorkspaceMemberRoleEnum'; import { HttpFile } from '../http/http'; export class AddMemberResponse { 'memberId'?: string; 'workspaceId'?: string; - 'role'?: AddMemberResponseRoleEnum; + 'role'?: WorkspaceMemberRoleEnum; 'email'?: string; 'firstName'?: string; 'lastName'?: string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "memberId", @@ -35,7 +38,7 @@ export class AddMemberResponse { { "name": "role", "baseName": "role", - "type": "AddMemberResponseRoleEnum", + "type": "WorkspaceMemberRoleEnum", "format": "" }, { @@ -66,5 +69,3 @@ export class AddMemberResponse { } -export type AddMemberResponseRoleEnum = "Admin" | "Manager" | "Member" | "Collaborator" ; - diff --git a/src/models/ApiKeyTypeEnum.ts b/src/models/ApiKeyTypeEnum.ts new file mode 100644 index 0000000..8b9e6ff --- /dev/null +++ b/src/models/ApiKeyTypeEnum.ts @@ -0,0 +1,18 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +/** +* A type of API key. +*/ +export enum ApiKeyTypeEnum { + Production = 'production', + Sandbox = 'sandbox' +} diff --git a/src/models/ApiLogEnvironmentTypeEnum.ts b/src/models/ApiLogEnvironmentTypeEnum.ts new file mode 100644 index 0000000..8eb59b2 --- /dev/null +++ b/src/models/ApiLogEnvironmentTypeEnum.ts @@ -0,0 +1,15 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export enum ApiLogEnvironmentTypeEnum { + Production = 'PRODUCTION', + Sandbox = 'SANDBOX' +} diff --git a/src/models/ApiLogMethodEnum.ts b/src/models/ApiLogMethodEnum.ts new file mode 100644 index 0000000..4b166ea --- /dev/null +++ b/src/models/ApiLogMethodEnum.ts @@ -0,0 +1,18 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export enum ApiLogMethodEnum { + Get = 'GET', + Post = 'POST', + Put = 'PUT', + Patch = 'PATCH', + Delete = 'DELETE' +} diff --git a/src/models/ApiLogStatusEnum.ts b/src/models/ApiLogStatusEnum.ts new file mode 100644 index 0000000..99a6fb6 --- /dev/null +++ b/src/models/ApiLogStatusEnum.ts @@ -0,0 +1,18 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export enum ApiLogStatusEnum { + NUMBER_100 = 100, + NUMBER_200 = 200, + NUMBER_300 = 300, + NUMBER_400 = 400, + NUMBER_500 = 500 +} diff --git a/src/models/AppendCLIDataRequest.ts b/src/models/AppendCLIDataRequest.ts new file mode 100644 index 0000000..8615166 --- /dev/null +++ b/src/models/AppendCLIDataRequest.ts @@ -0,0 +1,34 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AppendCLIDataRequestCli } from '../models/AppendCLIDataRequestCli'; +import { HttpFile } from '../http/http'; + +export class AppendCLIDataRequest { + 'cli'?: AppendCLIDataRequestCli; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "cli", + "baseName": "cli", + "type": "AppendCLIDataRequestCli", + "format": "" + } ]; + + static getAttributeTypeMap() { + return AppendCLIDataRequest.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/AppendCLIDataRequestCli.ts b/src/models/AppendCLIDataRequestCli.ts new file mode 100644 index 0000000..1b0f5bc --- /dev/null +++ b/src/models/AppendCLIDataRequestCli.ts @@ -0,0 +1,50 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AppendCLIDataRequestCliPagesInner } from '../models/AppendCLIDataRequestCliPagesInner'; +import { HttpFile } from '../http/http'; + +/** +* Settings to append a CLI to a document, with ability to change some parameters +*/ +export class AppendCLIDataRequestCli { + /** + * CLI ID to append to the first section. + */ + 'id': string; + /** + * The list of the CLI\'s pages you want to change in a result document + */ + 'pages'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "pages", + "baseName": "pages", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return AppendCLIDataRequestCli.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/AppendCLIDataRequestCliPagesInner.ts b/src/models/AppendCLIDataRequestCliPagesInner.ts new file mode 100644 index 0000000..dfafc33 --- /dev/null +++ b/src/models/AppendCLIDataRequestCliPagesInner.ts @@ -0,0 +1,46 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class AppendCLIDataRequestCliPagesInner { + /** + * The index of the CLI\'s page you want to change in a result document during appending the CLI + */ + 'index'?: number; + /** + * The name you want to apply to the CLI\'s page in a result document during appending the CLI + */ + 'name'?: string | null; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "index", + "baseName": "index", + "type": "number", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return AppendCLIDataRequestCliPagesInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/AppendCLIDataResponse.ts b/src/models/AppendCLIDataResponse.ts new file mode 100644 index 0000000..fe9a0c9 --- /dev/null +++ b/src/models/AppendCLIDataResponse.ts @@ -0,0 +1,42 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AppendCLIDataResponseBlockMapping } from '../models/AppendCLIDataResponseBlockMapping'; +import { AppendCLIDataResponseCli } from '../models/AppendCLIDataResponseCli'; +import { HttpFile } from '../http/http'; + +export class AppendCLIDataResponse { + 'cli'?: AppendCLIDataResponseCli; + 'blockMapping'?: AppendCLIDataResponseBlockMapping; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "cli", + "baseName": "cli", + "type": "AppendCLIDataResponseCli", + "format": "" + }, + { + "name": "blockMapping", + "baseName": "block_mapping", + "type": "AppendCLIDataResponseBlockMapping", + "format": "" + } ]; + + static getAttributeTypeMap() { + return AppendCLIDataResponse.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/AppendCLIDataResponseBlockMapping.ts b/src/models/AppendCLIDataResponseBlockMapping.ts new file mode 100644 index 0000000..cc2d0e1 --- /dev/null +++ b/src/models/AppendCLIDataResponseBlockMapping.ts @@ -0,0 +1,73 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AppendCLIDataResponseBlockMappingImagesInner } from '../models/AppendCLIDataResponseBlockMappingImagesInner'; +import { AppendCLIDataResponseBlockMappingPricingTablesInner } from '../models/AppendCLIDataResponseBlockMappingPricingTablesInner'; +import { AppendCLIDataResponseBlockMappingTablesInner } from '../models/AppendCLIDataResponseBlockMappingTablesInner'; +import { AppendCLIDataResponseBlockMappingTextsInner } from '../models/AppendCLIDataResponseBlockMappingTextsInner'; +import { HttpFile } from '../http/http'; + +/** +* Maps the original names of content blocks from the CLI to their new names in the document. Use the \'new_name\' to target blocks in subsequent API calls. +*/ +export class AppendCLIDataResponseBlockMapping { + /** + * Mapping for Table blocks. + */ + 'tables'?: Array; + /** + * Mapping for Pricing Table blocks. + */ + 'pricingTables'?: Array; + /** + * Mapping for Image blocks. + */ + 'images'?: Array; + /** + * Mapping for Text blocks. + */ + 'texts'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "tables", + "baseName": "tables", + "type": "Array", + "format": "" + }, + { + "name": "pricingTables", + "baseName": "pricing_tables", + "type": "Array", + "format": "" + }, + { + "name": "images", + "baseName": "images", + "type": "Array", + "format": "" + }, + { + "name": "texts", + "baseName": "texts", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return AppendCLIDataResponseBlockMapping.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/AppendCLIDataResponseBlockMappingImagesInner.ts b/src/models/AppendCLIDataResponseBlockMappingImagesInner.ts new file mode 100644 index 0000000..1f56348 --- /dev/null +++ b/src/models/AppendCLIDataResponseBlockMappingImagesInner.ts @@ -0,0 +1,46 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class AppendCLIDataResponseBlockMappingImagesInner { + /** + * The name of the block in the source Content Library Item. + */ + 'originalName'?: string; + /** + * The new, unique name of the block in the document after appending. + */ + 'newName'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "originalName", + "baseName": "original_name", + "type": "string", + "format": "" + }, + { + "name": "newName", + "baseName": "new_name", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return AppendCLIDataResponseBlockMappingImagesInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/AppendCLIDataResponseBlockMappingPricingTablesInner.ts b/src/models/AppendCLIDataResponseBlockMappingPricingTablesInner.ts new file mode 100644 index 0000000..57d7830 --- /dev/null +++ b/src/models/AppendCLIDataResponseBlockMappingPricingTablesInner.ts @@ -0,0 +1,46 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class AppendCLIDataResponseBlockMappingPricingTablesInner { + /** + * The name of the block in the source Content Library Item. + */ + 'originalName'?: string; + /** + * The new, unique name of the block in the document after appending. + */ + 'newName'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "originalName", + "baseName": "original_name", + "type": "string", + "format": "" + }, + { + "name": "newName", + "baseName": "new_name", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return AppendCLIDataResponseBlockMappingPricingTablesInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/AppendCLIDataResponseBlockMappingTablesInner.ts b/src/models/AppendCLIDataResponseBlockMappingTablesInner.ts new file mode 100644 index 0000000..b9433df --- /dev/null +++ b/src/models/AppendCLIDataResponseBlockMappingTablesInner.ts @@ -0,0 +1,46 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class AppendCLIDataResponseBlockMappingTablesInner { + /** + * The name of the block in the source Content Library Item. + */ + 'originalName'?: string; + /** + * The new, unique name of the block in the document after appending. + */ + 'newName'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "originalName", + "baseName": "original_name", + "type": "string", + "format": "" + }, + { + "name": "newName", + "baseName": "new_name", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return AppendCLIDataResponseBlockMappingTablesInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/AppendCLIDataResponseBlockMappingTextsInner.ts b/src/models/AppendCLIDataResponseBlockMappingTextsInner.ts new file mode 100644 index 0000000..0e15800 --- /dev/null +++ b/src/models/AppendCLIDataResponseBlockMappingTextsInner.ts @@ -0,0 +1,46 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class AppendCLIDataResponseBlockMappingTextsInner { + /** + * The name of the block in the source Content Library Item. + */ + 'originalName'?: string; + /** + * The new, unique name of the block in the document after appending. + */ + 'newName'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "originalName", + "baseName": "original_name", + "type": "string", + "format": "" + }, + { + "name": "newName", + "baseName": "new_name", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return AppendCLIDataResponseBlockMappingTextsInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/AppendCLIDataResponseCli.ts b/src/models/AppendCLIDataResponseCli.ts new file mode 100644 index 0000000..63ff552 --- /dev/null +++ b/src/models/AppendCLIDataResponseCli.ts @@ -0,0 +1,50 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AppendCLIDataResponseCliPagesInner } from '../models/AppendCLIDataResponseCliPagesInner'; +import { HttpFile } from '../http/http'; + +/** +* Settings of the appended to a document CLI. Name property can be different from what you passed if there were collisions +*/ +export class AppendCLIDataResponseCli { + /** + * CLI ID appended to the first section. + */ + 'id': string; + /** + * The list of the CLI\'s pages you have changed in a result document + */ + 'pages'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "pages", + "baseName": "pages", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return AppendCLIDataResponseCli.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/AppendCLIDataResponseCliPagesInner.ts b/src/models/AppendCLIDataResponseCliPagesInner.ts new file mode 100644 index 0000000..82cd9ab --- /dev/null +++ b/src/models/AppendCLIDataResponseCliPagesInner.ts @@ -0,0 +1,46 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class AppendCLIDataResponseCliPagesInner { + /** + * The index of the CLI\'s page you have changed in a result document during appending the CLI + */ + 'index'?: number; + /** + * The real name in the page. It can be different from the one you passed if there were collisions (e.g. you appended the same CLI twice with the same names) + */ + 'name'?: string | null; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "index", + "baseName": "index", + "type": "number", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return AppendCLIDataResponseCliPagesInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/AssignedToRecipientDeliveryMethods.ts b/src/models/AssignedToRecipientDeliveryMethods.ts new file mode 100644 index 0000000..549607d --- /dev/null +++ b/src/models/AssignedToRecipientDeliveryMethods.ts @@ -0,0 +1,40 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class AssignedToRecipientDeliveryMethods { + 'sms'?: boolean; + 'email'?: boolean; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "sms", + "baseName": "sms", + "type": "boolean", + "format": "" + }, + { + "name": "email", + "baseName": "email", + "type": "boolean", + "format": "" + } ]; + + static getAttributeTypeMap() { + return AssignedToRecipientDeliveryMethods.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/AutoReminders.ts b/src/models/AutoReminders.ts new file mode 100644 index 0000000..6f614f5 --- /dev/null +++ b/src/models/AutoReminders.ts @@ -0,0 +1,76 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentDeliveryMethodEnum } from '../models/DocumentDeliveryMethodEnum'; +import { HttpFile } from '../http/http'; + +export class AutoReminders { + /** + * Toggles auto-reminders for the document. If `true`, reminders are scheduled based on the configuration. + */ + 'enabled': boolean; + 'deliveryMethod'?: DocumentDeliveryMethodEnum; + /** + * Number of days to wait after sending the document before the first reminder is sent. + */ + 'initialDelayDays'?: number; + /** + * If `true`, reminders will be sent repeatedly at specified intervals after the initial reminder. + */ + 'isRecurring'?: boolean; + /** + * Number of days between recurring reminders, applicable if `is_recurring` is `true`. + */ + 'recurrenceFrequencyDays'?: number; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "enabled", + "baseName": "enabled", + "type": "boolean", + "format": "" + }, + { + "name": "deliveryMethod", + "baseName": "delivery_method", + "type": "DocumentDeliveryMethodEnum", + "format": "" + }, + { + "name": "initialDelayDays", + "baseName": "initial_delay_days", + "type": "number", + "format": "" + }, + { + "name": "isRecurring", + "baseName": "is_recurring", + "type": "boolean", + "format": "" + }, + { + "name": "recurrenceFrequencyDays", + "baseName": "recurrence_frequency_days", + "type": "number", + "format": "" + } ]; + + static getAttributeTypeMap() { + return AutoReminders.attributeTypeMap; + } + + public constructor() { + } +} + + diff --git a/src/models/BaseActor.ts b/src/models/BaseActor.ts new file mode 100644 index 0000000..aa9862b --- /dev/null +++ b/src/models/BaseActor.ts @@ -0,0 +1,46 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class BaseActor { + /** + * A recipient\'s role in the document from the template. A recipient will be added in CC if a role parameter is not provided. + */ + 'role'?: string; + /** + * Set a signing order for a recipient. Learn more: https://developers.pandadoc.com/docs/set-signing-order + */ + 'signingOrder'?: number; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "role", + "baseName": "role", + "type": "string", + "format": "" + }, + { + "name": "signingOrder", + "baseName": "signing_order", + "type": "number", + "format": "" + } ]; + + static getAttributeTypeMap() { + return BaseActor.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/BaseEditingSessionResponse.ts b/src/models/BaseEditingSessionResponse.ts new file mode 100644 index 0000000..8596631 --- /dev/null +++ b/src/models/BaseEditingSessionResponse.ts @@ -0,0 +1,77 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class BaseEditingSessionResponse { + /** + * Internal id of the editing session. Don\'t use it, it\'s not a token. + */ + 'id'?: string; + /** + * Email associated with the editing session. + */ + 'email'?: string; + /** + * Date and time when the editing session expires. + */ + 'expiresAt'?: Date; + /** + * Same value as `token`, token for the embedded editor, aka E-Token. Deprecated — use `token` instead. + * @deprecated + */ + 'key'?: string; + /** + * Token for the embedded editor, aka E-Token. Use it for your Embedding. + */ + 'token'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "email" + }, + { + "name": "expiresAt", + "baseName": "expires_at", + "type": "Date", + "format": "date-time" + }, + { + "name": "key", + "baseName": "key", + "type": "string", + "format": "" + }, + { + "name": "token", + "baseName": "token", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return BaseEditingSessionResponse.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/BaseField.ts b/src/models/BaseField.ts new file mode 100644 index 0000000..c81ec06 --- /dev/null +++ b/src/models/BaseField.ts @@ -0,0 +1,85 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { BaseFieldAssignedTo } from '../models/BaseFieldAssignedTo'; +import { DocumentFieldTypeEnum } from '../models/DocumentFieldTypeEnum'; +import { HttpFile } from '../http/http'; + +export class BaseField { + 'uuid'?: string; + /** + * Name of a field + */ + 'name'?: string; + 'title'?: string; + /** + * Placeholder of a field + */ + 'placeholder'?: string; + 'assignedTo'?: BaseFieldAssignedTo; + 'fieldId'?: string; + 'type'?: DocumentFieldTypeEnum; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "uuid", + "baseName": "uuid", + "type": "string", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "title", + "baseName": "title", + "type": "string", + "format": "" + }, + { + "name": "placeholder", + "baseName": "placeholder", + "type": "string", + "format": "" + }, + { + "name": "assignedTo", + "baseName": "assigned_to", + "type": "BaseFieldAssignedTo", + "format": "" + }, + { + "name": "fieldId", + "baseName": "field_id", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "DocumentFieldTypeEnum", + "format": "" + } ]; + + static getAttributeTypeMap() { + return BaseField.attributeTypeMap; + } + + public constructor() { + } +} + + diff --git a/src/models/BaseFieldAssignedTo.ts b/src/models/BaseFieldAssignedTo.ts new file mode 100644 index 0000000..ea8e2bc --- /dev/null +++ b/src/models/BaseFieldAssignedTo.ts @@ -0,0 +1,146 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AssignedToRecipientDeliveryMethods } from '../models/AssignedToRecipientDeliveryMethods'; +import { RecipientAssignedTo } from '../models/RecipientAssignedTo'; +import { RecipientRedirectSettings } from '../models/RecipientRedirectSettings'; +import { RecipientsGroupAssignedTo } from '../models/RecipientsGroupAssignedTo'; +import { RecipientsGroupAssignedToAllOfMembers } from '../models/RecipientsGroupAssignedToAllOfMembers'; +import { HttpFile } from '../http/http'; + +export class BaseFieldAssignedTo { + 'id'?: string; + 'email'?: string; + 'recipientType'?: string; + 'roles'?: Array; + 'signingOrder'?: number; + 'hasCompleted'?: boolean; + 'firstName'?: string; + 'lastName'?: string; + 'phone'?: string; + 'role'?: string; + 'deliveryMethods'?: AssignedToRecipientDeliveryMethods; + 'redirect'?: RecipientRedirectSettings; + 'type'?: BaseFieldAssignedToTypeEnum; + 'name'?: string; + 'members'?: Array; + + static readonly discriminator: string | undefined = "type"; + + static readonly mapping: {[index: string]: string} | undefined = { + "recipient": "RecipientAssignedTo", + "recipient_group": "RecipientsGroupAssignedTo", + }; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "email" + }, + { + "name": "recipientType", + "baseName": "recipient_type", + "type": "string", + "format": "" + }, + { + "name": "roles", + "baseName": "roles", + "type": "Array", + "format": "" + }, + { + "name": "signingOrder", + "baseName": "signing_order", + "type": "number", + "format": "" + }, + { + "name": "hasCompleted", + "baseName": "has_completed", + "type": "boolean", + "format": "" + }, + { + "name": "firstName", + "baseName": "first_name", + "type": "string", + "format": "" + }, + { + "name": "lastName", + "baseName": "last_name", + "type": "string", + "format": "" + }, + { + "name": "phone", + "baseName": "phone", + "type": "string", + "format": "" + }, + { + "name": "role", + "baseName": "role", + "type": "string", + "format": "" + }, + { + "name": "deliveryMethods", + "baseName": "delivery_methods", + "type": "AssignedToRecipientDeliveryMethods", + "format": "" + }, + { + "name": "redirect", + "baseName": "redirect", + "type": "RecipientRedirectSettings", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "BaseFieldAssignedToTypeEnum", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "members", + "baseName": "members", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return BaseFieldAssignedTo.attributeTypeMap; + } + + public constructor() { + this.type = "BaseFieldAssignedTo" as any; + } +} + +export enum BaseFieldAssignedToTypeEnum { + Recipient = 'recipient', + RecipientGroup = 'recipient_group' +} + diff --git a/src/models/BaseIdentity.ts b/src/models/BaseIdentity.ts new file mode 100644 index 0000000..37b72e0 --- /dev/null +++ b/src/models/BaseIdentity.ts @@ -0,0 +1,66 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class BaseIdentity { + /** + * A recipient\'s email address. + */ + 'email'?: string | null; + /** + * A recipient\'s phone number. + */ + 'phone'?: string | null; + /** + * A recipient\'s first name. We automatically take the first name from contact data if this field is missed. + */ + 'firstName'?: string; + /** + * A recipient\'s last name. We automatically take the last name from contact data if this field is missed. + */ + 'lastName'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "" + }, + { + "name": "phone", + "baseName": "phone", + "type": "string", + "format": "" + }, + { + "name": "firstName", + "baseName": "first_name", + "type": "string", + "format": "" + }, + { + "name": "lastName", + "baseName": "last_name", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return BaseIdentity.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ChangeDocumentStatus409Response.ts b/src/models/ChangeDocumentStatus409Response.ts new file mode 100644 index 0000000..4cfacf2 --- /dev/null +++ b/src/models/ChangeDocumentStatus409Response.ts @@ -0,0 +1,47 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class ChangeDocumentStatus409Response { + 'id'?: string; + 'status'?: string; + 'infoMessage'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "status", + "baseName": "status", + "type": "string", + "format": "" + }, + { + "name": "infoMessage", + "baseName": "info_message", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ChangeDocumentStatus409Response.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/Checkbox.ts b/src/models/Checkbox.ts new file mode 100644 index 0000000..8ea1097 --- /dev/null +++ b/src/models/Checkbox.ts @@ -0,0 +1,104 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { BaseFieldAssignedTo } from '../models/BaseFieldAssignedTo'; +import { HttpFile } from '../http/http'; + +export class Checkbox { + 'uuid'?: string; + /** + * Name of a field + */ + 'name'?: string; + 'title'?: string; + /** + * Placeholder of a field + */ + 'placeholder'?: string; + 'assignedTo'?: BaseFieldAssignedTo; + 'fieldId'?: string; + 'type'?: CheckboxTypeEnum; + /** + * Value of the Checkbox field. + */ + 'value'?: boolean; + 'mergeField'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "uuid", + "baseName": "uuid", + "type": "string", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "title", + "baseName": "title", + "type": "string", + "format": "" + }, + { + "name": "placeholder", + "baseName": "placeholder", + "type": "string", + "format": "" + }, + { + "name": "assignedTo", + "baseName": "assigned_to", + "type": "BaseFieldAssignedTo", + "format": "" + }, + { + "name": "fieldId", + "baseName": "field_id", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "CheckboxTypeEnum", + "format": "" + }, + { + "name": "value", + "baseName": "value", + "type": "boolean", + "format": "" + }, + { + "name": "mergeField", + "baseName": "merge_field", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return Checkbox.attributeTypeMap; + } + + public constructor() { + } +} + +export enum CheckboxTypeEnum { + Checkbox = 'checkbox' +} + diff --git a/src/models/CollectFile.ts b/src/models/CollectFile.ts new file mode 100644 index 0000000..75672d5 --- /dev/null +++ b/src/models/CollectFile.ts @@ -0,0 +1,95 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { BaseFieldAssignedTo } from '../models/BaseFieldAssignedTo'; +import { CollectFileAllOfValue } from '../models/CollectFileAllOfValue'; +import { HttpFile } from '../http/http'; + +export class CollectFile { + 'uuid'?: string; + /** + * Name of a field + */ + 'name'?: string; + 'title'?: string; + /** + * Placeholder of a field + */ + 'placeholder'?: string; + 'assignedTo'?: BaseFieldAssignedTo; + 'fieldId'?: string; + 'type'?: CollectFileTypeEnum; + 'value'?: CollectFileAllOfValue; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "uuid", + "baseName": "uuid", + "type": "string", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "title", + "baseName": "title", + "type": "string", + "format": "" + }, + { + "name": "placeholder", + "baseName": "placeholder", + "type": "string", + "format": "" + }, + { + "name": "assignedTo", + "baseName": "assigned_to", + "type": "BaseFieldAssignedTo", + "format": "" + }, + { + "name": "fieldId", + "baseName": "field_id", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "CollectFileTypeEnum", + "format": "" + }, + { + "name": "value", + "baseName": "value", + "type": "CollectFileAllOfValue", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CollectFile.attributeTypeMap; + } + + public constructor() { + } +} + +export enum CollectFileTypeEnum { + CollectFile = 'collect_file' +} + diff --git a/src/models/CollectFileAllOfValue.ts b/src/models/CollectFileAllOfValue.ts new file mode 100644 index 0000000..8c2d21c --- /dev/null +++ b/src/models/CollectFileAllOfValue.ts @@ -0,0 +1,43 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +/** +* Value of the Collect File field. +*/ +export class CollectFileAllOfValue { + 'name'?: string; + 'url'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "url", + "baseName": "url", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CollectFileAllOfValue.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ContactCreateRequest.ts b/src/models/ContactCreateRequest.ts index bb541bf..166f252 100644 --- a/src/models/ContactCreateRequest.ts +++ b/src/models/ContactCreateRequest.ts @@ -10,19 +10,55 @@ import { HttpFile } from '../http/http'; export class ContactCreateRequest { - 'email'?: string; - 'firstName'?: string; - 'lastName'?: string; - 'company'?: string; - 'jobTitle'?: string; - 'phone'?: string; - 'state'?: string; - 'streetAddress'?: string; - 'city'?: string; - 'postalCode'?: string; + /** + * An email address of the contact + */ + 'email'?: string | null; + /** + * Contact\'s first name + */ + 'firstName'?: string | null; + /** + * Contact\'s last name + */ + 'lastName'?: string | null; + /** + * Contact\'s company name + */ + 'company'?: string | null; + /** + * Contact\'s job title + */ + 'jobTitle'?: string | null; + /** + * A phone number + */ + 'phone'?: string | null; + /** + * A country name + */ + 'country'?: string | null; + /** + * A state name + */ + 'state'?: string | null; + /** + * A street address + */ + 'streetAddress'?: string | null; + /** + * A city name + */ + 'city'?: string | null; + /** + * A postal code + */ + 'postalCode'?: string | null; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "email", @@ -60,6 +96,12 @@ export class ContactCreateRequest { "type": "string", "format": "" }, + { + "name": "country", + "baseName": "country", + "type": "string", + "format": "" + }, { "name": "state", "baseName": "state", @@ -92,4 +134,3 @@ export class ContactCreateRequest { public constructor() { } } - diff --git a/src/models/ContactDetailsResponse.ts b/src/models/ContactDetailsResponse.ts index 72fa449..3397e07 100644 --- a/src/models/ContactDetailsResponse.ts +++ b/src/models/ContactDetailsResponse.ts @@ -10,20 +10,59 @@ import { HttpFile } from '../http/http'; export class ContactDetailsResponse { + /** + * A unique identifier of the contact + */ 'id'?: string; - 'email'?: string; - 'firstName'?: string; - 'lastName'?: string; - 'company'?: string; - 'jobTitle'?: string; - 'phone'?: string; - 'state'?: string; - 'streetAddress'?: string; - 'city'?: string; - 'postalCode'?: string; + /** + * An email address of the contact + */ + 'email'?: string | null; + /** + * Contact\'s first name + */ + 'firstName'?: string | null; + /** + * Contact\'s last name + */ + 'lastName'?: string | null; + /** + * Contact\'s company name + */ + 'company'?: string | null; + /** + * Contact\'s job title + */ + 'jobTitle'?: string | null; + /** + * A phone number + */ + 'phone'?: string | null; + /** + * A country name + */ + 'country'?: string | null; + /** + * A state name + */ + 'state'?: string | null; + /** + * A street address + */ + 'streetAddress'?: string | null; + /** + * A city name + */ + 'city'?: string | null; + /** + * A postal code + */ + 'postalCode'?: string | null; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -67,6 +106,12 @@ export class ContactDetailsResponse { "type": "string", "format": "" }, + { + "name": "country", + "baseName": "country", + "type": "string", + "format": "" + }, { "name": "state", "baseName": "state", @@ -99,4 +144,3 @@ export class ContactDetailsResponse { public constructor() { } } - diff --git a/src/models/ContactListResponse.ts b/src/models/ContactListResponse.ts index 4cf33e9..0cdb9c1 100644 --- a/src/models/ContactListResponse.ts +++ b/src/models/ContactListResponse.ts @@ -7,7 +7,7 @@ * Do not edit the class manually. */ -import { ContactDetailsResponse } from './ContactDetailsResponse'; +import { ContactDetailsResponse } from '../models/ContactDetailsResponse'; import { HttpFile } from '../http/http'; export class ContactListResponse { @@ -15,6 +15,8 @@ export class ContactListResponse { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "results", @@ -30,4 +32,3 @@ export class ContactListResponse { public constructor() { } } - diff --git a/src/models/ContactUpdateRequest.ts b/src/models/ContactUpdateRequest.ts index a54d408..94aa199 100644 --- a/src/models/ContactUpdateRequest.ts +++ b/src/models/ContactUpdateRequest.ts @@ -10,26 +10,21 @@ import { HttpFile } from '../http/http'; export class ContactUpdateRequest { - 'email'?: string; - 'firstName'?: string; - 'lastName'?: string; - 'company'?: string; - 'jobTitle'?: string; - 'phone'?: string; - 'state'?: string; - 'streetAddress'?: string; - 'city'?: string; - 'postalCode'?: string; + 'firstName'?: string | null; + 'lastName'?: string | null; + 'company'?: string | null; + 'jobTitle'?: string | null; + 'phone'?: string | null; + 'state'?: string | null; + 'streetAddress'?: string | null; + 'city'?: string | null; + 'postalCode'?: string | null; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string", - "format": "" - }, { "name": "firstName", "baseName": "first_name", @@ -92,4 +87,3 @@ export class ContactUpdateRequest { public constructor() { } } - diff --git a/src/models/ContentLibraryItemCreateFromUrlRequest.ts b/src/models/ContentLibraryItemCreateFromUrlRequest.ts new file mode 100644 index 0000000..6f96235 --- /dev/null +++ b/src/models/ContentLibraryItemCreateFromUrlRequest.ts @@ -0,0 +1,46 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class ContentLibraryItemCreateFromUrlRequest { + /** + * The name of the Content Library Item. + */ + 'name'?: string; + /** + * Secure (HTTPS) and publicly accessible URL to the PDF document. + */ + 'url'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "url", + "baseName": "url", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ContentLibraryItemCreateFromUrlRequest.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ContentLibraryItemCreateRequest.ts b/src/models/ContentLibraryItemCreateRequest.ts new file mode 100644 index 0000000..04d6aa8 --- /dev/null +++ b/src/models/ContentLibraryItemCreateRequest.ts @@ -0,0 +1,36 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class ContentLibraryItemCreateRequest { + /** + * The name of the Content Library Item. + */ + 'name'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ContentLibraryItemCreateRequest.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ContentLibraryItemListResponse.ts b/src/models/ContentLibraryItemListResponse.ts index eae35f5..db784e6 100644 --- a/src/models/ContentLibraryItemListResponse.ts +++ b/src/models/ContentLibraryItemListResponse.ts @@ -7,19 +7,21 @@ * Do not edit the class manually. */ -import { ContentLibraryItemListResponseResults } from './ContentLibraryItemListResponseResults'; +import { ContentLibraryItemListResponseResultsInner } from '../models/ContentLibraryItemListResponseResultsInner'; import { HttpFile } from '../http/http'; export class ContentLibraryItemListResponse { - 'results'?: Array; + 'results'?: Array; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "results", "baseName": "results", - "type": "Array", + "type": "Array", "format": "" } ]; @@ -30,4 +32,3 @@ export class ContentLibraryItemListResponse { public constructor() { } } - diff --git a/src/models/ContentLibraryItemListResponseResults.ts b/src/models/ContentLibraryItemListResponseResultsInner.ts similarity index 86% rename from src/models/ContentLibraryItemListResponseResults.ts rename to src/models/ContentLibraryItemListResponseResultsInner.ts index d04f7b1..69154ec 100644 --- a/src/models/ContentLibraryItemListResponseResults.ts +++ b/src/models/ContentLibraryItemListResponseResultsInner.ts @@ -9,7 +9,7 @@ import { HttpFile } from '../http/http'; -export class ContentLibraryItemListResponseResults { +export class ContentLibraryItemListResponseResultsInner { 'id'?: string; 'name'?: string; 'dateCreated'?: string; @@ -18,6 +18,8 @@ export class ContentLibraryItemListResponseResults { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -51,10 +53,9 @@ export class ContentLibraryItemListResponseResults { } ]; static getAttributeTypeMap() { - return ContentLibraryItemListResponseResults.attributeTypeMap; + return ContentLibraryItemListResponseResultsInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/ContentLibraryItemResponse.ts b/src/models/ContentLibraryItemResponse.ts index 4d91fc2..dd96760 100644 --- a/src/models/ContentLibraryItemResponse.ts +++ b/src/models/ContentLibraryItemResponse.ts @@ -7,8 +7,9 @@ * Do not edit the class manually. */ -import { ContentLibraryItemResponseCreatedBy } from './ContentLibraryItemResponseCreatedBy'; -import { PricingResponse } from './PricingResponse'; +import { ContentLibraryItemResponseCreatedBy } from '../models/ContentLibraryItemResponseCreatedBy'; +import { DocumentDetailsResponseTablesInner } from '../models/DocumentDetailsResponseTablesInner'; +import { PricingResponse } from '../models/PricingResponse'; import { HttpFile } from '../http/http'; export class ContentLibraryItemResponse { @@ -26,10 +27,16 @@ export class ContentLibraryItemResponse { 'roles'?: Array; 'version'?: string; 'contentPlaceholders'?: Array; + /** + * Document tables. + */ + 'tables'?: Array; 'images'?: Array; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -115,6 +122,12 @@ export class ContentLibraryItemResponse { "type": "Array", "format": "" }, + { + "name": "tables", + "baseName": "tables", + "type": "Array", + "format": "" + }, { "name": "images", "baseName": "images", @@ -129,4 +142,3 @@ export class ContentLibraryItemResponse { public constructor() { } } - diff --git a/src/models/ContentLibraryItemResponseCreatedBy.ts b/src/models/ContentLibraryItemResponseCreatedBy.ts index 6713689..5e2818e 100644 --- a/src/models/ContentLibraryItemResponseCreatedBy.ts +++ b/src/models/ContentLibraryItemResponseCreatedBy.ts @@ -14,10 +14,12 @@ export class ContentLibraryItemResponseCreatedBy { 'email'?: string; 'firstName'?: string; 'lastName'?: string; - 'avatar'?: string; + 'avatar'?: string | null; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -57,4 +59,3 @@ export class ContentLibraryItemResponseCreatedBy { public constructor() { } } - diff --git a/src/models/ContentLibraryResponse.ts b/src/models/ContentLibraryResponse.ts new file mode 100644 index 0000000..0a4e730 --- /dev/null +++ b/src/models/ContentLibraryResponse.ts @@ -0,0 +1,75 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class ContentLibraryResponse { + 'id'?: string; + 'name'?: string; + 'dateCreated'?: Date; + 'dateModified'?: Date; + 'version'?: string; + 'status'?: ContentLibraryResponseStatusEnum; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "dateCreated", + "baseName": "date_created", + "type": "Date", + "format": "date-time" + }, + { + "name": "dateModified", + "baseName": "date_modified", + "type": "Date", + "format": "date-time" + }, + { + "name": "version", + "baseName": "version", + "type": "string", + "format": "" + }, + { + "name": "status", + "baseName": "status", + "type": "ContentLibraryResponseStatusEnum", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ContentLibraryResponse.attributeTypeMap; + } + + public constructor() { + } +} + +export enum ContentLibraryResponseStatusEnum { + CliUploaded = 'cli.UPLOADED', + CliProcessed = 'cli.PROCESSED', + CliError = 'cli.ERROR' +} + diff --git a/src/models/CreateApiKeyRequest.ts b/src/models/CreateApiKeyRequest.ts new file mode 100644 index 0000000..fff1c01 --- /dev/null +++ b/src/models/CreateApiKeyRequest.ts @@ -0,0 +1,43 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ApiKeyTypeEnum } from '../models/ApiKeyTypeEnum'; +import { HttpFile } from '../http/http'; + +export class CreateApiKeyRequest { + 'userId'?: string; + 'type': ApiKeyTypeEnum; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "userId", + "baseName": "user_id", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "ApiKeyTypeEnum", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CreateApiKeyRequest.attributeTypeMap; + } + + public constructor() { + } +} + + diff --git a/src/models/CreateApiKeyResponse.ts b/src/models/CreateApiKeyResponse.ts new file mode 100644 index 0000000..5477777 --- /dev/null +++ b/src/models/CreateApiKeyResponse.ts @@ -0,0 +1,66 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ApiKeyTypeEnum } from '../models/ApiKeyTypeEnum'; +import { HttpFile } from '../http/http'; + +export class CreateApiKeyResponse { + /** + * A unique identifier of the user. + */ + 'userId'?: string; + 'type'?: ApiKeyTypeEnum; + /** + * A unique identifier of the workspace. + */ + 'workspaceId'?: string; + /** + * A New Public API key. + */ + 'key'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "userId", + "baseName": "user_id", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "ApiKeyTypeEnum", + "format": "" + }, + { + "name": "workspaceId", + "baseName": "workspace_id", + "type": "string", + "format": "" + }, + { + "name": "key", + "baseName": "key", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CreateApiKeyResponse.attributeTypeMap; + } + + public constructor() { + } +} + + diff --git a/src/models/CreateDocument400Response.ts b/src/models/CreateDocument400Response.ts new file mode 100644 index 0000000..e3cf7dd --- /dev/null +++ b/src/models/CreateDocument400Response.ts @@ -0,0 +1,40 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class CreateDocument400Response { + 'type'?: string; + 'detail'?: any; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "type", + "baseName": "type", + "type": "string", + "format": "" + }, + { + "name": "detail", + "baseName": "detail", + "type": "any", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CreateDocument400Response.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/CreateDocumentActor.ts b/src/models/CreateDocumentActor.ts new file mode 100644 index 0000000..c33bce9 --- /dev/null +++ b/src/models/CreateDocumentActor.ts @@ -0,0 +1,144 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { BaseIdentity } from '../models/BaseIdentity'; +import { CreateDocumentRecipient } from '../models/CreateDocumentRecipient'; +import { CreateDocumentRecipientGroup } from '../models/CreateDocumentRecipientGroup'; +import { RecipientDeliveryMethods } from '../models/RecipientDeliveryMethods'; +import { RecipientRedirect } from '../models/RecipientRedirect'; +import { RecipientVerificationSettings } from '../models/RecipientVerificationSettings'; +import { HttpFile } from '../http/http'; + +export class CreateDocumentActor { + /** + * A recipient\'s role in the document from the template. A recipient will be added in CC if a role parameter is not provided. + */ + 'role'?: string; + /** + * Set a signing order for a recipient. Learn more: https://developers.pandadoc.com/docs/set-signing-order + */ + 'signingOrder'?: number; + /** + * A recipient\'s email address. + */ + 'email'?: string | null; + /** + * A recipient\'s phone number. + */ + 'phone'?: string | null; + /** + * A recipient\'s first name. We automatically take the first name from contact data if this field is missed. + */ + 'firstName'?: string; + /** + * A recipient\'s last name. We automatically take the last name from contact data if this field is missed. + */ + 'lastName'?: string; + 'deliveryMethods'?: RecipientDeliveryMethods | null; + 'redirect'?: RecipientRedirect; + 'type': CreateDocumentActorTypeEnum; + 'verificationSettings'?: RecipientVerificationSettings | null; + 'name': string; + 'members'?: Array; + + static readonly discriminator: string | undefined = "type"; + + static readonly mapping: {[index: string]: string} | undefined = { + "recipient": "CreateDocumentRecipient", + "recipient_group": "CreateDocumentRecipientGroup", + }; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "role", + "baseName": "role", + "type": "string", + "format": "" + }, + { + "name": "signingOrder", + "baseName": "signing_order", + "type": "number", + "format": "" + }, + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "" + }, + { + "name": "phone", + "baseName": "phone", + "type": "string", + "format": "" + }, + { + "name": "firstName", + "baseName": "first_name", + "type": "string", + "format": "" + }, + { + "name": "lastName", + "baseName": "last_name", + "type": "string", + "format": "" + }, + { + "name": "deliveryMethods", + "baseName": "delivery_methods", + "type": "RecipientDeliveryMethods", + "format": "" + }, + { + "name": "redirect", + "baseName": "redirect", + "type": "RecipientRedirect", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "CreateDocumentActorTypeEnum", + "format": "" + }, + { + "name": "verificationSettings", + "baseName": "verification_settings", + "type": "RecipientVerificationSettings", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "members", + "baseName": "members", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CreateDocumentActor.attributeTypeMap; + } + + public constructor() { + this.type = CreateDocumentActorTypeEnum.Recipient; + } +} + +export enum CreateDocumentActorTypeEnum { + Recipient = 'recipient', + RecipientGroup = 'recipient_group' +} + diff --git a/src/models/CreateDocumentEditingSession201Response.ts b/src/models/CreateDocumentEditingSession201Response.ts new file mode 100644 index 0000000..8f479c0 --- /dev/null +++ b/src/models/CreateDocumentEditingSession201Response.ts @@ -0,0 +1,87 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class CreateDocumentEditingSession201Response { + /** + * Internal id of the editing session. Don\'t use it, it\'s not a token. + */ + 'id'?: string; + /** + * Email associated with the editing session. + */ + 'email'?: string; + /** + * Date and time when the editing session expires. + */ + 'expiresAt'?: Date; + /** + * Same value as `token`, token for the embedded editor, aka E-Token. Deprecated — use `token` instead. + * @deprecated + */ + 'key'?: string; + /** + * Token for the embedded editor, aka E-Token. Use it for your Embedding. + */ + 'token'?: string; + /** + * ID of the document + */ + 'documentId'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "email" + }, + { + "name": "expiresAt", + "baseName": "expires_at", + "type": "Date", + "format": "date-time" + }, + { + "name": "key", + "baseName": "key", + "type": "string", + "format": "" + }, + { + "name": "token", + "baseName": "token", + "type": "string", + "format": "" + }, + { + "name": "documentId", + "baseName": "document_id", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CreateDocumentEditingSession201Response.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/CreateDocumentFieldsRequest.ts b/src/models/CreateDocumentFieldsRequest.ts new file mode 100644 index 0000000..c167be6 --- /dev/null +++ b/src/models/CreateDocumentFieldsRequest.ts @@ -0,0 +1,37 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentFieldsFieldCreate } from '../models/DocumentFieldsFieldCreate'; +import { HttpFile } from '../http/http'; + +export class CreateDocumentFieldsRequest { + /** + * An array of fields to place on a document. + */ + 'fields'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "fields", + "baseName": "fields", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CreateDocumentFieldsRequest.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/CreateDocumentFieldsResponse.ts b/src/models/CreateDocumentFieldsResponse.ts new file mode 100644 index 0000000..dbaac4e --- /dev/null +++ b/src/models/CreateDocumentFieldsResponse.ts @@ -0,0 +1,34 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentFieldsField } from '../models/DocumentFieldsField'; +import { HttpFile } from '../http/http'; + +export class CreateDocumentFieldsResponse { + 'fields'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "fields", + "baseName": "fields", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CreateDocumentFieldsResponse.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/CreateDocumentRecipient.ts b/src/models/CreateDocumentRecipient.ts new file mode 100644 index 0000000..26cb0a9 --- /dev/null +++ b/src/models/CreateDocumentRecipient.ts @@ -0,0 +1,122 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RecipientDeliveryMethods } from '../models/RecipientDeliveryMethods'; +import { RecipientRedirect } from '../models/RecipientRedirect'; +import { RecipientVerificationSettings } from '../models/RecipientVerificationSettings'; +import { HttpFile } from '../http/http'; + +export class CreateDocumentRecipient { + /** + * A recipient\'s role in the document from the template. A recipient will be added in CC if a role parameter is not provided. + */ + 'role'?: string; + /** + * Set a signing order for a recipient. Learn more: https://developers.pandadoc.com/docs/set-signing-order + */ + 'signingOrder'?: number; + /** + * A recipient\'s email address. + */ + 'email'?: string | null; + /** + * A recipient\'s phone number. + */ + 'phone'?: string | null; + /** + * A recipient\'s first name. We automatically take the first name from contact data if this field is missed. + */ + 'firstName'?: string; + /** + * A recipient\'s last name. We automatically take the last name from contact data if this field is missed. + */ + 'lastName'?: string; + 'deliveryMethods'?: RecipientDeliveryMethods | null; + 'redirect'?: RecipientRedirect; + 'type'?: CreateDocumentRecipientTypeEnum; + 'verificationSettings'?: RecipientVerificationSettings | null; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "role", + "baseName": "role", + "type": "string", + "format": "" + }, + { + "name": "signingOrder", + "baseName": "signing_order", + "type": "number", + "format": "" + }, + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "" + }, + { + "name": "phone", + "baseName": "phone", + "type": "string", + "format": "" + }, + { + "name": "firstName", + "baseName": "first_name", + "type": "string", + "format": "" + }, + { + "name": "lastName", + "baseName": "last_name", + "type": "string", + "format": "" + }, + { + "name": "deliveryMethods", + "baseName": "delivery_methods", + "type": "RecipientDeliveryMethods", + "format": "" + }, + { + "name": "redirect", + "baseName": "redirect", + "type": "RecipientRedirect", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "CreateDocumentRecipientTypeEnum", + "format": "" + }, + { + "name": "verificationSettings", + "baseName": "verification_settings", + "type": "RecipientVerificationSettings", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CreateDocumentRecipient.attributeTypeMap; + } + + public constructor() { + } +} + +export enum CreateDocumentRecipientTypeEnum { + Recipient = 'recipient' +} + diff --git a/src/models/CreateDocumentRecipientGroup.ts b/src/models/CreateDocumentRecipientGroup.ts new file mode 100644 index 0000000..b868248 --- /dev/null +++ b/src/models/CreateDocumentRecipientGroup.ts @@ -0,0 +1,73 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { BaseIdentity } from '../models/BaseIdentity'; +import { HttpFile } from '../http/http'; + +export class CreateDocumentRecipientGroup { + /** + * A recipient\'s role in the document from the template. A recipient will be added in CC if a role parameter is not provided. + */ + 'role'?: string; + /** + * Set a signing order for a recipient. Learn more: https://developers.pandadoc.com/docs/set-signing-order + */ + 'signingOrder'?: number; + 'name': string; + 'type': CreateDocumentRecipientGroupTypeEnum; + 'members'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "role", + "baseName": "role", + "type": "string", + "format": "" + }, + { + "name": "signingOrder", + "baseName": "signing_order", + "type": "number", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "CreateDocumentRecipientGroupTypeEnum", + "format": "" + }, + { + "name": "members", + "baseName": "members", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CreateDocumentRecipientGroup.attributeTypeMap; + } + + public constructor() { + } +} + +export enum CreateDocumentRecipientGroupTypeEnum { + RecipientGroup = 'recipient_group' +} + diff --git a/src/models/CreateMemberTokenRequest.ts b/src/models/CreateMemberTokenRequest.ts new file mode 100644 index 0000000..51911fa --- /dev/null +++ b/src/models/CreateMemberTokenRequest.ts @@ -0,0 +1,36 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class CreateMemberTokenRequest { + /** + * Token lifetime in seconds. + */ + 'lifetime'?: number; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "lifetime", + "baseName": "lifetime", + "type": "number", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CreateMemberTokenRequest.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/CreateMemberTokenResponse.ts b/src/models/CreateMemberTokenResponse.ts new file mode 100644 index 0000000..a18e2ca --- /dev/null +++ b/src/models/CreateMemberTokenResponse.ts @@ -0,0 +1,33 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class CreateMemberTokenResponse { + 'token'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "token", + "baseName": "token", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CreateMemberTokenResponse.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/CreateNotarizationRequest.ts b/src/models/CreateNotarizationRequest.ts new file mode 100644 index 0000000..e58e757 --- /dev/null +++ b/src/models/CreateNotarizationRequest.ts @@ -0,0 +1,62 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CreateNotarizationRequestInvitation } from '../models/CreateNotarizationRequestInvitation'; +import { CreateNotarizationRequestNotary } from '../models/CreateNotarizationRequestNotary'; +import { HttpFile } from '../http/http'; + +export class CreateNotarizationRequest { + /** + * ID of the Document for notarization. + */ + 'documentId': string; + /** + * Disable all notifications for invitees including email with invitation for notarization. This is useful when you are using alternative delivery methods. + */ + 'disableInviteesNotifications'?: boolean | null; + 'invitation': CreateNotarizationRequestInvitation; + 'notary'?: CreateNotarizationRequestNotary; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "documentId", + "baseName": "document_id", + "type": "string", + "format": "" + }, + { + "name": "disableInviteesNotifications", + "baseName": "disable_invitees_notifications", + "type": "boolean", + "format": "" + }, + { + "name": "invitation", + "baseName": "invitation", + "type": "CreateNotarizationRequestInvitation", + "format": "" + }, + { + "name": "notary", + "baseName": "notary", + "type": "CreateNotarizationRequestNotary", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CreateNotarizationRequest.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/CreateNotarizationRequestInvitation.ts b/src/models/CreateNotarizationRequestInvitation.ts new file mode 100644 index 0000000..ea0da05 --- /dev/null +++ b/src/models/CreateNotarizationRequestInvitation.ts @@ -0,0 +1,44 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CreateNotarizationRequestInvitationInviteesInner } from '../models/CreateNotarizationRequestInvitationInviteesInner'; +import { HttpFile } from '../http/http'; + +export class CreateNotarizationRequestInvitation { + /** + * Optional message for invitation email. + */ + 'message'?: string; + 'invitees'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "message", + "baseName": "message", + "type": "string", + "format": "" + }, + { + "name": "invitees", + "baseName": "invitees", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CreateNotarizationRequestInvitation.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/CreateNotarizationRequestInvitationInviteesInner.ts b/src/models/CreateNotarizationRequestInvitationInviteesInner.ts new file mode 100644 index 0000000..6a8d6af --- /dev/null +++ b/src/models/CreateNotarizationRequestInvitationInviteesInner.ts @@ -0,0 +1,47 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class CreateNotarizationRequestInvitationInviteesInner { + 'email': string; + 'firstName'?: string | null; + 'lastName'?: string | null; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "email" + }, + { + "name": "firstName", + "baseName": "first_name", + "type": "string", + "format": "" + }, + { + "name": "lastName", + "baseName": "last_name", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CreateNotarizationRequestInvitationInviteesInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/CreateNotarizationRequestNotary.ts b/src/models/CreateNotarizationRequestNotary.ts new file mode 100644 index 0000000..e8111bb --- /dev/null +++ b/src/models/CreateNotarizationRequestNotary.ts @@ -0,0 +1,59 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +/** +* Optional notary assignment for in-house notary requests. Used for Bring you own notary use case. Only ACTIVE notaries can be used +*/ +export class CreateNotarizationRequestNotary { + /** + * ID of an ACTIVE notary + */ + 'id': string; + /** + * ISO 8601 timestamp for scheduled notarization + */ + 'scheduledAt': Date; + /** + * Optional custom message for the notary in the invitation email + */ + 'message'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "scheduledAt", + "baseName": "scheduled_at", + "type": "Date", + "format": "date-time" + }, + { + "name": "message", + "baseName": "message", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CreateNotarizationRequestNotary.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/CreateNotarizationResponse.ts b/src/models/CreateNotarizationResponse.ts new file mode 100644 index 0000000..3b57ccb --- /dev/null +++ b/src/models/CreateNotarizationResponse.ts @@ -0,0 +1,104 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CreateNotarizationResponseCreatedBy } from '../models/CreateNotarizationResponseCreatedBy'; +import { CreateNotarizationResponseInviteesInner } from '../models/CreateNotarizationResponseInviteesInner'; +import { HttpFile } from '../http/http'; + +export class CreateNotarizationResponse { + /** + * A unique identifier of the notarization request. + */ + 'id'?: string; + /** + * A name of the notarization request. + */ + 'name'?: string; + /** + * Current status of the notarization request. + */ + 'status'?: CreateNotarizationResponseStatusEnum; + /** + * A date when a notarization request was created. + */ + 'dateCreated'?: Date; + /** + * A date when a notarization session was accepted by notary. + */ + 'dateAccepted'?: Date | null; + 'createdBy'?: CreateNotarizationResponseCreatedBy; + 'invitees'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "status", + "baseName": "status", + "type": "CreateNotarizationResponseStatusEnum", + "format": "" + }, + { + "name": "dateCreated", + "baseName": "date_created", + "type": "Date", + "format": "date-time" + }, + { + "name": "dateAccepted", + "baseName": "date_accepted", + "type": "Date", + "format": "date-time" + }, + { + "name": "createdBy", + "baseName": "created_by", + "type": "CreateNotarizationResponseCreatedBy", + "format": "" + }, + { + "name": "invitees", + "baseName": "invitees", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CreateNotarizationResponse.attributeTypeMap; + } + + public constructor() { + } +} + +export enum CreateNotarizationResponseStatusEnum { + Draft = 'DRAFT', + Sent = 'SENT', + WaitingForNotary = 'WAITING_FOR_NOTARY', + Accepted = 'ACCEPTED', + Live = 'LIVE', + Completed = 'COMPLETED', + Incomplete = 'INCOMPLETE', + Cancelled = 'CANCELLED' +} + diff --git a/src/models/CreateNotarizationResponseCreatedBy.ts b/src/models/CreateNotarizationResponseCreatedBy.ts new file mode 100644 index 0000000..d8d9530 --- /dev/null +++ b/src/models/CreateNotarizationResponseCreatedBy.ts @@ -0,0 +1,66 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class CreateNotarizationResponseCreatedBy { + /** + * A unique identifier of the user who created a notarization request. + */ + 'userId'?: string; + /** + * A user\'s email address. + */ + 'email'?: string; + /** + * A user\'s first name. + */ + 'firstName'?: string; + /** + * A user\'s last name. + */ + 'lastName'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "userId", + "baseName": "user_id", + "type": "string", + "format": "" + }, + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "" + }, + { + "name": "firstName", + "baseName": "first_name", + "type": "string", + "format": "" + }, + { + "name": "lastName", + "baseName": "last_name", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CreateNotarizationResponseCreatedBy.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/CreateNotarizationResponseInviteesInner.ts b/src/models/CreateNotarizationResponseInviteesInner.ts new file mode 100644 index 0000000..a74739d --- /dev/null +++ b/src/models/CreateNotarizationResponseInviteesInner.ts @@ -0,0 +1,76 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class CreateNotarizationResponseInviteesInner { + /** + * A unique identifier of the invitee. + */ + 'id'?: string; + /** + * A invitee\'s email address. + */ + 'email'?: string; + /** + * A invitee\'s first name. + */ + 'firstName'?: string; + /** + * A invitee\'s last name. + */ + 'lastName'?: string; + /** + * A secure link to join a notarization request. + */ + 'notarizationLink'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "email" + }, + { + "name": "firstName", + "baseName": "first_name", + "type": "string", + "format": "" + }, + { + "name": "lastName", + "baseName": "last_name", + "type": "string", + "format": "" + }, + { + "name": "notarizationLink", + "baseName": "notarization_link", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CreateNotarizationResponseInviteesInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/CreateTemplateEditingSession201Response.ts b/src/models/CreateTemplateEditingSession201Response.ts new file mode 100644 index 0000000..736d806 --- /dev/null +++ b/src/models/CreateTemplateEditingSession201Response.ts @@ -0,0 +1,87 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class CreateTemplateEditingSession201Response { + /** + * Internal id of the editing session. Don\'t use it, it\'s not a token. + */ + 'id'?: string; + /** + * Email associated with the editing session. + */ + 'email'?: string; + /** + * Date and time when the editing session expires. + */ + 'expiresAt'?: Date; + /** + * Same value as `token`, token for the embedded editor, aka E-Token. Deprecated — use `token` instead. + * @deprecated + */ + 'key'?: string; + /** + * Token for the embedded editor, aka E-Token. Use it for your Embedding. + */ + 'token'?: string; + /** + * ID of the template + */ + 'templateId'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "email" + }, + { + "name": "expiresAt", + "baseName": "expires_at", + "type": "Date", + "format": "date-time" + }, + { + "name": "key", + "baseName": "key", + "type": "string", + "format": "" + }, + { + "name": "token", + "baseName": "token", + "type": "string", + "format": "" + }, + { + "name": "templateId", + "baseName": "template_id", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CreateTemplateEditingSession201Response.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/CreateTemplateFromUrlRequest.ts b/src/models/CreateTemplateFromUrlRequest.ts new file mode 100644 index 0000000..57808a4 --- /dev/null +++ b/src/models/CreateTemplateFromUrlRequest.ts @@ -0,0 +1,85 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CreateTemplateRequestOwner } from '../models/CreateTemplateRequestOwner'; +import { DocumentUpdateRequestTokensInner } from '../models/DocumentUpdateRequestTokensInner'; +import { HttpFile } from '../http/http'; + +export class CreateTemplateFromUrlRequest { + /** + * The name of the template. + */ + 'name'?: string; + /** + * The ID of the folder where the created template should be stored. + */ + 'folderUuid'?: string; + 'owner'?: CreateTemplateRequestOwner; + /** + * You can pass arbitrary data in the key-value format to associate custom information with a template. This information is returned in any API requests for the template details by id. + */ + 'metadata'?: any | null; + /** + * Create or initialize multiple CUSTOM variables with their values using tokens/values list. Template\'s predefined variables are read-only. Any attempts to do so will be ignored. + */ + 'tokens'?: Array; + /** + * Secure (HTTPS) and publicly accessible URL to the PDF document. + */ + 'url'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "folderUuid", + "baseName": "folder_uuid", + "type": "string", + "format": "" + }, + { + "name": "owner", + "baseName": "owner", + "type": "CreateTemplateRequestOwner", + "format": "" + }, + { + "name": "metadata", + "baseName": "metadata", + "type": "any", + "format": "" + }, + { + "name": "tokens", + "baseName": "tokens", + "type": "Array", + "format": "" + }, + { + "name": "url", + "baseName": "url", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CreateTemplateFromUrlRequest.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/CreateTemplateRequest.ts b/src/models/CreateTemplateRequest.ts new file mode 100644 index 0000000..d308058 --- /dev/null +++ b/src/models/CreateTemplateRequest.ts @@ -0,0 +1,75 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CreateTemplateRequestOwner } from '../models/CreateTemplateRequestOwner'; +import { DocumentUpdateRequestTokensInner } from '../models/DocumentUpdateRequestTokensInner'; +import { HttpFile } from '../http/http'; + +export class CreateTemplateRequest { + /** + * The name of the template. + */ + 'name'?: string; + /** + * The ID of the folder where the created template should be stored. + */ + 'folderUuid'?: string; + 'owner'?: CreateTemplateRequestOwner; + /** + * You can pass arbitrary data in the key-value format to associate custom information with a template. This information is returned in any API requests for the template details by id. + */ + 'metadata'?: any | null; + /** + * Create or initialize multiple CUSTOM variables with their values using tokens/values list. Template\'s predefined variables are read-only. Any attempts to do so will be ignored. + */ + 'tokens'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "folderUuid", + "baseName": "folder_uuid", + "type": "string", + "format": "" + }, + { + "name": "owner", + "baseName": "owner", + "type": "CreateTemplateRequestOwner", + "format": "" + }, + { + "name": "metadata", + "baseName": "metadata", + "type": "any", + "format": "" + }, + { + "name": "tokens", + "baseName": "tokens", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CreateTemplateRequest.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/CreateTemplateRequestOwner.ts b/src/models/CreateTemplateRequestOwner.ts new file mode 100644 index 0000000..9f9ace5 --- /dev/null +++ b/src/models/CreateTemplateRequestOwner.ts @@ -0,0 +1,43 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +/** +* You can set an owner of a template as an `email` or `membership_id`. +*/ +export class CreateTemplateRequestOwner { + 'membershipId'?: string; + 'email'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "membershipId", + "baseName": "membership_id", + "type": "string", + "format": "" + }, + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "email" + } ]; + + static getAttributeTypeMap() { + return CreateTemplateRequestOwner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/CreateUser400Response.ts b/src/models/CreateUser400Response.ts new file mode 100644 index 0000000..39531cb --- /dev/null +++ b/src/models/CreateUser400Response.ts @@ -0,0 +1,40 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class CreateUser400Response { + 'type'?: string; + 'detail'?: any; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "type", + "baseName": "type", + "type": "string", + "format": "" + }, + { + "name": "detail", + "baseName": "detail", + "type": "any", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CreateUser400Response.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/CreateUserRequest.ts b/src/models/CreateUserRequest.ts index 391c783..2eead6b 100644 --- a/src/models/CreateUserRequest.ts +++ b/src/models/CreateUserRequest.ts @@ -7,8 +7,9 @@ * Do not edit the class manually. */ -import { CreateUserRequestUser } from './CreateUserRequestUser'; -import { CreateUserRequestWorkspaces } from './CreateUserRequestWorkspaces'; +import { CreateUserRequestUser } from '../models/CreateUserRequestUser'; +import { CreateUserRequestWorkspacesInner } from '../models/CreateUserRequestWorkspacesInner'; +import { UserLicenseEnum } from '../models/UserLicenseEnum'; import { HttpFile } from '../http/http'; export class CreateUserRequest { @@ -16,11 +17,13 @@ export class CreateUserRequest { /** * Info for adding a user to a workspace(s) */ - 'workspaces': Array; - 'license': CreateUserRequestLicenseEnum; + 'workspaces': Array; + 'license': UserLicenseEnum; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "user", @@ -31,13 +34,13 @@ export class CreateUserRequest { { "name": "workspaces", "baseName": "workspaces", - "type": "Array", + "type": "Array", "format": "" }, { "name": "license", "baseName": "license", - "type": "CreateUserRequestLicenseEnum", + "type": "UserLicenseEnum", "format": "" } ]; @@ -50,5 +53,3 @@ export class CreateUserRequest { } -export type CreateUserRequestLicenseEnum = "Full" | "eSign" | "Read-only" | "Creator" | "Guest" ; - diff --git a/src/models/CreateUserRequestUser.ts b/src/models/CreateUserRequestUser.ts index 5862fec..fd77432 100644 --- a/src/models/CreateUserRequestUser.ts +++ b/src/models/CreateUserRequestUser.ts @@ -20,6 +20,8 @@ export class CreateUserRequestUser { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "email", @@ -53,4 +55,3 @@ export class CreateUserRequestUser { public constructor() { } } - diff --git a/src/models/CreateUserRequestWorkspaces.ts b/src/models/CreateUserRequestWorkspacesInner.ts similarity index 69% rename from src/models/CreateUserRequestWorkspaces.ts rename to src/models/CreateUserRequestWorkspacesInner.ts index 8dc1ed7..55534ee 100644 --- a/src/models/CreateUserRequestWorkspaces.ts +++ b/src/models/CreateUserRequestWorkspacesInner.ts @@ -7,14 +7,17 @@ * Do not edit the class manually. */ +import { WorkspaceMemberRoleEnum } from '../models/WorkspaceMemberRoleEnum'; import { HttpFile } from '../http/http'; -export class CreateUserRequestWorkspaces { +export class CreateUserRequestWorkspacesInner { 'workspaceId'?: string; - 'role'?: CreateUserRequestWorkspacesRoleEnum; + 'role'?: WorkspaceMemberRoleEnum; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "workspaceId", @@ -25,12 +28,12 @@ export class CreateUserRequestWorkspaces { { "name": "role", "baseName": "role", - "type": "CreateUserRequestWorkspacesRoleEnum", + "type": "WorkspaceMemberRoleEnum", "format": "" } ]; static getAttributeTypeMap() { - return CreateUserRequestWorkspaces.attributeTypeMap; + return CreateUserRequestWorkspacesInner.attributeTypeMap; } public constructor() { @@ -38,5 +41,3 @@ export class CreateUserRequestWorkspaces { } -export type CreateUserRequestWorkspacesRoleEnum = "Admin" | "Manager" | "Member" | "Collaborator" ; - diff --git a/src/models/CreateUserResponse.ts b/src/models/CreateUserResponse.ts index bbe1a9a..38c0ada 100644 --- a/src/models/CreateUserResponse.ts +++ b/src/models/CreateUserResponse.ts @@ -7,19 +7,29 @@ * Do not edit the class manually. */ +import { CreateUserResponseWorkspacesInner } from '../models/CreateUserResponseWorkspacesInner'; import { HttpFile } from '../http/http'; export class CreateUserResponse { 'userId'?: string; + 'workspaces'?: Array; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "userId", "baseName": "user_id", "type": "string", "format": "" + }, + { + "name": "workspaces", + "baseName": "workspaces", + "type": "Array", + "format": "" } ]; static getAttributeTypeMap() { @@ -29,4 +39,3 @@ export class CreateUserResponse { public constructor() { } } - diff --git a/src/models/CreateUserResponseWorkspacesInner.ts b/src/models/CreateUserResponseWorkspacesInner.ts new file mode 100644 index 0000000..d3fe9fb --- /dev/null +++ b/src/models/CreateUserResponseWorkspacesInner.ts @@ -0,0 +1,47 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class CreateUserResponseWorkspacesInner { + 'workspaceId'?: string; + 'role'?: string; + 'memberId'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "workspaceId", + "baseName": "workspace_id", + "type": "string", + "format": "" + }, + { + "name": "role", + "baseName": "role", + "type": "string", + "format": "" + }, + { + "name": "memberId", + "baseName": "member_id", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return CreateUserResponseWorkspacesInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/CreateWorkspaceRequest.ts b/src/models/CreateWorkspaceRequest.ts index 87ced8d..32ab2a2 100644 --- a/src/models/CreateWorkspaceRequest.ts +++ b/src/models/CreateWorkspaceRequest.ts @@ -10,10 +10,15 @@ import { HttpFile } from '../http/http'; export class CreateWorkspaceRequest { + /** + * A name for the new workspace. + */ 'name': string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "name", @@ -29,4 +34,3 @@ export class CreateWorkspaceRequest { public constructor() { } } - diff --git a/src/models/CreateWorkspaceResponse.ts b/src/models/CreateWorkspaceResponse.ts index 80a9ec7..32dc303 100644 --- a/src/models/CreateWorkspaceResponse.ts +++ b/src/models/CreateWorkspaceResponse.ts @@ -15,6 +15,8 @@ export class CreateWorkspaceResponse { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -36,4 +38,3 @@ export class CreateWorkspaceResponse { public constructor() { } } - diff --git a/src/models/DeleteNotarizationRequest404Response.ts b/src/models/DeleteNotarizationRequest404Response.ts new file mode 100644 index 0000000..4d49340 --- /dev/null +++ b/src/models/DeleteNotarizationRequest404Response.ts @@ -0,0 +1,41 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ListNotaries400ResponseDetailsInner } from '../models/ListNotaries400ResponseDetailsInner'; +import { HttpFile } from '../http/http'; + +export class DeleteNotarizationRequest404Response { + 'code'?: string; + 'details'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "code", + "baseName": "code", + "type": "string", + "format": "" + }, + { + "name": "details", + "baseName": "details", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DeleteNotarizationRequest404Response.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentAttachmentMetadata.ts b/src/models/DocumentAttachmentMetadata.ts new file mode 100644 index 0000000..53218c0 --- /dev/null +++ b/src/models/DocumentAttachmentMetadata.ts @@ -0,0 +1,36 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class DocumentAttachmentMetadata { + /** + * Optional name to set for uploaded file + */ + 'name'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentAttachmentMetadata.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentAttachmentRequest.ts b/src/models/DocumentAttachmentRequest.ts new file mode 100644 index 0000000..830cd6a --- /dev/null +++ b/src/models/DocumentAttachmentRequest.ts @@ -0,0 +1,46 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class DocumentAttachmentRequest { + /** + * Optional name to set for uploaded file + */ + 'name'?: string; + /** + * URL link to the file to be attached to a document + */ + 'source'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "source", + "baseName": "source", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentAttachmentRequest.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentAttachmentResponse.ts b/src/models/DocumentAttachmentResponse.ts index fc147d3..88a6d83 100644 --- a/src/models/DocumentAttachmentResponse.ts +++ b/src/models/DocumentAttachmentResponse.ts @@ -7,17 +7,19 @@ * Do not edit the class manually. */ -import { DocumentAttachmentResponseCreatedBy } from './DocumentAttachmentResponseCreatedBy'; +import { DocumentAttachmentResponseCreatedBy } from '../models/DocumentAttachmentResponseCreatedBy'; import { HttpFile } from '../http/http'; export class DocumentAttachmentResponse { 'uuid'?: string; 'dateCreated'?: string; 'createdBy'?: DocumentAttachmentResponseCreatedBy; - 'name'?: string; + 'name'?: string | null; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "uuid", @@ -51,4 +53,3 @@ export class DocumentAttachmentResponse { public constructor() { } } - diff --git a/src/models/DocumentAttachmentResponseCreatedBy.ts b/src/models/DocumentAttachmentResponseCreatedBy.ts index 9bab997..4fc48dd 100644 --- a/src/models/DocumentAttachmentResponseCreatedBy.ts +++ b/src/models/DocumentAttachmentResponseCreatedBy.ts @@ -14,10 +14,12 @@ export class DocumentAttachmentResponseCreatedBy { 'email'?: string; 'firstName'?: string; 'lastName'?: string; - 'avatar'?: string; + 'avatar'?: string | null; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -57,4 +59,3 @@ export class DocumentAttachmentResponseCreatedBy { public constructor() { } } - diff --git a/src/models/DocumentAuditTrailResponse.ts b/src/models/DocumentAuditTrailResponse.ts new file mode 100644 index 0000000..6676e88 --- /dev/null +++ b/src/models/DocumentAuditTrailResponse.ts @@ -0,0 +1,47 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentAuditTrailResponseResultsInner } from '../models/DocumentAuditTrailResponseResultsInner'; +import { HttpFile } from '../http/http'; + +export class DocumentAuditTrailResponse { + /** + * Total number of audit trail entries available. + */ + 'count'?: number; + /** + * List of audit trail entries returned for the current page. + */ + 'results'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "count", + "baseName": "count", + "type": "number", + "format": "" + }, + { + "name": "results", + "baseName": "results", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentAuditTrailResponse.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentAuditTrailResponseResultsInner.ts b/src/models/DocumentAuditTrailResponseResultsInner.ts new file mode 100644 index 0000000..b5c3e9b --- /dev/null +++ b/src/models/DocumentAuditTrailResponseResultsInner.ts @@ -0,0 +1,87 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentAuditTrailResponseResultsInnerUser } from '../models/DocumentAuditTrailResponseResultsInnerUser'; +import { HttpFile } from '../http/http'; + +/** +* Represents a single audit trail event for a document. +*/ +export class DocumentAuditTrailResponseResultsInner { + /** + * Unique identifier of the audit trail entry. + */ + 'id'?: string; + 'user'?: DocumentAuditTrailResponseResultsInnerUser; + /** + * Numeric code representing the type of action performed. Possible values: | Integer Value | String Representation | |---------------|---------------------------------------------| | 1 | new document | | 2 | new revision | | 3 | approval request | | 4 | approved | | 5 | rejected | | 6 | sent | | 7 | completed by all | | 8 | viewed | | 9 | completed | | 10 | waiting pay | | 11 | paid | | 12 | forwarded | | 13 | expired | | 14 | bank account submitted | | 15 | bank account verified | | 16 | payment submitted | | 17 | payment failed | | 18 | completed manually | | 19 | expired manually | | 20 | paid manually | | 21 | approval deleted | | 22 | approval forced | | 23 | reassigned | | 24 | recipient edited | | 25 | recipient added | | 26 | recipient deleted | | 27 | declined manually | | 28 | approval step skipped | | 29 | suggest edits | | 43 | declined | | 44 | partly paid | | 45 | partly paid manually | | 47 | recipient verification with kba passed | | 48 | recipient verification with id passed | | 49 | recipient verification with text sms passed | | 50 | recipient verification with passcode passed | | 51 | recipient verification with kba failed | | 52 | recipient verification with id failed | | 53 | recipient verification with text sms failed | | 54 | recipient verification with passcode failed | | 55 | recipient signed with QES | | 56 | QES completed | | 57 | recipient QES attempt started | | 58 | recipient QES attempt expired | | 59 | Optional item in quote selected | | 60 | Optional item in quote deselected | | 61 | Item quantity in quote changed | | 62 | Item quantity in pricing table changed | | 63 | Optional item in pricing table selected | | 64 | Optional item in pricing table deselected | | 65 | Section item in pricing table selected (one of) | | 66 | Optional section in quote selected | | 67 | Optional section in quote deselected | | 68 | Section quantity in quote changed | + */ + 'action'?: number; + /** + * Optional reason or explanation for the action. + */ + 'reason'?: string | null; + /** + * Timestamp when the action was performed (in ISO 8601 format). + */ + 'dateCreated'?: Date; + /** + * The IP address from which the action was performed. If a sandbox API key is used, this will be \"hidden\". + */ + 'ipAddress'?: string | null; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "user", + "baseName": "user", + "type": "DocumentAuditTrailResponseResultsInnerUser", + "format": "" + }, + { + "name": "action", + "baseName": "action", + "type": "number", + "format": "" + }, + { + "name": "reason", + "baseName": "reason", + "type": "string", + "format": "" + }, + { + "name": "dateCreated", + "baseName": "date_created", + "type": "Date", + "format": "date-time" + }, + { + "name": "ipAddress", + "baseName": "ip_address", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentAuditTrailResponseResultsInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentAuditTrailResponseResultsInnerUser.ts b/src/models/DocumentAuditTrailResponseResultsInnerUser.ts new file mode 100644 index 0000000..2948400 --- /dev/null +++ b/src/models/DocumentAuditTrailResponseResultsInnerUser.ts @@ -0,0 +1,49 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +/** +* The user who triggered the action. +*/ +export class DocumentAuditTrailResponseResultsInnerUser { + /** + * Unique identifier of the user. + */ + 'id'?: string; + /** + * User\'s email address. + */ + 'email'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "email" + } ]; + + static getAttributeTypeMap() { + return DocumentAuditTrailResponseResultsInnerUser.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentAutoRemindersResponse.ts b/src/models/DocumentAutoRemindersResponse.ts new file mode 100644 index 0000000..e8a8c8f --- /dev/null +++ b/src/models/DocumentAutoRemindersResponse.ts @@ -0,0 +1,34 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentAutoRemindersResponseResultInner } from '../models/DocumentAutoRemindersResponseResultInner'; +import { HttpFile } from '../http/http'; + +export class DocumentAutoRemindersResponse { + 'result'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "result", + "baseName": "result", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentAutoRemindersResponse.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentAutoRemindersResponse400.ts b/src/models/DocumentAutoRemindersResponse400.ts new file mode 100644 index 0000000..383f3ac --- /dev/null +++ b/src/models/DocumentAutoRemindersResponse400.ts @@ -0,0 +1,43 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class DocumentAutoRemindersResponse400 { + 'type'?: string; + /** + * Reason why auto reminder settings could not be retrieved. + */ + 'detail'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "type", + "baseName": "type", + "type": "string", + "format": "" + }, + { + "name": "detail", + "baseName": "detail", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentAutoRemindersResponse400.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentAutoRemindersResponseResultInner.ts b/src/models/DocumentAutoRemindersResponseResultInner.ts new file mode 100644 index 0000000..323e7fa --- /dev/null +++ b/src/models/DocumentAutoRemindersResponseResultInner.ts @@ -0,0 +1,53 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class DocumentAutoRemindersResponseResultInner { + /** + * Unique identifier of the recipient. + */ + 'recipientId'?: string; + /** + * Status of the reminder attempt (sent, error, scheduled). + */ + 'status'?: DocumentAutoRemindersResponseResultInnerStatusEnum; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "recipientId", + "baseName": "recipient_id", + "type": "string", + "format": "" + }, + { + "name": "status", + "baseName": "status", + "type": "DocumentAutoRemindersResponseResultInnerStatusEnum", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentAutoRemindersResponseResultInner.attributeTypeMap; + } + + public constructor() { + } +} + +export enum DocumentAutoRemindersResponseResultInnerStatusEnum { + Sent = 'sent', + Error = 'error', + Scheduled = 'scheduled' +} + diff --git a/src/models/DocumentCreateByPdfRequest.ts b/src/models/DocumentCreateByPdfRequest.ts index 48d36b1..a71b552 100644 --- a/src/models/DocumentCreateByPdfRequest.ts +++ b/src/models/DocumentCreateByPdfRequest.ts @@ -7,73 +7,92 @@ * Do not edit the class manually. */ -import { DocumentCreateByTemplateRequestRecipients } from './DocumentCreateByTemplateRequestRecipients'; +import { CreateDocumentActor } from '../models/CreateDocumentActor'; +import { DocumentCreateByTemplateRequestFieldsValue } from '../models/DocumentCreateByTemplateRequestFieldsValue'; +import { DocumentCreateByTemplateRequestOwner } from '../models/DocumentCreateByTemplateRequestOwner'; +import { DocumentCreateByTemplateRequestTokensInner } from '../models/DocumentCreateByTemplateRequestTokensInner'; import { HttpFile } from '../http/http'; export class DocumentCreateByPdfRequest { /** - * Use a URL to specify the PDF. We support only URLs starting with https. + * Set this parameter as `true` if you create a document from a PDF with form fields and as `false` if you upload a PDF with field tags. */ - 'url': string; + 'parseFormFields'?: boolean; /** - * The list of recipients you're sending the document to. Every object must contain the email parameter. The `role`, `first_name` and `last_name` parameters are optional. If the `role` parameter passed, a person is assigned all fields matching their corresponding role. If not passed, a person will receive a read-only link to view the document. If the `first_name` and `last_name` not passed the system 1. creates a new contact, if none exists with the given `email`; or 2. gets the existing contact with the given `email` that already exists. + * Set specific values to the fields. This object maps merge field names to their corresponding values. Each key represents a merge field name, and each value is an object containing the data to populate that field with. The structure allows you to pre-populate various field types including text inputs, checkboxes, dropdowns, and date fields. **Key Points:** - Keys must match the exact merge field names from your template or file. - Values must be wrapped in an object with a `value` property. - Supported value types: string, number, boolean. - Date fields should use RFC 3339 format (e.g., \'2019-12-31T00:00:00.000Z\'). - Signature fields cannot be pre-filled. **Example Usage:** - Text field: `\"CustomerName\": {\"value\": \"John Doe\"}` - Checkbox: `\"AgreeToTerms\": {\"value\": true}` - Date field: `\"DeliveryDate\": {\"value\": \"2019-12-31T00:00:00.000Z\"}` */ - 'recipients': Array; + 'fields'?: { [key: string]: DocumentCreateByTemplateRequestFieldsValue; }; /** - * Set this parameter as `true` if you create a document from a PDF with form fields and as `false` if you upload a PDF with field tags. + * Name the document you are creating. */ - 'parseFormFields'?: boolean; - 'name'?: string; + 'name': string; /** - * Mark your document with one or several tags. + * ID of the folder where the created document should be stored. */ - 'tags'?: Array; + 'folderUuid'?: string; + 'owner'?: DocumentCreateByTemplateRequestOwner; + /** + * The list of recipients to whom the document will be sent. Either `email` or `phone` is required. Specifying the `role` assigns all matching fields to the recipient or group. If `first_name` and `last_name` are not specified, the system looks them up in the workspace contacts list using the `email` or `phone number`. If `first_name` and `last_name` are provided, they override the existing contact\'s data. + */ + 'recipients'?: Array; + /** + * Also known as variables. Pass values for the variables in the template to render them into the created document or make them available for insertion later. + */ + 'tokens'?: Array; /** - * If you are creating a document from a PDF with field tags, you can pass a list of the fields you'd like to pre-fill in the document. If you are creating a document from a PDF with form fields, list all the fields and provide the `role` parameter so that the fields are assigned to document recipients. You can provide empty value for the field so that it's not pre-filled: \"value\": \"\". + * You can pass any data in a key-value format to associate it with a document. Searching by metadata is available in the List Documents endpoint and is also included in the Document Details response. */ - 'fields'?: any; + 'metadata'?: any | null; /** - * You can pass arbitrary data in the key-value format to associate custom information with a document. This information is returned in any API requests for the document details by id. + * Mark your document with one or more tags. Tags are displayed in the UI, and you can filter by tags in the List Documents endpoint. */ - 'metadata'?: any; + 'tags'?: Array; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { - "name": "url", - "baseName": "url", - "type": "string", + "name": "parseFormFields", + "baseName": "parse_form_fields", + "type": "boolean", "format": "" }, { - "name": "recipients", - "baseName": "recipients", - "type": "Array", + "name": "fields", + "baseName": "fields", + "type": "{ [key: string]: DocumentCreateByTemplateRequestFieldsValue; }", "format": "" }, { - "name": "parseFormFields", - "baseName": "parse_form_fields", - "type": "boolean", + "name": "name", + "baseName": "name", + "type": "string", "format": "" }, { - "name": "name", - "baseName": "name", + "name": "folderUuid", + "baseName": "folder_uuid", "type": "string", "format": "" }, { - "name": "tags", - "baseName": "tags", - "type": "Array", + "name": "owner", + "baseName": "owner", + "type": "DocumentCreateByTemplateRequestOwner", "format": "" }, { - "name": "fields", - "baseName": "fields", - "type": "any", + "name": "recipients", + "baseName": "recipients", + "type": "Array", + "format": "" + }, + { + "name": "tokens", + "baseName": "tokens", + "type": "Array", "format": "" }, { @@ -81,6 +100,12 @@ export class DocumentCreateByPdfRequest { "baseName": "metadata", "type": "any", "format": "" + }, + { + "name": "tags", + "baseName": "tags", + "type": "Array", + "format": "" } ]; static getAttributeTypeMap() { @@ -90,4 +115,3 @@ export class DocumentCreateByPdfRequest { public constructor() { } } - diff --git a/src/models/DocumentCreateByTemplateRequest.ts b/src/models/DocumentCreateByTemplateRequest.ts index 3fe1a84..36c4672 100644 --- a/src/models/DocumentCreateByTemplateRequest.ts +++ b/src/models/DocumentCreateByTemplateRequest.ts @@ -7,69 +7,117 @@ * Do not edit the class manually. */ -import { DocumentCreateByTemplateRequestContentPlaceholders } from './DocumentCreateByTemplateRequestContentPlaceholders'; -import { DocumentCreateByTemplateRequestImages } from './DocumentCreateByTemplateRequestImages'; -import { DocumentCreateByTemplateRequestRecipients } from './DocumentCreateByTemplateRequestRecipients'; -import { DocumentCreateByTemplateRequestTokens } from './DocumentCreateByTemplateRequestTokens'; -import { PricingTableRequest } from './PricingTableRequest'; +import { CreateDocumentActor } from '../models/CreateDocumentActor'; +import { DocumentCreateByTemplateRequestContentPlaceholdersInner } from '../models/DocumentCreateByTemplateRequestContentPlaceholdersInner'; +import { DocumentCreateByTemplateRequestFieldsValue } from '../models/DocumentCreateByTemplateRequestFieldsValue'; +import { DocumentCreateByTemplateRequestImagesInner } from '../models/DocumentCreateByTemplateRequestImagesInner'; +import { DocumentCreateByTemplateRequestOwner } from '../models/DocumentCreateByTemplateRequestOwner'; +import { DocumentCreateByTemplateRequestTextsInner } from '../models/DocumentCreateByTemplateRequestTextsInner'; +import { DocumentCreateByTemplateRequestTokensInner } from '../models/DocumentCreateByTemplateRequestTokensInner'; +import { PricingTableRequest } from '../models/PricingTableRequest'; +import { TableRequest } from '../models/TableRequest'; import { HttpFile } from '../http/http'; export class DocumentCreateByTemplateRequest { /** - * Name the document you are creating. If name is not passed, the template name is used. + * The ID of a template you want to use. You can copy it from an in app template url such as `https://app.pandadoc.com/a/#/templates/{ID}/content`. A template ID is also obtained by listing templates. */ - 'name'?: string; + 'templateUuid': string; /** - * Set this parameter as true if you want to detect title variables in the document. + * Set specific values to the fields. This object maps merge field names to their corresponding values. Each key represents a merge field name, and each value is an object containing the data to populate that field with. The structure allows you to pre-populate various field types including text inputs, checkboxes, dropdowns, and date fields. **Key Points:** - Keys must match the exact merge field names from your template or file. - Values must be wrapped in an object with a `value` property. - Supported value types: string, number, boolean. - Date fields should use RFC 3339 format (e.g., \'2019-12-31T00:00:00.000Z\'). - Signature fields cannot be pre-filled. **Example Usage:** - Text field: `\"CustomerName\": {\"value\": \"John Doe\"}` - Checkbox: `\"AgreeToTerms\": {\"value\": true}` - Date field: `\"DeliveryDate\": {\"value\": \"2019-12-31T00:00:00.000Z\"}` */ - 'detectTitleVariables'?: boolean; + 'fields'?: { [key: string]: DocumentCreateByTemplateRequestFieldsValue; }; /** - * The ID of a template you want to use. You can copy it from an in app template url such as `https://app.pandadoc.com/a/#/templates/{ID}/content`. A template ID is also obtained by listing templates. + * You can pass a list of images to image blocks (one image in one block) for replacement. */ - 'templateUuid': string; - 'folderUuid'?: string; + 'images'?: Array; /** - * The list of recipients you're sending the document to. Every object must contain the email parameter. The `role`, `first_name` and `last_name` parameters are optional. If the `role` parameter passed, a person is assigned all fields matching their corresponding role. If not passed, a person will receive a read-only link to view the document. If the `first_name` and `last_name` not passed the system 1. creates a new contact, if none exists with the given `email`; or 2. gets the existing contact with the given `email` that already exists. + * Information to construct or populate a pricing table can be passed when creating a document. All product information must be passed when creating a new document. Products stored in PandaDoc cannot be used to populate table rows at this time. Keep in mind that this is an array, so multiple table objects can be passed to a document. Make sure that \"Automatically add products to this table\" is enabled in the PandaDoc template pricing tables you wish to populate via API. */ - 'recipients': Array; + 'pricingTables'?: Array; /** - * You can pass a list of tokens/values to pre-fill tokens used in a template. Name is a token name in a template. Value is a real value you would like to replace a token with. + * Information to construct or populate a table can be passed when creating a document. Keep in mind that this is an array, so multiple table objects can be passed to a document. */ - 'tokens'?: Array; + 'tables'?: Array; /** - * You can pass a list of fields/values to pre-fill fields used in a template. Note that the Signature field can't be pre-filled. + * You can pass a list of rich text values to pre-fill text blocks in a template. This is useful for inserting dynamic content like introductions or terms and conditions. Markdown is supported. */ - 'fields'?: any; + 'texts'?: Array; /** - * You can pass arbitrary data in the key-value format to associate custom information with a document. This information is returned in any API requests for the document details by id. + * Set this parameter as true if you want to detect title variables in the document. */ - 'metadata'?: any; + 'detectTitleVariables'?: boolean; /** - * Mark your document with one or several tags. + * You may replace Content Library Item Placeholders with a few content library items each and pre-fill fields/variables values, pricing table items, and assign recipients to roles from there. */ - 'tags'?: Array; + 'contentPlaceholders'?: Array; /** - * You can pass a list of images to image blocks (one image in one block) for replacement. + * Name the document you are creating. */ - 'images'?: Array; + 'name'?: string; /** - * Information to construct or populate a pricing table can be passed when creating a document. All product information must be passed when creating a new document. Products stored in PandaDoc cannot be used to populate table rows at this time. Keep in mind that this is an array, so multiple table objects can be passed to a document. Make sure that \"Automatically add products to this table\" is enabled in the PandaDoc template pricing tables you wish to populate via API. + * ID of the folder where the created document should be stored. */ - 'pricingTables'?: Array; + 'folderUuid'?: string; + 'owner'?: DocumentCreateByTemplateRequestOwner; /** - * You may replace Content Library Item Placeholders with a few content library items each and pre-fill fields/variables values, pricing table items, and assign recipients to roles from there. + * The list of recipients to whom the document will be sent. Either `email` or `phone` is required. Specifying the `role` assigns all matching fields to the recipient or group. If `first_name` and `last_name` are not specified, the system looks them up in the workspace contacts list using the `email` or `phone number`. If `first_name` and `last_name` are provided, they override the existing contact\'s data. + */ + 'recipients': Array; + /** + * Also known as variables. Pass values for the variables in the template to render them into the created document or make them available for insertion later. */ - 'contentPlaceholders'?: Array; + 'tokens'?: Array; + /** + * You can pass any data in a key-value format to associate it with a document. Searching by metadata is available in the List Documents endpoint and is also included in the Document Details response. + */ + 'metadata'?: any | null; + /** + * Mark your document with one or more tags. Tags are displayed in the UI, and you can filter by tags in the List Documents endpoint. + */ + 'tags'?: Array; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { - "name": "name", - "baseName": "name", + "name": "templateUuid", + "baseName": "template_uuid", "type": "string", "format": "" }, + { + "name": "fields", + "baseName": "fields", + "type": "{ [key: string]: DocumentCreateByTemplateRequestFieldsValue; }", + "format": "" + }, + { + "name": "images", + "baseName": "images", + "type": "Array", + "format": "" + }, + { + "name": "pricingTables", + "baseName": "pricing_tables", + "type": "Array", + "format": "" + }, + { + "name": "tables", + "baseName": "tables", + "type": "Array", + "format": "" + }, + { + "name": "texts", + "baseName": "texts", + "type": "Array", + "format": "" + }, { "name": "detectTitleVariables", "baseName": "detect_title_variables", @@ -77,8 +125,14 @@ export class DocumentCreateByTemplateRequest { "format": "" }, { - "name": "templateUuid", - "baseName": "template_uuid", + "name": "contentPlaceholders", + "baseName": "content_placeholders", + "type": "Array", + "format": "" + }, + { + "name": "name", + "baseName": "name", "type": "string", "format": "" }, @@ -88,22 +142,22 @@ export class DocumentCreateByTemplateRequest { "type": "string", "format": "" }, + { + "name": "owner", + "baseName": "owner", + "type": "DocumentCreateByTemplateRequestOwner", + "format": "" + }, { "name": "recipients", "baseName": "recipients", - "type": "Array", + "type": "Array", "format": "" }, { "name": "tokens", "baseName": "tokens", - "type": "Array", - "format": "" - }, - { - "name": "fields", - "baseName": "fields", - "type": "any", + "type": "Array", "format": "" }, { @@ -117,24 +171,6 @@ export class DocumentCreateByTemplateRequest { "baseName": "tags", "type": "Array", "format": "" - }, - { - "name": "images", - "baseName": "images", - "type": "Array", - "format": "" - }, - { - "name": "pricingTables", - "baseName": "pricing_tables", - "type": "Array", - "format": "" - }, - { - "name": "contentPlaceholders", - "baseName": "content_placeholders", - "type": "Array", - "format": "" } ]; static getAttributeTypeMap() { @@ -144,4 +180,3 @@ export class DocumentCreateByTemplateRequest { public constructor() { } } - diff --git a/src/models/DocumentCreateByTemplateRequestContentPlaceholders.ts b/src/models/DocumentCreateByTemplateRequestContentPlaceholdersInner.ts similarity index 66% rename from src/models/DocumentCreateByTemplateRequestContentPlaceholders.ts rename to src/models/DocumentCreateByTemplateRequestContentPlaceholdersInner.ts index 4db18a4..2232d94 100644 --- a/src/models/DocumentCreateByTemplateRequestContentPlaceholders.ts +++ b/src/models/DocumentCreateByTemplateRequestContentPlaceholdersInner.ts @@ -7,20 +7,25 @@ * Do not edit the class manually. */ -import { DocumentCreateByTemplateRequestContentLibraryItems } from './DocumentCreateByTemplateRequestContentLibraryItems'; +import { DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInner } from '../models/DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInner'; import { HttpFile } from '../http/http'; -export class DocumentCreateByTemplateRequestContentPlaceholders { - 'contentLibraryItems'?: Array; +export class DocumentCreateByTemplateRequestContentPlaceholdersInner { + 'contentLibraryItems'?: Array; + /** + * Content placeholder block id + */ 'blockId': string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "contentLibraryItems", "baseName": "content_library_items", - "type": "Array", + "type": "Array", "format": "" }, { @@ -31,10 +36,9 @@ export class DocumentCreateByTemplateRequestContentPlaceholders { } ]; static getAttributeTypeMap() { - return DocumentCreateByTemplateRequestContentPlaceholders.attributeTypeMap; + return DocumentCreateByTemplateRequestContentPlaceholdersInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/DocumentCreateByTemplateRequestContentLibraryItems.ts b/src/models/DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInner.ts similarity index 57% rename from src/models/DocumentCreateByTemplateRequestContentLibraryItems.ts rename to src/models/DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInner.ts index 9ffc227..48e6515 100644 --- a/src/models/DocumentCreateByTemplateRequestContentLibraryItems.ts +++ b/src/models/DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInner.ts @@ -7,18 +7,23 @@ * Do not edit the class manually. */ -import { DocumentCreateByTemplateRequestRecipients } from './DocumentCreateByTemplateRequestRecipients'; -import { PricingTableRequest } from './PricingTableRequest'; +import { DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInnerRecipientsInner } from '../models/DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInnerRecipientsInner'; +import { PricingTableRequest } from '../models/PricingTableRequest'; import { HttpFile } from '../http/http'; -export class DocumentCreateByTemplateRequestContentLibraryItems { +export class DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInner { + /** + * Content library item id + */ 'id': string; 'fields'?: any; 'pricingTables'?: Array; - 'recipients'?: Array; + 'recipients'?: Array; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -41,15 +46,14 @@ export class DocumentCreateByTemplateRequestContentLibraryItems { { "name": "recipients", "baseName": "recipients", - "type": "Array", + "type": "Array", "format": "" } ]; static getAttributeTypeMap() { - return DocumentCreateByTemplateRequestContentLibraryItems.attributeTypeMap; + return DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/DocumentCreateRequestRecipients.ts b/src/models/DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInnerRecipientsInner.ts similarity index 73% rename from src/models/DocumentCreateRequestRecipients.ts rename to src/models/DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInnerRecipientsInner.ts index e6a8d24..7c3172c 100644 --- a/src/models/DocumentCreateRequestRecipients.ts +++ b/src/models/DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInnerRecipientsInner.ts @@ -7,22 +7,24 @@ * Do not edit the class manually. */ -import { RecipientRedirect } from './RecipientRedirect'; -import { RicipientDeliveryMethods } from './RicipientDeliveryMethods'; +import { RecipientDeliveryMethods } from '../models/RecipientDeliveryMethods'; +import { RecipientRedirect } from '../models/RecipientRedirect'; import { HttpFile } from '../http/http'; -export class DocumentCreateRequestRecipients { - 'email'?: string; - 'phone'?: string; - 'deliveryMethods'?: RicipientDeliveryMethods; +export class DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInnerRecipientsInner { + 'email'?: string | null; + 'phone'?: string | null; + 'deliveryMethods'?: RecipientDeliveryMethods | null; 'firstName'?: string; 'lastName'?: string; 'role'?: string; - 'signingOrder'?: number; + 'signingOrder'?: number | null; 'redirect'?: RecipientRedirect; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "email", @@ -39,7 +41,7 @@ export class DocumentCreateRequestRecipients { { "name": "deliveryMethods", "baseName": "delivery_methods", - "type": "RicipientDeliveryMethods", + "type": "RecipientDeliveryMethods", "format": "" }, { @@ -74,10 +76,9 @@ export class DocumentCreateRequestRecipients { } ]; static getAttributeTypeMap() { - return DocumentCreateRequestRecipients.attributeTypeMap; + return DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInnerRecipientsInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/DocumentCreateByTemplateRequestFieldsValue.ts b/src/models/DocumentCreateByTemplateRequestFieldsValue.ts new file mode 100644 index 0000000..7f2d5cd --- /dev/null +++ b/src/models/DocumentCreateByTemplateRequestFieldsValue.ts @@ -0,0 +1,44 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentCreateByTemplateRequestFieldsValueValue } from '../models/DocumentCreateByTemplateRequestFieldsValueValue'; +import { HttpFile } from '../http/http'; + +export class DocumentCreateByTemplateRequestFieldsValue { + 'value': DocumentCreateByTemplateRequestFieldsValueValue; + /** + * Assign this field to a recipient role. The role must be present in the `recipients` list. + */ + 'role'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "value", + "baseName": "value", + "type": "DocumentCreateByTemplateRequestFieldsValueValue", + "format": "" + }, + { + "name": "role", + "baseName": "role", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentCreateByTemplateRequestFieldsValue.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentCreateByTemplateRequestFieldsValueValue.ts b/src/models/DocumentCreateByTemplateRequestFieldsValueValue.ts new file mode 100644 index 0000000..79fd9c1 --- /dev/null +++ b/src/models/DocumentCreateByTemplateRequestFieldsValueValue.ts @@ -0,0 +1,33 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +/** +* The value to pre-fill the field with. The type of the value depends on the field type in the template. For example, for a checkbox field, you can pass a boolean value, and for a date field, you can pass a date string in RFC 3339 format (e.g., 2019-12-31T00:00:00.000Z). +*/ +/** + * @type DocumentCreateByTemplateRequestFieldsValueValue + * Type + * @export + */ +export type DocumentCreateByTemplateRequestFieldsValueValue = boolean | number | string; + +/** +* @type DocumentCreateByTemplateRequestFieldsValueValueClass + * The value to pre-fill the field with. The type of the value depends on the field type in the template. For example, for a checkbox field, you can pass a boolean value, and for a date field, you can pass a date string in RFC 3339 format (e.g., 2019-12-31T00:00:00.000Z). +* @export +*/ +export class DocumentCreateByTemplateRequestFieldsValueValueClass { + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; +} + + diff --git a/src/models/DocumentCreateRequestImages.ts b/src/models/DocumentCreateByTemplateRequestImagesInner.ts similarity index 80% rename from src/models/DocumentCreateRequestImages.ts rename to src/models/DocumentCreateByTemplateRequestImagesInner.ts index 9031715..427eae2 100644 --- a/src/models/DocumentCreateRequestImages.ts +++ b/src/models/DocumentCreateByTemplateRequestImagesInner.ts @@ -9,12 +9,14 @@ import { HttpFile } from '../http/http'; -export class DocumentCreateRequestImages { +export class DocumentCreateByTemplateRequestImagesInner { 'urls': Array; 'name': string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "urls", @@ -30,10 +32,9 @@ export class DocumentCreateRequestImages { } ]; static getAttributeTypeMap() { - return DocumentCreateRequestImages.attributeTypeMap; + return DocumentCreateByTemplateRequestImagesInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/DocumentCreateByTemplateRequestOwner.ts b/src/models/DocumentCreateByTemplateRequestOwner.ts new file mode 100644 index 0000000..4f60a53 --- /dev/null +++ b/src/models/DocumentCreateByTemplateRequestOwner.ts @@ -0,0 +1,43 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +/** +* The owner of the document. Pass either `email` or `membership_id` of the user in the workspace. +*/ +export class DocumentCreateByTemplateRequestOwner { + 'email'?: string; + 'membershipId'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "" + }, + { + "name": "membershipId", + "baseName": "membership_id", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentCreateByTemplateRequestOwner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentCreateByTemplateRequestTextsInner.ts b/src/models/DocumentCreateByTemplateRequestTextsInner.ts new file mode 100644 index 0000000..b6df6d1 --- /dev/null +++ b/src/models/DocumentCreateByTemplateRequestTextsInner.ts @@ -0,0 +1,46 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class DocumentCreateByTemplateRequestTextsInner { + /** + * The name of the Text Block to update. This name is defined in the template. + */ + 'name': string; + /** + * The text content to be inserted into the block. Supports markdown. + */ + 'data': string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "data", + "baseName": "data", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentCreateByTemplateRequestTextsInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentCreateByTemplateRequestTokensInner.ts b/src/models/DocumentCreateByTemplateRequestTokensInner.ts new file mode 100644 index 0000000..15dca63 --- /dev/null +++ b/src/models/DocumentCreateByTemplateRequestTokensInner.ts @@ -0,0 +1,40 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class DocumentCreateByTemplateRequestTokensInner { + 'name': string; + 'value': string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "value", + "baseName": "value", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentCreateByTemplateRequestTokensInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentCreateLinkRequest.ts b/src/models/DocumentCreateLinkRequest.ts index 0a4c727..129baf6 100644 --- a/src/models/DocumentCreateLinkRequest.ts +++ b/src/models/DocumentCreateLinkRequest.ts @@ -11,16 +11,18 @@ import { HttpFile } from '../http/http'; export class DocumentCreateLinkRequest { /** - * The email address for the recipient you're creating a document link for. + * Email address of the person who will receive access to the document. */ 'recipient': string; /** - * Provide the number of seconds that a document link should be valid for. Default is 3600 seconds. + * The duration in seconds for which the document link will remain valid. The link will expire and become inaccessible after this time period. For security, we recommend setting the lifetime to less than one year (e.g., `\"lifetime\": 31535999`). If not specified, the default value is 1 hour (3600 seconds). */ 'lifetime'?: number; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "recipient", @@ -42,4 +44,3 @@ export class DocumentCreateLinkRequest { public constructor() { } } - diff --git a/src/models/DocumentCreateLinkResponse.ts b/src/models/DocumentCreateLinkResponse.ts index 67db48a..4cc1361 100644 --- a/src/models/DocumentCreateLinkResponse.ts +++ b/src/models/DocumentCreateLinkResponse.ts @@ -10,11 +10,19 @@ import { HttpFile } from '../http/http'; export class DocumentCreateLinkResponse { + /** + * The session ID. + */ 'id'?: string; + /** + * The date and time when the session will expire. + */ 'expiresAt'?: string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -36,4 +44,3 @@ export class DocumentCreateLinkResponse { public constructor() { } } - diff --git a/src/models/DocumentCreateRequest.ts b/src/models/DocumentCreateRequest.ts index ef002ee..b0fbb3f 100644 --- a/src/models/DocumentCreateRequest.ts +++ b/src/models/DocumentCreateRequest.ts @@ -7,174 +7,24 @@ * Do not edit the class manually. */ -import { DocumentCreateByTemplateRequestTokens } from './DocumentCreateByTemplateRequestTokens'; -import { DocumentCreateRequestContentPlaceholders } from './DocumentCreateRequestContentPlaceholders'; -import { DocumentCreateRequestImages } from './DocumentCreateRequestImages'; -import { DocumentCreateRequestRecipients } from './DocumentCreateRequestRecipients'; -import { PricingTableRequest } from './PricingTableRequest'; +import { DocumentCreateRequestOneOf } from '../models/DocumentCreateRequestOneOf'; +import { DocumentCreateRequestOneOf1 } from '../models/DocumentCreateRequestOneOf1'; import { HttpFile } from '../http/http'; -export class DocumentCreateRequest { - /** - * Name the document you are creating. - */ - 'name'?: string; - /** - * Set this parameter as true if you want to detect title variables in the document. - */ - 'detectTitleVariables'?: boolean; - /** - * ID of the template you want to use. You can copy it from an in-app template URL such as `https://app.pandadoc.com/a/#/templates/{ID}/content`. A template ID is also obtained by listing templates. - */ - 'templateUuid'?: string; - /** - * ID of the folder where the created document should be stored. - */ - 'folderUuid'?: string; - /** - * You can set an owner of a document as an `email` or `membership_id` - */ - 'owner'?: { [key: string]: string; }; - /** - * The list of recipients you're sending the document to. Every object must contain the `email` parameter. The `role`, `first_name` and `last_name` parameters are optional. If the `role` parameter is passed, a person is assigned all fields matching their corresponding role. If a role was not passed, a person receives a read-only link to view the document. If the `first_name` and `last_name` are not passed, the system does this 1. Creates a new contact, if none exists with the given `email`; or 2. Gets the existing contact with the given `email` that already exists. - */ - 'recipients'?: Array; - /** - * You can pass a list of tokens/values to pre-fill tokens used in a template. Name is a token name in a template. Value is a real value you would like to replace a token with. - */ - 'tokens'?: Array; - /** - * You can pass a list of fields/values to pre-fill fields used in a template. Please note Signature field can't be pre-filled. - */ - 'fields'?: any; - /** - * You can pass arbitrary data in the key-value format to associate custom information with a document. This information is returned in any API requests for the document details by id. - */ - 'metadata'?: any; - /** - * Mark your document with one or several tags. - */ - 'tags'?: Array; - /** - * You can pass a list of images to image blocks (one image in one block) for replacement. - */ - 'images'?: Array; - /** - * Information to construct or populate a pricing table can be passed when creating a document. All product information must be passed when creating a new document. Products stored in PandaDoc cannot be used to populate table rows at this time. Keep in mind that this is an array, so multiple table objects can be passed to a document. - */ - 'pricingTables'?: Array; - /** - * You may replace Content Library Item Placeholders with a few content library items each and pre-fill fields/variables values, pricing table items, and assign recipients to roles from there. - */ - 'contentPlaceholders'?: Array; - /** - * Use a URL to specify the PDF. We support only URLs starting with https. - */ - 'url'?: string; - /** - * Set this parameter as true if you create a document from a PDF with form fields and as false if you upload a PDF with field tags. - */ - 'parseFormFields'?: boolean; +/** + * @type DocumentCreateRequest + * Type + * @export + */ +export type DocumentCreateRequest = DocumentCreateRequestOneOf | DocumentCreateRequestOneOf1; +/** +* @type DocumentCreateRequestClass +* @export +*/ +export class DocumentCreateRequestClass { static readonly discriminator: string | undefined = undefined; - static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string", - "format": "" - }, - { - "name": "detectTitleVariables", - "baseName": "detect_title_variables", - "type": "boolean", - "format": "" - }, - { - "name": "templateUuid", - "baseName": "template_uuid", - "type": "string", - "format": "" - }, - { - "name": "folderUuid", - "baseName": "folder_uuid", - "type": "string", - "format": "" - }, - { - "name": "owner", - "baseName": "owner", - "type": "{ [key: string]: string; }", - "format": "" - }, - { - "name": "recipients", - "baseName": "recipients", - "type": "Array", - "format": "" - }, - { - "name": "tokens", - "baseName": "tokens", - "type": "Array", - "format": "" - }, - { - "name": "fields", - "baseName": "fields", - "type": "any", - "format": "" - }, - { - "name": "metadata", - "baseName": "metadata", - "type": "any", - "format": "" - }, - { - "name": "tags", - "baseName": "tags", - "type": "Array", - "format": "" - }, - { - "name": "images", - "baseName": "images", - "type": "Array", - "format": "" - }, - { - "name": "pricingTables", - "baseName": "pricing_tables", - "type": "Array", - "format": "" - }, - { - "name": "contentPlaceholders", - "baseName": "content_placeholders", - "type": "Array", - "format": "" - }, - { - "name": "url", - "baseName": "url", - "type": "string", - "format": "" - }, - { - "name": "parseFormFields", - "baseName": "parse_form_fields", - "type": "boolean", - "format": "" - } ]; - - static getAttributeTypeMap() { - return DocumentCreateRequest.attributeTypeMap; - } - - public constructor() { - } + static readonly mapping: {[index: string]: string} | undefined = undefined; } diff --git a/src/models/DocumentCreateRequestOneOf.ts b/src/models/DocumentCreateRequestOneOf.ts new file mode 100644 index 0000000..9f29a35 --- /dev/null +++ b/src/models/DocumentCreateRequestOneOf.ts @@ -0,0 +1,182 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CreateDocumentActor } from '../models/CreateDocumentActor'; +import { DocumentCreateByTemplateRequestContentPlaceholdersInner } from '../models/DocumentCreateByTemplateRequestContentPlaceholdersInner'; +import { DocumentCreateByTemplateRequestFieldsValue } from '../models/DocumentCreateByTemplateRequestFieldsValue'; +import { DocumentCreateByTemplateRequestImagesInner } from '../models/DocumentCreateByTemplateRequestImagesInner'; +import { DocumentCreateByTemplateRequestOwner } from '../models/DocumentCreateByTemplateRequestOwner'; +import { DocumentCreateByTemplateRequestTextsInner } from '../models/DocumentCreateByTemplateRequestTextsInner'; +import { DocumentCreateByTemplateRequestTokensInner } from '../models/DocumentCreateByTemplateRequestTokensInner'; +import { PricingTableRequest } from '../models/PricingTableRequest'; +import { TableRequest } from '../models/TableRequest'; +import { HttpFile } from '../http/http'; + +export class DocumentCreateRequestOneOf { + /** + * ID of the template you want to use. You can copy it from an in-app template URL such as `https://app.pandadoc.com/a/#/templates/{ID}/content`. A template ID is also obtained by listing templates. + */ + 'templateUuid': string; + /** + * Set specific values to the fields. This object maps merge field names to their corresponding values. Each key represents a merge field name, and each value is an object containing the data to populate that field with. The structure allows you to pre-populate various field types including text inputs, checkboxes, dropdowns, and date fields. **Key Points:** - Keys must match the exact merge field names from your template or file. - Values must be wrapped in an object with a `value` property. - Supported value types: string, number, boolean. - Date fields should use RFC 3339 format (e.g., \'2019-12-31T00:00:00.000Z\'). - Signature fields cannot be pre-filled. **Example Usage:** - Text field: `\"CustomerName\": {\"value\": \"John Doe\"}` - Checkbox: `\"AgreeToTerms\": {\"value\": true}` - Date field: `\"DeliveryDate\": {\"value\": \"2019-12-31T00:00:00.000Z\"}` + */ + 'fields'?: { [key: string]: DocumentCreateByTemplateRequestFieldsValue; }; + /** + * You can pass a list of images to image blocks (one image in one block) for replacement. + */ + 'images'?: Array; + /** + * Information to construct or populate a pricing table can be passed when creating a document. All product information must be passed when creating a new document. Products stored in PandaDoc cannot be used to populate table rows at this time. Keep in mind that this is an array, so multiple table objects can be passed to a document. Make sure that \"Automatically add products to this table\" is enabled in the PandaDoc template pricing tables you wish to populate via API. + */ + 'pricingTables'?: Array; + /** + * Information to construct or populate a table can be passed when creating a document. Keep in mind that this is an array, so multiple table objects can be passed to a document. + */ + 'tables'?: Array; + /** + * You can pass a list of rich text values to pre-fill text blocks in a template. This is useful for inserting dynamic content like introductions or terms and conditions. Markdown is supported. + */ + 'texts'?: Array; + /** + * Set this parameter as true if you want to detect title variables in the document. + */ + 'detectTitleVariables'?: boolean; + /** + * You may replace Content Library Item Placeholders with a few content library items each and pre-fill fields/variables values, pricing table items, and assign recipients to roles from there. + */ + 'contentPlaceholders'?: Array; + /** + * Name the document you are creating. + */ + 'name'?: string; + /** + * ID of the folder where the created document should be stored. + */ + 'folderUuid'?: string; + 'owner'?: DocumentCreateByTemplateRequestOwner; + /** + * The list of recipients to whom the document will be sent. Either `email` or `phone` is required. Specifying the `role` assigns all matching fields to the recipient or group. If `first_name` and `last_name` are not specified, the system looks them up in the workspace contacts list using the `email` or `phone number`. If `first_name` and `last_name` are provided, they override the existing contact\'s data. + */ + 'recipients': Array; + /** + * Also known as variables. Pass values for the variables in the template to render them into the created document or make them available for insertion later. + */ + 'tokens'?: Array; + /** + * You can pass any data in a key-value format to associate it with a document. Searching by metadata is available in the List Documents endpoint and is also included in the Document Details response. + */ + 'metadata'?: any | null; + /** + * Mark your document with one or more tags. Tags are displayed in the UI, and you can filter by tags in the List Documents endpoint. + */ + 'tags'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "templateUuid", + "baseName": "template_uuid", + "type": "string", + "format": "" + }, + { + "name": "fields", + "baseName": "fields", + "type": "{ [key: string]: DocumentCreateByTemplateRequestFieldsValue; }", + "format": "" + }, + { + "name": "images", + "baseName": "images", + "type": "Array", + "format": "" + }, + { + "name": "pricingTables", + "baseName": "pricing_tables", + "type": "Array", + "format": "" + }, + { + "name": "tables", + "baseName": "tables", + "type": "Array", + "format": "" + }, + { + "name": "texts", + "baseName": "texts", + "type": "Array", + "format": "" + }, + { + "name": "detectTitleVariables", + "baseName": "detect_title_variables", + "type": "boolean", + "format": "" + }, + { + "name": "contentPlaceholders", + "baseName": "content_placeholders", + "type": "Array", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "folderUuid", + "baseName": "folder_uuid", + "type": "string", + "format": "" + }, + { + "name": "owner", + "baseName": "owner", + "type": "DocumentCreateByTemplateRequestOwner", + "format": "" + }, + { + "name": "recipients", + "baseName": "recipients", + "type": "Array", + "format": "" + }, + { + "name": "tokens", + "baseName": "tokens", + "type": "Array", + "format": "" + }, + { + "name": "metadata", + "baseName": "metadata", + "type": "any", + "format": "" + }, + { + "name": "tags", + "baseName": "tags", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentCreateRequestOneOf.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentCreateRequestOneOf1.ts b/src/models/DocumentCreateRequestOneOf1.ts new file mode 100644 index 0000000..2ddc95f --- /dev/null +++ b/src/models/DocumentCreateRequestOneOf1.ts @@ -0,0 +1,127 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CreateDocumentActor } from '../models/CreateDocumentActor'; +import { DocumentCreateByTemplateRequestFieldsValue } from '../models/DocumentCreateByTemplateRequestFieldsValue'; +import { DocumentCreateByTemplateRequestOwner } from '../models/DocumentCreateByTemplateRequestOwner'; +import { DocumentCreateByTemplateRequestTokensInner } from '../models/DocumentCreateByTemplateRequestTokensInner'; +import { HttpFile } from '../http/http'; + +export class DocumentCreateRequestOneOf1 { + /** + * Set this parameter as `true` if you create a document from a PDF with form fields and as `false` if you upload a PDF with field tags. + */ + 'parseFormFields'?: boolean; + /** + * Set specific values to the fields. This object maps merge field names to their corresponding values. Each key represents a merge field name, and each value is an object containing the data to populate that field with. The structure allows you to pre-populate various field types including text inputs, checkboxes, dropdowns, and date fields. **Key Points:** - Keys must match the exact merge field names from your template or file. - Values must be wrapped in an object with a `value` property. - Supported value types: string, number, boolean. - Date fields should use RFC 3339 format (e.g., \'2019-12-31T00:00:00.000Z\'). - Signature fields cannot be pre-filled. **Example Usage:** - Text field: `\"CustomerName\": {\"value\": \"John Doe\"}` - Checkbox: `\"AgreeToTerms\": {\"value\": true}` - Date field: `\"DeliveryDate\": {\"value\": \"2019-12-31T00:00:00.000Z\"}` + */ + 'fields'?: { [key: string]: DocumentCreateByTemplateRequestFieldsValue; }; + /** + * Name the document you are creating. + */ + 'name': string; + /** + * ID of the folder where the created document should be stored. + */ + 'folderUuid'?: string; + 'owner'?: DocumentCreateByTemplateRequestOwner; + /** + * The list of recipients to whom the document will be sent. Either `email` or `phone` is required. Specifying the `role` assigns all matching fields to the recipient or group. If `first_name` and `last_name` are not specified, the system looks them up in the workspace contacts list using the `email` or `phone number`. If `first_name` and `last_name` are provided, they override the existing contact\'s data. + */ + 'recipients'?: Array; + /** + * Also known as variables. Pass values for the variables in the template to render them into the created document or make them available for insertion later. + */ + 'tokens'?: Array; + /** + * You can pass any data in a key-value format to associate it with a document. Searching by metadata is available in the List Documents endpoint and is also included in the Document Details response. + */ + 'metadata'?: any | null; + /** + * Mark your document with one or more tags. Tags are displayed in the UI, and you can filter by tags in the List Documents endpoint. + */ + 'tags'?: Array; + /** + * Secure (HTTPS) and publicly accessible URL to the PDF document. + */ + 'url': string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "parseFormFields", + "baseName": "parse_form_fields", + "type": "boolean", + "format": "" + }, + { + "name": "fields", + "baseName": "fields", + "type": "{ [key: string]: DocumentCreateByTemplateRequestFieldsValue; }", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "folderUuid", + "baseName": "folder_uuid", + "type": "string", + "format": "" + }, + { + "name": "owner", + "baseName": "owner", + "type": "DocumentCreateByTemplateRequestOwner", + "format": "" + }, + { + "name": "recipients", + "baseName": "recipients", + "type": "Array", + "format": "" + }, + { + "name": "tokens", + "baseName": "tokens", + "type": "Array", + "format": "" + }, + { + "name": "metadata", + "baseName": "metadata", + "type": "any", + "format": "" + }, + { + "name": "tags", + "baseName": "tags", + "type": "Array", + "format": "" + }, + { + "name": "url", + "baseName": "url", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentCreateRequestOneOf1.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentCreateResponse.ts b/src/models/DocumentCreateResponse.ts index 954e3fc..8acd3db 100644 --- a/src/models/DocumentCreateResponse.ts +++ b/src/models/DocumentCreateResponse.ts @@ -7,8 +7,8 @@ * Do not edit the class manually. */ -import { DocumentCreateResponseLinks } from './DocumentCreateResponseLinks'; -import { DocumentStatusEnum } from './DocumentStatusEnum'; +import { DocumentCreateResponseLinksInner } from '../models/DocumentCreateResponseLinksInner'; +import { DocumentStatusEnum } from '../models/DocumentStatusEnum'; import { HttpFile } from '../http/http'; export class DocumentCreateResponse { @@ -17,13 +17,16 @@ export class DocumentCreateResponse { 'status'?: DocumentStatusEnum; 'dateCreated'?: string; 'dateModified'?: string; - 'expirationDate'?: string; + 'expirationDate'?: string | null; + 'version'?: string | null; 'uuid'?: string; - 'links'?: Array; + 'links'?: Array; 'infoMessage'?: string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -61,6 +64,12 @@ export class DocumentCreateResponse { "type": "string", "format": "" }, + { + "name": "version", + "baseName": "version", + "type": "string", + "format": "" + }, { "name": "uuid", "baseName": "uuid", @@ -70,7 +79,7 @@ export class DocumentCreateResponse { { "name": "links", "baseName": "links", - "type": "Array", + "type": "Array", "format": "" }, { @@ -88,3 +97,4 @@ export class DocumentCreateResponse { } } + diff --git a/src/models/DocumentCreateResponseLinks.ts b/src/models/DocumentCreateResponseLinksInner.ts similarity index 83% rename from src/models/DocumentCreateResponseLinks.ts rename to src/models/DocumentCreateResponseLinksInner.ts index 7834b11..84519ac 100644 --- a/src/models/DocumentCreateResponseLinks.ts +++ b/src/models/DocumentCreateResponseLinksInner.ts @@ -9,13 +9,15 @@ import { HttpFile } from '../http/http'; -export class DocumentCreateResponseLinks { +export class DocumentCreateResponseLinksInner { 'rel'?: string; 'href'?: string; 'type'?: string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "rel", @@ -37,10 +39,9 @@ export class DocumentCreateResponseLinks { } ]; static getAttributeTypeMap() { - return DocumentCreateResponseLinks.attributeTypeMap; + return DocumentCreateResponseLinksInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/DocumentDeliveryMethodEnum.ts b/src/models/DocumentDeliveryMethodEnum.ts new file mode 100644 index 0000000..335aca8 --- /dev/null +++ b/src/models/DocumentDeliveryMethodEnum.ts @@ -0,0 +1,18 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +/** +* The method used to deliver reminders (e.g., email, SMS). +*/ +export enum DocumentDeliveryMethodEnum { + Email = 'email', + Sms = 'sms' +} diff --git a/src/models/DocumentDetailsResponseRecipients.ts b/src/models/DocumentDetailsRecipient.ts similarity index 72% rename from src/models/DocumentDetailsResponseRecipients.ts rename to src/models/DocumentDetailsRecipient.ts index 4b67579..3c63b84 100644 --- a/src/models/DocumentDetailsResponseRecipients.ts +++ b/src/models/DocumentDetailsRecipient.ts @@ -7,32 +7,42 @@ * Do not edit the class manually. */ -import { RecipientRedirect } from './RecipientRedirect'; -import { RecipientVerificationSettings } from './RecipientVerificationSettings'; -import { RicipientDeliveryMethods } from './RicipientDeliveryMethods'; +import { RecipientDeliveryMethods } from '../models/RecipientDeliveryMethods'; +import { RecipientRedirect } from '../models/RecipientRedirect'; +import { RecipientVerificationSettings } from '../models/RecipientVerificationSettings'; import { HttpFile } from '../http/http'; -export class DocumentDetailsResponseRecipients { +export class DocumentDetailsRecipient { + 'id'?: string; 'recipientType'?: string; 'role'?: string; 'roles'?: Array; + 'signingOrder'?: number | null; + 'email'?: string | null; + 'hasCompleted'?: boolean; 'lastName'?: string; - 'signingOrder'?: any; - 'id'?: string; 'contactId'?: string; 'firstName'?: string; - 'email'?: string; - 'phone'?: string; - 'deliveryMethods'?: RicipientDeliveryMethods; - 'hasCompleted'?: boolean; + 'phone'?: string | null; + 'deliveryMethods'?: RecipientDeliveryMethods | null; 'sharedLink'?: string; - 'signatureDate'?: string; - 'verificationSettings'?: RecipientVerificationSettings; + 'signatureDate'?: string | null; + 'verificationSettings'?: RecipientVerificationSettings | null; 'redirect'?: RecipientRedirect; + 'avatar'?: string | null; + 'type'?: DocumentDetailsRecipientTypeEnum; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, { "name": "recipientType", "baseName": "recipient_type", @@ -52,20 +62,26 @@ export class DocumentDetailsResponseRecipients { "format": "" }, { - "name": "lastName", - "baseName": "last_name", + "name": "signingOrder", + "baseName": "signing_order", + "type": "number", + "format": "" + }, + { + "name": "email", + "baseName": "email", "type": "string", "format": "" }, { - "name": "signingOrder", - "baseName": "signing_order", - "type": "any", + "name": "hasCompleted", + "baseName": "has_completed", + "type": "boolean", "format": "" }, { - "name": "id", - "baseName": "id", + "name": "lastName", + "baseName": "last_name", "type": "string", "format": "" }, @@ -81,12 +97,6 @@ export class DocumentDetailsResponseRecipients { "type": "string", "format": "" }, - { - "name": "email", - "baseName": "email", - "type": "string", - "format": "" - }, { "name": "phone", "baseName": "phone", @@ -96,13 +106,7 @@ export class DocumentDetailsResponseRecipients { { "name": "deliveryMethods", "baseName": "delivery_methods", - "type": "RicipientDeliveryMethods", - "format": "" - }, - { - "name": "hasCompleted", - "baseName": "has_completed", - "type": "boolean", + "type": "RecipientDeliveryMethods", "format": "" }, { @@ -128,13 +132,29 @@ export class DocumentDetailsResponseRecipients { "baseName": "redirect", "type": "RecipientRedirect", "format": "" + }, + { + "name": "avatar", + "baseName": "avatar", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "DocumentDetailsRecipientTypeEnum", + "format": "" } ]; static getAttributeTypeMap() { - return DocumentDetailsResponseRecipients.attributeTypeMap; + return DocumentDetailsRecipient.attributeTypeMap; } public constructor() { } } +export enum DocumentDetailsRecipientTypeEnum { + Recipient = 'recipient' +} + diff --git a/src/models/DocumentDetailsRecipientGroup.ts b/src/models/DocumentDetailsRecipientGroup.ts new file mode 100644 index 0000000..cd7919a --- /dev/null +++ b/src/models/DocumentDetailsRecipientGroup.ts @@ -0,0 +1,102 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentDetailsRecipientGroupMember } from '../models/DocumentDetailsRecipientGroupMember'; +import { HttpFile } from '../http/http'; + +export class DocumentDetailsRecipientGroup { + 'id'?: string; + 'recipientType'?: string; + 'role'?: string; + 'roles'?: Array; + 'signingOrder'?: number | null; + 'email'?: string | null; + 'hasCompleted'?: boolean; + 'name'?: string; + 'type'?: DocumentDetailsRecipientGroupTypeEnum; + 'members'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "recipientType", + "baseName": "recipient_type", + "type": "string", + "format": "" + }, + { + "name": "role", + "baseName": "role", + "type": "string", + "format": "" + }, + { + "name": "roles", + "baseName": "roles", + "type": "Array", + "format": "" + }, + { + "name": "signingOrder", + "baseName": "signing_order", + "type": "number", + "format": "" + }, + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "" + }, + { + "name": "hasCompleted", + "baseName": "has_completed", + "type": "boolean", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "DocumentDetailsRecipientGroupTypeEnum", + "format": "" + }, + { + "name": "members", + "baseName": "members", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentDetailsRecipientGroup.attributeTypeMap; + } + + public constructor() { + } +} + +export enum DocumentDetailsRecipientGroupTypeEnum { + RecipientGroup = 'recipient_group' +} + diff --git a/src/models/DocumentUpdateRequestRecipients.ts b/src/models/DocumentDetailsRecipientGroupMember.ts similarity index 66% rename from src/models/DocumentUpdateRequestRecipients.ts rename to src/models/DocumentDetailsRecipientGroupMember.ts index 4fda005..585cad4 100644 --- a/src/models/DocumentUpdateRequestRecipients.ts +++ b/src/models/DocumentDetailsRecipientGroupMember.ts @@ -7,21 +7,24 @@ * Do not edit the class manually. */ -import { RecipientRedirect } from './RecipientRedirect'; -import { RicipientDeliveryMethods } from './RicipientDeliveryMethods'; import { HttpFile } from '../http/http'; -export class DocumentUpdateRequestRecipients { +/** +* Recipient Group Member +*/ +export class DocumentDetailsRecipientGroupMember { 'id'?: string; - 'email'?: string; - 'phone'?: string; 'firstName'?: string; 'lastName'?: string; - 'deliveryMethods'?: RicipientDeliveryMethods; - 'redirect'?: RecipientRedirect; + 'email'?: string | null; + 'sharedLink'?: string; + 'avatar'?: string | null; + 'signatureDate'?: string | null; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -30,47 +33,46 @@ export class DocumentUpdateRequestRecipients { "format": "" }, { - "name": "email", - "baseName": "email", + "name": "firstName", + "baseName": "first_name", "type": "string", "format": "" }, { - "name": "phone", - "baseName": "phone", + "name": "lastName", + "baseName": "last_name", "type": "string", "format": "" }, { - "name": "firstName", - "baseName": "first_name", + "name": "email", + "baseName": "email", "type": "string", "format": "" }, { - "name": "lastName", - "baseName": "last_name", + "name": "sharedLink", + "baseName": "shared_link", "type": "string", "format": "" }, { - "name": "deliveryMethods", - "baseName": "delivery_methods", - "type": "RicipientDeliveryMethods", + "name": "avatar", + "baseName": "avatar", + "type": "string", "format": "" }, { - "name": "redirect", - "baseName": "redirect", - "type": "RecipientRedirect", + "name": "signatureDate", + "baseName": "signature_date", + "type": "string", "format": "" } ]; static getAttributeTypeMap() { - return DocumentUpdateRequestRecipients.attributeTypeMap; + return DocumentDetailsRecipientGroupMember.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/DocumentDetailsResponse.ts b/src/models/DocumentDetailsResponse.ts index 16b9a73..b47f03a 100644 --- a/src/models/DocumentDetailsResponse.ts +++ b/src/models/DocumentDetailsResponse.ts @@ -7,39 +7,109 @@ * Do not edit the class manually. */ -import { DocumentDetailsResponseCreatedBy } from './DocumentDetailsResponseCreatedBy'; -import { DocumentDetailsResponseGrandTotal } from './DocumentDetailsResponseGrandTotal'; -import { DocumentDetailsResponseLinkedObjects } from './DocumentDetailsResponseLinkedObjects'; -import { DocumentDetailsResponseRecipients } from './DocumentDetailsResponseRecipients'; -import { DocumentDetailsResponseTemplate } from './DocumentDetailsResponseTemplate'; -import { PricingResponse } from './PricingResponse'; +import { DocumentDetailsResponseCreatedBy } from '../models/DocumentDetailsResponseCreatedBy'; +import { DocumentDetailsResponseGrandTotal } from '../models/DocumentDetailsResponseGrandTotal'; +import { DocumentDetailsResponseImagesInner } from '../models/DocumentDetailsResponseImagesInner'; +import { DocumentDetailsResponseLinkedObjectsInner } from '../models/DocumentDetailsResponseLinkedObjectsInner'; +import { DocumentDetailsResponseRecipientsInner } from '../models/DocumentDetailsResponseRecipientsInner'; +import { DocumentDetailsResponseTablesInner } from '../models/DocumentDetailsResponseTablesInner'; +import { DocumentDetailsResponseTemplate } from '../models/DocumentDetailsResponseTemplate'; +import { DocumentDetailsResponseTextsInner } from '../models/DocumentDetailsResponseTextsInner'; +import { Field } from '../models/Field'; +import { PricingResponse } from '../models/PricingResponse'; import { HttpFile } from '../http/http'; export class DocumentDetailsResponse { + /** + * Document ID. + */ 'id'?: string; + /** + * Document name. + */ 'name'?: string; - 'autonumberingSequenceNamePrefix'?: any; + 'autonumberingSequenceNamePrefix'?: any | null; + /** + * Document creation date. + */ 'dateCreated'?: string; + /** + * Document modification date. + */ 'dateModified'?: string; - 'dateCompleted'?: string; + /** + * Document completion date. + */ + 'dateCompleted'?: string | null; + /** + * Document content modification date. + */ 'contentDateModified'?: string; + /** + * Document sent date. + */ + 'dateSent'?: string | null; + /** + * Document reference number. + */ + 'refNumber'?: string; 'createdBy'?: DocumentDetailsResponseCreatedBy; - 'template'?: DocumentDetailsResponseTemplate; - 'expirationDate'?: any; + 'template'?: DocumentDetailsResponseTemplate | null; + /** + * Document expiration date. + */ + 'expirationDate'?: string | null; + /** + * Document metadata. + */ 'metadata'?: any; + /** + * Document tokens. + */ 'tokens'?: Array; - 'fields'?: Array; + /** + * Document fields. + */ + 'fields'?: Array; 'pricing'?: PricingResponse; - 'version'?: string; + /** + * Document tables. + */ + 'tables'?: Array; + /** + * Document images. + */ + 'images'?: Array; + /** + * Document text blocks. + */ + 'texts'?: Array; + /** + * Document tags. + */ 'tags'?: Array; - 'sentBy'?: any; - 'recipients'?: Array; + /** + * Document sent by. + */ + 'sentBy'?: any | null; + /** + * Document recipients. + */ + 'recipients'?: Array; 'grandTotal'?: DocumentDetailsResponseGrandTotal; - 'linkedObjects'?: Array; + /** + * Document linked objects. + */ + 'linkedObjects'?: Array; + /** + * Document status. + */ 'status'?: string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -83,6 +153,18 @@ export class DocumentDetailsResponse { "type": "string", "format": "" }, + { + "name": "dateSent", + "baseName": "date_sent", + "type": "string", + "format": "" + }, + { + "name": "refNumber", + "baseName": "ref_number", + "type": "string", + "format": "" + }, { "name": "createdBy", "baseName": "created_by", @@ -98,7 +180,7 @@ export class DocumentDetailsResponse { { "name": "expirationDate", "baseName": "expiration_date", - "type": "any", + "type": "string", "format": "" }, { @@ -116,7 +198,7 @@ export class DocumentDetailsResponse { { "name": "fields", "baseName": "fields", - "type": "Array", + "type": "Array", "format": "" }, { @@ -126,9 +208,21 @@ export class DocumentDetailsResponse { "format": "" }, { - "name": "version", - "baseName": "version", - "type": "string", + "name": "tables", + "baseName": "tables", + "type": "Array", + "format": "" + }, + { + "name": "images", + "baseName": "images", + "type": "Array", + "format": "" + }, + { + "name": "texts", + "baseName": "texts", + "type": "Array", "format": "" }, { @@ -146,7 +240,7 @@ export class DocumentDetailsResponse { { "name": "recipients", "baseName": "recipients", - "type": "Array", + "type": "Array", "format": "" }, { @@ -158,7 +252,7 @@ export class DocumentDetailsResponse { { "name": "linkedObjects", "baseName": "linked_objects", - "type": "Array", + "type": "Array", "format": "" }, { @@ -175,4 +269,3 @@ export class DocumentDetailsResponse { public constructor() { } } - diff --git a/src/models/DocumentDetailsResponseCreatedBy.ts b/src/models/DocumentDetailsResponseCreatedBy.ts index 295d1be..d3666be 100644 --- a/src/models/DocumentDetailsResponseCreatedBy.ts +++ b/src/models/DocumentDetailsResponseCreatedBy.ts @@ -9,16 +9,39 @@ import { HttpFile } from '../http/http'; +/** +* Document creator details. +*/ export class DocumentDetailsResponseCreatedBy { + /** + * Creator ID. + */ 'id'?: string; + /** + * Creator membership ID. + */ 'membershipId'?: string; + /** + * Creator email. + */ 'email'?: string; + /** + * Creator first name. + */ 'firstName'?: string; + /** + * Creator last name. + */ 'lastName'?: string; - 'avatar'?: string; + /** + * Creator avatar URL. + */ + 'avatar'?: string | null; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -64,4 +87,3 @@ export class DocumentDetailsResponseCreatedBy { public constructor() { } } - diff --git a/src/models/DocumentDetailsResponseGrandTotal.ts b/src/models/DocumentDetailsResponseGrandTotal.ts index 21c314e..0f65020 100644 --- a/src/models/DocumentDetailsResponseGrandTotal.ts +++ b/src/models/DocumentDetailsResponseGrandTotal.ts @@ -9,12 +9,23 @@ import { HttpFile } from '../http/http'; +/** +* Document grand total. +*/ export class DocumentDetailsResponseGrandTotal { + /** + * Total amount. + */ 'amount'?: string; + /** + * Currency type. + */ 'currency'?: string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "amount", @@ -36,4 +47,3 @@ export class DocumentDetailsResponseGrandTotal { public constructor() { } } - diff --git a/src/models/DocumentDetailsResponseImagesInner.ts b/src/models/DocumentDetailsResponseImagesInner.ts new file mode 100644 index 0000000..a456b3c --- /dev/null +++ b/src/models/DocumentDetailsResponseImagesInner.ts @@ -0,0 +1,36 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class DocumentDetailsResponseImagesInner { + /** + * Image name. + */ + 'name'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentDetailsResponseImagesInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentDetailsResponseLinkedObjectsInner.ts b/src/models/DocumentDetailsResponseLinkedObjectsInner.ts new file mode 100644 index 0000000..dba6f5e --- /dev/null +++ b/src/models/DocumentDetailsResponseLinkedObjectsInner.ts @@ -0,0 +1,77 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentDetailsResponseLinkedObjectsInnerChildrenInner } from '../models/DocumentDetailsResponseLinkedObjectsInnerChildrenInner'; +import { HttpFile } from '../http/http'; + +export class DocumentDetailsResponseLinkedObjectsInner { + /** + * Linked object provider. + */ + 'provider'?: string; + /** + * Linked object entity type. + */ + 'entityType'?: string; + /** + * Linked object entity ID. + */ + 'entityId'?: string; + /** + * Linked object ID. + */ + 'id'?: string; + /** + * Linked object children array. + */ + 'children'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "provider", + "baseName": "provider", + "type": "string", + "format": "" + }, + { + "name": "entityType", + "baseName": "entity_type", + "type": "string", + "format": "" + }, + { + "name": "entityId", + "baseName": "entity_id", + "type": "string", + "format": "" + }, + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "children", + "baseName": "children", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentDetailsResponseLinkedObjectsInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentDetailsResponseLinkedObjects.ts b/src/models/DocumentDetailsResponseLinkedObjectsInnerChildrenInner.ts similarity index 72% rename from src/models/DocumentDetailsResponseLinkedObjects.ts rename to src/models/DocumentDetailsResponseLinkedObjectsInnerChildrenInner.ts index c0f7db8..6ccd7a8 100644 --- a/src/models/DocumentDetailsResponseLinkedObjects.ts +++ b/src/models/DocumentDetailsResponseLinkedObjectsInnerChildrenInner.ts @@ -9,21 +9,25 @@ import { HttpFile } from '../http/http'; -export class DocumentDetailsResponseLinkedObjects { - 'provider'?: string; +export class DocumentDetailsResponseLinkedObjectsInnerChildrenInner { + /** + * Linked object child entity type. + */ 'entityType'?: string; + /** + * Linked object child entity ID. + */ 'entityId'?: string; + /** + * Linked object child ID. + */ 'id'?: string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ - { - "name": "provider", - "baseName": "provider", - "type": "string", - "format": "" - }, { "name": "entityType", "baseName": "entity_type", @@ -44,10 +48,9 @@ export class DocumentDetailsResponseLinkedObjects { } ]; static getAttributeTypeMap() { - return DocumentDetailsResponseLinkedObjects.attributeTypeMap; + return DocumentDetailsResponseLinkedObjectsInnerChildrenInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/DocumentDetailsResponseRecipientsInner.ts b/src/models/DocumentDetailsResponseRecipientsInner.ts new file mode 100644 index 0000000..d30fb59 --- /dev/null +++ b/src/models/DocumentDetailsResponseRecipientsInner.ts @@ -0,0 +1,33 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentDetailsRecipient } from '../models/DocumentDetailsRecipient'; +import { DocumentDetailsRecipientGroup } from '../models/DocumentDetailsRecipientGroup'; +import { HttpFile } from '../http/http'; + +/** + * @type DocumentDetailsResponseRecipientsInner + * Type + * @export + */ +export type DocumentDetailsResponseRecipientsInner = DocumentDetailsRecipient | DocumentDetailsRecipientGroup; + +/** +* @type DocumentDetailsResponseRecipientsInnerClass +* @export +*/ +export class DocumentDetailsResponseRecipientsInnerClass { + static readonly discriminator: string | undefined = "type"; + + static readonly mapping: {[index: string]: string} | undefined = { + "recipient": "DocumentDetailsRecipient", + "recipient_group": "DocumentDetailsRecipientGroup", + }; +} + diff --git a/src/models/DocumentDetailsResponseTablesInner.ts b/src/models/DocumentDetailsResponseTablesInner.ts new file mode 100644 index 0000000..62748be --- /dev/null +++ b/src/models/DocumentDetailsResponseTablesInner.ts @@ -0,0 +1,36 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class DocumentDetailsResponseTablesInner { + /** + * Table name. + */ + 'name'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentDetailsResponseTablesInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentDetailsResponseTemplate.ts b/src/models/DocumentDetailsResponseTemplate.ts index d82ad28..ae8e147 100644 --- a/src/models/DocumentDetailsResponseTemplate.ts +++ b/src/models/DocumentDetailsResponseTemplate.ts @@ -9,12 +9,23 @@ import { HttpFile } from '../http/http'; +/** +* Document template details. +*/ export class DocumentDetailsResponseTemplate { + /** + * Template ID. + */ 'id'?: string; + /** + * Template name. + */ 'name'?: string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -36,4 +47,3 @@ export class DocumentDetailsResponseTemplate { public constructor() { } } - diff --git a/src/models/DocumentDetailsResponseTextsInner.ts b/src/models/DocumentDetailsResponseTextsInner.ts new file mode 100644 index 0000000..32f8f42 --- /dev/null +++ b/src/models/DocumentDetailsResponseTextsInner.ts @@ -0,0 +1,36 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class DocumentDetailsResponseTextsInner { + /** + * Text name. + */ + 'name'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentDetailsResponseTextsInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentDocxExport.ts b/src/models/DocumentDocxExport.ts new file mode 100644 index 0000000..e02594b --- /dev/null +++ b/src/models/DocumentDocxExport.ts @@ -0,0 +1,56 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentDocxExportStatusEnum } from '../models/DocumentDocxExportStatusEnum'; +import { HttpFile } from '../http/http'; + +export class DocumentDocxExport { + /** + * Export task id. + */ + 'id': string; + /** + * Document id. + */ + 'documentId': string; + 'status': DocumentDocxExportStatusEnum; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "documentId", + "baseName": "document_id", + "type": "string", + "format": "" + }, + { + "name": "status", + "baseName": "status", + "type": "DocumentDocxExportStatusEnum", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentDocxExport.attributeTypeMap; + } + + public constructor() { + } +} + + diff --git a/src/models/DocumentDocxExportStatusEnum.ts b/src/models/DocumentDocxExportStatusEnum.ts new file mode 100644 index 0000000..b383d3f --- /dev/null +++ b/src/models/DocumentDocxExportStatusEnum.ts @@ -0,0 +1,20 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +/** +* | **Status** | **Description** | |---------------|---------------------------------------------------------------------------------------------| | **created** | The export task has been created, but the process has not started. | | **processing**| The export task is in progress. | | **done** | The export task is completed, and the response contains URLs for downloading the documents. | | **error** | An error occurred during the execution of the export task. | +*/ +export enum DocumentDocxExportStatusEnum { + Created = 'created', + Processing = 'processing', + Done = 'done', + Error = 'error' +} diff --git a/src/models/DocumentESignDisclosure.ts b/src/models/DocumentESignDisclosure.ts new file mode 100644 index 0000000..6da7488 --- /dev/null +++ b/src/models/DocumentESignDisclosure.ts @@ -0,0 +1,34 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentESignDisclosureResult } from '../models/DocumentESignDisclosureResult'; +import { HttpFile } from '../http/http'; + +export class DocumentESignDisclosure { + 'result'?: DocumentESignDisclosureResult; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "result", + "baseName": "result", + "type": "DocumentESignDisclosureResult", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentESignDisclosure.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentESignDisclosureResult.ts b/src/models/DocumentESignDisclosureResult.ts new file mode 100644 index 0000000..0b8b862 --- /dev/null +++ b/src/models/DocumentESignDisclosureResult.ts @@ -0,0 +1,53 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class DocumentESignDisclosureResult { + /** + * Indicates whether the ESign disclosure feature is enabled for the document. + */ + 'isEnabled'?: boolean; + 'companyName'?: string | null; + /** + * Rich text (HTML) of the pre-configured ESign disclosure. + */ + 'esignDisclosureText'?: string | null; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "isEnabled", + "baseName": "is_enabled", + "type": "boolean", + "format": "" + }, + { + "name": "companyName", + "baseName": "company_name", + "type": "string", + "format": "" + }, + { + "name": "esignDisclosureText", + "baseName": "esign_disclosure_text", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentESignDisclosureResult.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentFieldAnchorPointEnum.ts b/src/models/DocumentFieldAnchorPointEnum.ts new file mode 100644 index 0000000..c240eb8 --- /dev/null +++ b/src/models/DocumentFieldAnchorPointEnum.ts @@ -0,0 +1,17 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export enum DocumentFieldAnchorPointEnum { + Topleft = 'topleft', + Topright = 'topright', + Bottomleft = 'bottomleft', + Bottomright = 'bottomright' +} diff --git a/src/models/DocumentFieldTypeEnum.ts b/src/models/DocumentFieldTypeEnum.ts new file mode 100644 index 0000000..b70303b --- /dev/null +++ b/src/models/DocumentFieldTypeEnum.ts @@ -0,0 +1,23 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export enum DocumentFieldTypeEnum { + Checkbox = 'checkbox', + CollectFile = 'collect_file', + Date = 'date', + Dropdown = 'dropdown', + Initials = 'initials', + PaymentDetails = 'payment_details', + RadioButtons = 'radio_buttons', + Signature = 'signature', + Stamp = 'stamp', + Text = 'text' +} diff --git a/src/models/DocumentFieldsField.ts b/src/models/DocumentFieldsField.ts new file mode 100644 index 0000000..74a908c --- /dev/null +++ b/src/models/DocumentFieldsField.ts @@ -0,0 +1,101 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentFieldTypeEnum } from '../models/DocumentFieldTypeEnum'; +import { DocumentFieldsFieldAssignedTo } from '../models/DocumentFieldsFieldAssignedTo'; +import { DocumentFieldsLayout } from '../models/DocumentFieldsLayout'; +import { HttpFile } from '../http/http'; + +export class DocumentFieldsField { + 'uuid'?: string; + 'name'?: string; + 'title'?: string; + 'value'?: any | null; + 'fieldId'?: string; + 'type'?: DocumentFieldTypeEnum; + 'placeholder'?: string; + 'assignedTo'?: DocumentFieldsFieldAssignedTo; + 'layout'?: DocumentFieldsLayout; + 'sectionUuid'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "uuid", + "baseName": "uuid", + "type": "string", + "format": "uuid" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "title", + "baseName": "title", + "type": "string", + "format": "" + }, + { + "name": "value", + "baseName": "value", + "type": "any", + "format": "" + }, + { + "name": "fieldId", + "baseName": "field_id", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "DocumentFieldTypeEnum", + "format": "" + }, + { + "name": "placeholder", + "baseName": "placeholder", + "type": "string", + "format": "" + }, + { + "name": "assignedTo", + "baseName": "assigned_to", + "type": "DocumentFieldsFieldAssignedTo", + "format": "" + }, + { + "name": "layout", + "baseName": "layout", + "type": "DocumentFieldsLayout", + "format": "" + }, + { + "name": "sectionUuid", + "baseName": "section_uuid", + "type": "string", + "format": "uuid" + } ]; + + static getAttributeTypeMap() { + return DocumentFieldsField.attributeTypeMap; + } + + public constructor() { + } +} + + diff --git a/src/models/DocumentCreateByTemplateRequestRecipients.ts b/src/models/DocumentFieldsFieldAssignedTo.ts similarity index 62% rename from src/models/DocumentCreateByTemplateRequestRecipients.ts rename to src/models/DocumentFieldsFieldAssignedTo.ts index 7850b9a..5fab3c8 100644 --- a/src/models/DocumentCreateByTemplateRequestRecipients.ts +++ b/src/models/DocumentFieldsFieldAssignedTo.ts @@ -7,77 +7,97 @@ * Do not edit the class manually. */ -import { RecipientRedirect } from './RecipientRedirect'; -import { RicipientDeliveryMethods } from './RicipientDeliveryMethods'; import { HttpFile } from '../http/http'; -export class DocumentCreateByTemplateRequestRecipients { - 'email'?: string; - 'phone'?: string; - 'deliveryMethods'?: RicipientDeliveryMethods; +export class DocumentFieldsFieldAssignedTo { + 'id'?: string; 'firstName'?: string; 'lastName'?: string; - 'role'?: string; - 'signingOrder'?: number; - 'redirect'?: RecipientRedirect; + 'email'?: string; + 'phone'?: string; + 'recipientType'?: string; + 'hasCompleted'?: boolean; + 'signingOrder'?: any | null; + 'deliveryMethods'?: any | null; + 'redirect'?: any | null; + 'type'?: string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { - "name": "email", - "baseName": "email", + "name": "id", + "baseName": "id", "type": "string", "format": "" }, { - "name": "phone", - "baseName": "phone", + "name": "firstName", + "baseName": "first_name", "type": "string", "format": "" }, { - "name": "deliveryMethods", - "baseName": "delivery_methods", - "type": "RicipientDeliveryMethods", + "name": "lastName", + "baseName": "last_name", + "type": "string", "format": "" }, { - "name": "firstName", - "baseName": "first_name", + "name": "email", + "baseName": "email", "type": "string", "format": "" }, { - "name": "lastName", - "baseName": "last_name", + "name": "phone", + "baseName": "phone", "type": "string", "format": "" }, { - "name": "role", - "baseName": "role", + "name": "recipientType", + "baseName": "recipient_type", "type": "string", "format": "" }, + { + "name": "hasCompleted", + "baseName": "has_completed", + "type": "boolean", + "format": "" + }, { "name": "signingOrder", "baseName": "signing_order", - "type": "number", + "type": "any", + "format": "" + }, + { + "name": "deliveryMethods", + "baseName": "delivery_methods", + "type": "any", "format": "" }, { "name": "redirect", "baseName": "redirect", - "type": "RecipientRedirect", + "type": "any", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "string", "format": "" } ]; static getAttributeTypeMap() { - return DocumentCreateByTemplateRequestRecipients.attributeTypeMap; + return DocumentFieldsFieldAssignedTo.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/DocumentFieldsFieldCreate.ts b/src/models/DocumentFieldsFieldCreate.ts new file mode 100644 index 0000000..b236f5a --- /dev/null +++ b/src/models/DocumentFieldsFieldCreate.ts @@ -0,0 +1,81 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentFieldTypeEnum } from '../models/DocumentFieldTypeEnum'; +import { DocumentFieldsLayout } from '../models/DocumentFieldsLayout'; +import { HttpFile } from '../http/http'; + +export class DocumentFieldsFieldCreate { + /** + * Optional unique identifier. + */ + 'fieldId'?: string; + /** + * Use this to dynamically populate this field with data from your CRM or API. Supported field types: * text * checkbox * date * dropdown * radio_buttons + */ + 'mergeField'?: string; + 'type': DocumentFieldTypeEnum; + 'placeholder'?: string; + /** + * Optional uuid of a recipient. + */ + 'assignedTo'?: string; + 'layout': DocumentFieldsLayout; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "fieldId", + "baseName": "field_id", + "type": "string", + "format": "" + }, + { + "name": "mergeField", + "baseName": "merge_field", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "DocumentFieldTypeEnum", + "format": "" + }, + { + "name": "placeholder", + "baseName": "placeholder", + "type": "string", + "format": "" + }, + { + "name": "assignedTo", + "baseName": "assigned_to", + "type": "string", + "format": "" + }, + { + "name": "layout", + "baseName": "layout", + "type": "DocumentFieldsLayout", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentFieldsFieldCreate.attributeTypeMap; + } + + public constructor() { + } +} + + diff --git a/src/models/DocumentFieldsLayout.ts b/src/models/DocumentFieldsLayout.ts new file mode 100644 index 0000000..cceeb96 --- /dev/null +++ b/src/models/DocumentFieldsLayout.ts @@ -0,0 +1,49 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentFieldsLayoutPosition } from '../models/DocumentFieldsLayoutPosition'; +import { DocumentFieldsLayoutStyle } from '../models/DocumentFieldsLayoutStyle'; +import { HttpFile } from '../http/http'; + +export class DocumentFieldsLayout { + 'page': number; + 'position': DocumentFieldsLayoutPosition; + 'style': DocumentFieldsLayoutStyle; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "page", + "baseName": "page", + "type": "number", + "format": "" + }, + { + "name": "position", + "baseName": "position", + "type": "DocumentFieldsLayoutPosition", + "format": "" + }, + { + "name": "style", + "baseName": "style", + "type": "DocumentFieldsLayoutStyle", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentFieldsLayout.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentFieldsLayoutPosition.ts b/src/models/DocumentFieldsLayoutPosition.ts new file mode 100644 index 0000000..74a278f --- /dev/null +++ b/src/models/DocumentFieldsLayoutPosition.ts @@ -0,0 +1,50 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentFieldAnchorPointEnum } from '../models/DocumentFieldAnchorPointEnum'; +import { HttpFile } from '../http/http'; + +export class DocumentFieldsLayoutPosition { + 'offsetX': number; + 'offsetY': number; + 'anchorPoint': DocumentFieldAnchorPointEnum; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "offsetX", + "baseName": "offset_x", + "type": "number", + "format": "" + }, + { + "name": "offsetY", + "baseName": "offset_y", + "type": "number", + "format": "" + }, + { + "name": "anchorPoint", + "baseName": "anchor_point", + "type": "DocumentFieldAnchorPointEnum", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentFieldsLayoutPosition.attributeTypeMap; + } + + public constructor() { + } +} + + diff --git a/src/models/DocumentFieldsLayoutStyle.ts b/src/models/DocumentFieldsLayoutStyle.ts new file mode 100644 index 0000000..15254d9 --- /dev/null +++ b/src/models/DocumentFieldsLayoutStyle.ts @@ -0,0 +1,40 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class DocumentFieldsLayoutStyle { + 'width': number; + 'height': number; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "width", + "baseName": "width", + "type": "number", + "format": "" + }, + { + "name": "height", + "baseName": "height", + "type": "number", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentFieldsLayoutStyle.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentLanguageEnum.ts b/src/models/DocumentLanguageEnum.ts new file mode 100644 index 0000000..116e707 --- /dev/null +++ b/src/models/DocumentLanguageEnum.ts @@ -0,0 +1,33 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +/** +* Document language code (e.g., \'en-US\', \'fr-FR\'). +*/ +export enum DocumentLanguageEnum { + EnUs = 'en-US', + FrFr = 'fr-FR', + ItIt = 'it-IT', + EsEs = 'es-ES', + NlNl = 'nl-NL', + DeDe = 'de-DE', + PtBr = 'pt-BR', + PtPt = 'pt-PT', + PlPl = 'pl-PL', + SvSe = 'sv-SE', + CsCz = 'cs-CZ', + DaDk = 'da-DK', + ElGr = 'el-GR', + HuHu = 'hu-HU', + NbNo = 'nb-NO', + RoRo = 'ro-RO', + BgBg = 'bg-BG' +} diff --git a/src/models/DocumentListResponse.ts b/src/models/DocumentListResponse.ts index 45ed661..eeb2e99 100644 --- a/src/models/DocumentListResponse.ts +++ b/src/models/DocumentListResponse.ts @@ -7,19 +7,21 @@ * Do not edit the class manually. */ -import { DocumentListResponseResults } from './DocumentListResponseResults'; +import { DocumentListResponseResultsInner } from '../models/DocumentListResponseResultsInner'; import { HttpFile } from '../http/http'; export class DocumentListResponse { - 'results'?: Array; + 'results'?: Array; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "results", "baseName": "results", - "type": "Array", + "type": "Array", "format": "" } ]; @@ -30,4 +32,3 @@ export class DocumentListResponse { public constructor() { } } - diff --git a/src/models/DocumentListResponseResultsInner.ts b/src/models/DocumentListResponseResultsInner.ts new file mode 100644 index 0000000..1275295 --- /dev/null +++ b/src/models/DocumentListResponseResultsInner.ts @@ -0,0 +1,82 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class DocumentListResponseResultsInner { + 'id'?: string; + 'name'?: string; + 'status'?: string; + 'dateCreated'?: string; + 'dateModified'?: string; + 'dateCompleted'?: string | null; + 'expirationDate'?: string | null; + 'version'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "status", + "baseName": "status", + "type": "string", + "format": "" + }, + { + "name": "dateCreated", + "baseName": "date_created", + "type": "string", + "format": "" + }, + { + "name": "dateModified", + "baseName": "date_modified", + "type": "string", + "format": "" + }, + { + "name": "dateCompleted", + "baseName": "date_completed", + "type": "string", + "format": "" + }, + { + "name": "expirationDate", + "baseName": "expiration_date", + "type": "string", + "format": "" + }, + { + "name": "version", + "baseName": "version", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentListResponseResultsInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentOrderingFieldsEnum.ts b/src/models/DocumentOrderingFieldsEnum.ts index 2bfae8f..496cd59 100644 --- a/src/models/DocumentOrderingFieldsEnum.ts +++ b/src/models/DocumentOrderingFieldsEnum.ts @@ -9,4 +9,25 @@ import { HttpFile } from '../http/http'; -export type DocumentOrderingFieldsEnum = "name" | "date_created" | "date_status_changed" | "date_of_last_action" | "date_modified" | "date_sent" | "date_completed" | "date_expiration" | "date_declined" | "status" | "-name" | "-date_created" | "-date_status_changed" | "-date_of_last_action" | "-date_modified" | "-date_sent" | "-date_completed" | "-date_expiration" | "-date_declined" | "-status" ; +export enum DocumentOrderingFieldsEnum { + Name = 'name', + DateCreated = 'date_created', + DateStatusChanged = 'date_status_changed', + DateOfLastAction = 'date_of_last_action', + DateModified = 'date_modified', + DateSent = 'date_sent', + DateCompleted = 'date_completed', + DateExpiration = 'date_expiration', + DateDeclined = 'date_declined', + Status = 'status', + Name2 = '-name', + DateCreated2 = '-date_created', + DateStatusChanged2 = '-date_status_changed', + DateOfLastAction2 = '-date_of_last_action', + DateModified2 = '-date_modified', + DateSent2 = '-date_sent', + DateCompleted2 = '-date_completed', + DateExpiration2 = '-date_expiration', + DateDeclined2 = '-date_declined', + Status2 = '-status' +} diff --git a/src/models/DocumentRecipientCreateRequest.ts b/src/models/DocumentRecipientCreateRequest.ts index 5c8685b..c9ab766 100644 --- a/src/models/DocumentRecipientCreateRequest.ts +++ b/src/models/DocumentRecipientCreateRequest.ts @@ -7,14 +7,20 @@ * Do not edit the class manually. */ +import { RecipientKindEnum } from '../models/RecipientKindEnum'; import { HttpFile } from '../http/http'; export class DocumentRecipientCreateRequest { + /** + * Contact uuid. + */ 'id': string; - 'kind': DocumentRecipientCreateRequestKindEnum; + 'kind': RecipientKindEnum; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -25,7 +31,7 @@ export class DocumentRecipientCreateRequest { { "name": "kind", "baseName": "kind", - "type": "DocumentRecipientCreateRequestKindEnum", + "type": "RecipientKindEnum", "format": "" } ]; @@ -38,5 +44,3 @@ export class DocumentRecipientCreateRequest { } -export type DocumentRecipientCreateRequestKindEnum = "contact" | "contact_group" ; - diff --git a/src/models/DocumentRecipientEditRequest.ts b/src/models/DocumentRecipientEditRequest.ts index ee87baa..3d1c560 100644 --- a/src/models/DocumentRecipientEditRequest.ts +++ b/src/models/DocumentRecipientEditRequest.ts @@ -7,28 +7,33 @@ * Do not edit the class manually. */ -import { RecipientRedirect } from './RecipientRedirect'; -import { RecipientVerificationSettings } from './RecipientVerificationSettings'; -import { RicipientDeliveryMethods } from './RicipientDeliveryMethods'; +import { RecipientDeliveryMethods } from '../models/RecipientDeliveryMethods'; +import { RecipientRedirect } from '../models/RecipientRedirect'; +import { RecipientVerificationSettings } from '../models/RecipientVerificationSettings'; import { HttpFile } from '../http/http'; export class DocumentRecipientEditRequest { - 'email'?: string; - 'phone'?: string; - 'deliveryMethods'?: RicipientDeliveryMethods; - 'firstName'?: string; - 'lastName'?: string; - 'company'?: string; - 'jobTitle'?: string; - 'state'?: string; - 'streetAddress'?: string; - 'city'?: string; - 'postalCode'?: string; - 'verificationSettings'?: RecipientVerificationSettings; + /** + * You cannot use the email of another contact when updating a recipient contact. + */ + 'email'?: string | null; + 'phone'?: string | null; + 'deliveryMethods'?: RecipientDeliveryMethods | null; + 'firstName'?: string | null; + 'lastName'?: string | null; + 'company'?: string | null; + 'jobTitle'?: string | null; + 'state'?: string | null; + 'streetAddress'?: string | null; + 'city'?: string | null; + 'postalCode'?: string | null; + 'verificationSettings'?: RecipientVerificationSettings | null; 'redirect'?: RecipientRedirect; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "email", @@ -45,7 +50,7 @@ export class DocumentRecipientEditRequest { { "name": "deliveryMethods", "baseName": "delivery_methods", - "type": "RicipientDeliveryMethods", + "type": "RecipientDeliveryMethods", "format": "" }, { @@ -116,4 +121,3 @@ export class DocumentRecipientEditRequest { public constructor() { } } - diff --git a/src/models/DocumentRecipientResponse.ts b/src/models/DocumentRecipientResponse.ts index 63a7a8e..f34e49e 100644 --- a/src/models/DocumentRecipientResponse.ts +++ b/src/models/DocumentRecipientResponse.ts @@ -14,6 +14,8 @@ export class DocumentRecipientResponse { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "recipientId", @@ -29,4 +31,3 @@ export class DocumentRecipientResponse { public constructor() { } } - diff --git a/src/models/DocumentListResponseResults.ts b/src/models/DocumentRevertToDraftResponse.ts similarity index 88% rename from src/models/DocumentListResponseResults.ts rename to src/models/DocumentRevertToDraftResponse.ts index 126abd6..2a25d6b 100644 --- a/src/models/DocumentListResponseResults.ts +++ b/src/models/DocumentRevertToDraftResponse.ts @@ -9,17 +9,19 @@ import { HttpFile } from '../http/http'; -export class DocumentListResponseResults { +export class DocumentRevertToDraftResponse { 'id'?: string; 'name'?: string; 'status'?: string; 'dateCreated'?: string; 'dateModified'?: string; - 'expirationDate'?: string; + 'expirationDate'?: string | null; 'version'?: string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -65,10 +67,9 @@ export class DocumentListResponseResults { } ]; static getAttributeTypeMap() { - return DocumentListResponseResults.attributeTypeMap; + return DocumentRevertToDraftResponse.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/DocumentSendManualReminder200Response.ts b/src/models/DocumentSendManualReminder200Response.ts new file mode 100644 index 0000000..ef48b5a --- /dev/null +++ b/src/models/DocumentSendManualReminder200Response.ts @@ -0,0 +1,34 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentSendManualReminder200ResponseResultInner } from '../models/DocumentSendManualReminder200ResponseResultInner'; +import { HttpFile } from '../http/http'; + +export class DocumentSendManualReminder200Response { + 'result'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "result", + "baseName": "result", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentSendManualReminder200Response.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentSendManualReminder200ResponseResultInner.ts b/src/models/DocumentSendManualReminder200ResponseResultInner.ts new file mode 100644 index 0000000..c733315 --- /dev/null +++ b/src/models/DocumentSendManualReminder200ResponseResultInner.ts @@ -0,0 +1,60 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentSendManualReminder200ResponseResultInnerEmail } from '../models/DocumentSendManualReminder200ResponseResultInnerEmail'; +import { DocumentSendManualReminder200ResponseResultInnerEmailCustomization } from '../models/DocumentSendManualReminder200ResponseResultInnerEmailCustomization'; +import { DocumentSendManualReminder200ResponseResultInnerSms } from '../models/DocumentSendManualReminder200ResponseResultInnerSms'; +import { HttpFile } from '../http/http'; + +export class DocumentSendManualReminder200ResponseResultInner { + /** + * Unique identifier of the recipient. + */ + 'recipientId'?: string; + 'sms'?: DocumentSendManualReminder200ResponseResultInnerSms; + 'email'?: DocumentSendManualReminder200ResponseResultInnerEmail; + 'emailCustomization'?: DocumentSendManualReminder200ResponseResultInnerEmailCustomization; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "recipientId", + "baseName": "recipient_id", + "type": "string", + "format": "" + }, + { + "name": "sms", + "baseName": "sms", + "type": "DocumentSendManualReminder200ResponseResultInnerSms", + "format": "" + }, + { + "name": "email", + "baseName": "email", + "type": "DocumentSendManualReminder200ResponseResultInnerEmail", + "format": "" + }, + { + "name": "emailCustomization", + "baseName": "email_customization", + "type": "DocumentSendManualReminder200ResponseResultInnerEmailCustomization", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentSendManualReminder200ResponseResultInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentSendManualReminder200ResponseResultInnerEmail.ts b/src/models/DocumentSendManualReminder200ResponseResultInnerEmail.ts new file mode 100644 index 0000000..60a5ceb --- /dev/null +++ b/src/models/DocumentSendManualReminder200ResponseResultInnerEmail.ts @@ -0,0 +1,74 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class DocumentSendManualReminder200ResponseResultInnerEmail { + /** + * Status of the email reminder attempt (sent or error). + */ + 'status'?: DocumentSendManualReminder200ResponseResultInnerEmailStatusEnum; + /** + * Timestamp of when the reminder was sent, in ISO 8601 format. + */ + 'sentAt'?: Date; + /** + * Detailed explanation of why the reminder could not be sent, if applicable. + */ + 'detail'?: DocumentSendManualReminder200ResponseResultInnerEmailDetailEnum; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "status", + "baseName": "status", + "type": "DocumentSendManualReminder200ResponseResultInnerEmailStatusEnum", + "format": "" + }, + { + "name": "sentAt", + "baseName": "sent_at", + "type": "Date", + "format": "date-time" + }, + { + "name": "detail", + "baseName": "detail", + "type": "DocumentSendManualReminder200ResponseResultInnerEmailDetailEnum", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentSendManualReminder200ResponseResultInnerEmail.attributeTypeMap; + } + + public constructor() { + } +} + +export enum DocumentSendManualReminder200ResponseResultInnerEmailStatusEnum { + Sent = 'sent', + Error = 'error' +} +export enum DocumentSendManualReminder200ResponseResultInnerEmailDetailEnum { + CantSendReminderToCcRecipient = 'Can\'t send reminder to CC recipient', + CantSendReminderToRecipientGroup = 'Can\'t send reminder to recipient group', + CantSendReminderToTheRecipientWhoCompletedTheirPart = 'Can\'t send reminder to the Recipient who completed their part', + CantSendReminderSigningOrderIsEnabledAndThisRecipientCantSignTheDocumentYet = 'Can\'t send reminder. Signing order is enabled and this Recipient can\'t sign the document yet', + CantSendReminderEmailDeliveryMethodIsNotSelectedForRecipient = 'Can\'t send reminder. Email delivery method is not selected for recipient', + CantSendEmailReminderRecipientsMailboxIsUnreachable = 'Can\'t send email reminder. Recipient\'s mailbox is unreachable', + CantSendEmailReminderToTheRecipientWithNoEmail = 'Can\'t send email reminder to the Recipient with no email', + CantSendEmailReminderToTheRecipientMoreThanOnceEvery24Hours = 'Can\'t send email reminder to the Recipient more than once every 24 hours', + CantSendReminderTheDocumentDoesNotContainARecipientWithTheSpecifiedRecipientId = 'Can\'t send reminder. The document does not contain a recipient with the specified recipient ID', + CantSendReminderEmailMessageContainsPotentiallyMaliciousLinksAndCouldNotBeProcessed = 'Can’t send reminder. Email message contains potentially malicious links and could not be processed' +} + diff --git a/src/models/DocumentSendManualReminder200ResponseResultInnerEmailCustomization.ts b/src/models/DocumentSendManualReminder200ResponseResultInnerEmailCustomization.ts new file mode 100644 index 0000000..0ce9ca2 --- /dev/null +++ b/src/models/DocumentSendManualReminder200ResponseResultInnerEmailCustomization.ts @@ -0,0 +1,49 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +/** +* Optional customization settings for the reminder email. Defines the subject and body text used when sending the reminder via email. +*/ +export class DocumentSendManualReminder200ResponseResultInnerEmailCustomization { + /** + * Subject line of the reminder email sent to the recipient. + */ + 'subject'?: string; + /** + * Custom message body of the reminder email. Can include friendly or contextual text encouraging the recipient to complete the signing process. Supports **Markdown** syntax for rich text formatting (e.g., bold, italics, links, and line breaks). + */ + 'message'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "subject", + "baseName": "subject", + "type": "string", + "format": "" + }, + { + "name": "message", + "baseName": "message", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentSendManualReminder200ResponseResultInnerEmailCustomization.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentSendManualReminder200ResponseResultInnerSms.ts b/src/models/DocumentSendManualReminder200ResponseResultInnerSms.ts new file mode 100644 index 0000000..db24c4f --- /dev/null +++ b/src/models/DocumentSendManualReminder200ResponseResultInnerSms.ts @@ -0,0 +1,74 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class DocumentSendManualReminder200ResponseResultInnerSms { + /** + * Status of the SMS reminder attempt (sent or error). + */ + 'status'?: DocumentSendManualReminder200ResponseResultInnerSmsStatusEnum; + /** + * Timestamp of when the reminder was sent, in ISO 8601 format. + */ + 'sentAt'?: Date; + /** + * Detailed explanation of why the reminder could not be sent, if applicable. + */ + 'detail'?: DocumentSendManualReminder200ResponseResultInnerSmsDetailEnum; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "status", + "baseName": "status", + "type": "DocumentSendManualReminder200ResponseResultInnerSmsStatusEnum", + "format": "" + }, + { + "name": "sentAt", + "baseName": "sent_at", + "type": "Date", + "format": "date-time" + }, + { + "name": "detail", + "baseName": "detail", + "type": "DocumentSendManualReminder200ResponseResultInnerSmsDetailEnum", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentSendManualReminder200ResponseResultInnerSms.attributeTypeMap; + } + + public constructor() { + } +} + +export enum DocumentSendManualReminder200ResponseResultInnerSmsStatusEnum { + Sent = 'sent', + Error = 'error' +} +export enum DocumentSendManualReminder200ResponseResultInnerSmsDetailEnum { + CantSendReminderToCcRecipient = 'Can\'t send reminder to CC recipient', + CantSendReminderToRecipientGroup = 'Can\'t send reminder to recipient group', + CantSendReminderToTheRecipientWhoCompletedTheirPart = 'Can\'t send reminder to the Recipient who completed their part', + CantSendReminderSigningOrderIsEnabledAndThisRecipientCantSignTheDocumentYet = 'Can\'t send reminder. Signing order is enabled and this Recipient can\'t sign the document yet', + CantSendReminderSmsDeliveryMethodIsNotSelectedForRecipient = 'Can\'t send reminder. SMS delivery method is not selected for recipient', + CantSendSmsReminderConfirmationOfRecipientConsentIsRequiredAdminShouldAccessWorkspaceSettingsToCertify = 'Can\'t send SMS reminder. Confirmation of recipient consent is required. Admin should access workspace settings to certify', + CantSendSmsReminderToTheRecipientMoreThanOnceEvery24Hours = 'Can\'t send SMS reminder to the Recipient more than once every 24 hours', + CantSendSmsReminderToTheRecipientWithNoPhoneNumber = 'Can\'t send SMS reminder to the Recipient with no phone number', + CantSendSmsReminderToTheRecipientWithInvalidPhoneNumber = 'Can\'t send SMS reminder to the Recipient with invalid phone number', + CantSendReminderTheDocumentDoesNotContainARecipientWithTheSpecifiedRecipientId = 'Can\'t send reminder. The document does not contain a recipient with the specified recipient ID' +} + diff --git a/src/models/DocumentSendManualReminder409Response.ts b/src/models/DocumentSendManualReminder409Response.ts new file mode 100644 index 0000000..ded6ec4 --- /dev/null +++ b/src/models/DocumentSendManualReminder409Response.ts @@ -0,0 +1,47 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class DocumentSendManualReminder409Response { + 'id'?: string; + 'status'?: string; + 'infoMessage'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "status", + "baseName": "status", + "type": "string", + "format": "" + }, + { + "name": "infoMessage", + "baseName": "info_message", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentSendManualReminder409Response.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentSendManualReminderRequest.ts b/src/models/DocumentSendManualReminderRequest.ts new file mode 100644 index 0000000..43a406a --- /dev/null +++ b/src/models/DocumentSendManualReminderRequest.ts @@ -0,0 +1,37 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentSendManualReminderRequestRemindersInner } from '../models/DocumentSendManualReminderRequestRemindersInner'; +import { HttpFile } from '../http/http'; + +export class DocumentSendManualReminderRequest { + /** + * A list of reminders to be sent to specified recipients. Use this field to specify which recipients should receive a reminder and through which delivery methods. Each email reminder contains document sender in the From field, ensuring the recipient always sees consistent sender details and branding. + */ + 'reminders'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "reminders", + "baseName": "reminders", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentSendManualReminderRequest.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentSendManualReminderRequestRemindersInner.ts b/src/models/DocumentSendManualReminderRequestRemindersInner.ts new file mode 100644 index 0000000..35b6f7f --- /dev/null +++ b/src/models/DocumentSendManualReminderRequestRemindersInner.ts @@ -0,0 +1,52 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentSendManualReminderRequestRemindersInnerEmailCustomization } from '../models/DocumentSendManualReminderRequestRemindersInnerEmailCustomization'; +import { RecipientDeliveryMethods } from '../models/RecipientDeliveryMethods'; +import { HttpFile } from '../http/http'; + +export class DocumentSendManualReminderRequestRemindersInner { + /** + * Unique identifier of the recipient to receive the reminder. + */ + 'recipientId'?: string; + 'deliveryMethods'?: RecipientDeliveryMethods | null; + 'emailCustomization'?: DocumentSendManualReminderRequestRemindersInnerEmailCustomization; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "recipientId", + "baseName": "recipient_id", + "type": "string", + "format": "" + }, + { + "name": "deliveryMethods", + "baseName": "delivery_methods", + "type": "RecipientDeliveryMethods", + "format": "" + }, + { + "name": "emailCustomization", + "baseName": "email_customization", + "type": "DocumentSendManualReminderRequestRemindersInnerEmailCustomization", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentSendManualReminderRequestRemindersInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentSendManualReminderRequestRemindersInnerEmailCustomization.ts b/src/models/DocumentSendManualReminderRequestRemindersInnerEmailCustomization.ts new file mode 100644 index 0000000..ed42c35 --- /dev/null +++ b/src/models/DocumentSendManualReminderRequestRemindersInnerEmailCustomization.ts @@ -0,0 +1,49 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +/** +* Optional customization settings for the reminder email. Defines the subject and body text used when sending the reminder via email. **This object is processed only if** `delivery_methods.email` is set to `true`. +*/ +export class DocumentSendManualReminderRequestRemindersInnerEmailCustomization { + /** + * Subject line of the reminder email sent to the recipient. + */ + 'subject'?: string; + /** + * Custom message body of the reminder email. Can include friendly or contextual text encouraging the recipient to complete the signing process. Supports **Markdown** syntax for rich text formatting (e.g., bold, italics, links, and line breaks). + */ + 'message'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "subject", + "baseName": "subject", + "type": "string", + "format": "" + }, + { + "name": "message", + "baseName": "message", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentSendManualReminderRequestRemindersInnerEmailCustomization.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentSendRequest.ts b/src/models/DocumentSendRequest.ts index 0e5aeb2..6aa96dc 100644 --- a/src/models/DocumentSendRequest.ts +++ b/src/models/DocumentSendRequest.ts @@ -7,8 +7,9 @@ * Do not edit the class manually. */ -import { DocumentSendRequestForwardingSettings } from './DocumentSendRequestForwardingSettings'; -import { DocumentSendRequestSelectedApprovers } from './DocumentSendRequestSelectedApprovers'; +import { DocumentSendRequestForwardingSettings } from '../models/DocumentSendRequestForwardingSettings'; +import { DocumentSendRequestSelectedApprovers } from '../models/DocumentSendRequestSelectedApprovers'; +import { DocumentSendRequestSender } from '../models/DocumentSendRequestSender'; import { HttpFile } from '../http/http'; export class DocumentSendRequest { @@ -21,18 +22,21 @@ export class DocumentSendRequest { */ 'subject'?: string; /** - * Disables sent, viewed, comment, and completed email notifications for document recipients and the document sender. By default, notifications emails are sent for specific actions. If set as true, it won't affect the \"Approve document\" email notification sent to the Approver. + * If set to `true`, disables email notifications for document recipients and the document sender. Also disables scheduled reminders (manual reminders still possible). Doesn\'t affect \"Approve document\" email notification sent to the Approver. */ 'silent'?: boolean; + 'sender'?: DocumentSendRequestSender; + 'forwardingSettings'?: DocumentSendRequestForwardingSettings; /** - * You can set a sender of a document as an `email` or `membership_id` + * Email address that will be used as a reply-to address for the document. To use this parameter, please contact the support team to have it enabled for your account. */ - 'sender'?: { [key: string]: string; }; - 'forwardingSettings'?: DocumentSendRequestForwardingSettings; + 'replyTo'?: string; 'selectedApprovers'?: DocumentSendRequestSelectedApprovers; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "message", @@ -55,7 +59,7 @@ export class DocumentSendRequest { { "name": "sender", "baseName": "sender", - "type": "{ [key: string]: string; }", + "type": "DocumentSendRequestSender", "format": "" }, { @@ -64,6 +68,12 @@ export class DocumentSendRequest { "type": "DocumentSendRequestForwardingSettings", "format": "" }, + { + "name": "replyTo", + "baseName": "reply_to", + "type": "string", + "format": "email" + }, { "name": "selectedApprovers", "baseName": "selected_approvers", @@ -78,4 +88,3 @@ export class DocumentSendRequest { public constructor() { } } - diff --git a/src/models/DocumentSendRequestForwardingSettings.ts b/src/models/DocumentSendRequestForwardingSettings.ts index 4e36705..4439347 100644 --- a/src/models/DocumentSendRequestForwardingSettings.ts +++ b/src/models/DocumentSendRequestForwardingSettings.ts @@ -10,20 +10,22 @@ import { HttpFile } from '../http/http'; /** -* Forwarding settings +* Set settings for Document and Signature forwarding. */ export class DocumentSendRequestForwardingSettings { /** - * Allow forwarding + * Your recipient will be able/not able to forward the document to another email address. */ 'forwardingAllowed'?: boolean; /** - * Allow forwarding with reassigning + * Your recipient will be able/not able to forward the right to fill out all fields (including signature) assigned to them to another email address. */ 'forwardingWithReassigningAllowed'?: boolean; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "forwardingAllowed", @@ -45,4 +47,3 @@ export class DocumentSendRequestForwardingSettings { public constructor() { } } - diff --git a/src/models/DocumentSendRequestSelectedApprovers.ts b/src/models/DocumentSendRequestSelectedApprovers.ts index 43ee244..b341c27 100644 --- a/src/models/DocumentSendRequestSelectedApprovers.ts +++ b/src/models/DocumentSendRequestSelectedApprovers.ts @@ -7,25 +7,27 @@ * Do not edit the class manually. */ -import { DocumentSendRequestSelectedApproversSteps } from './DocumentSendRequestSelectedApproversSteps'; +import { DocumentSendRequestSelectedApproversStepsInner } from '../models/DocumentSendRequestSelectedApproversStepsInner'; import { HttpFile } from '../http/http'; /** -* Configuration for selected approvers +* Configuration for selected approvers. */ export class DocumentSendRequestSelectedApprovers { /** - * Approval steps + * Approval steps. */ - 'steps'?: Array; + 'steps'?: Array; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "steps", "baseName": "steps", - "type": "Array", + "type": "Array", "format": "" } ]; @@ -36,4 +38,3 @@ export class DocumentSendRequestSelectedApprovers { public constructor() { } } - diff --git a/src/models/DocumentSendRequestSelectedApproversSteps.ts b/src/models/DocumentSendRequestSelectedApproversStepsInner.ts similarity index 61% rename from src/models/DocumentSendRequestSelectedApproversSteps.ts rename to src/models/DocumentSendRequestSelectedApproversStepsInner.ts index 68bdeba..3f0a404 100644 --- a/src/models/DocumentSendRequestSelectedApproversSteps.ts +++ b/src/models/DocumentSendRequestSelectedApproversStepsInner.ts @@ -7,18 +7,20 @@ * Do not edit the class manually. */ -import { DocumentSendRequestSelectedApproversGroup } from './DocumentSendRequestSelectedApproversGroup'; +import { DocumentSendRequestSelectedApproversStepsInnerGroup } from '../models/DocumentSendRequestSelectedApproversStepsInnerGroup'; import { HttpFile } from '../http/http'; -export class DocumentSendRequestSelectedApproversSteps { +export class DocumentSendRequestSelectedApproversStepsInner { /** - * Step ID + * Step ID. */ 'id': string; - 'group': DocumentSendRequestSelectedApproversGroup; + 'group': DocumentSendRequestSelectedApproversStepsInnerGroup; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -29,15 +31,14 @@ export class DocumentSendRequestSelectedApproversSteps { { "name": "group", "baseName": "group", - "type": "DocumentSendRequestSelectedApproversGroup", + "type": "DocumentSendRequestSelectedApproversStepsInnerGroup", "format": "" } ]; static getAttributeTypeMap() { - return DocumentSendRequestSelectedApproversSteps.attributeTypeMap; + return DocumentSendRequestSelectedApproversStepsInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/DocumentSendRequestSelectedApproversGroup.ts b/src/models/DocumentSendRequestSelectedApproversStepsInnerGroup.ts similarity index 60% rename from src/models/DocumentSendRequestSelectedApproversGroup.ts rename to src/models/DocumentSendRequestSelectedApproversStepsInnerGroup.ts index 80055fd..52372b6 100644 --- a/src/models/DocumentSendRequestSelectedApproversGroup.ts +++ b/src/models/DocumentSendRequestSelectedApproversStepsInnerGroup.ts @@ -7,28 +7,30 @@ * Do not edit the class manually. */ -import { DocumentSendRequestSelectedApproversGroupAssignees } from './DocumentSendRequestSelectedApproversGroupAssignees'; +import { DocumentSendRequestSelectedApproversStepsInnerGroupAssigneesInner } from '../models/DocumentSendRequestSelectedApproversStepsInnerGroupAssigneesInner'; import { HttpFile } from '../http/http'; /** -* Group information +* Group information. */ -export class DocumentSendRequestSelectedApproversGroup { +export class DocumentSendRequestSelectedApproversStepsInnerGroup { /** - * Group ID + * Group ID. */ 'id': string; /** - * Group type + * Group type. */ 'type': string; /** - * Assignees for the group + * Assignees for the group. */ - 'assignees': Array; + 'assignees': Array; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -45,15 +47,14 @@ export class DocumentSendRequestSelectedApproversGroup { { "name": "assignees", "baseName": "assignees", - "type": "Array", + "type": "Array", "format": "" } ]; static getAttributeTypeMap() { - return DocumentSendRequestSelectedApproversGroup.attributeTypeMap; + return DocumentSendRequestSelectedApproversStepsInnerGroup.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/DocumentSendRequestSelectedApproversGroupAssignees.ts b/src/models/DocumentSendRequestSelectedApproversStepsInnerGroupAssigneesInner.ts similarity index 74% rename from src/models/DocumentSendRequestSelectedApproversGroupAssignees.ts rename to src/models/DocumentSendRequestSelectedApproversStepsInnerGroupAssigneesInner.ts index 20da289..58a1ccb 100644 --- a/src/models/DocumentSendRequestSelectedApproversGroupAssignees.ts +++ b/src/models/DocumentSendRequestSelectedApproversStepsInnerGroupAssigneesInner.ts @@ -9,18 +9,20 @@ import { HttpFile } from '../http/http'; -export class DocumentSendRequestSelectedApproversGroupAssignees { +export class DocumentSendRequestSelectedApproversStepsInnerGroupAssigneesInner { /** - * User ID + * User ID. */ 'user'?: string; /** - * Whether the user is selected + * Whether the user is selected. */ 'isSelected'?: boolean; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "user", @@ -36,10 +38,9 @@ export class DocumentSendRequestSelectedApproversGroupAssignees { } ]; static getAttributeTypeMap() { - return DocumentSendRequestSelectedApproversGroupAssignees.attributeTypeMap; + return DocumentSendRequestSelectedApproversStepsInnerGroupAssigneesInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/DocumentSendRequestSender.ts b/src/models/DocumentSendRequestSender.ts new file mode 100644 index 0000000..8ca50de --- /dev/null +++ b/src/models/DocumentSendRequestSender.ts @@ -0,0 +1,49 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +/** +* You can set a sender of a document as an `email` or `membership_id` +*/ +export class DocumentSendRequestSender { + /** + * Membership ID. + */ + 'membershipId'?: string; + /** + * Email. + */ + 'email'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "membershipId", + "baseName": "membership_id", + "type": "string", + "format": "" + }, + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentSendRequestSender.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentSendResponse.ts b/src/models/DocumentSendResponse.ts index eddeb76..5339ddf 100644 --- a/src/models/DocumentSendResponse.ts +++ b/src/models/DocumentSendResponse.ts @@ -7,7 +7,7 @@ * Do not edit the class manually. */ -import { DocumentSendResponseRecipients } from './DocumentSendResponseRecipients'; +import { DocumentSendResponseRecipientsInner } from '../models/DocumentSendResponseRecipientsInner'; import { HttpFile } from '../http/http'; export class DocumentSendResponse { @@ -19,10 +19,12 @@ export class DocumentSendResponse { 'expirationDate'?: string; 'version'?: string; 'uuid'?: string; - 'recipients'?: Array; + 'recipients'?: Array; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -75,7 +77,7 @@ export class DocumentSendResponse { { "name": "recipients", "baseName": "recipients", - "type": "Array", + "type": "Array", "format": "" } ]; @@ -86,4 +88,3 @@ export class DocumentSendResponse { public constructor() { } } - diff --git a/src/models/DocumentSendResponseRecipients.ts b/src/models/DocumentSendResponseRecipientsInner.ts similarity index 80% rename from src/models/DocumentSendResponseRecipients.ts rename to src/models/DocumentSendResponseRecipientsInner.ts index a660889..d90b7cc 100644 --- a/src/models/DocumentSendResponseRecipients.ts +++ b/src/models/DocumentSendResponseRecipientsInner.ts @@ -7,22 +7,24 @@ * Do not edit the class manually. */ -import { RicipientDeliveryMethods } from './RicipientDeliveryMethods'; +import { RecipientDeliveryMethods } from '../models/RecipientDeliveryMethods'; import { HttpFile } from '../http/http'; -export class DocumentSendResponseRecipients { +export class DocumentSendResponseRecipientsInner { 'id'?: string; 'firstName'?: string; 'lastName'?: string; 'recipientType'?: string; - 'email'?: string; - 'phone'?: string; - 'deliveryMethods'?: RicipientDeliveryMethods; - 'signingOrder'?: any; + 'email'?: string | null; + 'phone'?: string | null; + 'deliveryMethods'?: RecipientDeliveryMethods | null; + 'signingOrder'?: any | null; 'sharedLink'?: string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -63,7 +65,7 @@ export class DocumentSendResponseRecipients { { "name": "deliveryMethods", "baseName": "delivery_methods", - "type": "RicipientDeliveryMethods", + "type": "RecipientDeliveryMethods", "format": "" }, { @@ -80,10 +82,9 @@ export class DocumentSendResponseRecipients { } ]; static getAttributeTypeMap() { - return DocumentSendResponseRecipients.attributeTypeMap; + return DocumentSendResponseRecipientsInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/DocumentSettingsResponse.ts b/src/models/DocumentSettingsResponse.ts new file mode 100644 index 0000000..6840b27 --- /dev/null +++ b/src/models/DocumentSettingsResponse.ts @@ -0,0 +1,59 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentLanguageEnum } from '../models/DocumentLanguageEnum'; +import { HttpFile } from '../http/http'; + +/** +* Document settings response. +*/ +export class DocumentSettingsResponse { + 'language': DocumentLanguageEnum; + /** + * Indicates whether the document requires a Qualified Electronic Signature (QES) during the signing process. If `true`, signers must complete the document using a third-party qualified electronic signature provider according to supported verification rules. + */ + 'qualifiedElectronicSignature': boolean; + /** + * Document expiration in days. If not explicitly set, defaults to the system default expiration. + */ + 'expiresIn': number; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "language", + "baseName": "language", + "type": "DocumentLanguageEnum", + "format": "" + }, + { + "name": "qualifiedElectronicSignature", + "baseName": "qualified_electronic_signature", + "type": "boolean", + "format": "" + }, + { + "name": "expiresIn", + "baseName": "expires_in", + "type": "number", + "format": "int32" + } ]; + + static getAttributeTypeMap() { + return DocumentSettingsResponse.attributeTypeMap; + } + + public constructor() { + } +} + + diff --git a/src/models/DocumentStatusChangeRequest.ts b/src/models/DocumentStatusChangeRequest.ts index a3e86b6..df07b07 100644 --- a/src/models/DocumentStatusChangeRequest.ts +++ b/src/models/DocumentStatusChangeRequest.ts @@ -7,11 +7,11 @@ * Do not edit the class manually. */ -import { DocumentStatusRequestEnum } from './DocumentStatusRequestEnum'; +import { DocumentStatusChangeRequestStatusEnum } from '../models/DocumentStatusChangeRequestStatusEnum'; import { HttpFile } from '../http/http'; export class DocumentStatusChangeRequest { - 'status': DocumentStatusRequestEnum; + 'status': DocumentStatusChangeRequestStatusEnum; /** * Provide “private notes” regarding the manual status change. */ @@ -23,11 +23,13 @@ export class DocumentStatusChangeRequest { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "status", "baseName": "status", - "type": "DocumentStatusRequestEnum", + "type": "DocumentStatusChangeRequestStatusEnum", "format": "" }, { @@ -51,3 +53,4 @@ export class DocumentStatusChangeRequest { } } + diff --git a/src/models/DocumentStatusChangeRequestStatusEnum.ts b/src/models/DocumentStatusChangeRequestStatusEnum.ts new file mode 100644 index 0000000..feda795 --- /dev/null +++ b/src/models/DocumentStatusChangeRequestStatusEnum.ts @@ -0,0 +1,20 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +/** +* Number code for the target document status. See notes for the codes corresponding to each status. +*/ +export enum DocumentStatusChangeRequestStatusEnum { + NUMBER_2 = 2, + NUMBER_10 = 10, + NUMBER_11 = 11, + NUMBER_12 = 12 +} diff --git a/src/models/DocumentStatusEnum.ts b/src/models/DocumentStatusEnum.ts index cb60009..4220f39 100644 --- a/src/models/DocumentStatusEnum.ts +++ b/src/models/DocumentStatusEnum.ts @@ -9,4 +9,19 @@ import { HttpFile } from '../http/http'; -export type DocumentStatusEnum = "document.draft" | "document.sent" | "document.completed" | "document.uploaded" | "document.error" | "document.viewed" | "document.waiting_approval" | "document.approved" | "document.rejected" | "document.waiting_pay" | "document.paid" | "document.voided" | "document.declined" | "document.external_review" ; +export enum DocumentStatusEnum { + DocumentDraft = 'document.draft', + DocumentSent = 'document.sent', + DocumentCompleted = 'document.completed', + DocumentUploaded = 'document.uploaded', + DocumentError = 'document.error', + DocumentViewed = 'document.viewed', + DocumentWaitingApproval = 'document.waiting_approval', + DocumentApproved = 'document.approved', + DocumentRejected = 'document.rejected', + DocumentWaitingPay = 'document.waiting_pay', + DocumentPaid = 'document.paid', + DocumentVoided = 'document.voided', + DocumentDeclined = 'document.declined', + DocumentExternalReview = 'document.external_review' +} diff --git a/src/models/DocumentStatusRequestEnum.ts b/src/models/DocumentStatusRequestEnum.ts index 9d9a654..9535a6c 100644 --- a/src/models/DocumentStatusRequestEnum.ts +++ b/src/models/DocumentStatusRequestEnum.ts @@ -9,4 +9,19 @@ import { HttpFile } from '../http/http'; -export type DocumentStatusRequestEnum = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13" ; +export enum DocumentStatusRequestEnum { + NUMBER_0 = 0, + NUMBER_1 = 1, + NUMBER_2 = 2, + NUMBER_3 = 3, + NUMBER_4 = 4, + NUMBER_5 = 5, + NUMBER_6 = 6, + NUMBER_7 = 7, + NUMBER_8 = 8, + NUMBER_9 = 9, + NUMBER_10 = 10, + NUMBER_11 = 11, + NUMBER_12 = 12, + NUMBER_13 = 13 +} diff --git a/src/models/DocumentStatusResponse.ts b/src/models/DocumentStatusResponse.ts index a5232d6..82a6e96 100644 --- a/src/models/DocumentStatusResponse.ts +++ b/src/models/DocumentStatusResponse.ts @@ -14,14 +14,16 @@ export class DocumentStatusResponse { 'name'?: string; 'status'?: string; 'dateCreated'?: string; - 'dateModified'?: string; - 'dateCompleted'?: string; - 'expirationDate'?: string; - 'version'?: string; + 'dateModified'?: string | null; + 'dateCompleted'?: string | null; + 'expirationDate'?: string | null; + 'version'?: string | null; 'uuid'?: string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -85,4 +87,3 @@ export class DocumentStatusResponse { public constructor() { } } - diff --git a/src/models/DocumentTransferAllOwnershipRequest.ts b/src/models/DocumentTransferAllOwnershipRequest.ts index 6c6f6c5..0c8f4e5 100644 --- a/src/models/DocumentTransferAllOwnershipRequest.ts +++ b/src/models/DocumentTransferAllOwnershipRequest.ts @@ -21,6 +21,8 @@ export class DocumentTransferAllOwnershipRequest { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "fromMembershipId", @@ -42,4 +44,3 @@ export class DocumentTransferAllOwnershipRequest { public constructor() { } } - diff --git a/src/models/DocumentTransferOwnershipRequest.ts b/src/models/DocumentTransferOwnershipRequest.ts index 2b13a33..ae6bdfd 100644 --- a/src/models/DocumentTransferOwnershipRequest.ts +++ b/src/models/DocumentTransferOwnershipRequest.ts @@ -17,6 +17,8 @@ export class DocumentTransferOwnershipRequest { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "membershipId", @@ -32,4 +34,3 @@ export class DocumentTransferOwnershipRequest { public constructor() { } } - diff --git a/src/models/DocumentUpdateRequest.ts b/src/models/DocumentUpdateRequest.ts index 66ba280..d9bdda9 100644 --- a/src/models/DocumentUpdateRequest.ts +++ b/src/models/DocumentUpdateRequest.ts @@ -7,9 +7,13 @@ * Do not edit the class manually. */ -import { DocumentCreateByTemplateRequestTokens } from './DocumentCreateByTemplateRequestTokens'; -import { DocumentUpdateRequestRecipients } from './DocumentUpdateRequestRecipients'; -import { PricingTableRequest } from './PricingTableRequest'; +import { DocumentUpdateRequestFieldValue } from '../models/DocumentUpdateRequestFieldValue'; +import { DocumentUpdateRequestImagesInner } from '../models/DocumentUpdateRequestImagesInner'; +import { DocumentUpdateRequestTextsInner } from '../models/DocumentUpdateRequestTextsInner'; +import { DocumentUpdateRequestTokensInner } from '../models/DocumentUpdateRequestTokensInner'; +import { PricingTableRequest } from '../models/PricingTableRequest'; +import { TableRequest } from '../models/TableRequest'; +import { UpdateDocumentActor } from '../models/UpdateDocumentActor'; import { HttpFile } from '../http/http'; export class DocumentUpdateRequest { @@ -18,25 +22,40 @@ export class DocumentUpdateRequest { */ 'name'?: string; /** - * The list of recipients you're sending the document to. The ID or email are required. If the ID is passed, an existing recipient will be updated. If the email is passed, a new recipient will be added to CC. + * The list of recipients you\'re sending the document to. The ID or email are required. If the ID is passed, an existing recipient will be updated. If the email is passed, a new recipient will be added to CC. */ - 'recipients'?: Array; + 'recipients'?: Array; /** - * You may pass a list of fields/values which exist in a document. Please use `Merge Field` property of the fields like the key. + * Set specific values to the fields. This object maps merge field names to their corresponding values. Each key represents a merge field name, and each value is an object containing the data to populate that field with. The structure allows you to pre-populate various field types including text inputs, checkboxes, dropdowns, and date fields. **Key Points:** - Keys must match the exact merge field names from your template or file. - Values must be wrapped in an object with a `value` property. - Supported value types: string, number, boolean. - Date fields should use RFC 3339 format (e.g., \'2019-12-31T00:00:00.000Z\'). - Signature fields cannot be pre-filled. **Example Usage:** - Text field: `\"CustomerName\": {\"value\": \"John Doe\"}` - Checkbox: `\"AgreeToTerms\": {\"value\": true}` - Date field: `\"DeliveryDate\": {\"value\": \"2019-12-31T00:00:00.000Z\"}` */ - 'fields'?: any; + 'fields'?: { [key: string]: DocumentUpdateRequestFieldValue; }; /** - * You can pass a list of tokens/values. If a token name exists in a document then the value will be updated. Otherwise, a new token will be added to the document. + * Create or initialize multiple variables with their values using tokens/values list. */ - 'tokens'?: Array; + 'tokens'?: Array; + /** + * Mark your document with one or several tags. + */ + 'tags'?: Array; /** * You can pass arbitrary data in the key-value format to associate custom information with a document. This information is returned in any API requests for the document details by id. If metadata exists in a document then the value will be updated. Otherwise, metadata will be added to the document. */ 'metadata'?: any; 'pricingTables'?: Array; + 'tables'?: Array; + /** + * You can pass a list of images to image blocks (one image in one block) for replacement. + */ + 'images'?: Array; + /** + * You can pass a list of texts to text blocks for replacement. + */ + 'texts'?: Array; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "name", @@ -47,19 +66,25 @@ export class DocumentUpdateRequest { { "name": "recipients", "baseName": "recipients", - "type": "Array", + "type": "Array", "format": "" }, { "name": "fields", "baseName": "fields", - "type": "any", + "type": "{ [key: string]: DocumentUpdateRequestFieldValue; }", "format": "" }, { "name": "tokens", "baseName": "tokens", - "type": "Array", + "type": "Array", + "format": "" + }, + { + "name": "tags", + "baseName": "tags", + "type": "Array", "format": "" }, { @@ -73,6 +98,24 @@ export class DocumentUpdateRequest { "baseName": "pricing_tables", "type": "Array", "format": "" + }, + { + "name": "tables", + "baseName": "tables", + "type": "Array", + "format": "" + }, + { + "name": "images", + "baseName": "images", + "type": "Array", + "format": "" + }, + { + "name": "texts", + "baseName": "texts", + "type": "Array", + "format": "" } ]; static getAttributeTypeMap() { @@ -82,4 +125,3 @@ export class DocumentUpdateRequest { public constructor() { } } - diff --git a/src/models/DocumentUpdateRequestFieldValue.ts b/src/models/DocumentUpdateRequestFieldValue.ts new file mode 100644 index 0000000..b52a1e7 --- /dev/null +++ b/src/models/DocumentUpdateRequestFieldValue.ts @@ -0,0 +1,34 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentCreateByTemplateRequestFieldsValueValue } from '../models/DocumentCreateByTemplateRequestFieldsValueValue'; +import { HttpFile } from '../http/http'; + +export class DocumentUpdateRequestFieldValue { + 'value': DocumentCreateByTemplateRequestFieldsValueValue; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "value", + "baseName": "value", + "type": "DocumentCreateByTemplateRequestFieldsValueValue", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentUpdateRequestFieldValue.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentCreateByTemplateRequestImages.ts b/src/models/DocumentUpdateRequestImagesInner.ts similarity index 81% rename from src/models/DocumentCreateByTemplateRequestImages.ts rename to src/models/DocumentUpdateRequestImagesInner.ts index 822e7f6..c7bac16 100644 --- a/src/models/DocumentCreateByTemplateRequestImages.ts +++ b/src/models/DocumentUpdateRequestImagesInner.ts @@ -9,12 +9,14 @@ import { HttpFile } from '../http/http'; -export class DocumentCreateByTemplateRequestImages { +export class DocumentUpdateRequestImagesInner { 'urls': Array; 'name': string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "urls", @@ -30,10 +32,9 @@ export class DocumentCreateByTemplateRequestImages { } ]; static getAttributeTypeMap() { - return DocumentCreateByTemplateRequestImages.attributeTypeMap; + return DocumentUpdateRequestImagesInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/DocumentUpdateRequestTextsInner.ts b/src/models/DocumentUpdateRequestTextsInner.ts new file mode 100644 index 0000000..3c440fe --- /dev/null +++ b/src/models/DocumentUpdateRequestTextsInner.ts @@ -0,0 +1,46 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class DocumentUpdateRequestTextsInner { + /** + * The name of the text block to update. + */ + 'name': string; + /** + * The rich text content to be inserted into the block. Supports markdown. + */ + 'data': string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "data", + "baseName": "data", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocumentUpdateRequestTextsInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/DocumentCreateByTemplateRequestTokens.ts b/src/models/DocumentUpdateRequestTokensInner.ts similarity index 81% rename from src/models/DocumentCreateByTemplateRequestTokens.ts rename to src/models/DocumentUpdateRequestTokensInner.ts index 5441d23..3b025c3 100644 --- a/src/models/DocumentCreateByTemplateRequestTokens.ts +++ b/src/models/DocumentUpdateRequestTokensInner.ts @@ -9,12 +9,14 @@ import { HttpFile } from '../http/http'; -export class DocumentCreateByTemplateRequestTokens { +export class DocumentUpdateRequestTokensInner { 'name': string; 'value': string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "name", @@ -30,10 +32,9 @@ export class DocumentCreateByTemplateRequestTokens { } ]; static getAttributeTypeMap() { - return DocumentCreateByTemplateRequestTokens.attributeTypeMap; + return DocumentUpdateRequestTokensInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/DocumentsFolderCreateRequest.ts b/src/models/DocumentsFolderCreateRequest.ts index 1223dee..c020bec 100644 --- a/src/models/DocumentsFolderCreateRequest.ts +++ b/src/models/DocumentsFolderCreateRequest.ts @@ -21,6 +21,8 @@ export class DocumentsFolderCreateRequest { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "name", @@ -42,4 +44,3 @@ export class DocumentsFolderCreateRequest { public constructor() { } } - diff --git a/src/models/DocumentsFolderCreateResponse.ts b/src/models/DocumentsFolderCreateResponse.ts index 91d53d2..9fa3685 100644 --- a/src/models/DocumentsFolderCreateResponse.ts +++ b/src/models/DocumentsFolderCreateResponse.ts @@ -16,6 +16,8 @@ export class DocumentsFolderCreateResponse { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "uuid", @@ -43,4 +45,3 @@ export class DocumentsFolderCreateResponse { public constructor() { } } - diff --git a/src/models/DocumentsFolderListResponse.ts b/src/models/DocumentsFolderListResponse.ts index 8e654cc..7cb7a55 100644 --- a/src/models/DocumentsFolderListResponse.ts +++ b/src/models/DocumentsFolderListResponse.ts @@ -7,19 +7,21 @@ * Do not edit the class manually. */ -import { DocumentsFolderListResponseResults } from './DocumentsFolderListResponseResults'; +import { DocumentsFolderListResponseResultsInner } from '../models/DocumentsFolderListResponseResultsInner'; import { HttpFile } from '../http/http'; export class DocumentsFolderListResponse { - 'results'?: Array; + 'results'?: Array; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "results", "baseName": "results", - "type": "Array", + "type": "Array", "format": "" } ]; @@ -30,4 +32,3 @@ export class DocumentsFolderListResponse { public constructor() { } } - diff --git a/src/models/DocumentsFolderListResponseResults.ts b/src/models/DocumentsFolderListResponseResultsInner.ts similarity index 86% rename from src/models/DocumentsFolderListResponseResults.ts rename to src/models/DocumentsFolderListResponseResultsInner.ts index 8a18e42..6c8b0c1 100644 --- a/src/models/DocumentsFolderListResponseResults.ts +++ b/src/models/DocumentsFolderListResponseResultsInner.ts @@ -9,7 +9,7 @@ import { HttpFile } from '../http/http'; -export class DocumentsFolderListResponseResults { +export class DocumentsFolderListResponseResultsInner { 'uuid'?: string; 'name'?: string; 'dateCreated'?: string; @@ -18,6 +18,8 @@ export class DocumentsFolderListResponseResults { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "uuid", @@ -51,10 +53,9 @@ export class DocumentsFolderListResponseResults { } ]; static getAttributeTypeMap() { - return DocumentsFolderListResponseResults.attributeTypeMap; + return DocumentsFolderListResponseResultsInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/DocumentsFolderRenameRequest.ts b/src/models/DocumentsFolderRenameRequest.ts index 107026e..5cb01d3 100644 --- a/src/models/DocumentsFolderRenameRequest.ts +++ b/src/models/DocumentsFolderRenameRequest.ts @@ -17,6 +17,8 @@ export class DocumentsFolderRenameRequest { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "name", @@ -32,4 +34,3 @@ export class DocumentsFolderRenameRequest { public constructor() { } } - diff --git a/src/models/DocumentsFolderRenameResponse.ts b/src/models/DocumentsFolderRenameResponse.ts index 34b8f74..96cc3b9 100644 --- a/src/models/DocumentsFolderRenameResponse.ts +++ b/src/models/DocumentsFolderRenameResponse.ts @@ -16,6 +16,8 @@ export class DocumentsFolderRenameResponse { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "uuid", @@ -43,4 +45,3 @@ export class DocumentsFolderRenameResponse { public constructor() { } } - diff --git a/src/models/DocxExportTaskResponse.ts b/src/models/DocxExportTaskResponse.ts new file mode 100644 index 0000000..d18b8a2 --- /dev/null +++ b/src/models/DocxExportTaskResponse.ts @@ -0,0 +1,67 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentDocxExportStatusEnum } from '../models/DocumentDocxExportStatusEnum'; +import { DocxExportTaskResponseAllOfDocxItems } from '../models/DocxExportTaskResponseAllOfDocxItems'; +import { HttpFile } from '../http/http'; + +export class DocxExportTaskResponse { + /** + * Export task id. + */ + 'id': string; + /** + * Document id. + */ + 'documentId': string; + 'status': DocumentDocxExportStatusEnum; + /** + * DOCX files result URLs with their names. + */ + 'docxItems'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "documentId", + "baseName": "document_id", + "type": "string", + "format": "" + }, + { + "name": "status", + "baseName": "status", + "type": "DocumentDocxExportStatusEnum", + "format": "" + }, + { + "name": "docxItems", + "baseName": "docx_items", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return DocxExportTaskResponse.attributeTypeMap; + } + + public constructor() { + } +} + + diff --git a/src/models/DocxExportTaskResponseAllOfDocxItems.ts b/src/models/DocxExportTaskResponseAllOfDocxItems.ts new file mode 100644 index 0000000..86ce825 --- /dev/null +++ b/src/models/DocxExportTaskResponseAllOfDocxItems.ts @@ -0,0 +1,49 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +/** +* List of download links and section item titles of the document. +*/ +export class DocxExportTaskResponseAllOfDocxItems { + /** + * Document Section Item title. + */ + 'sectionTitle'?: string | null; + /** + * The url for downloading the DOCX file. + */ + 'url'?: string | null; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "sectionTitle", + "baseName": "section_title", + "type": "string", + "format": "" + }, + { + "name": "url", + "baseName": "url", + "type": "string", + "format": "uri" + } ]; + + static getAttributeTypeMap() { + return DocxExportTaskResponseAllOfDocxItems.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/Dropdown.ts b/src/models/Dropdown.ts new file mode 100644 index 0000000..001f0d1 --- /dev/null +++ b/src/models/Dropdown.ts @@ -0,0 +1,104 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { BaseFieldAssignedTo } from '../models/BaseFieldAssignedTo'; +import { HttpFile } from '../http/http'; + +export class Dropdown { + 'uuid'?: string; + /** + * Name of a field + */ + 'name'?: string; + 'title'?: string; + /** + * Placeholder of a field + */ + 'placeholder'?: string; + 'assignedTo'?: BaseFieldAssignedTo; + 'fieldId'?: string; + 'type'?: DropdownTypeEnum; + /** + * Value of the Dropdown field. + */ + 'value'?: string; + 'mergeField'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "uuid", + "baseName": "uuid", + "type": "string", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "title", + "baseName": "title", + "type": "string", + "format": "" + }, + { + "name": "placeholder", + "baseName": "placeholder", + "type": "string", + "format": "" + }, + { + "name": "assignedTo", + "baseName": "assigned_to", + "type": "BaseFieldAssignedTo", + "format": "" + }, + { + "name": "fieldId", + "baseName": "field_id", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "DropdownTypeEnum", + "format": "" + }, + { + "name": "value", + "baseName": "value", + "type": "string", + "format": "" + }, + { + "name": "mergeField", + "baseName": "merge_field", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return Dropdown.attributeTypeMap; + } + + public constructor() { + } +} + +export enum DropdownTypeEnum { + Dropdown = 'dropdown' +} + diff --git a/src/models/EditingSessionRequest.ts b/src/models/EditingSessionRequest.ts new file mode 100644 index 0000000..0124afc --- /dev/null +++ b/src/models/EditingSessionRequest.ts @@ -0,0 +1,46 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class EditingSessionRequest { + /** + * Email of the user to create the editing session for + */ + 'email': string; + /** + * Lifetime of the E-Token in seconds. + */ + 'lifetime'?: number; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "email" + }, + { + "name": "lifetime", + "baseName": "lifetime", + "type": "number", + "format": "int32" + } ]; + + static getAttributeTypeMap() { + return EditingSessionRequest.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/Field.ts b/src/models/Field.ts new file mode 100644 index 0000000..c4e8f47 --- /dev/null +++ b/src/models/Field.ts @@ -0,0 +1,135 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { BaseFieldAssignedTo } from '../models/BaseFieldAssignedTo'; +import { Checkbox } from '../models/Checkbox'; +import { CollectFile } from '../models/CollectFile'; +import { Dropdown } from '../models/Dropdown'; +import { Initials } from '../models/Initials'; +import { ModelDate } from '../models/ModelDate'; +import { Payment } from '../models/Payment'; +import { RadioButtons } from '../models/RadioButtons'; +import { Signature } from '../models/Signature'; +import { Stamp } from '../models/Stamp'; +import { Text } from '../models/Text'; +import { HttpFile } from '../http/http'; + +export class Field { + 'uuid'?: string; + /** + * Name of a field + */ + 'name'?: string; + 'title'?: string; + /** + * Placeholder of a field + */ + 'placeholder'?: string; + 'assignedTo'?: BaseFieldAssignedTo; + 'fieldId'?: string; + 'type'?: FieldTypeEnum; + /** + * Value of the Text field. + */ + 'value'?: string; + 'mergeField'?: string; + + static readonly discriminator: string | undefined = "type"; + + static readonly mapping: {[index: string]: string} | undefined = { + "checkbox": "Checkbox", + "collect_file": "CollectFile", + "date": "ModelDate", + "dropdown": "Dropdown", + "initials": "Initials", + "payment": "Payment", + "radio_buttons": "RadioButtons", + "signature": "Signature", + "stamp": "Stamp", + "text": "Text", + }; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "uuid", + "baseName": "uuid", + "type": "string", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "title", + "baseName": "title", + "type": "string", + "format": "" + }, + { + "name": "placeholder", + "baseName": "placeholder", + "type": "string", + "format": "" + }, + { + "name": "assignedTo", + "baseName": "assigned_to", + "type": "BaseFieldAssignedTo", + "format": "" + }, + { + "name": "fieldId", + "baseName": "field_id", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "FieldTypeEnum", + "format": "" + }, + { + "name": "value", + "baseName": "value", + "type": "string", + "format": "" + }, + { + "name": "mergeField", + "baseName": "merge_field", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return Field.attributeTypeMap; + } + + public constructor() { + this.type = "Field" as any; + } +} + +export enum FieldTypeEnum { + Checkbox = 'checkbox', + CollectFile = 'collect_file', + Date = 'date', + Dropdown = 'dropdown', + Initials = 'initials', + PaymentDetails = 'payment_details', + RadioButtons = 'radio_buttons', + Signature = 'signature', + Stamp = 'stamp', + Text = 'text' +} + diff --git a/src/models/FormListResponse.ts b/src/models/FormListResponse.ts index 1d86608..df1ccc8 100644 --- a/src/models/FormListResponse.ts +++ b/src/models/FormListResponse.ts @@ -7,20 +7,22 @@ * Do not edit the class manually. */ -import { FormListResponseResults } from './FormListResponseResults'; +import { FormListResponseResultsInner } from '../models/FormListResponseResultsInner'; import { HttpFile } from '../http/http'; export class FormListResponse { - 'results'?: Array; + 'results'?: Array; 'hasNextPage'?: boolean; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "results", "baseName": "results", - "type": "Array", + "type": "Array", "format": "" }, { @@ -37,4 +39,3 @@ export class FormListResponse { public constructor() { } } - diff --git a/src/models/FormListResponseResults.ts b/src/models/FormListResponseResultsInner.ts similarity index 88% rename from src/models/FormListResponseResults.ts rename to src/models/FormListResponseResultsInner.ts index 6e15739..b4ceece 100644 --- a/src/models/FormListResponseResults.ts +++ b/src/models/FormListResponseResultsInner.ts @@ -9,7 +9,7 @@ import { HttpFile } from '../http/http'; -export class FormListResponseResults { +export class FormListResponseResultsInner { 'id'?: string; 'name'?: string; 'dateCreated'?: string; @@ -18,6 +18,8 @@ export class FormListResponseResults { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -51,10 +53,9 @@ export class FormListResponseResults { } ]; static getAttributeTypeMap() { - return FormListResponseResults.attributeTypeMap; + return FormListResponseResultsInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/Initials.ts b/src/models/Initials.ts new file mode 100644 index 0000000..51fe613 --- /dev/null +++ b/src/models/Initials.ts @@ -0,0 +1,97 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { BaseFieldAssignedTo } from '../models/BaseFieldAssignedTo'; +import { HttpFile } from '../http/http'; + +export class Initials { + 'uuid'?: string; + /** + * Name of a field + */ + 'name'?: string; + 'title'?: string; + /** + * Placeholder of a field + */ + 'placeholder'?: string; + 'assignedTo'?: BaseFieldAssignedTo; + 'fieldId'?: string; + 'type'?: InitialsTypeEnum; + /** + * Value of the Initials field. Always empty object. + */ + 'value'?: any; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "uuid", + "baseName": "uuid", + "type": "string", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "title", + "baseName": "title", + "type": "string", + "format": "" + }, + { + "name": "placeholder", + "baseName": "placeholder", + "type": "string", + "format": "" + }, + { + "name": "assignedTo", + "baseName": "assigned_to", + "type": "BaseFieldAssignedTo", + "format": "" + }, + { + "name": "fieldId", + "baseName": "field_id", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "InitialsTypeEnum", + "format": "" + }, + { + "name": "value", + "baseName": "value", + "type": "any", + "format": "" + } ]; + + static getAttributeTypeMap() { + return Initials.attributeTypeMap; + } + + public constructor() { + } +} + +export enum InitialsTypeEnum { + Initials = 'initials' +} + diff --git a/src/models/LinkedObjectChild.ts b/src/models/LinkedObjectChild.ts new file mode 100644 index 0000000..5e5f0ba --- /dev/null +++ b/src/models/LinkedObjectChild.ts @@ -0,0 +1,59 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +/** +* Child entity reference in a hierarchical chain structure that provides essential metadata and direct access links for lazy-loading the complete object by ID. +*/ +export class LinkedObjectChild { + /** + * Linked object identifier (link_id). + */ + 'id'?: string; + /** + * Entity type. See the available entity types: https://developers.pandadoc.com/reference/link-service#examples-of-the-most-popular-crms + */ + 'entityType'?: string; + /** + * Entity unique identifier. The system validates if the entity exists. + */ + 'entityId'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "entityType", + "baseName": "entity_type", + "type": "string", + "format": "" + }, + { + "name": "entityId", + "baseName": "entity_id", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return LinkedObjectChild.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/LinkedObjectCreateRequest.ts b/src/models/LinkedObjectCreateRequest.ts index 11a3af0..7302cf3 100644 --- a/src/models/LinkedObjectCreateRequest.ts +++ b/src/models/LinkedObjectCreateRequest.ts @@ -11,11 +11,11 @@ import { HttpFile } from '../http/http'; export class LinkedObjectCreateRequest { /** - * CRM name (lowercase). See the list above. + * CRM name (lowercase). See the list of available providers: https://developers.pandadoc.com/reference/link-service#examples-of-the-most-popular-crms */ 'provider': string; /** - * Entity type. The system validates if the type is supported. See the list for each CRM above. + * Entity type. See the available entity types: https://developers.pandadoc.com/reference/link-service#examples-of-the-most-popular-crms */ 'entityType': string; /** @@ -25,6 +25,8 @@ export class LinkedObjectCreateRequest { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "provider", @@ -52,4 +54,3 @@ export class LinkedObjectCreateRequest { public constructor() { } } - diff --git a/src/models/LinkedObjectCreateResponse.ts b/src/models/LinkedObjectCreateResponse.ts index 4a6874a..06196eb 100644 --- a/src/models/LinkedObjectCreateResponse.ts +++ b/src/models/LinkedObjectCreateResponse.ts @@ -7,25 +7,32 @@ * Do not edit the class manually. */ +import { LinkedObjectChild } from '../models/LinkedObjectChild'; import { HttpFile } from '../http/http'; export class LinkedObjectCreateResponse { + /** + * Linked object identifier (link_id). + */ 'id'?: string; /** - * CRM name (lowercase). See the list above. + * CRM name (lowercase). See the list of available providers: https://developers.pandadoc.com/reference/link-service#examples-of-the-most-popular-crms */ 'provider'?: string; /** - * Entity type. The system validates if the type is supported. See the list for each CRM above. + * Entity type. See the available entity types: https://developers.pandadoc.com/reference/link-service#examples-of-the-most-popular-crms */ 'entityType'?: string; /** * Entity unique identifier. The system validates if the entity exists. */ - 'entiryId'?: string; + 'entityId'?: string; + 'children'?: Array; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -46,10 +53,16 @@ export class LinkedObjectCreateResponse { "format": "" }, { - "name": "entiryId", - "baseName": "entiry_id", + "name": "entityId", + "baseName": "entity_id", "type": "string", "format": "" + }, + { + "name": "children", + "baseName": "children", + "type": "Array", + "format": "" } ]; static getAttributeTypeMap() { @@ -59,4 +72,3 @@ export class LinkedObjectCreateResponse { public constructor() { } } - diff --git a/src/models/LinkedObjectListResponse.ts b/src/models/LinkedObjectListResponse.ts index 53fb241..4bb1d70 100644 --- a/src/models/LinkedObjectListResponse.ts +++ b/src/models/LinkedObjectListResponse.ts @@ -7,7 +7,7 @@ * Do not edit the class manually. */ -import { LinkedObjectCreateResponse } from './LinkedObjectCreateResponse'; +import { LinkedObjectCreateResponse } from '../models/LinkedObjectCreateResponse'; import { HttpFile } from '../http/http'; export class LinkedObjectListResponse { @@ -15,6 +15,8 @@ export class LinkedObjectListResponse { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "linkedObjects", @@ -30,4 +32,3 @@ export class LinkedObjectListResponse { public constructor() { } } - diff --git a/src/models/ListCatalogItemsSearchResponse.ts b/src/models/ListCatalogItemsSearchResponse.ts new file mode 100644 index 0000000..9995a2c --- /dev/null +++ b/src/models/ListCatalogItemsSearchResponse.ts @@ -0,0 +1,48 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ProductCatalogSearchCatalogItemResponse } from '../models/ProductCatalogSearchCatalogItemResponse'; +import { HttpFile } from '../http/http'; + +export class ListCatalogItemsSearchResponse { + 'items'?: Array; + 'hasMoreItems'?: boolean; + 'total'?: number; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "items", + "baseName": "items", + "type": "Array", + "format": "" + }, + { + "name": "hasMoreItems", + "baseName": "has_more_items", + "type": "boolean", + "format": "" + }, + { + "name": "total", + "baseName": "total", + "type": "number", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ListCatalogItemsSearchResponse.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ListDocumentFieldsResponse.ts b/src/models/ListDocumentFieldsResponse.ts new file mode 100644 index 0000000..342fd94 --- /dev/null +++ b/src/models/ListDocumentFieldsResponse.ts @@ -0,0 +1,34 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentFieldsField } from '../models/DocumentFieldsField'; +import { HttpFile } from '../http/http'; + +export class ListDocumentFieldsResponse { + 'fields'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "fields", + "baseName": "fields", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ListDocumentFieldsResponse.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ListDocuments400Response.ts b/src/models/ListDocuments400Response.ts new file mode 100644 index 0000000..715d658 --- /dev/null +++ b/src/models/ListDocuments400Response.ts @@ -0,0 +1,40 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class ListDocuments400Response { + 'type'?: string; + 'detail'?: any; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "type", + "baseName": "type", + "type": "string", + "format": "" + }, + { + "name": "detail", + "baseName": "detail", + "type": "any", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ListDocuments400Response.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ListDocuments401Response.ts b/src/models/ListDocuments401Response.ts new file mode 100644 index 0000000..a89569d --- /dev/null +++ b/src/models/ListDocuments401Response.ts @@ -0,0 +1,40 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class ListDocuments401Response { + 'type'?: string; + 'detail'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "type", + "baseName": "type", + "type": "string", + "format": "" + }, + { + "name": "detail", + "baseName": "detail", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ListDocuments401Response.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ListDocuments403Response.ts b/src/models/ListDocuments403Response.ts new file mode 100644 index 0000000..aefb99c --- /dev/null +++ b/src/models/ListDocuments403Response.ts @@ -0,0 +1,61 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ListDocuments403ResponseLinksInner } from '../models/ListDocuments403ResponseLinksInner'; +import { HttpFile } from '../http/http'; + +export class ListDocuments403Response { + 'type'?: string; + 'detail'?: string; + /** + * Human-readable explanation of the permission error. + */ + 'infoMessage'?: string; + /** + * Optional links related to the error (e.g. a status endpoint). + */ + 'links'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "type", + "baseName": "type", + "type": "string", + "format": "" + }, + { + "name": "detail", + "baseName": "detail", + "type": "string", + "format": "" + }, + { + "name": "infoMessage", + "baseName": "info_message", + "type": "string", + "format": "" + }, + { + "name": "links", + "baseName": "links", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ListDocuments403Response.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ListDocuments403ResponseLinksInner.ts b/src/models/ListDocuments403ResponseLinksInner.ts new file mode 100644 index 0000000..bc02b8f --- /dev/null +++ b/src/models/ListDocuments403ResponseLinksInner.ts @@ -0,0 +1,47 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class ListDocuments403ResponseLinksInner { + 'rel'?: string; + 'href'?: string; + 'type'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "rel", + "baseName": "rel", + "type": "string", + "format": "" + }, + { + "name": "href", + "baseName": "href", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ListDocuments403ResponseLinksInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ListDocuments429Response.ts b/src/models/ListDocuments429Response.ts new file mode 100644 index 0000000..bebdc43 --- /dev/null +++ b/src/models/ListDocuments429Response.ts @@ -0,0 +1,40 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class ListDocuments429Response { + 'type'?: string; + 'detail'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "type", + "baseName": "type", + "type": "string", + "format": "" + }, + { + "name": "detail", + "baseName": "detail", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ListDocuments429Response.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ListDocumentsByLinkedObjectsResponseInner.ts b/src/models/ListDocumentsByLinkedObjectsResponseInner.ts new file mode 100644 index 0000000..f31b1a0 --- /dev/null +++ b/src/models/ListDocumentsByLinkedObjectsResponseInner.ts @@ -0,0 +1,54 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class ListDocumentsByLinkedObjectsResponseInner { + 'id'?: string; + 'status'?: string; + 'dateCreated'?: string; + 'templateId'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "status", + "baseName": "status", + "type": "string", + "format": "" + }, + { + "name": "dateCreated", + "baseName": "date_created", + "type": "string", + "format": "" + }, + { + "name": "templateId", + "baseName": "template_id", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ListDocumentsByLinkedObjectsResponseInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ListNotaries400Response.ts b/src/models/ListNotaries400Response.ts new file mode 100644 index 0000000..70814ea --- /dev/null +++ b/src/models/ListNotaries400Response.ts @@ -0,0 +1,41 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ListNotaries400ResponseDetailsInner } from '../models/ListNotaries400ResponseDetailsInner'; +import { HttpFile } from '../http/http'; + +export class ListNotaries400Response { + 'code'?: string; + 'details'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "code", + "baseName": "code", + "type": "string", + "format": "" + }, + { + "name": "details", + "baseName": "details", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ListNotaries400Response.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ListNotaries400ResponseDetailsInner.ts b/src/models/ListNotaries400ResponseDetailsInner.ts new file mode 100644 index 0000000..f795bce --- /dev/null +++ b/src/models/ListNotaries400ResponseDetailsInner.ts @@ -0,0 +1,53 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class ListNotaries400ResponseDetailsInner { + 'code': string; + /** + * JSON Pointer. + */ + 'pointer'?: string | null; + /** + * Details data. + */ + 'data'?: { [key: string]: any; } | null; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "code", + "baseName": "code", + "type": "string", + "format": "" + }, + { + "name": "pointer", + "baseName": "pointer", + "type": "string", + "format": "" + }, + { + "name": "data", + "baseName": "data", + "type": "{ [key: string]: any; }", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ListNotaries400ResponseDetailsInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ListNotaries403Response.ts b/src/models/ListNotaries403Response.ts new file mode 100644 index 0000000..ebcda6d --- /dev/null +++ b/src/models/ListNotaries403Response.ts @@ -0,0 +1,41 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ListNotaries400ResponseDetailsInner } from '../models/ListNotaries400ResponseDetailsInner'; +import { HttpFile } from '../http/http'; + +export class ListNotaries403Response { + 'code'?: string; + 'details'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "code", + "baseName": "code", + "type": "string", + "format": "" + }, + { + "name": "details", + "baseName": "details", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ListNotaries403Response.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ListNotaries429Response.ts b/src/models/ListNotaries429Response.ts new file mode 100644 index 0000000..bd8ec3c --- /dev/null +++ b/src/models/ListNotaries429Response.ts @@ -0,0 +1,41 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ListNotaries400ResponseDetailsInner } from '../models/ListNotaries400ResponseDetailsInner'; +import { HttpFile } from '../http/http'; + +export class ListNotaries429Response { + 'code'?: string; + 'details'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "code", + "baseName": "code", + "type": "string", + "format": "" + }, + { + "name": "details", + "baseName": "details", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ListNotaries429Response.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ListNotariesResponse.ts b/src/models/ListNotariesResponse.ts new file mode 100644 index 0000000..a3874b4 --- /dev/null +++ b/src/models/ListNotariesResponse.ts @@ -0,0 +1,47 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ListNotariesResponseResultsInner } from '../models/ListNotariesResponseResultsInner'; +import { HttpFile } from '../http/http'; + +export class ListNotariesResponse { + /** + * Array of notary objects + */ + 'results'?: Array; + /** + * Total number of notaries matching the criteria + */ + 'count'?: number; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "results", + "baseName": "results", + "type": "Array", + "format": "" + }, + { + "name": "count", + "baseName": "count", + "type": "number", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ListNotariesResponse.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ListNotariesResponseResultsInner.ts b/src/models/ListNotariesResponseResultsInner.ts new file mode 100644 index 0000000..4ea8dee --- /dev/null +++ b/src/models/ListNotariesResponseResultsInner.ts @@ -0,0 +1,82 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class ListNotariesResponseResultsInner { + /** + * Unique identifier for the notary + */ + 'id'?: string; + /** + * Email address of the notary + */ + 'email'?: string; + /** + * Full name of the notary + */ + 'name'?: string | null; + /** + * Current status of the notary + */ + 'status'?: ListNotariesResponseResultsInnerStatusEnum; + 'commissionState'?: string | null; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "email" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "status", + "baseName": "status", + "type": "ListNotariesResponseResultsInnerStatusEnum", + "format": "" + }, + { + "name": "commissionState", + "baseName": "commission_state", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ListNotariesResponseResultsInner.attributeTypeMap; + } + + public constructor() { + } +} + +export enum ListNotariesResponseResultsInnerStatusEnum { + Invited = 'INVITED', + UnderReview = 'UNDER_REVIEW', + Active = 'ACTIVE', + Rejected = 'REJECTED', + Inactive = 'INACTIVE' +} + diff --git a/src/models/ListSmsOptOutChangelogResponse.ts b/src/models/ListSmsOptOutChangelogResponse.ts new file mode 100644 index 0000000..a2fa43d --- /dev/null +++ b/src/models/ListSmsOptOutChangelogResponse.ts @@ -0,0 +1,34 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ListSmsOptOutChangelogResponseResultsInner } from '../models/ListSmsOptOutChangelogResponseResultsInner'; +import { HttpFile } from '../http/http'; + +export class ListSmsOptOutChangelogResponse { + 'results'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "results", + "baseName": "results", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ListSmsOptOutChangelogResponse.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ListSmsOptOutChangelogResponseResultsInner.ts b/src/models/ListSmsOptOutChangelogResponseResultsInner.ts new file mode 100644 index 0000000..d84bb85 --- /dev/null +++ b/src/models/ListSmsOptOutChangelogResponseResultsInner.ts @@ -0,0 +1,53 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class ListSmsOptOutChangelogResponseResultsInner { + 'phoneNumber'?: string; + 'status'?: ListSmsOptOutChangelogResponseResultsInnerStatusEnum; + 'optOutChanged'?: Date; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "phoneNumber", + "baseName": "phone_number", + "type": "string", + "format": "" + }, + { + "name": "status", + "baseName": "status", + "type": "ListSmsOptOutChangelogResponseResultsInnerStatusEnum", + "format": "" + }, + { + "name": "optOutChanged", + "baseName": "opt_out_changed", + "type": "Date", + "format": "date-time" + } ]; + + static getAttributeTypeMap() { + return ListSmsOptOutChangelogResponseResultsInner.attributeTypeMap; + } + + public constructor() { + } +} + +export enum ListSmsOptOutChangelogResponseResultsInnerStatusEnum { + OptIn = 'opt-in', + OptOut = 'opt-out' +} + diff --git a/src/models/ListUsersResponse.ts b/src/models/ListUsersResponse.ts new file mode 100644 index 0000000..5baaff9 --- /dev/null +++ b/src/models/ListUsersResponse.ts @@ -0,0 +1,44 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ListUsersResponseResultsInner } from '../models/ListUsersResponseResultsInner'; +import { HttpFile } from '../http/http'; + +export class ListUsersResponse { + /** + * A number of users + */ + 'total'?: number; + 'results'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "total", + "baseName": "total", + "type": "number", + "format": "" + }, + { + "name": "results", + "baseName": "results", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ListUsersResponse.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ListUsersResponseResultsInner.ts b/src/models/ListUsersResponseResultsInner.ts new file mode 100644 index 0000000..c50232c --- /dev/null +++ b/src/models/ListUsersResponseResultsInner.ts @@ -0,0 +1,101 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ListUsersResponseResultsInnerWorkspacesInner } from '../models/ListUsersResponseResultsInnerWorkspacesInner'; +import { HttpFile } from '../http/http'; + +export class ListUsersResponseResultsInner { + /** + * A unique identifier of the user in the organization. + */ + 'userId'?: string; + /** + * A user\'s email address. + */ + 'email'?: string; + /** + * A user\'s first name. + */ + 'firstName'?: string; + /** + * A user\'s last name. + */ + 'lastName'?: string; + /** + * A user\'s phone number. + */ + 'phoneNumber'?: string; + /** + * A user\'s license in the organization. + */ + 'license'?: string; + 'isOrganizationOwner'?: boolean; + 'workspaces'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "userId", + "baseName": "user_id", + "type": "string", + "format": "" + }, + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "" + }, + { + "name": "firstName", + "baseName": "first_name", + "type": "string", + "format": "" + }, + { + "name": "lastName", + "baseName": "last_name", + "type": "string", + "format": "" + }, + { + "name": "phoneNumber", + "baseName": "phone_number", + "type": "string", + "format": "" + }, + { + "name": "license", + "baseName": "license", + "type": "string", + "format": "" + }, + { + "name": "isOrganizationOwner", + "baseName": "is_organization_owner", + "type": "boolean", + "format": "" + }, + { + "name": "workspaces", + "baseName": "workspaces", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ListUsersResponseResultsInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ListUsersResponseResultsInnerWorkspacesInner.ts b/src/models/ListUsersResponseResultsInnerWorkspacesInner.ts new file mode 100644 index 0000000..fc7cba5 --- /dev/null +++ b/src/models/ListUsersResponseResultsInnerWorkspacesInner.ts @@ -0,0 +1,56 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class ListUsersResponseResultsInnerWorkspacesInner { + /** + * A user\'s role in workspace. + */ + 'role'?: string; + /** + * A user\'s workspace. + */ + 'workspaceId'?: string; + /** + * A user\'s membership id in workspace. + */ + 'membershipId'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "role", + "baseName": "role", + "type": "string", + "format": "" + }, + { + "name": "workspaceId", + "baseName": "workspace_id", + "type": "string", + "format": "" + }, + { + "name": "membershipId", + "baseName": "membership_id", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ListUsersResponseResultsInnerWorkspacesInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ListWorkspacesResponse.ts b/src/models/ListWorkspacesResponse.ts new file mode 100644 index 0000000..8adcc8e --- /dev/null +++ b/src/models/ListWorkspacesResponse.ts @@ -0,0 +1,44 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ListWorkspacesResponseResultsInner } from '../models/ListWorkspacesResponseResultsInner'; +import { HttpFile } from '../http/http'; + +export class ListWorkspacesResponse { + /** + * A number of workspaces + */ + 'total'?: number; + 'results'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "total", + "baseName": "total", + "type": "number", + "format": "" + }, + { + "name": "results", + "baseName": "results", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ListWorkspacesResponse.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ListWorkspacesResponseResultsInner.ts b/src/models/ListWorkspacesResponseResultsInner.ts new file mode 100644 index 0000000..9a4036c --- /dev/null +++ b/src/models/ListWorkspacesResponseResultsInner.ts @@ -0,0 +1,66 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class ListWorkspacesResponseResultsInner { + /** + * A unique identifier of a workspace in a organization + */ + 'id'?: string; + /** + * A workspace\'s name + */ + 'name'?: string; + /** + * A workspace\'s date creation + */ + 'dateCreated'?: string; + /** + * A owner\'s email address + */ + 'owner'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "dateCreated", + "baseName": "date_created", + "type": "string", + "format": "" + }, + { + "name": "owner", + "baseName": "owner", + "type": "string", + "format": "email" + } ]; + + static getAttributeTypeMap() { + return ListWorkspacesResponseResultsInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/MemberDetailsResponse.ts b/src/models/MemberDetailsResponse.ts index 3b6e335..f0d1b3e 100644 --- a/src/models/MemberDetailsResponse.ts +++ b/src/models/MemberDetailsResponse.ts @@ -19,15 +19,15 @@ export class MemberDetailsResponse { */ 'membershipId'?: string; /** - * A user's email address. + * A user\'s email address. */ 'email'?: string; /** - * A user's first name. + * A user\'s first name. */ 'firstName'?: string; /** - * A user's last name. + * A user\'s last name. */ 'lastName'?: string; /** @@ -35,11 +35,11 @@ export class MemberDetailsResponse { */ 'isActive'?: boolean; /** - * A name of the user's current active workspace. + * A unique identifier of the user\'s current active workspace. */ 'workspace'?: string; /** - * A unique identifier of the user's current active workspace. + * A name of the user\'s current active workspace. */ 'workspaceName'?: string; /** @@ -47,7 +47,7 @@ export class MemberDetailsResponse { */ 'emailsVerified'?: boolean; /** - * A member's role in the workspace. + * A member\'s role in the workspace. */ 'role'?: string; /** @@ -65,6 +65,8 @@ export class MemberDetailsResponse { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "userId", @@ -152,4 +154,3 @@ export class MemberDetailsResponse { public constructor() { } } - diff --git a/src/models/MemberListResponse.ts b/src/models/MemberListResponse.ts index b976e95..3e8794a 100644 --- a/src/models/MemberListResponse.ts +++ b/src/models/MemberListResponse.ts @@ -7,7 +7,7 @@ * Do not edit the class manually. */ -import { MemberDetailsResponse } from './MemberDetailsResponse'; +import { MemberDetailsResponse } from '../models/MemberDetailsResponse'; import { HttpFile } from '../http/http'; export class MemberListResponse { @@ -15,6 +15,8 @@ export class MemberListResponse { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "results", @@ -30,4 +32,3 @@ export class MemberListResponse { public constructor() { } } - diff --git a/src/models/ModelDate.ts b/src/models/ModelDate.ts new file mode 100644 index 0000000..ad09c7b --- /dev/null +++ b/src/models/ModelDate.ts @@ -0,0 +1,104 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { BaseFieldAssignedTo } from '../models/BaseFieldAssignedTo'; +import { HttpFile } from '../http/http'; + +export class ModelDate { + 'uuid'?: string; + /** + * Name of a field + */ + 'name'?: string; + 'title'?: string; + /** + * Placeholder of a field + */ + 'placeholder'?: string; + 'assignedTo'?: BaseFieldAssignedTo; + 'fieldId'?: string; + 'type'?: ModelDateTypeEnum; + /** + * Value of the Date field. + */ + 'value'?: Date; + 'mergeField'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "uuid", + "baseName": "uuid", + "type": "string", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "title", + "baseName": "title", + "type": "string", + "format": "" + }, + { + "name": "placeholder", + "baseName": "placeholder", + "type": "string", + "format": "" + }, + { + "name": "assignedTo", + "baseName": "assigned_to", + "type": "BaseFieldAssignedTo", + "format": "" + }, + { + "name": "fieldId", + "baseName": "field_id", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "ModelDateTypeEnum", + "format": "" + }, + { + "name": "value", + "baseName": "value", + "type": "Date", + "format": "date-time" + }, + { + "name": "mergeField", + "baseName": "merge_field", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ModelDate.attributeTypeMap; + } + + public constructor() { + } +} + +export enum ModelDateTypeEnum { + Date = 'date' +} + diff --git a/src/models/NotarizationRequestDetailsResponse.ts b/src/models/NotarizationRequestDetailsResponse.ts new file mode 100644 index 0000000..49f226a --- /dev/null +++ b/src/models/NotarizationRequestDetailsResponse.ts @@ -0,0 +1,130 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { NotarizationRequestDetailsResponseCreatedBy } from '../models/NotarizationRequestDetailsResponseCreatedBy'; +import { NotarizationRequestDetailsResponseInviteesInner } from '../models/NotarizationRequestDetailsResponseInviteesInner'; +import { NotarizationRequestDetailsResponseRecording } from '../models/NotarizationRequestDetailsResponseRecording'; +import { NotarizationRequestDetailsResponseSignedDocumentsInner } from '../models/NotarizationRequestDetailsResponseSignedDocumentsInner'; +import { HttpFile } from '../http/http'; + +export class NotarizationRequestDetailsResponse { + /** + * A unique identifier of the notarization request. + */ + 'id'?: string; + /** + * Current status of the notarization request. + */ + 'status'?: NotarizationRequestDetailsResponseStatusEnum; + /** + * A unique identifier of the document for notarization. + */ + 'documentId'?: string; + /** + * A date when a notarization request was created. + */ + 'dateCreated'?: Date; + /** + * A date when a notarization session was started. + */ + 'dateStarted'?: Date | null; + /** + * A date when a notarization session was completed. + */ + 'dateCompleted'?: Date | null; + 'createdBy'?: NotarizationRequestDetailsResponseCreatedBy; + 'invitees'?: Array; + 'signedDocuments'?: Array; + 'recording'?: NotarizationRequestDetailsResponseRecording | null; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "status", + "baseName": "status", + "type": "NotarizationRequestDetailsResponseStatusEnum", + "format": "" + }, + { + "name": "documentId", + "baseName": "document_id", + "type": "string", + "format": "" + }, + { + "name": "dateCreated", + "baseName": "date_created", + "type": "Date", + "format": "date-time" + }, + { + "name": "dateStarted", + "baseName": "date_started", + "type": "Date", + "format": "date-time" + }, + { + "name": "dateCompleted", + "baseName": "date_completed", + "type": "Date", + "format": "date-time" + }, + { + "name": "createdBy", + "baseName": "created_by", + "type": "NotarizationRequestDetailsResponseCreatedBy", + "format": "" + }, + { + "name": "invitees", + "baseName": "invitees", + "type": "Array", + "format": "" + }, + { + "name": "signedDocuments", + "baseName": "signed_documents", + "type": "Array", + "format": "" + }, + { + "name": "recording", + "baseName": "recording", + "type": "NotarizationRequestDetailsResponseRecording", + "format": "" + } ]; + + static getAttributeTypeMap() { + return NotarizationRequestDetailsResponse.attributeTypeMap; + } + + public constructor() { + } +} + +export enum NotarizationRequestDetailsResponseStatusEnum { + Draft = 'DRAFT', + Sent = 'SENT', + WaitingForNotary = 'WAITING_FOR_NOTARY', + Accepted = 'ACCEPTED', + Live = 'LIVE', + Completed = 'COMPLETED', + Incomplete = 'INCOMPLETE', + Cancelled = 'CANCELLED' +} + diff --git a/src/models/NotarizationRequestDetailsResponseCreatedBy.ts b/src/models/NotarizationRequestDetailsResponseCreatedBy.ts new file mode 100644 index 0000000..576c872 --- /dev/null +++ b/src/models/NotarizationRequestDetailsResponseCreatedBy.ts @@ -0,0 +1,66 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class NotarizationRequestDetailsResponseCreatedBy { + /** + * A unique identifier of the user who created a notarization request. + */ + 'userId'?: string; + /** + * A user\'s email address. + */ + 'email'?: string; + /** + * A user\'s first name. + */ + 'firstName'?: string; + /** + * A user\'s last name. + */ + 'lastName'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "userId", + "baseName": "user_id", + "type": "string", + "format": "" + }, + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "" + }, + { + "name": "firstName", + "baseName": "first_name", + "type": "string", + "format": "" + }, + { + "name": "lastName", + "baseName": "last_name", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return NotarizationRequestDetailsResponseCreatedBy.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/NotarizationRequestDetailsResponseInviteesInner.ts b/src/models/NotarizationRequestDetailsResponseInviteesInner.ts new file mode 100644 index 0000000..6b0aa0a --- /dev/null +++ b/src/models/NotarizationRequestDetailsResponseInviteesInner.ts @@ -0,0 +1,66 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class NotarizationRequestDetailsResponseInviteesInner { + /** + * A unique identifier of the invitee. + */ + 'id'?: string; + /** + * A invitee\'s email address. + */ + 'email'?: string; + /** + * A invitee\'s first name. + */ + 'firstName'?: string | null; + /** + * A invitee\'s last name. + */ + 'lastName'?: string | null; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "email" + }, + { + "name": "firstName", + "baseName": "first_name", + "type": "string", + "format": "" + }, + { + "name": "lastName", + "baseName": "last_name", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return NotarizationRequestDetailsResponseInviteesInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/NotarizationRequestDetailsResponseRecording.ts b/src/models/NotarizationRequestDetailsResponseRecording.ts new file mode 100644 index 0000000..6300b3b --- /dev/null +++ b/src/models/NotarizationRequestDetailsResponseRecording.ts @@ -0,0 +1,56 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class NotarizationRequestDetailsResponseRecording { + /** + * Secure URL to download video recording of the notarization session. + */ + 'url'?: string; + /** + * Name of the video recording file. + */ + 'name'?: string; + /** + * Size of the video recording file in bytes. + */ + 'size'?: number; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "url", + "baseName": "url", + "type": "string", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "size", + "baseName": "size", + "type": "number", + "format": "" + } ]; + + static getAttributeTypeMap() { + return NotarizationRequestDetailsResponseRecording.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/NotarizationRequestDetailsResponseSignedDocumentsInner.ts b/src/models/NotarizationRequestDetailsResponseSignedDocumentsInner.ts new file mode 100644 index 0000000..c76572b --- /dev/null +++ b/src/models/NotarizationRequestDetailsResponseSignedDocumentsInner.ts @@ -0,0 +1,72 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class NotarizationRequestDetailsResponseSignedDocumentsInner { + /** + * Secure URL to download signed PDF document. + */ + 'url'?: string; + /** + * A signer document name. + */ + 'documentName'?: string; + /** + * A signer document size in bytes. + */ + 'size'?: number; + /** + * A type of the signed document. + */ + 'documentType'?: NotarizationRequestDetailsResponseSignedDocumentsInnerDocumentTypeEnum; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "url", + "baseName": "url", + "type": "string", + "format": "" + }, + { + "name": "documentName", + "baseName": "document_name", + "type": "string", + "format": "" + }, + { + "name": "size", + "baseName": "size", + "type": "number", + "format": "" + }, + { + "name": "documentType", + "baseName": "document_type", + "type": "NotarizationRequestDetailsResponseSignedDocumentsInnerDocumentTypeEnum", + "format": "" + } ]; + + static getAttributeTypeMap() { + return NotarizationRequestDetailsResponseSignedDocumentsInner.attributeTypeMap; + } + + public constructor() { + } +} + +export enum NotarizationRequestDetailsResponseSignedDocumentsInnerDocumentTypeEnum { + Combined = 'COMBINED', + Single = 'SINGLE' +} + diff --git a/src/models/OAuth2AccessTokenResponse.ts b/src/models/OAuth2AccessTokenResponse.ts index 8ccf38d..095492c 100644 --- a/src/models/OAuth2AccessTokenResponse.ts +++ b/src/models/OAuth2AccessTokenResponse.ts @@ -18,6 +18,8 @@ export class OAuth2AccessTokenResponse { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "accessToken", @@ -57,4 +59,3 @@ export class OAuth2AccessTokenResponse { public constructor() { } } - diff --git a/src/models/ObjectSerializer.ts b/src/models/ObjectSerializer.ts index a587a8f..16a1549 100644 --- a/src/models/ObjectSerializer.ts +++ b/src/models/ObjectSerializer.ts @@ -1,314 +1,737 @@ -export * from './APILogDetailsResponse'; -export * from './APILogListResponse'; -export * from './APILogListResponseResults'; -export * from './AddMemberRequest'; -export * from './AddMemberResponse'; -export * from './ContactCreateRequest'; -export * from './ContactDetailsResponse'; -export * from './ContactListResponse'; -export * from './ContactUpdateRequest'; -export * from './ContentLibraryItemListResponse'; -export * from './ContentLibraryItemListResponseResults'; -export * from './ContentLibraryItemResponse'; -export * from './ContentLibraryItemResponseCreatedBy'; -export * from './CreateUserRequest'; -export * from './CreateUserRequestUser'; -export * from './CreateUserRequestWorkspaces'; -export * from './CreateUserResponse'; -export * from './CreateWorkspaceRequest'; -export * from './CreateWorkspaceResponse'; -export * from './DocumentAttachmentResponse'; -export * from './DocumentAttachmentResponseCreatedBy'; -export * from './DocumentCreateByPdfRequest'; -export * from './DocumentCreateByTemplateRequest'; -export * from './DocumentCreateByTemplateRequestContentLibraryItems'; -export * from './DocumentCreateByTemplateRequestContentPlaceholders'; -export * from './DocumentCreateByTemplateRequestImages'; -export * from './DocumentCreateByTemplateRequestRecipients'; -export * from './DocumentCreateByTemplateRequestTokens'; -export * from './DocumentCreateLinkRequest'; -export * from './DocumentCreateLinkResponse'; -export * from './DocumentCreateRequest'; -export * from './DocumentCreateRequestContentLibraryItems'; -export * from './DocumentCreateRequestContentPlaceholders'; -export * from './DocumentCreateRequestImages'; -export * from './DocumentCreateRequestRecipients'; -export * from './DocumentCreateResponse'; -export * from './DocumentCreateResponseLinks'; -export * from './DocumentDetailsResponse'; -export * from './DocumentDetailsResponseCreatedBy'; -export * from './DocumentDetailsResponseGrandTotal'; -export * from './DocumentDetailsResponseLinkedObjects'; -export * from './DocumentDetailsResponseRecipients'; -export * from './DocumentDetailsResponseTemplate'; -export * from './DocumentListResponse'; -export * from './DocumentListResponseResults'; -export * from './DocumentOrderingFieldsEnum'; -export * from './DocumentRecipientCreateRequest'; -export * from './DocumentRecipientEditRequest'; -export * from './DocumentRecipientResponse'; -export * from './DocumentSendRequest'; -export * from './DocumentSendRequestForwardingSettings'; -export * from './DocumentSendRequestSelectedApprovers'; -export * from './DocumentSendRequestSelectedApproversGroup'; -export * from './DocumentSendRequestSelectedApproversGroupAssignees'; -export * from './DocumentSendRequestSelectedApproversSteps'; -export * from './DocumentSendResponse'; -export * from './DocumentSendResponseRecipients'; -export * from './DocumentStatusChangeRequest'; -export * from './DocumentStatusEnum'; -export * from './DocumentStatusRequestEnum'; -export * from './DocumentStatusResponse'; -export * from './DocumentTransferAllOwnershipRequest'; -export * from './DocumentTransferOwnershipRequest'; -export * from './DocumentUpdateRequest'; -export * from './DocumentUpdateRequestRecipients'; -export * from './DocumentsFolderCreateRequest'; -export * from './DocumentsFolderCreateResponse'; -export * from './DocumentsFolderListResponse'; -export * from './DocumentsFolderListResponseResults'; -export * from './DocumentsFolderRenameRequest'; -export * from './DocumentsFolderRenameResponse'; -export * from './FormListResponse'; -export * from './FormListResponseResults'; -export * from './LinkedObjectCreateRequest'; -export * from './LinkedObjectCreateResponse'; -export * from './LinkedObjectListResponse'; -export * from './MemberDetailsResponse'; -export * from './MemberListResponse'; -export * from './OAuth2AccessTokenResponse'; -export * from './PricingResponse'; -export * from './PricingTableRequest'; -export * from './PricingTableRequestRowOptions'; -export * from './PricingTableRequestRows'; -export * from './PricingTableRequestSections'; -export * from './PricingTableResponse'; -export * from './PricingTableResponseDiscount'; -export * from './PricingTableResponseItems'; -export * from './PricingTableResponseOptions'; -export * from './PricingTableResponseSummary'; -export * from './QuoteResponse'; -export * from './QuoteResponseAction'; -export * from './QuoteResponseCondition'; -export * from './QuoteResponseConditionComparison'; -export * from './QuoteResponseMergeRules'; -export * from './QuoteResponseOptions'; -export * from './QuoteResponseSectionColumn'; -export * from './QuoteResponseSectionItem'; -export * from './QuoteResponseSectionSummary'; -export * from './QuoteResponseSections'; -export * from './QuoteResponseSettings'; -export * from './QuoteResponseSummary'; -export * from './QuoteResponseSummaryDiscounts'; -export * from './QuoteResponseSummaryRecurringSubtotal'; -export * from './QuoteSectionSettings'; -export * from './QuoteUpdateRequest'; -export * from './QuoteUpdateRequestDiscounts'; -export * from './QuoteUpdateRequestOptions'; -export * from './QuoteUpdateRequestPriceSettings'; -export * from './QuoteUpdateRequestPriceSettingsTiers'; -export * from './QuoteUpdateRequestSettings'; -export * from './QuoteUpdateRequestSettings1'; -export * from './RecipientRedirect'; -export * from './RecipientVerificationSettings'; -export * from './RecipientVerificationSettingsPasscodeVerification'; -export * from './RecipientVerificationSettingsPhoneVerification'; -export * from './RicipientDeliveryMethods'; -export * from './SectionInfoResponse'; -export * from './TemplateDetailsResponse'; -export * from './TemplateDetailsResponseContentPlaceholders'; -export * from './TemplateDetailsResponseImages'; -export * from './TemplateDetailsResponsePreassignedPerson'; -export * from './TemplateDetailsResponseRoles'; -export * from './TemplateDetailsResponseTokens'; -export * from './TemplateListResponse'; -export * from './TemplateListResponseResults'; -export * from './TemplatesFolderCreateRequest'; -export * from './TemplatesFolderCreateResponse'; -export * from './TemplatesFolderListResponse'; -export * from './TemplatesFolderListResponseResults'; -export * from './TemplatesFolderRenameRequest'; -export * from './TemplatesFolderRenameResponse'; -export * from './UpdateIntegrationQuoteSection'; -export * from './UpdateIntegrationQuoteSectionItem'; -export * from './UploadSectionByPdfRequest'; -export * from './UploadSectionByTemplateRequest'; -export * from './UploadSectionListResponse'; -export * from './UploadSectionListResponseResults'; -export * from './UploadSectionRequest'; -export * from './UploadSectionResponse'; -export * from './UploadSectionStatusEnum'; -export * from './UploadSectionStatusResponse'; -export * from './WebhookEventDetailsResponse'; -export * from './WebhookEventErrorEnum'; -export * from './WebhookEventHttpStatusCodeGroupEnum'; -export * from './WebhookEventItemResponse'; -export * from './WebhookEventPageResponse'; -export * from './WebhookEventTriggerEnum'; -export * from './WebhookSubscriptionCreateRequest'; -export * from './WebhookSubscriptionItemResponse'; -export * from './WebhookSubscriptionListResponse'; -export * from './WebhookSubscriptionPatchRequest'; -export * from './WebhookSubscriptionPayloadEnum'; -export * from './WebhookSubscriptionSharedKeyResponse'; -export * from './WebhookSubscriptionStatusEnum'; -export * from './WebhookSubscriptionTriggerEnum'; - -import { APILogDetailsResponse } from './APILogDetailsResponse'; -import { APILogListResponse } from './APILogListResponse'; -import { APILogListResponseResults } from './APILogListResponseResults'; -import { AddMemberRequest , AddMemberRequestRoleEnum } from './AddMemberRequest'; -import { AddMemberResponse , AddMemberResponseRoleEnum } from './AddMemberResponse'; -import { ContactCreateRequest } from './ContactCreateRequest'; -import { ContactDetailsResponse } from './ContactDetailsResponse'; -import { ContactListResponse } from './ContactListResponse'; -import { ContactUpdateRequest } from './ContactUpdateRequest'; -import { ContentLibraryItemListResponse } from './ContentLibraryItemListResponse'; -import { ContentLibraryItemListResponseResults } from './ContentLibraryItemListResponseResults'; -import { ContentLibraryItemResponse } from './ContentLibraryItemResponse'; -import { ContentLibraryItemResponseCreatedBy } from './ContentLibraryItemResponseCreatedBy'; -import { CreateUserRequest , CreateUserRequestLicenseEnum } from './CreateUserRequest'; -import { CreateUserRequestUser } from './CreateUserRequestUser'; -import { CreateUserRequestWorkspaces , CreateUserRequestWorkspacesRoleEnum } from './CreateUserRequestWorkspaces'; -import { CreateUserResponse } from './CreateUserResponse'; -import { CreateWorkspaceRequest } from './CreateWorkspaceRequest'; -import { CreateWorkspaceResponse } from './CreateWorkspaceResponse'; -import { DocumentAttachmentResponse } from './DocumentAttachmentResponse'; -import { DocumentAttachmentResponseCreatedBy } from './DocumentAttachmentResponseCreatedBy'; -import { DocumentCreateByPdfRequest } from './DocumentCreateByPdfRequest'; -import { DocumentCreateByTemplateRequest } from './DocumentCreateByTemplateRequest'; -import { DocumentCreateByTemplateRequestContentLibraryItems } from './DocumentCreateByTemplateRequestContentLibraryItems'; -import { DocumentCreateByTemplateRequestContentPlaceholders } from './DocumentCreateByTemplateRequestContentPlaceholders'; -import { DocumentCreateByTemplateRequestImages } from './DocumentCreateByTemplateRequestImages'; -import { DocumentCreateByTemplateRequestRecipients } from './DocumentCreateByTemplateRequestRecipients'; -import { DocumentCreateByTemplateRequestTokens } from './DocumentCreateByTemplateRequestTokens'; -import { DocumentCreateLinkRequest } from './DocumentCreateLinkRequest'; -import { DocumentCreateLinkResponse } from './DocumentCreateLinkResponse'; -import { DocumentCreateRequest } from './DocumentCreateRequest'; -import { DocumentCreateRequestContentLibraryItems } from './DocumentCreateRequestContentLibraryItems'; -import { DocumentCreateRequestContentPlaceholders } from './DocumentCreateRequestContentPlaceholders'; -import { DocumentCreateRequestImages } from './DocumentCreateRequestImages'; -import { DocumentCreateRequestRecipients } from './DocumentCreateRequestRecipients'; -import { DocumentCreateResponse } from './DocumentCreateResponse'; -import { DocumentCreateResponseLinks } from './DocumentCreateResponseLinks'; -import { DocumentDetailsResponse } from './DocumentDetailsResponse'; -import { DocumentDetailsResponseCreatedBy } from './DocumentDetailsResponseCreatedBy'; -import { DocumentDetailsResponseGrandTotal } from './DocumentDetailsResponseGrandTotal'; -import { DocumentDetailsResponseLinkedObjects } from './DocumentDetailsResponseLinkedObjects'; -import { DocumentDetailsResponseRecipients } from './DocumentDetailsResponseRecipients'; -import { DocumentDetailsResponseTemplate } from './DocumentDetailsResponseTemplate'; -import { DocumentListResponse } from './DocumentListResponse'; -import { DocumentListResponseResults } from './DocumentListResponseResults'; -import { DocumentOrderingFieldsEnum } from './DocumentOrderingFieldsEnum'; -import { DocumentRecipientCreateRequest , DocumentRecipientCreateRequestKindEnum } from './DocumentRecipientCreateRequest'; -import { DocumentRecipientEditRequest } from './DocumentRecipientEditRequest'; -import { DocumentRecipientResponse } from './DocumentRecipientResponse'; -import { DocumentSendRequest } from './DocumentSendRequest'; -import { DocumentSendRequestForwardingSettings } from './DocumentSendRequestForwardingSettings'; -import { DocumentSendRequestSelectedApprovers } from './DocumentSendRequestSelectedApprovers'; -import { DocumentSendRequestSelectedApproversGroup } from './DocumentSendRequestSelectedApproversGroup'; -import { DocumentSendRequestSelectedApproversGroupAssignees } from './DocumentSendRequestSelectedApproversGroupAssignees'; -import { DocumentSendRequestSelectedApproversSteps } from './DocumentSendRequestSelectedApproversSteps'; -import { DocumentSendResponse } from './DocumentSendResponse'; -import { DocumentSendResponseRecipients } from './DocumentSendResponseRecipients'; -import { DocumentStatusChangeRequest } from './DocumentStatusChangeRequest'; -import { DocumentStatusEnum } from './DocumentStatusEnum'; -import { DocumentStatusRequestEnum } from './DocumentStatusRequestEnum'; -import { DocumentStatusResponse } from './DocumentStatusResponse'; -import { DocumentTransferAllOwnershipRequest } from './DocumentTransferAllOwnershipRequest'; -import { DocumentTransferOwnershipRequest } from './DocumentTransferOwnershipRequest'; -import { DocumentUpdateRequest } from './DocumentUpdateRequest'; -import { DocumentUpdateRequestRecipients } from './DocumentUpdateRequestRecipients'; -import { DocumentsFolderCreateRequest } from './DocumentsFolderCreateRequest'; -import { DocumentsFolderCreateResponse } from './DocumentsFolderCreateResponse'; -import { DocumentsFolderListResponse } from './DocumentsFolderListResponse'; -import { DocumentsFolderListResponseResults } from './DocumentsFolderListResponseResults'; -import { DocumentsFolderRenameRequest } from './DocumentsFolderRenameRequest'; -import { DocumentsFolderRenameResponse } from './DocumentsFolderRenameResponse'; -import { FormListResponse } from './FormListResponse'; -import { FormListResponseResults } from './FormListResponseResults'; -import { LinkedObjectCreateRequest } from './LinkedObjectCreateRequest'; -import { LinkedObjectCreateResponse } from './LinkedObjectCreateResponse'; -import { LinkedObjectListResponse } from './LinkedObjectListResponse'; -import { MemberDetailsResponse } from './MemberDetailsResponse'; -import { MemberListResponse } from './MemberListResponse'; -import { OAuth2AccessTokenResponse } from './OAuth2AccessTokenResponse'; -import { PricingResponse } from './PricingResponse'; -import { PricingTableRequest } from './PricingTableRequest'; -import { PricingTableRequestRowOptions } from './PricingTableRequestRowOptions'; -import { PricingTableRequestRows } from './PricingTableRequestRows'; -import { PricingTableRequestSections } from './PricingTableRequestSections'; -import { PricingTableResponse } from './PricingTableResponse'; -import { PricingTableResponseDiscount } from './PricingTableResponseDiscount'; -import { PricingTableResponseItems } from './PricingTableResponseItems'; -import { PricingTableResponseOptions } from './PricingTableResponseOptions'; -import { PricingTableResponseSummary } from './PricingTableResponseSummary'; -import { QuoteResponse } from './QuoteResponse'; -import { QuoteResponseAction } from './QuoteResponseAction'; -import { QuoteResponseCondition } from './QuoteResponseCondition'; -import { QuoteResponseConditionComparison } from './QuoteResponseConditionComparison'; -import { QuoteResponseMergeRules } from './QuoteResponseMergeRules'; -import { QuoteResponseOptions } from './QuoteResponseOptions'; -import { QuoteResponseSectionColumn } from './QuoteResponseSectionColumn'; -import { QuoteResponseSectionItem } from './QuoteResponseSectionItem'; -import { QuoteResponseSectionSummary } from './QuoteResponseSectionSummary'; -import { QuoteResponseSections } from './QuoteResponseSections'; -import { QuoteResponseSettings, QuoteResponseSettingsSelectionTypeEnum } from './QuoteResponseSettings'; -import { QuoteResponseSummary } from './QuoteResponseSummary'; -import { QuoteResponseSummaryDiscounts } from './QuoteResponseSummaryDiscounts'; -import { QuoteResponseSummaryRecurringSubtotal } from './QuoteResponseSummaryRecurringSubtotal'; -import { QuoteSectionSettings , QuoteSectionSettingsSelectionTypeEnum } from './QuoteSectionSettings'; -import { QuoteUpdateRequest } from './QuoteUpdateRequest'; -import { QuoteUpdateRequestDiscounts, QuoteUpdateRequestDiscountsTypeEnum } from './QuoteUpdateRequestDiscounts'; -import { QuoteUpdateRequestOptions } from './QuoteUpdateRequestOptions'; -import { QuoteUpdateRequestPriceSettings } from './QuoteUpdateRequestPriceSettings'; -import { QuoteUpdateRequestPriceSettingsTiers } from './QuoteUpdateRequestPriceSettingsTiers'; -import { QuoteUpdateRequestSettings , QuoteUpdateRequestSettingsSelectionTypeEnum } from './QuoteUpdateRequestSettings'; -import { QuoteUpdateRequestSettings1, QuoteUpdateRequestSettings1SelectionTypeEnum } from './QuoteUpdateRequestSettings1'; -import { RecipientRedirect } from './RecipientRedirect'; -import { RecipientVerificationSettings, RecipientVerificationSettingsVerificationPlaceEnum } from './RecipientVerificationSettings'; -import { RecipientVerificationSettingsPasscodeVerification } from './RecipientVerificationSettingsPasscodeVerification'; -import { RecipientVerificationSettingsPhoneVerification } from './RecipientVerificationSettingsPhoneVerification'; -import { RicipientDeliveryMethods } from './RicipientDeliveryMethods'; -import { SectionInfoResponse } from './SectionInfoResponse'; -import { TemplateDetailsResponse } from './TemplateDetailsResponse'; -import { TemplateDetailsResponseContentPlaceholders } from './TemplateDetailsResponseContentPlaceholders'; -import { TemplateDetailsResponseImages } from './TemplateDetailsResponseImages'; -import { TemplateDetailsResponsePreassignedPerson } from './TemplateDetailsResponsePreassignedPerson'; -import { TemplateDetailsResponseRoles } from './TemplateDetailsResponseRoles'; -import { TemplateDetailsResponseTokens } from './TemplateDetailsResponseTokens'; -import { TemplateListResponse } from './TemplateListResponse'; -import { TemplateListResponseResults } from './TemplateListResponseResults'; -import { TemplatesFolderCreateRequest } from './TemplatesFolderCreateRequest'; -import { TemplatesFolderCreateResponse } from './TemplatesFolderCreateResponse'; -import { TemplatesFolderListResponse } from './TemplatesFolderListResponse'; -import { TemplatesFolderListResponseResults } from './TemplatesFolderListResponseResults'; -import { TemplatesFolderRenameRequest } from './TemplatesFolderRenameRequest'; -import { TemplatesFolderRenameResponse } from './TemplatesFolderRenameResponse'; -import { UpdateIntegrationQuoteSection } from './UpdateIntegrationQuoteSection'; -import { UpdateIntegrationQuoteSectionItem , UpdateIntegrationQuoteSectionItemBillingFrequencyEnum } from './UpdateIntegrationQuoteSectionItem'; -import { UploadSectionByPdfRequest } from './UploadSectionByPdfRequest'; -import { UploadSectionByTemplateRequest } from './UploadSectionByTemplateRequest'; -import { UploadSectionListResponse } from './UploadSectionListResponse'; -import { UploadSectionListResponseResults } from './UploadSectionListResponseResults'; -import { UploadSectionRequest } from './UploadSectionRequest'; -import { UploadSectionResponse } from './UploadSectionResponse'; -import { UploadSectionStatusEnum } from './UploadSectionStatusEnum'; -import { UploadSectionStatusResponse } from './UploadSectionStatusResponse'; -import { WebhookEventDetailsResponse } from './WebhookEventDetailsResponse'; -import { WebhookEventErrorEnum } from './WebhookEventErrorEnum'; -import { WebhookEventHttpStatusCodeGroupEnum } from './WebhookEventHttpStatusCodeGroupEnum'; -import { WebhookEventItemResponse } from './WebhookEventItemResponse'; -import { WebhookEventPageResponse } from './WebhookEventPageResponse'; -import { WebhookEventTriggerEnum } from './WebhookEventTriggerEnum'; -import { WebhookSubscriptionCreateRequest } from './WebhookSubscriptionCreateRequest'; -import { WebhookSubscriptionItemResponse } from './WebhookSubscriptionItemResponse'; -import { WebhookSubscriptionListResponse } from './WebhookSubscriptionListResponse'; -import { WebhookSubscriptionPatchRequest } from './WebhookSubscriptionPatchRequest'; -import { WebhookSubscriptionPayloadEnum } from './WebhookSubscriptionPayloadEnum'; -import { WebhookSubscriptionSharedKeyResponse } from './WebhookSubscriptionSharedKeyResponse'; -import { WebhookSubscriptionStatusEnum } from './WebhookSubscriptionStatusEnum'; -import { WebhookSubscriptionTriggerEnum } from './WebhookSubscriptionTriggerEnum'; +export * from '../models/APILogDetailsResponse'; +export * from '../models/APILogListResponse'; +export * from '../models/APILogListResponseResultsInner'; +export * from '../models/AccessToken400Response'; +export * from '../models/AddDsvNamedItemsRequest'; +export * from '../models/AddDsvNamedItemsRequestItemsInner'; +export * from '../models/AddDsvNamedItemsResponse'; +export * from '../models/AddDsvNamedItemsResponseResultsInner'; +export * from '../models/AddMember400Response'; +export * from '../models/AddMemberRequest'; +export * from '../models/AddMemberResponse'; +export * from '../models/ApiKeyTypeEnum'; +export * from '../models/ApiLogEnvironmentTypeEnum'; +export * from '../models/ApiLogMethodEnum'; +export * from '../models/ApiLogStatusEnum'; +export * from '../models/AppendCLIDataRequest'; +export * from '../models/AppendCLIDataRequestCli'; +export * from '../models/AppendCLIDataRequestCliPagesInner'; +export * from '../models/AppendCLIDataResponse'; +export * from '../models/AppendCLIDataResponseBlockMapping'; +export * from '../models/AppendCLIDataResponseBlockMappingImagesInner'; +export * from '../models/AppendCLIDataResponseBlockMappingPricingTablesInner'; +export * from '../models/AppendCLIDataResponseBlockMappingTablesInner'; +export * from '../models/AppendCLIDataResponseBlockMappingTextsInner'; +export * from '../models/AppendCLIDataResponseCli'; +export * from '../models/AppendCLIDataResponseCliPagesInner'; +export * from '../models/AssignedToRecipientDeliveryMethods'; +export * from '../models/AutoReminders'; +export * from '../models/BaseActor'; +export * from '../models/BaseEditingSessionResponse'; +export * from '../models/BaseField'; +export * from '../models/BaseFieldAssignedTo'; +export * from '../models/BaseIdentity'; +export * from '../models/ChangeDocumentStatus409Response'; +export * from '../models/Checkbox'; +export * from '../models/CollectFile'; +export * from '../models/CollectFileAllOfValue'; +export * from '../models/ContactCreateRequest'; +export * from '../models/ContactDetailsResponse'; +export * from '../models/ContactListResponse'; +export * from '../models/ContactUpdateRequest'; +export * from '../models/ContentLibraryItemCreateFromUrlRequest'; +export * from '../models/ContentLibraryItemCreateRequest'; +export * from '../models/ContentLibraryItemListResponse'; +export * from '../models/ContentLibraryItemListResponseResultsInner'; +export * from '../models/ContentLibraryItemResponse'; +export * from '../models/ContentLibraryItemResponseCreatedBy'; +export * from '../models/ContentLibraryResponse'; +export * from '../models/CreateApiKeyRequest'; +export * from '../models/CreateApiKeyResponse'; +export * from '../models/CreateDocument400Response'; +export * from '../models/CreateDocumentActor'; +export * from '../models/CreateDocumentEditingSession201Response'; +export * from '../models/CreateDocumentFieldsRequest'; +export * from '../models/CreateDocumentFieldsResponse'; +export * from '../models/CreateDocumentRecipient'; +export * from '../models/CreateDocumentRecipientGroup'; +export * from '../models/CreateMemberTokenRequest'; +export * from '../models/CreateMemberTokenResponse'; +export * from '../models/CreateNotarizationRequest'; +export * from '../models/CreateNotarizationRequestInvitation'; +export * from '../models/CreateNotarizationRequestInvitationInviteesInner'; +export * from '../models/CreateNotarizationRequestNotary'; +export * from '../models/CreateNotarizationResponse'; +export * from '../models/CreateNotarizationResponseCreatedBy'; +export * from '../models/CreateNotarizationResponseInviteesInner'; +export * from '../models/CreateTemplateEditingSession201Response'; +export * from '../models/CreateTemplateFromUrlRequest'; +export * from '../models/CreateTemplateRequest'; +export * from '../models/CreateTemplateRequestOwner'; +export * from '../models/CreateUser400Response'; +export * from '../models/CreateUserRequest'; +export * from '../models/CreateUserRequestUser'; +export * from '../models/CreateUserRequestWorkspacesInner'; +export * from '../models/CreateUserResponse'; +export * from '../models/CreateUserResponseWorkspacesInner'; +export * from '../models/CreateWorkspaceRequest'; +export * from '../models/CreateWorkspaceResponse'; +export * from '../models/DeleteNotarizationRequest404Response'; +export * from '../models/DocumentAttachmentMetadata'; +export * from '../models/DocumentAttachmentRequest'; +export * from '../models/DocumentAttachmentResponse'; +export * from '../models/DocumentAttachmentResponseCreatedBy'; +export * from '../models/DocumentAuditTrailResponse'; +export * from '../models/DocumentAuditTrailResponseResultsInner'; +export * from '../models/DocumentAuditTrailResponseResultsInnerUser'; +export * from '../models/DocumentAutoRemindersResponse'; +export * from '../models/DocumentAutoRemindersResponse400'; +export * from '../models/DocumentAutoRemindersResponseResultInner'; +export * from '../models/DocumentCreateByPdfRequest'; +export * from '../models/DocumentCreateByTemplateRequest'; +export * from '../models/DocumentCreateByTemplateRequestContentPlaceholdersInner'; +export * from '../models/DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInner'; +export * from '../models/DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInnerRecipientsInner'; +export * from '../models/DocumentCreateByTemplateRequestFieldsValue'; +export * from '../models/DocumentCreateByTemplateRequestFieldsValueValue'; +export * from '../models/DocumentCreateByTemplateRequestImagesInner'; +export * from '../models/DocumentCreateByTemplateRequestOwner'; +export * from '../models/DocumentCreateByTemplateRequestTextsInner'; +export * from '../models/DocumentCreateByTemplateRequestTokensInner'; +export * from '../models/DocumentCreateLinkRequest'; +export * from '../models/DocumentCreateLinkResponse'; +export * from '../models/DocumentCreateRequest'; +export * from '../models/DocumentCreateRequestOneOf'; +export * from '../models/DocumentCreateRequestOneOf1'; +export * from '../models/DocumentCreateResponse'; +export * from '../models/DocumentCreateResponseLinksInner'; +export * from '../models/DocumentDeliveryMethodEnum'; +export * from '../models/DocumentDetailsRecipient'; +export * from '../models/DocumentDetailsRecipientGroup'; +export * from '../models/DocumentDetailsRecipientGroupMember'; +export * from '../models/DocumentDetailsResponse'; +export * from '../models/DocumentDetailsResponseCreatedBy'; +export * from '../models/DocumentDetailsResponseGrandTotal'; +export * from '../models/DocumentDetailsResponseImagesInner'; +export * from '../models/DocumentDetailsResponseLinkedObjectsInner'; +export * from '../models/DocumentDetailsResponseLinkedObjectsInnerChildrenInner'; +export * from '../models/DocumentDetailsResponseRecipientsInner'; +export * from '../models/DocumentDetailsResponseTablesInner'; +export * from '../models/DocumentDetailsResponseTemplate'; +export * from '../models/DocumentDetailsResponseTextsInner'; +export * from '../models/DocumentDocxExport'; +export * from '../models/DocumentDocxExportStatusEnum'; +export * from '../models/DocumentESignDisclosure'; +export * from '../models/DocumentESignDisclosureResult'; +export * from '../models/DocumentFieldAnchorPointEnum'; +export * from '../models/DocumentFieldTypeEnum'; +export * from '../models/DocumentFieldsField'; +export * from '../models/DocumentFieldsFieldAssignedTo'; +export * from '../models/DocumentFieldsFieldCreate'; +export * from '../models/DocumentFieldsLayout'; +export * from '../models/DocumentFieldsLayoutPosition'; +export * from '../models/DocumentFieldsLayoutStyle'; +export * from '../models/DocumentLanguageEnum'; +export * from '../models/DocumentListResponse'; +export * from '../models/DocumentListResponseResultsInner'; +export * from '../models/DocumentOrderingFieldsEnum'; +export * from '../models/DocumentRecipientCreateRequest'; +export * from '../models/DocumentRecipientEditRequest'; +export * from '../models/DocumentRecipientResponse'; +export * from '../models/DocumentRevertToDraftResponse'; +export * from '../models/DocumentSendManualReminder200Response'; +export * from '../models/DocumentSendManualReminder200ResponseResultInner'; +export * from '../models/DocumentSendManualReminder200ResponseResultInnerEmail'; +export * from '../models/DocumentSendManualReminder200ResponseResultInnerEmailCustomization'; +export * from '../models/DocumentSendManualReminder200ResponseResultInnerSms'; +export * from '../models/DocumentSendManualReminder409Response'; +export * from '../models/DocumentSendManualReminderRequest'; +export * from '../models/DocumentSendManualReminderRequestRemindersInner'; +export * from '../models/DocumentSendManualReminderRequestRemindersInnerEmailCustomization'; +export * from '../models/DocumentSendRequest'; +export * from '../models/DocumentSendRequestForwardingSettings'; +export * from '../models/DocumentSendRequestSelectedApprovers'; +export * from '../models/DocumentSendRequestSelectedApproversStepsInner'; +export * from '../models/DocumentSendRequestSelectedApproversStepsInnerGroup'; +export * from '../models/DocumentSendRequestSelectedApproversStepsInnerGroupAssigneesInner'; +export * from '../models/DocumentSendRequestSender'; +export * from '../models/DocumentSendResponse'; +export * from '../models/DocumentSendResponseRecipientsInner'; +export * from '../models/DocumentSettingsResponse'; +export * from '../models/DocumentStatusChangeRequest'; +export * from '../models/DocumentStatusChangeRequestStatusEnum'; +export * from '../models/DocumentStatusEnum'; +export * from '../models/DocumentStatusRequestEnum'; +export * from '../models/DocumentStatusResponse'; +export * from '../models/DocumentTransferAllOwnershipRequest'; +export * from '../models/DocumentTransferOwnershipRequest'; +export * from '../models/DocumentUpdateRequest'; +export * from '../models/DocumentUpdateRequestFieldValue'; +export * from '../models/DocumentUpdateRequestImagesInner'; +export * from '../models/DocumentUpdateRequestTextsInner'; +export * from '../models/DocumentUpdateRequestTokensInner'; +export * from '../models/DocumentsFolderCreateRequest'; +export * from '../models/DocumentsFolderCreateResponse'; +export * from '../models/DocumentsFolderListResponse'; +export * from '../models/DocumentsFolderListResponseResultsInner'; +export * from '../models/DocumentsFolderRenameRequest'; +export * from '../models/DocumentsFolderRenameResponse'; +export * from '../models/DocxExportTaskResponse'; +export * from '../models/DocxExportTaskResponseAllOfDocxItems'; +export * from '../models/Dropdown'; +export * from '../models/EditingSessionRequest'; +export * from '../models/Field'; +export * from '../models/FormListResponse'; +export * from '../models/FormListResponseResultsInner'; +export * from '../models/Initials'; +export * from '../models/LinkedObjectChild'; +export * from '../models/LinkedObjectCreateRequest'; +export * from '../models/LinkedObjectCreateResponse'; +export * from '../models/LinkedObjectListResponse'; +export * from '../models/ListCatalogItemsSearchResponse'; +export * from '../models/ListDocumentFieldsResponse'; +export * from '../models/ListDocuments400Response'; +export * from '../models/ListDocuments401Response'; +export * from '../models/ListDocuments403Response'; +export * from '../models/ListDocuments403ResponseLinksInner'; +export * from '../models/ListDocuments429Response'; +export * from '../models/ListDocumentsByLinkedObjectsResponseInner'; +export * from '../models/ListNotaries400Response'; +export * from '../models/ListNotaries400ResponseDetailsInner'; +export * from '../models/ListNotaries403Response'; +export * from '../models/ListNotaries429Response'; +export * from '../models/ListNotariesResponse'; +export * from '../models/ListNotariesResponseResultsInner'; +export * from '../models/ListSmsOptOutChangelogResponse'; +export * from '../models/ListSmsOptOutChangelogResponseResultsInner'; +export * from '../models/ListUsersResponse'; +export * from '../models/ListUsersResponseResultsInner'; +export * from '../models/ListUsersResponseResultsInnerWorkspacesInner'; +export * from '../models/ListWorkspacesResponse'; +export * from '../models/ListWorkspacesResponseResultsInner'; +export * from '../models/MemberDetailsResponse'; +export * from '../models/MemberListResponse'; +export * from '../models/ModelDate'; +export * from '../models/NotarizationRequestDetailsResponse'; +export * from '../models/NotarizationRequestDetailsResponseCreatedBy'; +export * from '../models/NotarizationRequestDetailsResponseInviteesInner'; +export * from '../models/NotarizationRequestDetailsResponseRecording'; +export * from '../models/NotarizationRequestDetailsResponseSignedDocumentsInner'; +export * from '../models/OAuth2AccessTokenResponse'; +export * from '../models/Payment'; +export * from '../models/PricingResponse'; +export * from '../models/PricingTableRequest'; +export * from '../models/PricingTableRequestRowOptions'; +export * from '../models/PricingTableRequestSectionsInner'; +export * from '../models/PricingTableRequestSectionsInnerRowsInner'; +export * from '../models/PricingTableResponse'; +export * from '../models/PricingTableResponseItemsInner'; +export * from '../models/PricingTableResponseItemsInnerDiscount'; +export * from '../models/PricingTableResponseItemsInnerOptions'; +export * from '../models/PricingTableResponseSummary'; +export * from '../models/ProductCatalogCatalogCustomBundleItem'; +export * from '../models/ProductCatalogCatalogItemInBundle'; +export * from '../models/ProductCatalogCustomBundleItemNoId'; +export * from '../models/ProductCatalogCustomCatalogItemInBundle'; +export * from '../models/ProductCatalogItemPatchRequest'; +export * from '../models/ProductCatalogItemPatchRequestBundleItemsInner'; +export * from '../models/ProductCatalogItemPatchRequestBundleItemsInnerItemOrUuid'; +export * from '../models/ProductCatalogItemPatchRequestProductVariant'; +export * from '../models/ProductCatalogItemPriceConfiguration'; +export * from '../models/ProductCatalogItemPriceTier'; +export * from '../models/ProductCatalogItemRequest'; +export * from '../models/ProductCatalogItemRequestBundleItemsInner'; +export * from '../models/ProductCatalogItemRequestBundleItemsInnerItemOrUuid'; +export * from '../models/ProductCatalogItemRequestCustomFieldsInner'; +export * from '../models/ProductCatalogItemRequestImagesInner'; +export * from '../models/ProductCatalogItemResponse'; +export * from '../models/ProductCatalogItemResponseBundleItemsInner'; +export * from '../models/ProductCatalogItemResponseBundleItemsInnerItem'; +export * from '../models/ProductCatalogItemResponseDefaultPriceConfiguration'; +export * from '../models/ProductCatalogItemResponseVariantsInner'; +export * from '../models/ProductCatalogPricingMethodEnum'; +export * from '../models/ProductCatalogSearchCatalogItemResponse'; +export * from '../models/ProductCatalogSearchCatalogItemResponseCustomFieldsInner'; +export * from '../models/ProductCatalogSearchCatalogItemResponseImagesInner'; +export * from '../models/ProductCatalogSearchCatalogItemResponseTiersInner'; +export * from '../models/ProductCatalogTypeEnum'; +export * from '../models/QuoteResponse'; +export * from '../models/QuoteResponseMergeRulesInner'; +export * from '../models/QuoteResponseMergeRulesInnerAction'; +export * from '../models/QuoteResponseMergeRulesInnerCondition'; +export * from '../models/QuoteResponseMergeRulesInnerConditionComparisonInner'; +export * from '../models/QuoteResponseSectionColumn'; +export * from '../models/QuoteResponseSectionItem'; +export * from '../models/QuoteResponseSectionItemOptions'; +export * from '../models/QuoteResponseSectionSummary'; +export * from '../models/QuoteResponseSectionsInner'; +export * from '../models/QuoteResponseSettings'; +export * from '../models/QuoteResponseSummary'; +export * from '../models/QuoteResponseSummaryDiscountsValue'; +export * from '../models/QuoteResponseSummaryRecurringSubtotalInner'; +export * from '../models/QuoteSectionSettings'; +export * from '../models/QuoteUpdateRequest'; +export * from '../models/QuoteUpdateRequestBillingFrequencyEnum'; +export * from '../models/QuoteUpdateRequestDiscountTypeEnum'; +export * from '../models/QuoteUpdateRequestSettings'; +export * from '../models/QuoteUpdateRequestSettingsSelectionTypeTypeEnum'; +export * from '../models/RadioButtons'; +export * from '../models/RecipientAssignedTo'; +export * from '../models/RecipientAssignmentDetails'; +export * from '../models/RecipientDeliveryMethods'; +export * from '../models/RecipientKindEnum'; +export * from '../models/RecipientPersonalDetails'; +export * from '../models/RecipientRedirect'; +export * from '../models/RecipientRedirectSettings'; +export * from '../models/RecipientVerificationPlaceEnum'; +export * from '../models/RecipientVerificationSettings'; +export * from '../models/RecipientVerificationSettingsIdVerification'; +export * from '../models/RecipientVerificationSettingsKbaVerification'; +export * from '../models/RecipientVerificationSettingsPasscodeVerification'; +export * from '../models/RecipientVerificationSettingsPhoneVerification'; +export * from '../models/RecipientsGroupAssignedTo'; +export * from '../models/RecipientsGroupAssignedToAllOfMembers'; +export * from '../models/RemoveMember400Response'; +export * from '../models/RemoveMember404Response'; +export * from '../models/SearchCatalogItems401Response'; +export * from '../models/SectionInfoResponse'; +export * from '../models/Signature'; +export * from '../models/Stamp'; +export * from '../models/StatusDocument404Response'; +export * from '../models/StatusDocumentAutoReminder400Response'; +export * from '../models/TableCell'; +export * from '../models/TableRequest'; +export * from '../models/TableRequestData'; +export * from '../models/TableRequestDataSectionsInner'; +export * from '../models/TemplateCreateResponse'; +export * from '../models/TemplateDetailsResponse'; +export * from '../models/TemplateDetailsResponseContentPlaceholdersInner'; +export * from '../models/TemplateDetailsResponseImagesInner'; +export * from '../models/TemplateDetailsResponseRolesInner'; +export * from '../models/TemplateDetailsResponseRolesInnerPreassignedPerson'; +export * from '../models/TemplateDetailsResponseRolesInnerPreassignedPersonMembersInner'; +export * from '../models/TemplateDetailsResponseTokensInner'; +export * from '../models/TemplateListResponse'; +export * from '../models/TemplateSettingsResponse'; +export * from '../models/TemplateStatusResponse'; +export * from '../models/TemplateUpdateRequest'; +export * from '../models/TemplatesFolderCreateRequest'; +export * from '../models/TemplatesFolderCreateResponse'; +export * from '../models/TemplatesFolderListResponse'; +export * from '../models/TemplatesFolderListResponseResultsInner'; +export * from '../models/TemplatesFolderRenameRequest'; +export * from '../models/TemplatesFolderRenameResponse'; +export * from '../models/Text'; +export * from '../models/UpdateDocument400Response'; +export * from '../models/UpdateDocumentActor'; +export * from '../models/UpdateDocumentAutoRemindersRequest'; +export * from '../models/UpdateDocumentAutoRemindersResponse'; +export * from '../models/UpdateDocumentRecipient'; +export * from '../models/UpdateDocumentRecipientGroup'; +export * from '../models/UpdateDocumentSettingsRequest'; +export * from '../models/UpdateIntegrationQuoteSection'; +export * from '../models/UpdateIntegrationQuoteSectionItem'; +export * from '../models/UpdateIntegrationQuoteSectionItemDiscountsValue'; +export * from '../models/UpdateIntegrationQuoteSectionItemOptions'; +export * from '../models/UpdateIntegrationQuoteSectionItemPriceSettings'; +export * from '../models/UpdateIntegrationQuoteSectionItemPriceSettingsTiersInner'; +export * from '../models/UpdateIntegrationQuoteSectionSettings'; +export * from '../models/UpdateTemplateSettingsRequest'; +export * from '../models/UploadSectionBase'; +export * from '../models/UploadSectionByTemplateRequest'; +export * from '../models/UploadSectionByTemplateRequestAllOfContentLibraryItems'; +export * from '../models/UploadSectionByTemplateRequestAllOfContentPlaceholders'; +export * from '../models/UploadSectionListResponse'; +export * from '../models/UploadSectionListResponseResultsInner'; +export * from '../models/UploadSectionRequest'; +export * from '../models/UploadSectionRequestOneOf'; +export * from '../models/UploadSectionResponse'; +export * from '../models/UploadSectionStatusEnum'; +export * from '../models/UploadSectionStatusResponse'; +export * from '../models/UserLicenseEnum'; +export * from '../models/WebhookEventDetailsResponse'; +export * from '../models/WebhookEventErrorEnum'; +export * from '../models/WebhookEventHttpStatusCodeGroupEnum'; +export * from '../models/WebhookEventItemResponse'; +export * from '../models/WebhookEventPageResponse'; +export * from '../models/WebhookEventTriggerEnum'; +export * from '../models/WebhookSubscriptionCreateRequest'; +export * from '../models/WebhookSubscriptionItemResponse'; +export * from '../models/WebhookSubscriptionListResponse'; +export * from '../models/WebhookSubscriptionPatchRequest'; +export * from '../models/WebhookSubscriptionPayloadEnum'; +export * from '../models/WebhookSubscriptionSharedKeyResponse'; +export * from '../models/WebhookSubscriptionStatusEnum'; +export * from '../models/WebhookSubscriptionTriggerEnum'; +export * from '../models/WorkspaceMemberRoleEnum'; + +import { APILogDetailsResponse } from '../models/APILogDetailsResponse'; +import { APILogListResponse } from '../models/APILogListResponse'; +import { APILogListResponseResultsInner } from '../models/APILogListResponseResultsInner'; +import { AccessToken400Response } from '../models/AccessToken400Response'; +import { AddDsvNamedItemsRequest } from '../models/AddDsvNamedItemsRequest'; +import { AddDsvNamedItemsRequestItemsInner } from '../models/AddDsvNamedItemsRequestItemsInner'; +import { AddDsvNamedItemsResponse } from '../models/AddDsvNamedItemsResponse'; +import { AddDsvNamedItemsResponseResultsInner } from '../models/AddDsvNamedItemsResponseResultsInner'; +import { AddMember400Response } from '../models/AddMember400Response'; +import { AddMemberRequest } from '../models/AddMemberRequest'; +import { AddMemberResponse } from '../models/AddMemberResponse'; +import { ApiKeyTypeEnum } from '../models/ApiKeyTypeEnum'; +import { ApiLogEnvironmentTypeEnum } from '../models/ApiLogEnvironmentTypeEnum'; +import { ApiLogMethodEnum } from '../models/ApiLogMethodEnum'; +import { ApiLogStatusEnum } from '../models/ApiLogStatusEnum'; +import { AppendCLIDataRequest } from '../models/AppendCLIDataRequest'; +import { AppendCLIDataRequestCli } from '../models/AppendCLIDataRequestCli'; +import { AppendCLIDataRequestCliPagesInner } from '../models/AppendCLIDataRequestCliPagesInner'; +import { AppendCLIDataResponse } from '../models/AppendCLIDataResponse'; +import { AppendCLIDataResponseBlockMapping } from '../models/AppendCLIDataResponseBlockMapping'; +import { AppendCLIDataResponseBlockMappingImagesInner } from '../models/AppendCLIDataResponseBlockMappingImagesInner'; +import { AppendCLIDataResponseBlockMappingPricingTablesInner } from '../models/AppendCLIDataResponseBlockMappingPricingTablesInner'; +import { AppendCLIDataResponseBlockMappingTablesInner } from '../models/AppendCLIDataResponseBlockMappingTablesInner'; +import { AppendCLIDataResponseBlockMappingTextsInner } from '../models/AppendCLIDataResponseBlockMappingTextsInner'; +import { AppendCLIDataResponseCli } from '../models/AppendCLIDataResponseCli'; +import { AppendCLIDataResponseCliPagesInner } from '../models/AppendCLIDataResponseCliPagesInner'; +import { AssignedToRecipientDeliveryMethods } from '../models/AssignedToRecipientDeliveryMethods'; +import { AutoReminders } from '../models/AutoReminders'; +import { BaseActor } from '../models/BaseActor'; +import { BaseEditingSessionResponse } from '../models/BaseEditingSessionResponse'; +import { BaseField } from '../models/BaseField'; +import { BaseFieldAssignedTo , BaseFieldAssignedToTypeEnum } from '../models/BaseFieldAssignedTo'; +import { BaseIdentity } from '../models/BaseIdentity'; +import { ChangeDocumentStatus409Response } from '../models/ChangeDocumentStatus409Response'; +import { Checkbox , CheckboxTypeEnum } from '../models/Checkbox'; +import { CollectFile , CollectFileTypeEnum } from '../models/CollectFile'; +import { CollectFileAllOfValue } from '../models/CollectFileAllOfValue'; +import { ContactCreateRequest } from '../models/ContactCreateRequest'; +import { ContactDetailsResponse } from '../models/ContactDetailsResponse'; +import { ContactListResponse } from '../models/ContactListResponse'; +import { ContactUpdateRequest } from '../models/ContactUpdateRequest'; +import { ContentLibraryItemCreateFromUrlRequest } from '../models/ContentLibraryItemCreateFromUrlRequest'; +import { ContentLibraryItemCreateRequest } from '../models/ContentLibraryItemCreateRequest'; +import { ContentLibraryItemListResponse } from '../models/ContentLibraryItemListResponse'; +import { ContentLibraryItemListResponseResultsInner } from '../models/ContentLibraryItemListResponseResultsInner'; +import { ContentLibraryItemResponse } from '../models/ContentLibraryItemResponse'; +import { ContentLibraryItemResponseCreatedBy } from '../models/ContentLibraryItemResponseCreatedBy'; +import { ContentLibraryResponse , ContentLibraryResponseStatusEnum } from '../models/ContentLibraryResponse'; +import { CreateApiKeyRequest } from '../models/CreateApiKeyRequest'; +import { CreateApiKeyResponse } from '../models/CreateApiKeyResponse'; +import { CreateDocument400Response } from '../models/CreateDocument400Response'; +import { CreateDocumentActor , CreateDocumentActorTypeEnum } from '../models/CreateDocumentActor'; +import { CreateDocumentEditingSession201Response } from '../models/CreateDocumentEditingSession201Response'; +import { CreateDocumentFieldsRequest } from '../models/CreateDocumentFieldsRequest'; +import { CreateDocumentFieldsResponse } from '../models/CreateDocumentFieldsResponse'; +import { CreateDocumentRecipient , CreateDocumentRecipientTypeEnum } from '../models/CreateDocumentRecipient'; +import { CreateDocumentRecipientGroup , CreateDocumentRecipientGroupTypeEnum } from '../models/CreateDocumentRecipientGroup'; +import { CreateMemberTokenRequest } from '../models/CreateMemberTokenRequest'; +import { CreateMemberTokenResponse } from '../models/CreateMemberTokenResponse'; +import { CreateNotarizationRequest } from '../models/CreateNotarizationRequest'; +import { CreateNotarizationRequestInvitation } from '../models/CreateNotarizationRequestInvitation'; +import { CreateNotarizationRequestInvitationInviteesInner } from '../models/CreateNotarizationRequestInvitationInviteesInner'; +import { CreateNotarizationRequestNotary } from '../models/CreateNotarizationRequestNotary'; +import { CreateNotarizationResponse , CreateNotarizationResponseStatusEnum } from '../models/CreateNotarizationResponse'; +import { CreateNotarizationResponseCreatedBy } from '../models/CreateNotarizationResponseCreatedBy'; +import { CreateNotarizationResponseInviteesInner } from '../models/CreateNotarizationResponseInviteesInner'; +import { CreateTemplateEditingSession201Response } from '../models/CreateTemplateEditingSession201Response'; +import { CreateTemplateFromUrlRequest } from '../models/CreateTemplateFromUrlRequest'; +import { CreateTemplateRequest } from '../models/CreateTemplateRequest'; +import { CreateTemplateRequestOwner } from '../models/CreateTemplateRequestOwner'; +import { CreateUser400Response } from '../models/CreateUser400Response'; +import { CreateUserRequest } from '../models/CreateUserRequest'; +import { CreateUserRequestUser } from '../models/CreateUserRequestUser'; +import { CreateUserRequestWorkspacesInner } from '../models/CreateUserRequestWorkspacesInner'; +import { CreateUserResponse } from '../models/CreateUserResponse'; +import { CreateUserResponseWorkspacesInner } from '../models/CreateUserResponseWorkspacesInner'; +import { CreateWorkspaceRequest } from '../models/CreateWorkspaceRequest'; +import { CreateWorkspaceResponse } from '../models/CreateWorkspaceResponse'; +import { DeleteNotarizationRequest404Response } from '../models/DeleteNotarizationRequest404Response'; +import { DocumentAttachmentMetadata } from '../models/DocumentAttachmentMetadata'; +import { DocumentAttachmentRequest } from '../models/DocumentAttachmentRequest'; +import { DocumentAttachmentResponse } from '../models/DocumentAttachmentResponse'; +import { DocumentAttachmentResponseCreatedBy } from '../models/DocumentAttachmentResponseCreatedBy'; +import { DocumentAuditTrailResponse } from '../models/DocumentAuditTrailResponse'; +import { DocumentAuditTrailResponseResultsInner } from '../models/DocumentAuditTrailResponseResultsInner'; +import { DocumentAuditTrailResponseResultsInnerUser } from '../models/DocumentAuditTrailResponseResultsInnerUser'; +import { DocumentAutoRemindersResponse } from '../models/DocumentAutoRemindersResponse'; +import { DocumentAutoRemindersResponse400 } from '../models/DocumentAutoRemindersResponse400'; +import { DocumentAutoRemindersResponseResultInner , DocumentAutoRemindersResponseResultInnerStatusEnum } from '../models/DocumentAutoRemindersResponseResultInner'; +import { DocumentCreateByPdfRequest } from '../models/DocumentCreateByPdfRequest'; +import { DocumentCreateByTemplateRequest } from '../models/DocumentCreateByTemplateRequest'; +import { DocumentCreateByTemplateRequestContentPlaceholdersInner } from '../models/DocumentCreateByTemplateRequestContentPlaceholdersInner'; +import { DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInner } from '../models/DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInner'; +import { DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInnerRecipientsInner } from '../models/DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInnerRecipientsInner'; +import { DocumentCreateByTemplateRequestFieldsValue } from '../models/DocumentCreateByTemplateRequestFieldsValue'; +import { DocumentCreateByTemplateRequestFieldsValueValueClass } from '../models/DocumentCreateByTemplateRequestFieldsValueValue'; +import { DocumentCreateByTemplateRequestImagesInner } from '../models/DocumentCreateByTemplateRequestImagesInner'; +import { DocumentCreateByTemplateRequestOwner } from '../models/DocumentCreateByTemplateRequestOwner'; +import { DocumentCreateByTemplateRequestTextsInner } from '../models/DocumentCreateByTemplateRequestTextsInner'; +import { DocumentCreateByTemplateRequestTokensInner } from '../models/DocumentCreateByTemplateRequestTokensInner'; +import { DocumentCreateLinkRequest } from '../models/DocumentCreateLinkRequest'; +import { DocumentCreateLinkResponse } from '../models/DocumentCreateLinkResponse'; +import { DocumentCreateRequestClass } from '../models/DocumentCreateRequest'; +import { DocumentCreateRequestOneOf } from '../models/DocumentCreateRequestOneOf'; +import { DocumentCreateRequestOneOf1 } from '../models/DocumentCreateRequestOneOf1'; +import { DocumentCreateResponse } from '../models/DocumentCreateResponse'; +import { DocumentCreateResponseLinksInner } from '../models/DocumentCreateResponseLinksInner'; +import { DocumentDeliveryMethodEnum } from '../models/DocumentDeliveryMethodEnum'; +import { DocumentDetailsRecipient , DocumentDetailsRecipientTypeEnum } from '../models/DocumentDetailsRecipient'; +import { DocumentDetailsRecipientGroup , DocumentDetailsRecipientGroupTypeEnum } from '../models/DocumentDetailsRecipientGroup'; +import { DocumentDetailsRecipientGroupMember } from '../models/DocumentDetailsRecipientGroupMember'; +import { DocumentDetailsResponse } from '../models/DocumentDetailsResponse'; +import { DocumentDetailsResponseCreatedBy } from '../models/DocumentDetailsResponseCreatedBy'; +import { DocumentDetailsResponseGrandTotal } from '../models/DocumentDetailsResponseGrandTotal'; +import { DocumentDetailsResponseImagesInner } from '../models/DocumentDetailsResponseImagesInner'; +import { DocumentDetailsResponseLinkedObjectsInner } from '../models/DocumentDetailsResponseLinkedObjectsInner'; +import { DocumentDetailsResponseLinkedObjectsInnerChildrenInner } from '../models/DocumentDetailsResponseLinkedObjectsInnerChildrenInner'; +import { DocumentDetailsResponseRecipientsInnerClass } from '../models/DocumentDetailsResponseRecipientsInner'; +import { DocumentDetailsResponseTablesInner } from '../models/DocumentDetailsResponseTablesInner'; +import { DocumentDetailsResponseTemplate } from '../models/DocumentDetailsResponseTemplate'; +import { DocumentDetailsResponseTextsInner } from '../models/DocumentDetailsResponseTextsInner'; +import { DocumentDocxExport } from '../models/DocumentDocxExport'; +import { DocumentDocxExportStatusEnum } from '../models/DocumentDocxExportStatusEnum'; +import { DocumentESignDisclosure } from '../models/DocumentESignDisclosure'; +import { DocumentESignDisclosureResult } from '../models/DocumentESignDisclosureResult'; +import { DocumentFieldAnchorPointEnum } from '../models/DocumentFieldAnchorPointEnum'; +import { DocumentFieldTypeEnum } from '../models/DocumentFieldTypeEnum'; +import { DocumentFieldsField } from '../models/DocumentFieldsField'; +import { DocumentFieldsFieldAssignedTo } from '../models/DocumentFieldsFieldAssignedTo'; +import { DocumentFieldsFieldCreate } from '../models/DocumentFieldsFieldCreate'; +import { DocumentFieldsLayout } from '../models/DocumentFieldsLayout'; +import { DocumentFieldsLayoutPosition } from '../models/DocumentFieldsLayoutPosition'; +import { DocumentFieldsLayoutStyle } from '../models/DocumentFieldsLayoutStyle'; +import { DocumentLanguageEnum } from '../models/DocumentLanguageEnum'; +import { DocumentListResponse } from '../models/DocumentListResponse'; +import { DocumentListResponseResultsInner } from '../models/DocumentListResponseResultsInner'; +import { DocumentOrderingFieldsEnum } from '../models/DocumentOrderingFieldsEnum'; +import { DocumentRecipientCreateRequest } from '../models/DocumentRecipientCreateRequest'; +import { DocumentRecipientEditRequest } from '../models/DocumentRecipientEditRequest'; +import { DocumentRecipientResponse } from '../models/DocumentRecipientResponse'; +import { DocumentRevertToDraftResponse } from '../models/DocumentRevertToDraftResponse'; +import { DocumentSendManualReminder200Response } from '../models/DocumentSendManualReminder200Response'; +import { DocumentSendManualReminder200ResponseResultInner } from '../models/DocumentSendManualReminder200ResponseResultInner'; +import { DocumentSendManualReminder200ResponseResultInnerEmail, DocumentSendManualReminder200ResponseResultInnerEmailStatusEnum , DocumentSendManualReminder200ResponseResultInnerEmailDetailEnum } from '../models/DocumentSendManualReminder200ResponseResultInnerEmail'; +import { DocumentSendManualReminder200ResponseResultInnerEmailCustomization } from '../models/DocumentSendManualReminder200ResponseResultInnerEmailCustomization'; +import { DocumentSendManualReminder200ResponseResultInnerSms, DocumentSendManualReminder200ResponseResultInnerSmsStatusEnum , DocumentSendManualReminder200ResponseResultInnerSmsDetailEnum } from '../models/DocumentSendManualReminder200ResponseResultInnerSms'; +import { DocumentSendManualReminder409Response } from '../models/DocumentSendManualReminder409Response'; +import { DocumentSendManualReminderRequest } from '../models/DocumentSendManualReminderRequest'; +import { DocumentSendManualReminderRequestRemindersInner } from '../models/DocumentSendManualReminderRequestRemindersInner'; +import { DocumentSendManualReminderRequestRemindersInnerEmailCustomization } from '../models/DocumentSendManualReminderRequestRemindersInnerEmailCustomization'; +import { DocumentSendRequest } from '../models/DocumentSendRequest'; +import { DocumentSendRequestForwardingSettings } from '../models/DocumentSendRequestForwardingSettings'; +import { DocumentSendRequestSelectedApprovers } from '../models/DocumentSendRequestSelectedApprovers'; +import { DocumentSendRequestSelectedApproversStepsInner } from '../models/DocumentSendRequestSelectedApproversStepsInner'; +import { DocumentSendRequestSelectedApproversStepsInnerGroup } from '../models/DocumentSendRequestSelectedApproversStepsInnerGroup'; +import { DocumentSendRequestSelectedApproversStepsInnerGroupAssigneesInner } from '../models/DocumentSendRequestSelectedApproversStepsInnerGroupAssigneesInner'; +import { DocumentSendRequestSender } from '../models/DocumentSendRequestSender'; +import { DocumentSendResponse } from '../models/DocumentSendResponse'; +import { DocumentSendResponseRecipientsInner } from '../models/DocumentSendResponseRecipientsInner'; +import { DocumentSettingsResponse } from '../models/DocumentSettingsResponse'; +import { DocumentStatusChangeRequest } from '../models/DocumentStatusChangeRequest'; +import { DocumentStatusChangeRequestStatusEnum } from '../models/DocumentStatusChangeRequestStatusEnum'; +import { DocumentStatusEnum } from '../models/DocumentStatusEnum'; +import { DocumentStatusRequestEnum } from '../models/DocumentStatusRequestEnum'; +import { DocumentStatusResponse } from '../models/DocumentStatusResponse'; +import { DocumentTransferAllOwnershipRequest } from '../models/DocumentTransferAllOwnershipRequest'; +import { DocumentTransferOwnershipRequest } from '../models/DocumentTransferOwnershipRequest'; +import { DocumentUpdateRequest } from '../models/DocumentUpdateRequest'; +import { DocumentUpdateRequestFieldValue } from '../models/DocumentUpdateRequestFieldValue'; +import { DocumentUpdateRequestImagesInner } from '../models/DocumentUpdateRequestImagesInner'; +import { DocumentUpdateRequestTextsInner } from '../models/DocumentUpdateRequestTextsInner'; +import { DocumentUpdateRequestTokensInner } from '../models/DocumentUpdateRequestTokensInner'; +import { DocumentsFolderCreateRequest } from '../models/DocumentsFolderCreateRequest'; +import { DocumentsFolderCreateResponse } from '../models/DocumentsFolderCreateResponse'; +import { DocumentsFolderListResponse } from '../models/DocumentsFolderListResponse'; +import { DocumentsFolderListResponseResultsInner } from '../models/DocumentsFolderListResponseResultsInner'; +import { DocumentsFolderRenameRequest } from '../models/DocumentsFolderRenameRequest'; +import { DocumentsFolderRenameResponse } from '../models/DocumentsFolderRenameResponse'; +import { DocxExportTaskResponse } from '../models/DocxExportTaskResponse'; +import { DocxExportTaskResponseAllOfDocxItems } from '../models/DocxExportTaskResponseAllOfDocxItems'; +import { Dropdown , DropdownTypeEnum } from '../models/Dropdown'; +import { EditingSessionRequest } from '../models/EditingSessionRequest'; +import { Field , FieldTypeEnum } from '../models/Field'; +import { FormListResponse } from '../models/FormListResponse'; +import { FormListResponseResultsInner } from '../models/FormListResponseResultsInner'; +import { Initials , InitialsTypeEnum } from '../models/Initials'; +import { LinkedObjectChild } from '../models/LinkedObjectChild'; +import { LinkedObjectCreateRequest } from '../models/LinkedObjectCreateRequest'; +import { LinkedObjectCreateResponse } from '../models/LinkedObjectCreateResponse'; +import { LinkedObjectListResponse } from '../models/LinkedObjectListResponse'; +import { ListCatalogItemsSearchResponse } from '../models/ListCatalogItemsSearchResponse'; +import { ListDocumentFieldsResponse } from '../models/ListDocumentFieldsResponse'; +import { ListDocuments400Response } from '../models/ListDocuments400Response'; +import { ListDocuments401Response } from '../models/ListDocuments401Response'; +import { ListDocuments403Response } from '../models/ListDocuments403Response'; +import { ListDocuments403ResponseLinksInner } from '../models/ListDocuments403ResponseLinksInner'; +import { ListDocuments429Response } from '../models/ListDocuments429Response'; +import { ListDocumentsByLinkedObjectsResponseInner } from '../models/ListDocumentsByLinkedObjectsResponseInner'; +import { ListNotaries400Response } from '../models/ListNotaries400Response'; +import { ListNotaries400ResponseDetailsInner } from '../models/ListNotaries400ResponseDetailsInner'; +import { ListNotaries403Response } from '../models/ListNotaries403Response'; +import { ListNotaries429Response } from '../models/ListNotaries429Response'; +import { ListNotariesResponse } from '../models/ListNotariesResponse'; +import { ListNotariesResponseResultsInner , ListNotariesResponseResultsInnerStatusEnum } from '../models/ListNotariesResponseResultsInner'; +import { ListSmsOptOutChangelogResponse } from '../models/ListSmsOptOutChangelogResponse'; +import { ListSmsOptOutChangelogResponseResultsInner , ListSmsOptOutChangelogResponseResultsInnerStatusEnum } from '../models/ListSmsOptOutChangelogResponseResultsInner'; +import { ListUsersResponse } from '../models/ListUsersResponse'; +import { ListUsersResponseResultsInner } from '../models/ListUsersResponseResultsInner'; +import { ListUsersResponseResultsInnerWorkspacesInner } from '../models/ListUsersResponseResultsInnerWorkspacesInner'; +import { ListWorkspacesResponse } from '../models/ListWorkspacesResponse'; +import { ListWorkspacesResponseResultsInner } from '../models/ListWorkspacesResponseResultsInner'; +import { MemberDetailsResponse } from '../models/MemberDetailsResponse'; +import { MemberListResponse } from '../models/MemberListResponse'; +import { ModelDate , ModelDateTypeEnum } from '../models/ModelDate'; +import { NotarizationRequestDetailsResponse , NotarizationRequestDetailsResponseStatusEnum } from '../models/NotarizationRequestDetailsResponse'; +import { NotarizationRequestDetailsResponseCreatedBy } from '../models/NotarizationRequestDetailsResponseCreatedBy'; +import { NotarizationRequestDetailsResponseInviteesInner } from '../models/NotarizationRequestDetailsResponseInviteesInner'; +import { NotarizationRequestDetailsResponseRecording } from '../models/NotarizationRequestDetailsResponseRecording'; +import { NotarizationRequestDetailsResponseSignedDocumentsInner , NotarizationRequestDetailsResponseSignedDocumentsInnerDocumentTypeEnum } from '../models/NotarizationRequestDetailsResponseSignedDocumentsInner'; +import { OAuth2AccessTokenResponse } from '../models/OAuth2AccessTokenResponse'; +import { Payment , PaymentTypeEnum } from '../models/Payment'; +import { PricingResponse } from '../models/PricingResponse'; +import { PricingTableRequest } from '../models/PricingTableRequest'; +import { PricingTableRequestRowOptions } from '../models/PricingTableRequestRowOptions'; +import { PricingTableRequestSectionsInner } from '../models/PricingTableRequestSectionsInner'; +import { PricingTableRequestSectionsInnerRowsInner } from '../models/PricingTableRequestSectionsInnerRowsInner'; +import { PricingTableResponse } from '../models/PricingTableResponse'; +import { PricingTableResponseItemsInner } from '../models/PricingTableResponseItemsInner'; +import { PricingTableResponseItemsInnerDiscount } from '../models/PricingTableResponseItemsInnerDiscount'; +import { PricingTableResponseItemsInnerOptions } from '../models/PricingTableResponseItemsInnerOptions'; +import { PricingTableResponseSummary } from '../models/PricingTableResponseSummary'; +import { ProductCatalogCatalogCustomBundleItem } from '../models/ProductCatalogCatalogCustomBundleItem'; +import { ProductCatalogCatalogItemInBundle } from '../models/ProductCatalogCatalogItemInBundle'; +import { ProductCatalogCustomBundleItemNoId } from '../models/ProductCatalogCustomBundleItemNoId'; +import { ProductCatalogCustomCatalogItemInBundle } from '../models/ProductCatalogCustomCatalogItemInBundle'; +import { ProductCatalogItemPatchRequest } from '../models/ProductCatalogItemPatchRequest'; +import { ProductCatalogItemPatchRequestBundleItemsInner } from '../models/ProductCatalogItemPatchRequestBundleItemsInner'; +import { ProductCatalogItemPatchRequestBundleItemsInnerItemOrUuidClass } from '../models/ProductCatalogItemPatchRequestBundleItemsInnerItemOrUuid'; +import { ProductCatalogItemPatchRequestProductVariant } from '../models/ProductCatalogItemPatchRequestProductVariant'; +import { ProductCatalogItemPriceConfiguration } from '../models/ProductCatalogItemPriceConfiguration'; +import { ProductCatalogItemPriceTier } from '../models/ProductCatalogItemPriceTier'; +import { ProductCatalogItemRequest } from '../models/ProductCatalogItemRequest'; +import { ProductCatalogItemRequestBundleItemsInner } from '../models/ProductCatalogItemRequestBundleItemsInner'; +import { ProductCatalogItemRequestBundleItemsInnerItemOrUuidClass } from '../models/ProductCatalogItemRequestBundleItemsInnerItemOrUuid'; +import { ProductCatalogItemRequestCustomFieldsInner } from '../models/ProductCatalogItemRequestCustomFieldsInner'; +import { ProductCatalogItemRequestImagesInner } from '../models/ProductCatalogItemRequestImagesInner'; +import { ProductCatalogItemResponse } from '../models/ProductCatalogItemResponse'; +import { ProductCatalogItemResponseBundleItemsInner } from '../models/ProductCatalogItemResponseBundleItemsInner'; +import { ProductCatalogItemResponseBundleItemsInnerItem } from '../models/ProductCatalogItemResponseBundleItemsInnerItem'; +import { ProductCatalogItemResponseDefaultPriceConfiguration } from '../models/ProductCatalogItemResponseDefaultPriceConfiguration'; +import { ProductCatalogItemResponseVariantsInner } from '../models/ProductCatalogItemResponseVariantsInner'; +import { ProductCatalogPricingMethodEnum } from '../models/ProductCatalogPricingMethodEnum'; +import { ProductCatalogSearchCatalogItemResponse } from '../models/ProductCatalogSearchCatalogItemResponse'; +import { ProductCatalogSearchCatalogItemResponseCustomFieldsInner } from '../models/ProductCatalogSearchCatalogItemResponseCustomFieldsInner'; +import { ProductCatalogSearchCatalogItemResponseImagesInner } from '../models/ProductCatalogSearchCatalogItemResponseImagesInner'; +import { ProductCatalogSearchCatalogItemResponseTiersInner } from '../models/ProductCatalogSearchCatalogItemResponseTiersInner'; +import { ProductCatalogTypeEnum } from '../models/ProductCatalogTypeEnum'; +import { QuoteResponse } from '../models/QuoteResponse'; +import { QuoteResponseMergeRulesInner } from '../models/QuoteResponseMergeRulesInner'; +import { QuoteResponseMergeRulesInnerAction } from '../models/QuoteResponseMergeRulesInnerAction'; +import { QuoteResponseMergeRulesInnerCondition } from '../models/QuoteResponseMergeRulesInnerCondition'; +import { QuoteResponseMergeRulesInnerConditionComparisonInner } from '../models/QuoteResponseMergeRulesInnerConditionComparisonInner'; +import { QuoteResponseSectionColumn } from '../models/QuoteResponseSectionColumn'; +import { QuoteResponseSectionItem } from '../models/QuoteResponseSectionItem'; +import { QuoteResponseSectionItemOptions } from '../models/QuoteResponseSectionItemOptions'; +import { QuoteResponseSectionSummary } from '../models/QuoteResponseSectionSummary'; +import { QuoteResponseSectionsInner } from '../models/QuoteResponseSectionsInner'; +import { QuoteResponseSettings, QuoteResponseSettingsSelectionTypeEnum } from '../models/QuoteResponseSettings'; +import { QuoteResponseSummary } from '../models/QuoteResponseSummary'; +import { QuoteResponseSummaryDiscountsValue } from '../models/QuoteResponseSummaryDiscountsValue'; +import { QuoteResponseSummaryRecurringSubtotalInner } from '../models/QuoteResponseSummaryRecurringSubtotalInner'; +import { QuoteSectionSettings , QuoteSectionSettingsSelectionTypeEnum } from '../models/QuoteSectionSettings'; +import { QuoteUpdateRequest } from '../models/QuoteUpdateRequest'; +import { QuoteUpdateRequestBillingFrequencyEnum } from '../models/QuoteUpdateRequestBillingFrequencyEnum'; +import { QuoteUpdateRequestDiscountTypeEnum } from '../models/QuoteUpdateRequestDiscountTypeEnum'; +import { QuoteUpdateRequestSettings } from '../models/QuoteUpdateRequestSettings'; +import { QuoteUpdateRequestSettingsSelectionTypeTypeEnum } from '../models/QuoteUpdateRequestSettingsSelectionTypeTypeEnum'; +import { RadioButtons , RadioButtonsTypeEnum } from '../models/RadioButtons'; +import { RecipientAssignedTo , RecipientAssignedToTypeEnum } from '../models/RecipientAssignedTo'; +import { RecipientAssignmentDetails } from '../models/RecipientAssignmentDetails'; +import { RecipientDeliveryMethods } from '../models/RecipientDeliveryMethods'; +import { RecipientKindEnum } from '../models/RecipientKindEnum'; +import { RecipientPersonalDetails } from '../models/RecipientPersonalDetails'; +import { RecipientRedirect } from '../models/RecipientRedirect'; +import { RecipientRedirectSettings } from '../models/RecipientRedirectSettings'; +import { RecipientVerificationPlaceEnum } from '../models/RecipientVerificationPlaceEnum'; +import { RecipientVerificationSettings } from '../models/RecipientVerificationSettings'; +import { RecipientVerificationSettingsIdVerification } from '../models/RecipientVerificationSettingsIdVerification'; +import { RecipientVerificationSettingsKbaVerification } from '../models/RecipientVerificationSettingsKbaVerification'; +import { RecipientVerificationSettingsPasscodeVerification } from '../models/RecipientVerificationSettingsPasscodeVerification'; +import { RecipientVerificationSettingsPhoneVerification } from '../models/RecipientVerificationSettingsPhoneVerification'; +import { RecipientsGroupAssignedTo , RecipientsGroupAssignedToTypeEnum } from '../models/RecipientsGroupAssignedTo'; +import { RecipientsGroupAssignedToAllOfMembers } from '../models/RecipientsGroupAssignedToAllOfMembers'; +import { RemoveMember400Response } from '../models/RemoveMember400Response'; +import { RemoveMember404Response } from '../models/RemoveMember404Response'; +import { SearchCatalogItems401Response } from '../models/SearchCatalogItems401Response'; +import { SectionInfoResponse } from '../models/SectionInfoResponse'; +import { Signature , SignatureTypeEnum } from '../models/Signature'; +import { Stamp , StampTypeEnum } from '../models/Stamp'; +import { StatusDocument404Response } from '../models/StatusDocument404Response'; +import { StatusDocumentAutoReminder400Response } from '../models/StatusDocumentAutoReminder400Response'; +import { TableCell } from '../models/TableCell'; +import { TableRequest } from '../models/TableRequest'; +import { TableRequestData } from '../models/TableRequestData'; +import { TableRequestDataSectionsInner } from '../models/TableRequestDataSectionsInner'; +import { TemplateCreateResponse } from '../models/TemplateCreateResponse'; +import { TemplateDetailsResponse } from '../models/TemplateDetailsResponse'; +import { TemplateDetailsResponseContentPlaceholdersInner } from '../models/TemplateDetailsResponseContentPlaceholdersInner'; +import { TemplateDetailsResponseImagesInner } from '../models/TemplateDetailsResponseImagesInner'; +import { TemplateDetailsResponseRolesInner } from '../models/TemplateDetailsResponseRolesInner'; +import { TemplateDetailsResponseRolesInnerPreassignedPerson } from '../models/TemplateDetailsResponseRolesInnerPreassignedPerson'; +import { TemplateDetailsResponseRolesInnerPreassignedPersonMembersInner } from '../models/TemplateDetailsResponseRolesInnerPreassignedPersonMembersInner'; +import { TemplateDetailsResponseTokensInner } from '../models/TemplateDetailsResponseTokensInner'; +import { TemplateListResponse } from '../models/TemplateListResponse'; +import { TemplateSettingsResponse } from '../models/TemplateSettingsResponse'; +import { TemplateStatusResponse , TemplateStatusResponseStatusEnum } from '../models/TemplateStatusResponse'; +import { TemplateUpdateRequest } from '../models/TemplateUpdateRequest'; +import { TemplatesFolderCreateRequest } from '../models/TemplatesFolderCreateRequest'; +import { TemplatesFolderCreateResponse } from '../models/TemplatesFolderCreateResponse'; +import { TemplatesFolderListResponse } from '../models/TemplatesFolderListResponse'; +import { TemplatesFolderListResponseResultsInner } from '../models/TemplatesFolderListResponseResultsInner'; +import { TemplatesFolderRenameRequest } from '../models/TemplatesFolderRenameRequest'; +import { TemplatesFolderRenameResponse } from '../models/TemplatesFolderRenameResponse'; +import { Text , TextTypeEnum } from '../models/Text'; +import { UpdateDocument400Response } from '../models/UpdateDocument400Response'; +import { UpdateDocumentActor , UpdateDocumentActorTypeEnum } from '../models/UpdateDocumentActor'; +import { UpdateDocumentAutoRemindersRequest } from '../models/UpdateDocumentAutoRemindersRequest'; +import { UpdateDocumentAutoRemindersResponse } from '../models/UpdateDocumentAutoRemindersResponse'; +import { UpdateDocumentRecipient , UpdateDocumentRecipientTypeEnum } from '../models/UpdateDocumentRecipient'; +import { UpdateDocumentRecipientGroup , UpdateDocumentRecipientGroupTypeEnum } from '../models/UpdateDocumentRecipientGroup'; +import { UpdateDocumentSettingsRequest } from '../models/UpdateDocumentSettingsRequest'; +import { UpdateIntegrationQuoteSection } from '../models/UpdateIntegrationQuoteSection'; +import { UpdateIntegrationQuoteSectionItem } from '../models/UpdateIntegrationQuoteSectionItem'; +import { UpdateIntegrationQuoteSectionItemDiscountsValue } from '../models/UpdateIntegrationQuoteSectionItemDiscountsValue'; +import { UpdateIntegrationQuoteSectionItemOptions } from '../models/UpdateIntegrationQuoteSectionItemOptions'; +import { UpdateIntegrationQuoteSectionItemPriceSettings } from '../models/UpdateIntegrationQuoteSectionItemPriceSettings'; +import { UpdateIntegrationQuoteSectionItemPriceSettingsTiersInner } from '../models/UpdateIntegrationQuoteSectionItemPriceSettingsTiersInner'; +import { UpdateIntegrationQuoteSectionSettings } from '../models/UpdateIntegrationQuoteSectionSettings'; +import { UpdateTemplateSettingsRequest } from '../models/UpdateTemplateSettingsRequest'; +import { UploadSectionBase } from '../models/UploadSectionBase'; +import { UploadSectionByTemplateRequest } from '../models/UploadSectionByTemplateRequest'; +import { UploadSectionByTemplateRequestAllOfContentLibraryItems } from '../models/UploadSectionByTemplateRequestAllOfContentLibraryItems'; +import { UploadSectionByTemplateRequestAllOfContentPlaceholders } from '../models/UploadSectionByTemplateRequestAllOfContentPlaceholders'; +import { UploadSectionListResponse } from '../models/UploadSectionListResponse'; +import { UploadSectionListResponseResultsInner } from '../models/UploadSectionListResponseResultsInner'; +import { UploadSectionRequestClass } from '../models/UploadSectionRequest'; +import { UploadSectionRequestOneOf } from '../models/UploadSectionRequestOneOf'; +import { UploadSectionResponse } from '../models/UploadSectionResponse'; +import { UploadSectionStatusEnum } from '../models/UploadSectionStatusEnum'; +import { UploadSectionStatusResponse } from '../models/UploadSectionStatusResponse'; +import { UserLicenseEnum } from '../models/UserLicenseEnum'; +import { WebhookEventDetailsResponse } from '../models/WebhookEventDetailsResponse'; +import { WebhookEventErrorEnum } from '../models/WebhookEventErrorEnum'; +import { WebhookEventHttpStatusCodeGroupEnum } from '../models/WebhookEventHttpStatusCodeGroupEnum'; +import { WebhookEventItemResponse } from '../models/WebhookEventItemResponse'; +import { WebhookEventPageResponse } from '../models/WebhookEventPageResponse'; +import { WebhookEventTriggerEnum } from '../models/WebhookEventTriggerEnum'; +import { WebhookSubscriptionCreateRequest } from '../models/WebhookSubscriptionCreateRequest'; +import { WebhookSubscriptionItemResponse } from '../models/WebhookSubscriptionItemResponse'; +import { WebhookSubscriptionListResponse } from '../models/WebhookSubscriptionListResponse'; +import { WebhookSubscriptionPatchRequest } from '../models/WebhookSubscriptionPatchRequest'; +import { WebhookSubscriptionPayloadEnum } from '../models/WebhookSubscriptionPayloadEnum'; +import { WebhookSubscriptionSharedKeyResponse } from '../models/WebhookSubscriptionSharedKeyResponse'; +import { WebhookSubscriptionStatusEnum } from '../models/WebhookSubscriptionStatusEnum'; +import { WebhookSubscriptionTriggerEnum } from '../models/WebhookSubscriptionTriggerEnum'; +import { WorkspaceMemberRoleEnum } from '../models/WorkspaceMemberRoleEnum'; +import { resolveTypeForAttributeMap } from '../pandadoc/oneOfTypeResolver'; /* tslint:disable:no-unused-variable */ let primitives = [ @@ -322,174 +745,403 @@ let primitives = [ "any" ]; -const supportedMediaTypes: { [mediaType: string]: number } = { - "application/json": Infinity, - "application/octet-stream": 0, - "application/x-www-form-urlencoded": 0 -} - - let enumsMap: Set = new Set([ - "AddMemberRequestRoleEnum", - "AddMemberResponseRoleEnum", - "CreateUserRequestLicenseEnum", - "CreateUserRequestWorkspacesRoleEnum", + "ApiKeyTypeEnum", + "ApiLogEnvironmentTypeEnum", + "ApiLogMethodEnum", + "ApiLogStatusEnum", + "BaseFieldAssignedToTypeEnum", + "CheckboxTypeEnum", + "CollectFileTypeEnum", + "ContentLibraryResponseStatusEnum", + "CreateDocumentActorTypeEnum", + "CreateDocumentRecipientTypeEnum", + "CreateDocumentRecipientGroupTypeEnum", + "CreateNotarizationResponseStatusEnum", + "DocumentAutoRemindersResponseResultInnerStatusEnum", + "DocumentDeliveryMethodEnum", + "DocumentDetailsRecipientTypeEnum", + "DocumentDetailsRecipientGroupTypeEnum", + "DocumentDetailsResponseRecipientsInnerTypeEnum", + "DocumentDocxExportStatusEnum", + "DocumentFieldAnchorPointEnum", + "DocumentFieldTypeEnum", + "DocumentLanguageEnum", "DocumentOrderingFieldsEnum", - "DocumentRecipientCreateRequestKindEnum", + "DocumentSendManualReminder200ResponseResultInnerEmailStatusEnum", + "DocumentSendManualReminder200ResponseResultInnerEmailDetailEnum", + "DocumentSendManualReminder200ResponseResultInnerSmsStatusEnum", + "DocumentSendManualReminder200ResponseResultInnerSmsDetailEnum", + "DocumentStatusChangeRequestStatusEnum", "DocumentStatusEnum", "DocumentStatusRequestEnum", + "DropdownTypeEnum", + "FieldTypeEnum", + "InitialsTypeEnum", + "ListNotariesResponseResultsInnerStatusEnum", + "ListSmsOptOutChangelogResponseResultsInnerStatusEnum", + "ModelDateTypeEnum", + "NotarizationRequestDetailsResponseStatusEnum", + "NotarizationRequestDetailsResponseSignedDocumentsInnerDocumentTypeEnum", + "PaymentTypeEnum", + "ProductCatalogPricingMethodEnum", + "ProductCatalogTypeEnum", "QuoteResponseSettingsSelectionTypeEnum", "QuoteSectionSettingsSelectionTypeEnum", - "QuoteUpdateRequestDiscountsTypeEnum", - "QuoteUpdateRequestSettingsSelectionTypeEnum", - "QuoteUpdateRequestSettings1SelectionTypeEnum", - "RecipientVerificationSettingsVerificationPlaceEnum", - "UpdateIntegrationQuoteSectionItemBillingFrequencyEnum", + "QuoteUpdateRequestBillingFrequencyEnum", + "QuoteUpdateRequestDiscountTypeEnum", + "QuoteUpdateRequestSettingsSelectionTypeTypeEnum", + "RadioButtonsTypeEnum", + "RecipientAssignedToTypeEnum", + "RecipientKindEnum", + "RecipientVerificationPlaceEnum", + "RecipientsGroupAssignedToTypeEnum", + "SignatureTypeEnum", + "StampTypeEnum", + "TemplateStatusResponseStatusEnum", + "TextTypeEnum", + "UpdateDocumentActorTypeEnum", + "UpdateDocumentRecipientTypeEnum", + "UpdateDocumentRecipientGroupTypeEnum", "UploadSectionStatusEnum", + "UserLicenseEnum", "WebhookEventErrorEnum", "WebhookEventHttpStatusCodeGroupEnum", "WebhookEventTriggerEnum", "WebhookSubscriptionPayloadEnum", "WebhookSubscriptionStatusEnum", "WebhookSubscriptionTriggerEnum", + "WorkspaceMemberRoleEnum", ]); let typeMap: {[index: string]: any} = { "APILogDetailsResponse": APILogDetailsResponse, "APILogListResponse": APILogListResponse, - "APILogListResponseResults": APILogListResponseResults, + "APILogListResponseResultsInner": APILogListResponseResultsInner, + "AccessToken400Response": AccessToken400Response, + "AddDsvNamedItemsRequest": AddDsvNamedItemsRequest, + "AddDsvNamedItemsRequestItemsInner": AddDsvNamedItemsRequestItemsInner, + "AddDsvNamedItemsResponse": AddDsvNamedItemsResponse, + "AddDsvNamedItemsResponseResultsInner": AddDsvNamedItemsResponseResultsInner, + "AddMember400Response": AddMember400Response, "AddMemberRequest": AddMemberRequest, "AddMemberResponse": AddMemberResponse, + "AppendCLIDataRequest": AppendCLIDataRequest, + "AppendCLIDataRequestCli": AppendCLIDataRequestCli, + "AppendCLIDataRequestCliPagesInner": AppendCLIDataRequestCliPagesInner, + "AppendCLIDataResponse": AppendCLIDataResponse, + "AppendCLIDataResponseBlockMapping": AppendCLIDataResponseBlockMapping, + "AppendCLIDataResponseBlockMappingImagesInner": AppendCLIDataResponseBlockMappingImagesInner, + "AppendCLIDataResponseBlockMappingPricingTablesInner": AppendCLIDataResponseBlockMappingPricingTablesInner, + "AppendCLIDataResponseBlockMappingTablesInner": AppendCLIDataResponseBlockMappingTablesInner, + "AppendCLIDataResponseBlockMappingTextsInner": AppendCLIDataResponseBlockMappingTextsInner, + "AppendCLIDataResponseCli": AppendCLIDataResponseCli, + "AppendCLIDataResponseCliPagesInner": AppendCLIDataResponseCliPagesInner, + "AssignedToRecipientDeliveryMethods": AssignedToRecipientDeliveryMethods, + "AutoReminders": AutoReminders, + "BaseActor": BaseActor, + "BaseEditingSessionResponse": BaseEditingSessionResponse, + "BaseField": BaseField, + "BaseFieldAssignedTo": BaseFieldAssignedTo, + "BaseIdentity": BaseIdentity, + "ChangeDocumentStatus409Response": ChangeDocumentStatus409Response, + "Checkbox": Checkbox, + "CollectFile": CollectFile, + "CollectFileAllOfValue": CollectFileAllOfValue, "ContactCreateRequest": ContactCreateRequest, "ContactDetailsResponse": ContactDetailsResponse, "ContactListResponse": ContactListResponse, "ContactUpdateRequest": ContactUpdateRequest, + "ContentLibraryItemCreateFromUrlRequest": ContentLibraryItemCreateFromUrlRequest, + "ContentLibraryItemCreateRequest": ContentLibraryItemCreateRequest, "ContentLibraryItemListResponse": ContentLibraryItemListResponse, - "ContentLibraryItemListResponseResults": ContentLibraryItemListResponseResults, + "ContentLibraryItemListResponseResultsInner": ContentLibraryItemListResponseResultsInner, "ContentLibraryItemResponse": ContentLibraryItemResponse, "ContentLibraryItemResponseCreatedBy": ContentLibraryItemResponseCreatedBy, + "ContentLibraryResponse": ContentLibraryResponse, + "CreateApiKeyRequest": CreateApiKeyRequest, + "CreateApiKeyResponse": CreateApiKeyResponse, + "CreateDocument400Response": CreateDocument400Response, + "CreateDocumentActor": CreateDocumentActor, + "CreateDocumentEditingSession201Response": CreateDocumentEditingSession201Response, + "CreateDocumentFieldsRequest": CreateDocumentFieldsRequest, + "CreateDocumentFieldsResponse": CreateDocumentFieldsResponse, + "CreateDocumentRecipient": CreateDocumentRecipient, + "CreateDocumentRecipientGroup": CreateDocumentRecipientGroup, + "CreateMemberTokenRequest": CreateMemberTokenRequest, + "CreateMemberTokenResponse": CreateMemberTokenResponse, + "CreateNotarizationRequest": CreateNotarizationRequest, + "CreateNotarizationRequestInvitation": CreateNotarizationRequestInvitation, + "CreateNotarizationRequestInvitationInviteesInner": CreateNotarizationRequestInvitationInviteesInner, + "CreateNotarizationRequestNotary": CreateNotarizationRequestNotary, + "CreateNotarizationResponse": CreateNotarizationResponse, + "CreateNotarizationResponseCreatedBy": CreateNotarizationResponseCreatedBy, + "CreateNotarizationResponseInviteesInner": CreateNotarizationResponseInviteesInner, + "CreateTemplateEditingSession201Response": CreateTemplateEditingSession201Response, + "CreateTemplateFromUrlRequest": CreateTemplateFromUrlRequest, + "CreateTemplateRequest": CreateTemplateRequest, + "CreateTemplateRequestOwner": CreateTemplateRequestOwner, + "CreateUser400Response": CreateUser400Response, "CreateUserRequest": CreateUserRequest, "CreateUserRequestUser": CreateUserRequestUser, - "CreateUserRequestWorkspaces": CreateUserRequestWorkspaces, + "CreateUserRequestWorkspacesInner": CreateUserRequestWorkspacesInner, "CreateUserResponse": CreateUserResponse, + "CreateUserResponseWorkspacesInner": CreateUserResponseWorkspacesInner, "CreateWorkspaceRequest": CreateWorkspaceRequest, "CreateWorkspaceResponse": CreateWorkspaceResponse, + "DeleteNotarizationRequest404Response": DeleteNotarizationRequest404Response, + "DocumentAttachmentMetadata": DocumentAttachmentMetadata, + "DocumentAttachmentRequest": DocumentAttachmentRequest, "DocumentAttachmentResponse": DocumentAttachmentResponse, "DocumentAttachmentResponseCreatedBy": DocumentAttachmentResponseCreatedBy, + "DocumentAuditTrailResponse": DocumentAuditTrailResponse, + "DocumentAuditTrailResponseResultsInner": DocumentAuditTrailResponseResultsInner, + "DocumentAuditTrailResponseResultsInnerUser": DocumentAuditTrailResponseResultsInnerUser, + "DocumentAutoRemindersResponse": DocumentAutoRemindersResponse, + "DocumentAutoRemindersResponse400": DocumentAutoRemindersResponse400, + "DocumentAutoRemindersResponseResultInner": DocumentAutoRemindersResponseResultInner, "DocumentCreateByPdfRequest": DocumentCreateByPdfRequest, "DocumentCreateByTemplateRequest": DocumentCreateByTemplateRequest, - "DocumentCreateByTemplateRequestContentLibraryItems": DocumentCreateByTemplateRequestContentLibraryItems, - "DocumentCreateByTemplateRequestContentPlaceholders": DocumentCreateByTemplateRequestContentPlaceholders, - "DocumentCreateByTemplateRequestImages": DocumentCreateByTemplateRequestImages, - "DocumentCreateByTemplateRequestRecipients": DocumentCreateByTemplateRequestRecipients, - "DocumentCreateByTemplateRequestTokens": DocumentCreateByTemplateRequestTokens, + "DocumentCreateByTemplateRequestContentPlaceholdersInner": DocumentCreateByTemplateRequestContentPlaceholdersInner, + "DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInner": DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInner, + "DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInnerRecipientsInner": DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInnerRecipientsInner, + "DocumentCreateByTemplateRequestFieldsValue": DocumentCreateByTemplateRequestFieldsValue, + "DocumentCreateByTemplateRequestFieldsValueValue": DocumentCreateByTemplateRequestFieldsValueValueClass, + "DocumentCreateByTemplateRequestImagesInner": DocumentCreateByTemplateRequestImagesInner, + "DocumentCreateByTemplateRequestOwner": DocumentCreateByTemplateRequestOwner, + "DocumentCreateByTemplateRequestTextsInner": DocumentCreateByTemplateRequestTextsInner, + "DocumentCreateByTemplateRequestTokensInner": DocumentCreateByTemplateRequestTokensInner, "DocumentCreateLinkRequest": DocumentCreateLinkRequest, "DocumentCreateLinkResponse": DocumentCreateLinkResponse, - "DocumentCreateRequest": DocumentCreateRequest, - "DocumentCreateRequestContentLibraryItems": DocumentCreateRequestContentLibraryItems, - "DocumentCreateRequestContentPlaceholders": DocumentCreateRequestContentPlaceholders, - "DocumentCreateRequestImages": DocumentCreateRequestImages, - "DocumentCreateRequestRecipients": DocumentCreateRequestRecipients, + "DocumentCreateRequest": DocumentCreateRequestClass, + "DocumentCreateRequestOneOf": DocumentCreateRequestOneOf, + "DocumentCreateRequestOneOf1": DocumentCreateRequestOneOf1, "DocumentCreateResponse": DocumentCreateResponse, - "DocumentCreateResponseLinks": DocumentCreateResponseLinks, + "DocumentCreateResponseLinksInner": DocumentCreateResponseLinksInner, + "DocumentDetailsRecipient": DocumentDetailsRecipient, + "DocumentDetailsRecipientGroup": DocumentDetailsRecipientGroup, + "DocumentDetailsRecipientGroupMember": DocumentDetailsRecipientGroupMember, "DocumentDetailsResponse": DocumentDetailsResponse, "DocumentDetailsResponseCreatedBy": DocumentDetailsResponseCreatedBy, "DocumentDetailsResponseGrandTotal": DocumentDetailsResponseGrandTotal, - "DocumentDetailsResponseLinkedObjects": DocumentDetailsResponseLinkedObjects, - "DocumentDetailsResponseRecipients": DocumentDetailsResponseRecipients, + "DocumentDetailsResponseImagesInner": DocumentDetailsResponseImagesInner, + "DocumentDetailsResponseLinkedObjectsInner": DocumentDetailsResponseLinkedObjectsInner, + "DocumentDetailsResponseLinkedObjectsInnerChildrenInner": DocumentDetailsResponseLinkedObjectsInnerChildrenInner, + "DocumentDetailsResponseRecipientsInner": DocumentDetailsResponseRecipientsInnerClass, + "DocumentDetailsResponseTablesInner": DocumentDetailsResponseTablesInner, "DocumentDetailsResponseTemplate": DocumentDetailsResponseTemplate, + "DocumentDetailsResponseTextsInner": DocumentDetailsResponseTextsInner, + "DocumentDocxExport": DocumentDocxExport, + "DocumentESignDisclosure": DocumentESignDisclosure, + "DocumentESignDisclosureResult": DocumentESignDisclosureResult, + "DocumentFieldsField": DocumentFieldsField, + "DocumentFieldsFieldAssignedTo": DocumentFieldsFieldAssignedTo, + "DocumentFieldsFieldCreate": DocumentFieldsFieldCreate, + "DocumentFieldsLayout": DocumentFieldsLayout, + "DocumentFieldsLayoutPosition": DocumentFieldsLayoutPosition, + "DocumentFieldsLayoutStyle": DocumentFieldsLayoutStyle, "DocumentListResponse": DocumentListResponse, - "DocumentListResponseResults": DocumentListResponseResults, + "DocumentListResponseResultsInner": DocumentListResponseResultsInner, "DocumentRecipientCreateRequest": DocumentRecipientCreateRequest, "DocumentRecipientEditRequest": DocumentRecipientEditRequest, "DocumentRecipientResponse": DocumentRecipientResponse, + "DocumentRevertToDraftResponse": DocumentRevertToDraftResponse, + "DocumentSendManualReminder200Response": DocumentSendManualReminder200Response, + "DocumentSendManualReminder200ResponseResultInner": DocumentSendManualReminder200ResponseResultInner, + "DocumentSendManualReminder200ResponseResultInnerEmail": DocumentSendManualReminder200ResponseResultInnerEmail, + "DocumentSendManualReminder200ResponseResultInnerEmailCustomization": DocumentSendManualReminder200ResponseResultInnerEmailCustomization, + "DocumentSendManualReminder200ResponseResultInnerSms": DocumentSendManualReminder200ResponseResultInnerSms, + "DocumentSendManualReminder409Response": DocumentSendManualReminder409Response, + "DocumentSendManualReminderRequest": DocumentSendManualReminderRequest, + "DocumentSendManualReminderRequestRemindersInner": DocumentSendManualReminderRequestRemindersInner, + "DocumentSendManualReminderRequestRemindersInnerEmailCustomization": DocumentSendManualReminderRequestRemindersInnerEmailCustomization, "DocumentSendRequest": DocumentSendRequest, "DocumentSendRequestForwardingSettings": DocumentSendRequestForwardingSettings, "DocumentSendRequestSelectedApprovers": DocumentSendRequestSelectedApprovers, - "DocumentSendRequestSelectedApproversGroup": DocumentSendRequestSelectedApproversGroup, - "DocumentSendRequestSelectedApproversGroupAssignees": DocumentSendRequestSelectedApproversGroupAssignees, - "DocumentSendRequestSelectedApproversSteps": DocumentSendRequestSelectedApproversSteps, + "DocumentSendRequestSelectedApproversStepsInner": DocumentSendRequestSelectedApproversStepsInner, + "DocumentSendRequestSelectedApproversStepsInnerGroup": DocumentSendRequestSelectedApproversStepsInnerGroup, + "DocumentSendRequestSelectedApproversStepsInnerGroupAssigneesInner": DocumentSendRequestSelectedApproversStepsInnerGroupAssigneesInner, + "DocumentSendRequestSender": DocumentSendRequestSender, "DocumentSendResponse": DocumentSendResponse, - "DocumentSendResponseRecipients": DocumentSendResponseRecipients, + "DocumentSendResponseRecipientsInner": DocumentSendResponseRecipientsInner, + "DocumentSettingsResponse": DocumentSettingsResponse, "DocumentStatusChangeRequest": DocumentStatusChangeRequest, "DocumentStatusResponse": DocumentStatusResponse, "DocumentTransferAllOwnershipRequest": DocumentTransferAllOwnershipRequest, "DocumentTransferOwnershipRequest": DocumentTransferOwnershipRequest, "DocumentUpdateRequest": DocumentUpdateRequest, - "DocumentUpdateRequestRecipients": DocumentUpdateRequestRecipients, + "DocumentUpdateRequestFieldValue": DocumentUpdateRequestFieldValue, + "DocumentUpdateRequestImagesInner": DocumentUpdateRequestImagesInner, + "DocumentUpdateRequestTextsInner": DocumentUpdateRequestTextsInner, + "DocumentUpdateRequestTokensInner": DocumentUpdateRequestTokensInner, "DocumentsFolderCreateRequest": DocumentsFolderCreateRequest, "DocumentsFolderCreateResponse": DocumentsFolderCreateResponse, "DocumentsFolderListResponse": DocumentsFolderListResponse, - "DocumentsFolderListResponseResults": DocumentsFolderListResponseResults, + "DocumentsFolderListResponseResultsInner": DocumentsFolderListResponseResultsInner, "DocumentsFolderRenameRequest": DocumentsFolderRenameRequest, "DocumentsFolderRenameResponse": DocumentsFolderRenameResponse, + "DocxExportTaskResponse": DocxExportTaskResponse, + "DocxExportTaskResponseAllOfDocxItems": DocxExportTaskResponseAllOfDocxItems, + "Dropdown": Dropdown, + "EditingSessionRequest": EditingSessionRequest, + "Field": Field, "FormListResponse": FormListResponse, - "FormListResponseResults": FormListResponseResults, + "FormListResponseResultsInner": FormListResponseResultsInner, + "Initials": Initials, + "LinkedObjectChild": LinkedObjectChild, "LinkedObjectCreateRequest": LinkedObjectCreateRequest, "LinkedObjectCreateResponse": LinkedObjectCreateResponse, "LinkedObjectListResponse": LinkedObjectListResponse, + "ListCatalogItemsSearchResponse": ListCatalogItemsSearchResponse, + "ListDocumentFieldsResponse": ListDocumentFieldsResponse, + "ListDocuments400Response": ListDocuments400Response, + "ListDocuments401Response": ListDocuments401Response, + "ListDocuments403Response": ListDocuments403Response, + "ListDocuments403ResponseLinksInner": ListDocuments403ResponseLinksInner, + "ListDocuments429Response": ListDocuments429Response, + "ListDocumentsByLinkedObjectsResponseInner": ListDocumentsByLinkedObjectsResponseInner, + "ListNotaries400Response": ListNotaries400Response, + "ListNotaries400ResponseDetailsInner": ListNotaries400ResponseDetailsInner, + "ListNotaries403Response": ListNotaries403Response, + "ListNotaries429Response": ListNotaries429Response, + "ListNotariesResponse": ListNotariesResponse, + "ListNotariesResponseResultsInner": ListNotariesResponseResultsInner, + "ListSmsOptOutChangelogResponse": ListSmsOptOutChangelogResponse, + "ListSmsOptOutChangelogResponseResultsInner": ListSmsOptOutChangelogResponseResultsInner, + "ListUsersResponse": ListUsersResponse, + "ListUsersResponseResultsInner": ListUsersResponseResultsInner, + "ListUsersResponseResultsInnerWorkspacesInner": ListUsersResponseResultsInnerWorkspacesInner, + "ListWorkspacesResponse": ListWorkspacesResponse, + "ListWorkspacesResponseResultsInner": ListWorkspacesResponseResultsInner, "MemberDetailsResponse": MemberDetailsResponse, "MemberListResponse": MemberListResponse, + "ModelDate": ModelDate, + "NotarizationRequestDetailsResponse": NotarizationRequestDetailsResponse, + "NotarizationRequestDetailsResponseCreatedBy": NotarizationRequestDetailsResponseCreatedBy, + "NotarizationRequestDetailsResponseInviteesInner": NotarizationRequestDetailsResponseInviteesInner, + "NotarizationRequestDetailsResponseRecording": NotarizationRequestDetailsResponseRecording, + "NotarizationRequestDetailsResponseSignedDocumentsInner": NotarizationRequestDetailsResponseSignedDocumentsInner, "OAuth2AccessTokenResponse": OAuth2AccessTokenResponse, + "Payment": Payment, "PricingResponse": PricingResponse, "PricingTableRequest": PricingTableRequest, "PricingTableRequestRowOptions": PricingTableRequestRowOptions, - "PricingTableRequestRows": PricingTableRequestRows, - "PricingTableRequestSections": PricingTableRequestSections, + "PricingTableRequestSectionsInner": PricingTableRequestSectionsInner, + "PricingTableRequestSectionsInnerRowsInner": PricingTableRequestSectionsInnerRowsInner, "PricingTableResponse": PricingTableResponse, - "PricingTableResponseDiscount": PricingTableResponseDiscount, - "PricingTableResponseItems": PricingTableResponseItems, - "PricingTableResponseOptions": PricingTableResponseOptions, + "PricingTableResponseItemsInner": PricingTableResponseItemsInner, + "PricingTableResponseItemsInnerDiscount": PricingTableResponseItemsInnerDiscount, + "PricingTableResponseItemsInnerOptions": PricingTableResponseItemsInnerOptions, "PricingTableResponseSummary": PricingTableResponseSummary, + "ProductCatalogCatalogCustomBundleItem": ProductCatalogCatalogCustomBundleItem, + "ProductCatalogCatalogItemInBundle": ProductCatalogCatalogItemInBundle, + "ProductCatalogCustomBundleItemNoId": ProductCatalogCustomBundleItemNoId, + "ProductCatalogCustomCatalogItemInBundle": ProductCatalogCustomCatalogItemInBundle, + "ProductCatalogItemPatchRequest": ProductCatalogItemPatchRequest, + "ProductCatalogItemPatchRequestBundleItemsInner": ProductCatalogItemPatchRequestBundleItemsInner, + "ProductCatalogItemPatchRequestBundleItemsInnerItemOrUuid": ProductCatalogItemPatchRequestBundleItemsInnerItemOrUuidClass, + "ProductCatalogItemPatchRequestProductVariant": ProductCatalogItemPatchRequestProductVariant, + "ProductCatalogItemPriceConfiguration": ProductCatalogItemPriceConfiguration, + "ProductCatalogItemPriceTier": ProductCatalogItemPriceTier, + "ProductCatalogItemRequest": ProductCatalogItemRequest, + "ProductCatalogItemRequestBundleItemsInner": ProductCatalogItemRequestBundleItemsInner, + "ProductCatalogItemRequestBundleItemsInnerItemOrUuid": ProductCatalogItemRequestBundleItemsInnerItemOrUuidClass, + "ProductCatalogItemRequestCustomFieldsInner": ProductCatalogItemRequestCustomFieldsInner, + "ProductCatalogItemRequestImagesInner": ProductCatalogItemRequestImagesInner, + "ProductCatalogItemResponse": ProductCatalogItemResponse, + "ProductCatalogItemResponseBundleItemsInner": ProductCatalogItemResponseBundleItemsInner, + "ProductCatalogItemResponseBundleItemsInnerItem": ProductCatalogItemResponseBundleItemsInnerItem, + "ProductCatalogItemResponseDefaultPriceConfiguration": ProductCatalogItemResponseDefaultPriceConfiguration, + "ProductCatalogItemResponseVariantsInner": ProductCatalogItemResponseVariantsInner, + "ProductCatalogSearchCatalogItemResponse": ProductCatalogSearchCatalogItemResponse, + "ProductCatalogSearchCatalogItemResponseCustomFieldsInner": ProductCatalogSearchCatalogItemResponseCustomFieldsInner, + "ProductCatalogSearchCatalogItemResponseImagesInner": ProductCatalogSearchCatalogItemResponseImagesInner, + "ProductCatalogSearchCatalogItemResponseTiersInner": ProductCatalogSearchCatalogItemResponseTiersInner, "QuoteResponse": QuoteResponse, - "QuoteResponseAction": QuoteResponseAction, - "QuoteResponseCondition": QuoteResponseCondition, - "QuoteResponseConditionComparison": QuoteResponseConditionComparison, - "QuoteResponseMergeRules": QuoteResponseMergeRules, - "QuoteResponseOptions": QuoteResponseOptions, + "QuoteResponseMergeRulesInner": QuoteResponseMergeRulesInner, + "QuoteResponseMergeRulesInnerAction": QuoteResponseMergeRulesInnerAction, + "QuoteResponseMergeRulesInnerCondition": QuoteResponseMergeRulesInnerCondition, + "QuoteResponseMergeRulesInnerConditionComparisonInner": QuoteResponseMergeRulesInnerConditionComparisonInner, "QuoteResponseSectionColumn": QuoteResponseSectionColumn, "QuoteResponseSectionItem": QuoteResponseSectionItem, + "QuoteResponseSectionItemOptions": QuoteResponseSectionItemOptions, "QuoteResponseSectionSummary": QuoteResponseSectionSummary, - "QuoteResponseSections": QuoteResponseSections, + "QuoteResponseSectionsInner": QuoteResponseSectionsInner, "QuoteResponseSettings": QuoteResponseSettings, "QuoteResponseSummary": QuoteResponseSummary, - "QuoteResponseSummaryDiscounts": QuoteResponseSummaryDiscounts, - "QuoteResponseSummaryRecurringSubtotal": QuoteResponseSummaryRecurringSubtotal, + "QuoteResponseSummaryDiscountsValue": QuoteResponseSummaryDiscountsValue, + "QuoteResponseSummaryRecurringSubtotalInner": QuoteResponseSummaryRecurringSubtotalInner, "QuoteSectionSettings": QuoteSectionSettings, "QuoteUpdateRequest": QuoteUpdateRequest, - "QuoteUpdateRequestDiscounts": QuoteUpdateRequestDiscounts, - "QuoteUpdateRequestOptions": QuoteUpdateRequestOptions, - "QuoteUpdateRequestPriceSettings": QuoteUpdateRequestPriceSettings, - "QuoteUpdateRequestPriceSettingsTiers": QuoteUpdateRequestPriceSettingsTiers, "QuoteUpdateRequestSettings": QuoteUpdateRequestSettings, - "QuoteUpdateRequestSettings1": QuoteUpdateRequestSettings1, + "RadioButtons": RadioButtons, + "RecipientAssignedTo": RecipientAssignedTo, + "RecipientAssignmentDetails": RecipientAssignmentDetails, + "RecipientDeliveryMethods": RecipientDeliveryMethods, + "RecipientPersonalDetails": RecipientPersonalDetails, "RecipientRedirect": RecipientRedirect, + "RecipientRedirectSettings": RecipientRedirectSettings, "RecipientVerificationSettings": RecipientVerificationSettings, + "RecipientVerificationSettingsIdVerification": RecipientVerificationSettingsIdVerification, + "RecipientVerificationSettingsKbaVerification": RecipientVerificationSettingsKbaVerification, "RecipientVerificationSettingsPasscodeVerification": RecipientVerificationSettingsPasscodeVerification, "RecipientVerificationSettingsPhoneVerification": RecipientVerificationSettingsPhoneVerification, - "RicipientDeliveryMethods": RicipientDeliveryMethods, + "RecipientsGroupAssignedTo": RecipientsGroupAssignedTo, + "RecipientsGroupAssignedToAllOfMembers": RecipientsGroupAssignedToAllOfMembers, + "RemoveMember400Response": RemoveMember400Response, + "RemoveMember404Response": RemoveMember404Response, + "SearchCatalogItems401Response": SearchCatalogItems401Response, "SectionInfoResponse": SectionInfoResponse, + "Signature": Signature, + "Stamp": Stamp, + "StatusDocument404Response": StatusDocument404Response, + "StatusDocumentAutoReminder400Response": StatusDocumentAutoReminder400Response, + "TableCell": TableCell, + "TableRequest": TableRequest, + "TableRequestData": TableRequestData, + "TableRequestDataSectionsInner": TableRequestDataSectionsInner, + "TemplateCreateResponse": TemplateCreateResponse, "TemplateDetailsResponse": TemplateDetailsResponse, - "TemplateDetailsResponseContentPlaceholders": TemplateDetailsResponseContentPlaceholders, - "TemplateDetailsResponseImages": TemplateDetailsResponseImages, - "TemplateDetailsResponsePreassignedPerson": TemplateDetailsResponsePreassignedPerson, - "TemplateDetailsResponseRoles": TemplateDetailsResponseRoles, - "TemplateDetailsResponseTokens": TemplateDetailsResponseTokens, + "TemplateDetailsResponseContentPlaceholdersInner": TemplateDetailsResponseContentPlaceholdersInner, + "TemplateDetailsResponseImagesInner": TemplateDetailsResponseImagesInner, + "TemplateDetailsResponseRolesInner": TemplateDetailsResponseRolesInner, + "TemplateDetailsResponseRolesInnerPreassignedPerson": TemplateDetailsResponseRolesInnerPreassignedPerson, + "TemplateDetailsResponseRolesInnerPreassignedPersonMembersInner": TemplateDetailsResponseRolesInnerPreassignedPersonMembersInner, + "TemplateDetailsResponseTokensInner": TemplateDetailsResponseTokensInner, "TemplateListResponse": TemplateListResponse, - "TemplateListResponseResults": TemplateListResponseResults, + "TemplateSettingsResponse": TemplateSettingsResponse, + "TemplateStatusResponse": TemplateStatusResponse, + "TemplateUpdateRequest": TemplateUpdateRequest, "TemplatesFolderCreateRequest": TemplatesFolderCreateRequest, "TemplatesFolderCreateResponse": TemplatesFolderCreateResponse, "TemplatesFolderListResponse": TemplatesFolderListResponse, - "TemplatesFolderListResponseResults": TemplatesFolderListResponseResults, + "TemplatesFolderListResponseResultsInner": TemplatesFolderListResponseResultsInner, "TemplatesFolderRenameRequest": TemplatesFolderRenameRequest, "TemplatesFolderRenameResponse": TemplatesFolderRenameResponse, + "Text": Text, + "UpdateDocument400Response": UpdateDocument400Response, + "UpdateDocumentActor": UpdateDocumentActor, + "UpdateDocumentAutoRemindersRequest": UpdateDocumentAutoRemindersRequest, + "UpdateDocumentAutoRemindersResponse": UpdateDocumentAutoRemindersResponse, + "UpdateDocumentRecipient": UpdateDocumentRecipient, + "UpdateDocumentRecipientGroup": UpdateDocumentRecipientGroup, + "UpdateDocumentSettingsRequest": UpdateDocumentSettingsRequest, "UpdateIntegrationQuoteSection": UpdateIntegrationQuoteSection, "UpdateIntegrationQuoteSectionItem": UpdateIntegrationQuoteSectionItem, - "UploadSectionByPdfRequest": UploadSectionByPdfRequest, + "UpdateIntegrationQuoteSectionItemDiscountsValue": UpdateIntegrationQuoteSectionItemDiscountsValue, + "UpdateIntegrationQuoteSectionItemOptions": UpdateIntegrationQuoteSectionItemOptions, + "UpdateIntegrationQuoteSectionItemPriceSettings": UpdateIntegrationQuoteSectionItemPriceSettings, + "UpdateIntegrationQuoteSectionItemPriceSettingsTiersInner": UpdateIntegrationQuoteSectionItemPriceSettingsTiersInner, + "UpdateIntegrationQuoteSectionSettings": UpdateIntegrationQuoteSectionSettings, + "UpdateTemplateSettingsRequest": UpdateTemplateSettingsRequest, + "UploadSectionBase": UploadSectionBase, "UploadSectionByTemplateRequest": UploadSectionByTemplateRequest, + "UploadSectionByTemplateRequestAllOfContentLibraryItems": UploadSectionByTemplateRequestAllOfContentLibraryItems, + "UploadSectionByTemplateRequestAllOfContentPlaceholders": UploadSectionByTemplateRequestAllOfContentPlaceholders, "UploadSectionListResponse": UploadSectionListResponse, - "UploadSectionListResponseResults": UploadSectionListResponseResults, - "UploadSectionRequest": UploadSectionRequest, + "UploadSectionListResponseResultsInner": UploadSectionListResponseResultsInner, + "UploadSectionRequest": UploadSectionRequestClass, + "UploadSectionRequestOneOf": UploadSectionRequestOneOf, "UploadSectionResponse": UploadSectionResponse, "UploadSectionStatusResponse": UploadSectionStatusResponse, "WebhookEventDetailsResponse": WebhookEventDetailsResponse, @@ -502,6 +1154,65 @@ let typeMap: {[index: string]: any} = { "WebhookSubscriptionSharedKeyResponse": WebhookSubscriptionSharedKeyResponse, } +type MimeTypeDescriptor = { + type: string; + subtype: string; + subtypeTokens: string[]; +}; + +/** + * Every mime-type consists of a type, subtype, and optional parameters. + * The subtype can be composite, including information about the content format. + * For example: `application/json-patch+json`, `application/merge-patch+json`. + * + * This helper transforms a string mime-type into an internal representation. + * This simplifies the implementation of predicates that in turn define common rules for parsing or stringifying + * the payload. + */ +const parseMimeType = (mimeType: string): MimeTypeDescriptor => { + const [type = '', subtype = ''] = mimeType.split('/'); + return { + type, + subtype, + subtypeTokens: subtype.split('+'), + }; +}; + +type MimeTypePredicate = (mimeType: string) => boolean; + +// This factory creates a predicate function that checks a string mime-type against defined rules. +const mimeTypePredicateFactory = (predicate: (descriptor: MimeTypeDescriptor) => boolean): MimeTypePredicate => (mimeType) => predicate(parseMimeType(mimeType)); + +// Use this factory when you need to define a simple predicate based only on type and, if applicable, subtype. +const mimeTypeSimplePredicateFactory = (type: string, subtype?: string): MimeTypePredicate => mimeTypePredicateFactory((descriptor) => { + if (descriptor.type !== type) return false; + if (subtype != null && descriptor.subtype !== subtype) return false; + return true; +}); + +// Creating a set of named predicates that will help us determine how to handle different mime-types +const isTextLikeMimeType = mimeTypeSimplePredicateFactory('text'); +const isJsonMimeType = mimeTypeSimplePredicateFactory('application', 'json'); +const isJsonLikeMimeType = mimeTypePredicateFactory((descriptor) => descriptor.type === 'application' && descriptor.subtypeTokens.some((item) => item === 'json')); +const isOctetStreamMimeType = mimeTypeSimplePredicateFactory('application', 'octet-stream'); +const isFormUrlencodedMimeType = mimeTypeSimplePredicateFactory('application', 'x-www-form-urlencoded'); + +// Defining a list of mime-types in the order of prioritization for handling. +const supportedMimeTypePredicatesWithPriority: MimeTypePredicate[] = [ + isJsonMimeType, + isJsonLikeMimeType, + isTextLikeMimeType, + isOctetStreamMimeType, + isFormUrlencodedMimeType, +]; + +const nullableSuffix = " | null"; +const optionalSuffix = " | undefined"; +const arrayPrefix = "Array<"; +const arraySuffix = ">"; +const mapPrefix = "{ [key: string]: "; +const mapSuffix = "; }"; + export class ObjectSerializer { public static findCorrectType(data: any, expectedType: string) { if (data == undefined) { @@ -526,8 +1237,11 @@ export class ObjectSerializer { } else { if (data[discriminatorProperty]) { var discriminatorType = data[discriminatorProperty]; - if(typeMap[discriminatorType]){ - return discriminatorType; // use the type given in the discriminator + let mapping = typeMap[expectedType].mapping; + if (mapping != undefined && mapping[discriminatorType]) { + return mapping[discriminatorType]; // use the type given in the discriminator + } else if(typeMap[discriminatorType]) { + return discriminatorType; } else { return expectedType; // discriminator did not map to a type } @@ -538,28 +1252,46 @@ export class ObjectSerializer { } } - public static serialize(data: any, type: string, format: string) { + public static serialize(data: any, type: string, format: string): any { if (data == undefined) { return data; } else if (primitives.indexOf(type.toLowerCase()) !== -1) { return data; - } else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6 - let subType: string = type.replace("Array<", ""); // Array => Type> - subType = subType.substring(0, subType.length - 1); // Type> => Type + } else if (type.endsWith(nullableSuffix)) { + let subType: string = type.slice(0, -nullableSuffix.length); // Type | null => Type + return ObjectSerializer.serialize(data, subType, format); + } else if (type.endsWith(optionalSuffix)) { + let subType: string = type.slice(0, -optionalSuffix.length); // Type | undefined => Type + return ObjectSerializer.serialize(data, subType, format); + } else if (type.startsWith(arrayPrefix)) { + let subType: string = type.slice(arrayPrefix.length, -arraySuffix.length); // Array => Type let transformedData: any[] = []; - for (let index in data) { - let date = data[index]; + for (let date of data) { transformedData.push(ObjectSerializer.serialize(date, subType, format)); } return transformedData; + } else if (type.startsWith(mapPrefix)) { + let subType: string = type.slice(mapPrefix.length, -mapSuffix.length); // { [key: string]: Type; } => Type + let transformedData: { [key: string]: any } = {}; + for (let key in data) { + transformedData[key] = ObjectSerializer.serialize( + data[key], + subType, + format, + ); + } + return transformedData; } else if (type === "Date") { + if (!(data instanceof Date)) { + return data; + } if (format == "date") { let month = data.getMonth()+1 - month = month < 10 ? "0" + month.toString() : month.toString() + let monthStr = month < 10 ? "0" + month.toString() : month.toString() let day = data.getDate(); - day = day < 10 ? "0" + day.toString() : day.toString(); + let dayStr = day < 10 ? "0" + day.toString() : day.toString(); - return data.getFullYear() + "-" + month + "-" + day; + return data.getFullYear() + "-" + monthStr + "-" + dayStr; } else { return data.toISOString(); } @@ -575,32 +1307,52 @@ export class ObjectSerializer { type = this.findCorrectType(data, type); // get the map for the correct type. - let attributeTypes = typeMap[type].getAttributeTypeMap(); + // PandaDoc fix: DocumentCreateRequest oneOf union (delegates type resolution to runtime helper) + type = resolveTypeForAttributeMap(type, data); + const ctor: any = (typeMap as any)[type]; + if (!ctor || typeof ctor.getAttributeTypeMap !== "function") { + return data; + } + let attributeTypes = ctor.getAttributeTypeMap(); let instance: {[index: string]: any} = {}; - for (let index in attributeTypes) { - let attributeType = attributeTypes[index]; + for (let attributeType of attributeTypes) { instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type, attributeType.format); } return instance; } } - public static deserialize(data: any, type: string, format: string) { + public static deserialize(data: any, type: string, format: string): any { // polymorphism may change the actual type. type = ObjectSerializer.findCorrectType(data, type); if (data == undefined) { return data; } else if (primitives.indexOf(type.toLowerCase()) !== -1) { return data; - } else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6 - let subType: string = type.replace("Array<", ""); // Array => Type> - subType = subType.substring(0, subType.length - 1); // Type> => Type + } else if (type.endsWith(nullableSuffix)) { + let subType: string = type.slice(0, -nullableSuffix.length); // Type | null => Type + return ObjectSerializer.deserialize(data, subType, format); + } else if (type.endsWith(optionalSuffix)) { + let subType: string = type.slice(0, -optionalSuffix.length); // Type | undefined => Type + return ObjectSerializer.deserialize(data, subType, format); + } else if (type.startsWith(arrayPrefix)) { + let subType: string = type.slice(arrayPrefix.length, -arraySuffix.length); // Array => Type let transformedData: any[] = []; - for (let index in data) { - let date = data[index]; + for (let date of data) { transformedData.push(ObjectSerializer.deserialize(date, subType, format)); } return transformedData; + } else if (type.startsWith(mapPrefix)) { + let subType: string = type.slice(mapPrefix.length, -mapSuffix.length); // { [key: string]: Type; } => Type + let transformedData: { [key: string]: any } = {}; + for (let key in data) { + transformedData[key] = ObjectSerializer.deserialize( + data[key], + subType, + format, + ); + } + return transformedData; } else if (type === "Date") { return new Date(data); } else { @@ -613,9 +1365,11 @@ export class ObjectSerializer { } let instance = new typeMap[type](); let attributeTypes = typeMap[type].getAttributeTypeMap(); - for (let index in attributeTypes) { - let attributeType = attributeTypes[index]; - instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type, attributeType.format); + for (let attributeType of attributeTypes) { + let value = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type, attributeType.format); + if (value !== undefined) { + instance[attributeType.name] = value; + } } return instance; } @@ -632,7 +1386,7 @@ export class ObjectSerializer { if (mediaType === undefined) { return undefined; } - return mediaType.split(";")[0].trim().toLowerCase(); + return (mediaType.split(";")[0] ?? '').trim().toLowerCase(); } /** @@ -643,32 +1397,32 @@ export class ObjectSerializer { */ public static getPreferredMediaType(mediaTypes: Array): string { /** According to OAS 3 we should default to json */ - if (!mediaTypes) { + if (mediaTypes.length === 0) { return "application/json"; } - const normalMediaTypes = mediaTypes.map(this.normalizeMediaType); - let selectedMediaType: string | undefined = undefined; - let selectedRank: number = -Infinity; - for (const mediaType of normalMediaTypes) { - if (supportedMediaTypes[mediaType!] > selectedRank) { - selectedMediaType = mediaType; - selectedRank = supportedMediaTypes[mediaType!]; - } - } + const normalMediaTypes = mediaTypes.map(ObjectSerializer.normalizeMediaType); - if (selectedMediaType === undefined) { - throw new Error("None of the given media types are supported: " + mediaTypes.join(", ")); + for (const predicate of supportedMimeTypePredicatesWithPriority) { + for (const mediaType of normalMediaTypes) { + if (mediaType != null && predicate(mediaType)) { + return mediaType; + } + } } - return selectedMediaType!; + throw new Error("None of the given media types are supported: " + mediaTypes.join(", ")); } /** * Convert data to a string according the given media type */ public static stringify(data: any, mediaType: string): string { - if (mediaType === "application/json") { + if (isTextLikeMimeType(mediaType)) { + return String(data); + } + + if (isJsonLikeMimeType(mediaType)) { return JSON.stringify(data); } @@ -683,7 +1437,11 @@ export class ObjectSerializer { throw new Error("Cannot parse content. No Content-Type defined."); } - if (mediaType === "application/json") { + if (isTextLikeMimeType(mediaType)) { + return rawData; + } + + if (isJsonLikeMimeType(mediaType)) { return JSON.parse(rawData); } diff --git a/src/models/Payment.ts b/src/models/Payment.ts new file mode 100644 index 0000000..c3cd006 --- /dev/null +++ b/src/models/Payment.ts @@ -0,0 +1,97 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { BaseFieldAssignedTo } from '../models/BaseFieldAssignedTo'; +import { HttpFile } from '../http/http'; + +export class Payment { + 'uuid'?: string; + /** + * Name of a field + */ + 'name'?: string; + 'title'?: string; + /** + * Placeholder of a field + */ + 'placeholder'?: string; + 'assignedTo'?: BaseFieldAssignedTo; + 'fieldId'?: string; + 'type'?: PaymentTypeEnum; + /** + * Value of the Payment field. Always empty string. + */ + 'value'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "uuid", + "baseName": "uuid", + "type": "string", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "title", + "baseName": "title", + "type": "string", + "format": "" + }, + { + "name": "placeholder", + "baseName": "placeholder", + "type": "string", + "format": "" + }, + { + "name": "assignedTo", + "baseName": "assigned_to", + "type": "BaseFieldAssignedTo", + "format": "" + }, + { + "name": "fieldId", + "baseName": "field_id", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "PaymentTypeEnum", + "format": "" + }, + { + "name": "value", + "baseName": "value", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return Payment.attributeTypeMap; + } + + public constructor() { + } +} + +export enum PaymentTypeEnum { + PaymentDetails = 'payment_details' +} + diff --git a/src/models/PricingResponse.ts b/src/models/PricingResponse.ts index cf8a58c..df3788f 100644 --- a/src/models/PricingResponse.ts +++ b/src/models/PricingResponse.ts @@ -7,8 +7,8 @@ * Do not edit the class manually. */ -import { PricingTableResponse } from './PricingTableResponse'; -import { QuoteResponse } from './QuoteResponse'; +import { PricingTableResponse } from '../models/PricingTableResponse'; +import { QuoteResponse } from '../models/QuoteResponse'; import { HttpFile } from '../http/http'; export class PricingResponse { @@ -18,6 +18,8 @@ export class PricingResponse { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "tables", @@ -45,4 +47,3 @@ export class PricingResponse { public constructor() { } } - diff --git a/src/models/PricingTableRequest.ts b/src/models/PricingTableRequest.ts index b3b0afd..e8da97d 100644 --- a/src/models/PricingTableRequest.ts +++ b/src/models/PricingTableRequest.ts @@ -7,7 +7,7 @@ * Do not edit the class manually. */ -import { PricingTableRequestSections } from './PricingTableRequestSections'; +import { PricingTableRequestSectionsInner } from '../models/PricingTableRequestSectionsInner'; import { HttpFile } from '../http/http'; export class PricingTableRequest { @@ -17,10 +17,12 @@ export class PricingTableRequest { */ 'dataMerge'?: boolean; 'options'?: any; - 'sections'?: Array; + 'sections'?: Array; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "name", @@ -43,7 +45,7 @@ export class PricingTableRequest { { "name": "sections", "baseName": "sections", - "type": "Array", + "type": "Array", "format": "" } ]; @@ -54,4 +56,3 @@ export class PricingTableRequest { public constructor() { } } - diff --git a/src/models/PricingTableRequestRowOptions.ts b/src/models/PricingTableRequestRowOptions.ts index 55f3512..ef08a31 100644 --- a/src/models/PricingTableRequestRowOptions.ts +++ b/src/models/PricingTableRequestRowOptions.ts @@ -16,6 +16,8 @@ export class PricingTableRequestRowOptions { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "qtyEditable", @@ -43,4 +45,3 @@ export class PricingTableRequestRowOptions { public constructor() { } } - diff --git a/src/models/PricingTableRequestSections.ts b/src/models/PricingTableRequestSectionsInner.ts similarity index 72% rename from src/models/PricingTableRequestSections.ts rename to src/models/PricingTableRequestSectionsInner.ts index 40e96a4..9722288 100644 --- a/src/models/PricingTableRequestSections.ts +++ b/src/models/PricingTableRequestSectionsInner.ts @@ -7,17 +7,19 @@ * Do not edit the class manually. */ -import { PricingTableRequestRows } from './PricingTableRequestRows'; +import { PricingTableRequestSectionsInnerRowsInner } from '../models/PricingTableRequestSectionsInnerRowsInner'; import { HttpFile } from '../http/http'; -export class PricingTableRequestSections { +export class PricingTableRequestSectionsInner { 'title': string; '_default'?: boolean; 'multichoiceEnabled'?: boolean; - 'rows'?: Array; + 'rows'?: Array; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "title", @@ -40,15 +42,14 @@ export class PricingTableRequestSections { { "name": "rows", "baseName": "rows", - "type": "Array", + "type": "Array", "format": "" } ]; static getAttributeTypeMap() { - return PricingTableRequestSections.attributeTypeMap; + return PricingTableRequestSectionsInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/PricingTableRequestRows.ts b/src/models/PricingTableRequestSectionsInnerRowsInner.ts similarity index 78% rename from src/models/PricingTableRequestRows.ts rename to src/models/PricingTableRequestSectionsInnerRowsInner.ts index 35371f5..bf55aaf 100644 --- a/src/models/PricingTableRequestRows.ts +++ b/src/models/PricingTableRequestSectionsInnerRowsInner.ts @@ -7,16 +7,18 @@ * Do not edit the class manually. */ -import { PricingTableRequestRowOptions } from './PricingTableRequestRowOptions'; +import { PricingTableRequestRowOptions } from '../models/PricingTableRequestRowOptions'; import { HttpFile } from '../http/http'; -export class PricingTableRequestRows { +export class PricingTableRequestSectionsInnerRowsInner { 'options'?: PricingTableRequestRowOptions; 'data'?: any; 'customFields'?: any; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "options", @@ -38,10 +40,9 @@ export class PricingTableRequestRows { } ]; static getAttributeTypeMap() { - return PricingTableRequestRows.attributeTypeMap; + return PricingTableRequestSectionsInnerRowsInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/PricingTableResponse.ts b/src/models/PricingTableResponse.ts index 5d69430..30292bc 100644 --- a/src/models/PricingTableResponse.ts +++ b/src/models/PricingTableResponse.ts @@ -7,8 +7,8 @@ * Do not edit the class manually. */ -import { PricingTableResponseItems } from './PricingTableResponseItems'; -import { PricingTableResponseSummary } from './PricingTableResponseSummary'; +import { PricingTableResponseItemsInner } from '../models/PricingTableResponseItemsInner'; +import { PricingTableResponseSummary } from '../models/PricingTableResponseSummary'; import { HttpFile } from '../http/http'; export class PricingTableResponse { @@ -16,12 +16,14 @@ export class PricingTableResponse { 'id'?: string; 'total'?: string; 'isIncludedInTotal'?: boolean; - 'summary'?: PricingTableResponseSummary; - 'items'?: Array; + 'summary'?: PricingTableResponseSummary | null; + 'items'?: Array; 'currency'?: string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "name", @@ -56,7 +58,7 @@ export class PricingTableResponse { { "name": "items", "baseName": "items", - "type": "Array", + "type": "Array", "format": "" }, { @@ -73,4 +75,3 @@ export class PricingTableResponse { public constructor() { } } - diff --git a/src/models/PricingTableResponseItems.ts b/src/models/PricingTableResponseItemsInner.ts similarity index 70% rename from src/models/PricingTableResponseItems.ts rename to src/models/PricingTableResponseItemsInner.ts index e6cb319..1e79f6f 100644 --- a/src/models/PricingTableResponseItems.ts +++ b/src/models/PricingTableResponseItemsInner.ts @@ -7,36 +7,38 @@ * Do not edit the class manually. */ -import { PricingTableResponseDiscount } from './PricingTableResponseDiscount'; -import { PricingTableResponseOptions } from './PricingTableResponseOptions'; +import { PricingTableResponseItemsInnerDiscount } from '../models/PricingTableResponseItemsInnerDiscount'; +import { PricingTableResponseItemsInnerOptions } from '../models/PricingTableResponseItemsInnerOptions'; import { HttpFile } from '../http/http'; -export class PricingTableResponseItems { - 'id'?: string; - 'sku'?: string; - 'qty'?: string; - 'name'?: string; - 'cost'?: string; - 'price'?: string; - 'description'?: string; - 'customFields'?: any; - 'customColumns'?: any; - 'discount'?: PricingTableResponseDiscount; - 'taxFirst'?: PricingTableResponseDiscount; - 'taxSecond'?: PricingTableResponseDiscount; - 'subtotal'?: string; - 'options'?: PricingTableResponseOptions; - 'salePrice'?: string; - 'taxes'?: any; - 'discounts'?: any; - 'fees'?: any; +export class PricingTableResponseItemsInner { + 'id'?: string | null; + 'sku'?: string | null; + 'qty'?: string | null; + 'name'?: string | null; + 'cost'?: string | null; + 'price'?: string | null; + 'description'?: string | null; + 'customFields'?: any | null; + 'customColumns'?: any | null; + 'discount'?: PricingTableResponseItemsInnerDiscount | null; + 'taxFirst'?: PricingTableResponseItemsInnerDiscount | null; + 'taxSecond'?: PricingTableResponseItemsInnerDiscount | null; + 'subtotal'?: string | null; + 'options'?: PricingTableResponseItemsInnerOptions | null; + 'salePrice'?: string | null; + 'taxes'?: any | null; + 'discounts'?: any | null; + 'fees'?: any | null; /** * Contains all fields in a flat structure with external field names defined in the template. */ - 'mergedData'?: any; + 'mergedData'?: any | null; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -95,19 +97,19 @@ export class PricingTableResponseItems { { "name": "discount", "baseName": "discount", - "type": "PricingTableResponseDiscount", + "type": "PricingTableResponseItemsInnerDiscount", "format": "" }, { "name": "taxFirst", "baseName": "tax_first", - "type": "PricingTableResponseDiscount", + "type": "PricingTableResponseItemsInnerDiscount", "format": "" }, { "name": "taxSecond", "baseName": "tax_second", - "type": "PricingTableResponseDiscount", + "type": "PricingTableResponseItemsInnerDiscount", "format": "" }, { @@ -119,7 +121,7 @@ export class PricingTableResponseItems { { "name": "options", "baseName": "options", - "type": "PricingTableResponseOptions", + "type": "PricingTableResponseItemsInnerOptions", "format": "" }, { @@ -154,10 +156,9 @@ export class PricingTableResponseItems { } ]; static getAttributeTypeMap() { - return PricingTableResponseItems.attributeTypeMap; + return PricingTableResponseItemsInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/QuoteResponseSummaryDiscounts.ts b/src/models/PricingTableResponseItemsInnerDiscount.ts similarity index 75% rename from src/models/QuoteResponseSummaryDiscounts.ts rename to src/models/PricingTableResponseItemsInnerDiscount.ts index 0394322..c8ace15 100644 --- a/src/models/QuoteResponseSummaryDiscounts.ts +++ b/src/models/PricingTableResponseItemsInnerDiscount.ts @@ -9,31 +9,32 @@ import { HttpFile } from '../http/http'; -export class QuoteResponseSummaryDiscounts { - 'type'?: string; - 'value'?: string; +export class PricingTableResponseItemsInnerDiscount { + 'value'?: string | null; + 'type'?: string | null; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { - "name": "type", - "baseName": "type", + "name": "value", + "baseName": "value", "type": "string", "format": "" }, { - "name": "value", - "baseName": "value", + "name": "type", + "baseName": "type", "type": "string", "format": "" } ]; static getAttributeTypeMap() { - return QuoteResponseSummaryDiscounts.attributeTypeMap; + return PricingTableResponseItemsInnerDiscount.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/PricingTableResponseOptions.ts b/src/models/PricingTableResponseItemsInnerOptions.ts similarity index 76% rename from src/models/PricingTableResponseOptions.ts rename to src/models/PricingTableResponseItemsInnerOptions.ts index fc208a5..4db9389 100644 --- a/src/models/PricingTableResponseOptions.ts +++ b/src/models/PricingTableResponseItemsInnerOptions.ts @@ -9,14 +9,16 @@ import { HttpFile } from '../http/http'; -export class PricingTableResponseOptions { - 'optional'?: boolean; - 'optionalSelected'?: boolean; - 'multichoiceEnabled'?: boolean; - 'multichoiceSelected'?: boolean; +export class PricingTableResponseItemsInnerOptions { + 'optional'?: boolean | null; + 'optionalSelected'?: boolean | null; + 'multichoiceEnabled'?: boolean | null; + 'multichoiceSelected'?: boolean | null; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "optional", @@ -44,10 +46,9 @@ export class PricingTableResponseOptions { } ]; static getAttributeTypeMap() { - return PricingTableResponseOptions.attributeTypeMap; + return PricingTableResponseItemsInnerOptions.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/PricingTableResponseSummary.ts b/src/models/PricingTableResponseSummary.ts index 1485b27..52dfe2a 100644 --- a/src/models/PricingTableResponseSummary.ts +++ b/src/models/PricingTableResponseSummary.ts @@ -10,13 +10,16 @@ import { HttpFile } from '../http/http'; export class PricingTableResponseSummary { - 'subtotal'?: string; - 'total'?: string; - 'discount'?: string; - 'tax'?: string; + 'subtotal'?: string | null; + 'total'?: string | null; + 'discount'?: string | null; + 'tax'?: string | null; + 'fee'?: string | null; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "subtotal", @@ -41,6 +44,12 @@ export class PricingTableResponseSummary { "baseName": "tax", "type": "string", "format": "" + }, + { + "name": "fee", + "baseName": "fee", + "type": "string", + "format": "" } ]; static getAttributeTypeMap() { @@ -50,4 +59,3 @@ export class PricingTableResponseSummary { public constructor() { } } - diff --git a/src/models/ProductCatalogCatalogCustomBundleItem.ts b/src/models/ProductCatalogCatalogCustomBundleItem.ts new file mode 100644 index 0000000..5c0f73d --- /dev/null +++ b/src/models/ProductCatalogCatalogCustomBundleItem.ts @@ -0,0 +1,70 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ProductCatalogItemPriceConfiguration } from '../models/ProductCatalogItemPriceConfiguration'; +import { ProductCatalogSearchCatalogItemResponseImagesInner } from '../models/ProductCatalogSearchCatalogItemResponseImagesInner'; +import { HttpFile } from '../http/http'; + +export class ProductCatalogCatalogCustomBundleItem { + 'uuid'?: string; + 'title'?: string; + 'description'?: string | null; + 'imageUrl'?: string | null; + 'images'?: Array | null; + 'priceConfiguration'?: ProductCatalogItemPriceConfiguration; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "uuid", + "baseName": "uuid", + "type": "string", + "format": "" + }, + { + "name": "title", + "baseName": "title", + "type": "string", + "format": "" + }, + { + "name": "description", + "baseName": "description", + "type": "string", + "format": "" + }, + { + "name": "imageUrl", + "baseName": "image_url", + "type": "string", + "format": "" + }, + { + "name": "images", + "baseName": "images", + "type": "Array", + "format": "" + }, + { + "name": "priceConfiguration", + "baseName": "price_configuration", + "type": "ProductCatalogItemPriceConfiguration", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ProductCatalogCatalogCustomBundleItem.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ProductCatalogCatalogItemInBundle.ts b/src/models/ProductCatalogCatalogItemInBundle.ts new file mode 100644 index 0000000..658cd43 --- /dev/null +++ b/src/models/ProductCatalogCatalogItemInBundle.ts @@ -0,0 +1,83 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ProductCatalogSearchCatalogItemResponseImagesInner } from '../models/ProductCatalogSearchCatalogItemResponseImagesInner'; +import { HttpFile } from '../http/http'; + +export class ProductCatalogCatalogItemInBundle { + 'uuid'?: string; + 'title'?: string; + 'sku'?: string | null; + 'description'?: string | null; + 'imageUrl'?: string | null; + 'images'?: Array | null; + 'price'?: number | null; + 'currency'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "uuid", + "baseName": "uuid", + "type": "string", + "format": "" + }, + { + "name": "title", + "baseName": "title", + "type": "string", + "format": "" + }, + { + "name": "sku", + "baseName": "sku", + "type": "string", + "format": "" + }, + { + "name": "description", + "baseName": "description", + "type": "string", + "format": "" + }, + { + "name": "imageUrl", + "baseName": "image_url", + "type": "string", + "format": "" + }, + { + "name": "images", + "baseName": "images", + "type": "Array", + "format": "" + }, + { + "name": "price", + "baseName": "price", + "type": "number", + "format": "" + }, + { + "name": "currency", + "baseName": "currency", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ProductCatalogCatalogItemInBundle.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ProductCatalogCustomBundleItemNoId.ts b/src/models/ProductCatalogCustomBundleItemNoId.ts new file mode 100644 index 0000000..5ff3036 --- /dev/null +++ b/src/models/ProductCatalogCustomBundleItemNoId.ts @@ -0,0 +1,76 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ProductCatalogSearchCatalogItemResponseImagesInner } from '../models/ProductCatalogSearchCatalogItemResponseImagesInner'; +import { HttpFile } from '../http/http'; + +export class ProductCatalogCustomBundleItemNoId { + 'title'?: string; + 'sku'?: string | null; + 'description'?: string | null; + 'imageUrl'?: string | null; + 'images'?: Array | null; + 'price'?: number | null; + 'currency'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "title", + "baseName": "title", + "type": "string", + "format": "" + }, + { + "name": "sku", + "baseName": "sku", + "type": "string", + "format": "" + }, + { + "name": "description", + "baseName": "description", + "type": "string", + "format": "" + }, + { + "name": "imageUrl", + "baseName": "image_url", + "type": "string", + "format": "" + }, + { + "name": "images", + "baseName": "images", + "type": "Array", + "format": "" + }, + { + "name": "price", + "baseName": "price", + "type": "number", + "format": "" + }, + { + "name": "currency", + "baseName": "currency", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ProductCatalogCustomBundleItemNoId.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ProductCatalogCustomCatalogItemInBundle.ts b/src/models/ProductCatalogCustomCatalogItemInBundle.ts new file mode 100644 index 0000000..b6ddb59 --- /dev/null +++ b/src/models/ProductCatalogCustomCatalogItemInBundle.ts @@ -0,0 +1,76 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ProductCatalogSearchCatalogItemResponseImagesInner } from '../models/ProductCatalogSearchCatalogItemResponseImagesInner'; +import { HttpFile } from '../http/http'; + +export class ProductCatalogCustomCatalogItemInBundle { + 'uuid'?: string; + 'title'?: string; + 'description'?: string | null; + 'imageUrl'?: string | null; + 'images'?: Array | null; + 'price'?: number | null; + 'currency'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "uuid", + "baseName": "uuid", + "type": "string", + "format": "" + }, + { + "name": "title", + "baseName": "title", + "type": "string", + "format": "" + }, + { + "name": "description", + "baseName": "description", + "type": "string", + "format": "" + }, + { + "name": "imageUrl", + "baseName": "image_url", + "type": "string", + "format": "" + }, + { + "name": "images", + "baseName": "images", + "type": "Array", + "format": "" + }, + { + "name": "price", + "baseName": "price", + "type": "number", + "format": "" + }, + { + "name": "currency", + "baseName": "currency", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ProductCatalogCustomCatalogItemInBundle.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ProductCatalogItemPatchRequest.ts b/src/models/ProductCatalogItemPatchRequest.ts new file mode 100644 index 0000000..90bb494 --- /dev/null +++ b/src/models/ProductCatalogItemPatchRequest.ts @@ -0,0 +1,66 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ProductCatalogItemPatchRequestBundleItemsInner } from '../models/ProductCatalogItemPatchRequestBundleItemsInner'; +import { ProductCatalogItemPatchRequestProductVariant } from '../models/ProductCatalogItemPatchRequestProductVariant'; +import { ProductCatalogTypeEnum } from '../models/ProductCatalogTypeEnum'; +import { HttpFile } from '../http/http'; + +export class ProductCatalogItemPatchRequest { + 'title'?: string; + 'categoryId'?: string | null; + 'type'?: ProductCatalogTypeEnum; + 'bundleItems'?: Array | null; + 'productVariant'?: ProductCatalogItemPatchRequestProductVariant; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "title", + "baseName": "title", + "type": "string", + "format": "" + }, + { + "name": "categoryId", + "baseName": "category_id", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "ProductCatalogTypeEnum", + "format": "" + }, + { + "name": "bundleItems", + "baseName": "bundle_items", + "type": "Array", + "format": "" + }, + { + "name": "productVariant", + "baseName": "product_variant", + "type": "ProductCatalogItemPatchRequestProductVariant", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ProductCatalogItemPatchRequest.attributeTypeMap; + } + + public constructor() { + } +} + + diff --git a/src/models/ProductCatalogItemPatchRequestBundleItemsInner.ts b/src/models/ProductCatalogItemPatchRequestBundleItemsInner.ts new file mode 100644 index 0000000..1b25726 --- /dev/null +++ b/src/models/ProductCatalogItemPatchRequestBundleItemsInner.ts @@ -0,0 +1,41 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ProductCatalogItemPatchRequestBundleItemsInnerItemOrUuid } from '../models/ProductCatalogItemPatchRequestBundleItemsInnerItemOrUuid'; +import { HttpFile } from '../http/http'; + +export class ProductCatalogItemPatchRequestBundleItemsInner { + 'quantity'?: number; + 'itemOrUuid'?: ProductCatalogItemPatchRequestBundleItemsInnerItemOrUuid; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "quantity", + "baseName": "quantity", + "type": "number", + "format": "" + }, + { + "name": "itemOrUuid", + "baseName": "item_or_uuid", + "type": "ProductCatalogItemPatchRequestBundleItemsInnerItemOrUuid", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ProductCatalogItemPatchRequestBundleItemsInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ProductCatalogItemPatchRequestBundleItemsInnerItemOrUuid.ts b/src/models/ProductCatalogItemPatchRequestBundleItemsInnerItemOrUuid.ts new file mode 100644 index 0000000..4725fd5 --- /dev/null +++ b/src/models/ProductCatalogItemPatchRequestBundleItemsInnerItemOrUuid.ts @@ -0,0 +1,29 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ProductCatalogCustomBundleItemNoId } from '../models/ProductCatalogCustomBundleItemNoId'; +import { HttpFile } from '../http/http'; + +/** + * @type ProductCatalogItemPatchRequestBundleItemsInnerItemOrUuid + * Type + * @export + */ +export type ProductCatalogItemPatchRequestBundleItemsInnerItemOrUuid = ProductCatalogCustomBundleItemNoId | string; + +/** +* @type ProductCatalogItemPatchRequestBundleItemsInnerItemOrUuidClass +* @export +*/ +export class ProductCatalogItemPatchRequestBundleItemsInnerItemOrUuidClass { + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; +} + diff --git a/src/models/ProductCatalogItemPatchRequestProductVariant.ts b/src/models/ProductCatalogItemPatchRequestProductVariant.ts new file mode 100644 index 0000000..1c90fb9 --- /dev/null +++ b/src/models/ProductCatalogItemPatchRequestProductVariant.ts @@ -0,0 +1,64 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ProductCatalogItemPriceConfiguration } from '../models/ProductCatalogItemPriceConfiguration'; +import { ProductCatalogItemRequestImagesInner } from '../models/ProductCatalogItemRequestImagesInner'; +import { ProductCatalogSearchCatalogItemResponseCustomFieldsInner } from '../models/ProductCatalogSearchCatalogItemResponseCustomFieldsInner'; +import { HttpFile } from '../http/http'; + +export class ProductCatalogItemPatchRequestProductVariant { + 'sku'?: string | null; + 'description'?: string | null; + 'images'?: Array | null; + 'customFields'?: Array | null; + 'priceConfiguration'?: ProductCatalogItemPriceConfiguration; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "sku", + "baseName": "sku", + "type": "string", + "format": "" + }, + { + "name": "description", + "baseName": "description", + "type": "string", + "format": "" + }, + { + "name": "images", + "baseName": "images", + "type": "Array", + "format": "" + }, + { + "name": "customFields", + "baseName": "custom_fields", + "type": "Array", + "format": "" + }, + { + "name": "priceConfiguration", + "baseName": "price_configuration", + "type": "ProductCatalogItemPriceConfiguration", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ProductCatalogItemPatchRequestProductVariant.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ProductCatalogItemPriceConfiguration.ts b/src/models/ProductCatalogItemPriceConfiguration.ts new file mode 100644 index 0000000..4aa97d3 --- /dev/null +++ b/src/models/ProductCatalogItemPriceConfiguration.ts @@ -0,0 +1,82 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ProductCatalogItemPriceTier } from '../models/ProductCatalogItemPriceTier'; +import { ProductCatalogPricingMethodEnum } from '../models/ProductCatalogPricingMethodEnum'; +import { HttpFile } from '../http/http'; + +export class ProductCatalogItemPriceConfiguration { + 'currency': string; + 'price'?: number | null; + 'cost'?: number | null; + 'billingType'?: string; + 'billingCycle'?: string | null; + /** + * only for volume based pricing + */ + 'tiers'?: Array | null; + 'pricingMethod': ProductCatalogPricingMethodEnum; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "currency", + "baseName": "currency", + "type": "string", + "format": "" + }, + { + "name": "price", + "baseName": "price", + "type": "number", + "format": "" + }, + { + "name": "cost", + "baseName": "cost", + "type": "number", + "format": "" + }, + { + "name": "billingType", + "baseName": "billing_type", + "type": "string", + "format": "" + }, + { + "name": "billingCycle", + "baseName": "billing_cycle", + "type": "string", + "format": "" + }, + { + "name": "tiers", + "baseName": "tiers", + "type": "Array", + "format": "" + }, + { + "name": "pricingMethod", + "baseName": "pricing_method", + "type": "ProductCatalogPricingMethodEnum", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ProductCatalogItemPriceConfiguration.attributeTypeMap; + } + + public constructor() { + } +} + + diff --git a/src/models/QuoteUpdateRequestPriceSettingsTiers.ts b/src/models/ProductCatalogItemPriceTier.ts similarity index 79% rename from src/models/QuoteUpdateRequestPriceSettingsTiers.ts rename to src/models/ProductCatalogItemPriceTier.ts index 170441d..5678442 100644 --- a/src/models/QuoteUpdateRequestPriceSettingsTiers.ts +++ b/src/models/ProductCatalogItemPriceTier.ts @@ -9,31 +9,32 @@ import { HttpFile } from '../http/http'; -export class QuoteUpdateRequestPriceSettingsTiers { - 'minQty': number; +export class ProductCatalogItemPriceTier { 'value': number; + 'minQty': number; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { - "name": "minQty", - "baseName": "min_qty", + "name": "value", + "baseName": "value", "type": "number", - "format": "" + "format": "float" }, { - "name": "value", - "baseName": "value", + "name": "minQty", + "baseName": "min_qty", "type": "number", "format": "" } ]; static getAttributeTypeMap() { - return QuoteUpdateRequestPriceSettingsTiers.attributeTypeMap; + return ProductCatalogItemPriceTier.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/ProductCatalogItemRequest.ts b/src/models/ProductCatalogItemRequest.ts new file mode 100644 index 0000000..b1830c9 --- /dev/null +++ b/src/models/ProductCatalogItemRequest.ts @@ -0,0 +1,96 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ProductCatalogItemPriceConfiguration } from '../models/ProductCatalogItemPriceConfiguration'; +import { ProductCatalogItemRequestBundleItemsInner } from '../models/ProductCatalogItemRequestBundleItemsInner'; +import { ProductCatalogItemRequestCustomFieldsInner } from '../models/ProductCatalogItemRequestCustomFieldsInner'; +import { ProductCatalogItemRequestImagesInner } from '../models/ProductCatalogItemRequestImagesInner'; +import { ProductCatalogTypeEnum } from '../models/ProductCatalogTypeEnum'; +import { HttpFile } from '../http/http'; + +export class ProductCatalogItemRequest { + 'title': string; + 'categoryId'?: string | null; + 'sku'?: string | null; + 'description'?: string | null; + 'type'?: ProductCatalogTypeEnum; + 'bundleItems'?: Array | null; + 'images'?: Array | null; + 'customFields'?: Array | null; + 'priceConfiguration': ProductCatalogItemPriceConfiguration; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "title", + "baseName": "title", + "type": "string", + "format": "" + }, + { + "name": "categoryId", + "baseName": "category_id", + "type": "string", + "format": "" + }, + { + "name": "sku", + "baseName": "sku", + "type": "string", + "format": "" + }, + { + "name": "description", + "baseName": "description", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "ProductCatalogTypeEnum", + "format": "" + }, + { + "name": "bundleItems", + "baseName": "bundle_items", + "type": "Array", + "format": "" + }, + { + "name": "images", + "baseName": "images", + "type": "Array", + "format": "" + }, + { + "name": "customFields", + "baseName": "custom_fields", + "type": "Array", + "format": "" + }, + { + "name": "priceConfiguration", + "baseName": "price_configuration", + "type": "ProductCatalogItemPriceConfiguration", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ProductCatalogItemRequest.attributeTypeMap; + } + + public constructor() { + } +} + + diff --git a/src/models/ProductCatalogItemRequestBundleItemsInner.ts b/src/models/ProductCatalogItemRequestBundleItemsInner.ts new file mode 100644 index 0000000..d335eb8 --- /dev/null +++ b/src/models/ProductCatalogItemRequestBundleItemsInner.ts @@ -0,0 +1,41 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ProductCatalogItemRequestBundleItemsInnerItemOrUuid } from '../models/ProductCatalogItemRequestBundleItemsInnerItemOrUuid'; +import { HttpFile } from '../http/http'; + +export class ProductCatalogItemRequestBundleItemsInner { + 'quantity'?: number; + 'itemOrUuid'?: ProductCatalogItemRequestBundleItemsInnerItemOrUuid; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "quantity", + "baseName": "quantity", + "type": "number", + "format": "" + }, + { + "name": "itemOrUuid", + "baseName": "item_or_uuid", + "type": "ProductCatalogItemRequestBundleItemsInnerItemOrUuid", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ProductCatalogItemRequestBundleItemsInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ProductCatalogItemRequestBundleItemsInnerItemOrUuid.ts b/src/models/ProductCatalogItemRequestBundleItemsInnerItemOrUuid.ts new file mode 100644 index 0000000..129c7c0 --- /dev/null +++ b/src/models/ProductCatalogItemRequestBundleItemsInnerItemOrUuid.ts @@ -0,0 +1,29 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ProductCatalogCatalogCustomBundleItem } from '../models/ProductCatalogCatalogCustomBundleItem'; +import { HttpFile } from '../http/http'; + +/** + * @type ProductCatalogItemRequestBundleItemsInnerItemOrUuid + * Type + * @export + */ +export type ProductCatalogItemRequestBundleItemsInnerItemOrUuid = ProductCatalogCatalogCustomBundleItem | string; + +/** +* @type ProductCatalogItemRequestBundleItemsInnerItemOrUuidClass +* @export +*/ +export class ProductCatalogItemRequestBundleItemsInnerItemOrUuidClass { + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; +} + diff --git a/src/models/ProductCatalogItemRequestCustomFieldsInner.ts b/src/models/ProductCatalogItemRequestCustomFieldsInner.ts new file mode 100644 index 0000000..8f51235 --- /dev/null +++ b/src/models/ProductCatalogItemRequestCustomFieldsInner.ts @@ -0,0 +1,40 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class ProductCatalogItemRequestCustomFieldsInner { + 'name'?: string; + 'value'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "value", + "baseName": "value", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ProductCatalogItemRequestCustomFieldsInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ProductCatalogItemRequestImagesInner.ts b/src/models/ProductCatalogItemRequestImagesInner.ts new file mode 100644 index 0000000..679ffa1 --- /dev/null +++ b/src/models/ProductCatalogItemRequestImagesInner.ts @@ -0,0 +1,47 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class ProductCatalogItemRequestImagesInner { + 'isMain'?: boolean; + 'order'?: number; + 'src'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "isMain", + "baseName": "is_main", + "type": "boolean", + "format": "" + }, + { + "name": "order", + "baseName": "order", + "type": "number", + "format": "" + }, + { + "name": "src", + "baseName": "src", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ProductCatalogItemRequestImagesInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ProductCatalogItemResponse.ts b/src/models/ProductCatalogItemResponse.ts new file mode 100644 index 0000000..8379d23 --- /dev/null +++ b/src/models/ProductCatalogItemResponse.ts @@ -0,0 +1,116 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ProductCatalogItemResponseBundleItemsInner } from '../models/ProductCatalogItemResponseBundleItemsInner'; +import { ProductCatalogItemResponseDefaultPriceConfiguration } from '../models/ProductCatalogItemResponseDefaultPriceConfiguration'; +import { ProductCatalogItemResponseVariantsInner } from '../models/ProductCatalogItemResponseVariantsInner'; +import { ProductCatalogTypeEnum } from '../models/ProductCatalogTypeEnum'; +import { HttpFile } from '../http/http'; + +export class ProductCatalogItemResponse { + 'uuid'?: string; + 'title'?: string; + 'dateCreated'?: Date; + 'dateModified'?: Date | null; + 'createdBy'?: string; + 'modifiedBy'?: string | null; + 'categoryId'?: string | null; + 'categoryName'?: string | null; + 'type'?: ProductCatalogTypeEnum; + 'bundleItems'?: Array | null; + 'defaultPriceConfiguration'?: ProductCatalogItemResponseDefaultPriceConfiguration; + 'variants'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "uuid", + "baseName": "uuid", + "type": "string", + "format": "uuid" + }, + { + "name": "title", + "baseName": "title", + "type": "string", + "format": "" + }, + { + "name": "dateCreated", + "baseName": "date_created", + "type": "Date", + "format": "date-time" + }, + { + "name": "dateModified", + "baseName": "date_modified", + "type": "Date", + "format": "date-time" + }, + { + "name": "createdBy", + "baseName": "created_by", + "type": "string", + "format": "" + }, + { + "name": "modifiedBy", + "baseName": "modified_by", + "type": "string", + "format": "" + }, + { + "name": "categoryId", + "baseName": "category_id", + "type": "string", + "format": "uuid" + }, + { + "name": "categoryName", + "baseName": "category_name", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "ProductCatalogTypeEnum", + "format": "" + }, + { + "name": "bundleItems", + "baseName": "bundle_items", + "type": "Array", + "format": "" + }, + { + "name": "defaultPriceConfiguration", + "baseName": "default_price_configuration", + "type": "ProductCatalogItemResponseDefaultPriceConfiguration", + "format": "" + }, + { + "name": "variants", + "baseName": "variants", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ProductCatalogItemResponse.attributeTypeMap; + } + + public constructor() { + } +} + + diff --git a/src/models/ProductCatalogItemResponseBundleItemsInner.ts b/src/models/ProductCatalogItemResponseBundleItemsInner.ts new file mode 100644 index 0000000..fff50de --- /dev/null +++ b/src/models/ProductCatalogItemResponseBundleItemsInner.ts @@ -0,0 +1,41 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ProductCatalogItemResponseBundleItemsInnerItem } from '../models/ProductCatalogItemResponseBundleItemsInnerItem'; +import { HttpFile } from '../http/http'; + +export class ProductCatalogItemResponseBundleItemsInner { + 'quantity'?: number; + 'item'?: ProductCatalogItemResponseBundleItemsInnerItem; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "quantity", + "baseName": "quantity", + "type": "number", + "format": "" + }, + { + "name": "item", + "baseName": "item", + "type": "ProductCatalogItemResponseBundleItemsInnerItem", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ProductCatalogItemResponseBundleItemsInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ProductCatalogItemResponseBundleItemsInnerItem.ts b/src/models/ProductCatalogItemResponseBundleItemsInnerItem.ts new file mode 100644 index 0000000..b75c960 --- /dev/null +++ b/src/models/ProductCatalogItemResponseBundleItemsInnerItem.ts @@ -0,0 +1,85 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ProductCatalogCatalogItemInBundle } from '../models/ProductCatalogCatalogItemInBundle'; +import { ProductCatalogCustomCatalogItemInBundle } from '../models/ProductCatalogCustomCatalogItemInBundle'; +import { ProductCatalogSearchCatalogItemResponseImagesInner } from '../models/ProductCatalogSearchCatalogItemResponseImagesInner'; +import { HttpFile } from '../http/http'; + +export class ProductCatalogItemResponseBundleItemsInnerItem { + 'uuid'?: string; + 'title'?: string; + 'sku'?: string | null; + 'description'?: string | null; + 'imageUrl'?: string | null; + 'images'?: Array | null; + 'price'?: number | null; + 'currency'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "uuid", + "baseName": "uuid", + "type": "string", + "format": "" + }, + { + "name": "title", + "baseName": "title", + "type": "string", + "format": "" + }, + { + "name": "sku", + "baseName": "sku", + "type": "string", + "format": "" + }, + { + "name": "description", + "baseName": "description", + "type": "string", + "format": "" + }, + { + "name": "imageUrl", + "baseName": "image_url", + "type": "string", + "format": "" + }, + { + "name": "images", + "baseName": "images", + "type": "Array", + "format": "" + }, + { + "name": "price", + "baseName": "price", + "type": "number", + "format": "" + }, + { + "name": "currency", + "baseName": "currency", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ProductCatalogItemResponseBundleItemsInnerItem.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ProductCatalogItemResponseDefaultPriceConfiguration.ts b/src/models/ProductCatalogItemResponseDefaultPriceConfiguration.ts new file mode 100644 index 0000000..198e3b9 --- /dev/null +++ b/src/models/ProductCatalogItemResponseDefaultPriceConfiguration.ts @@ -0,0 +1,86 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ProductCatalogItemPriceTier } from '../models/ProductCatalogItemPriceTier'; +import { HttpFile } from '../http/http'; + +export class ProductCatalogItemResponseDefaultPriceConfiguration { + 'currency': string; + 'price'?: number | null; + 'cost'?: number | null; + 'billingType'?: string; + 'billingCycle'?: string | null; + /** + * only for volume based pricing + */ + 'tiers'?: Array | null; + 'pricingMethod': number; + 'uuid'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "currency", + "baseName": "currency", + "type": "string", + "format": "" + }, + { + "name": "price", + "baseName": "price", + "type": "number", + "format": "" + }, + { + "name": "cost", + "baseName": "cost", + "type": "number", + "format": "" + }, + { + "name": "billingType", + "baseName": "billing_type", + "type": "string", + "format": "" + }, + { + "name": "billingCycle", + "baseName": "billing_cycle", + "type": "string", + "format": "" + }, + { + "name": "tiers", + "baseName": "tiers", + "type": "Array", + "format": "" + }, + { + "name": "pricingMethod", + "baseName": "pricing_method", + "type": "number", + "format": "" + }, + { + "name": "uuid", + "baseName": "uuid", + "type": "string", + "format": "uuid" + } ]; + + static getAttributeTypeMap() { + return ProductCatalogItemResponseDefaultPriceConfiguration.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ProductCatalogItemResponseVariantsInner.ts b/src/models/ProductCatalogItemResponseVariantsInner.ts new file mode 100644 index 0000000..174932e --- /dev/null +++ b/src/models/ProductCatalogItemResponseVariantsInner.ts @@ -0,0 +1,92 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ProductCatalogItemResponseDefaultPriceConfiguration } from '../models/ProductCatalogItemResponseDefaultPriceConfiguration'; +import { ProductCatalogSearchCatalogItemResponseCustomFieldsInner } from '../models/ProductCatalogSearchCatalogItemResponseCustomFieldsInner'; +import { ProductCatalogSearchCatalogItemResponseImagesInner } from '../models/ProductCatalogSearchCatalogItemResponseImagesInner'; +import { HttpFile } from '../http/http'; + +export class ProductCatalogItemResponseVariantsInner { + 'uuid'?: string; + 'sku'?: string | null; + 'description'?: string | null; + 'customFields'?: Array | null; + 'images'?: Array | null; + 'dateCreated'?: Date; + 'dateModified'?: Date | null; + 'status'?: number; + 'priceConfigurations'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "uuid", + "baseName": "uuid", + "type": "string", + "format": "uuid" + }, + { + "name": "sku", + "baseName": "sku", + "type": "string", + "format": "" + }, + { + "name": "description", + "baseName": "description", + "type": "string", + "format": "" + }, + { + "name": "customFields", + "baseName": "custom_fields", + "type": "Array", + "format": "" + }, + { + "name": "images", + "baseName": "images", + "type": "Array", + "format": "" + }, + { + "name": "dateCreated", + "baseName": "date_created", + "type": "Date", + "format": "date-time" + }, + { + "name": "dateModified", + "baseName": "date_modified", + "type": "Date", + "format": "date-time" + }, + { + "name": "status", + "baseName": "status", + "type": "number", + "format": "" + }, + { + "name": "priceConfigurations", + "baseName": "price_configurations", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ProductCatalogItemResponseVariantsInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ProductCatalogPricingMethodEnum.ts b/src/models/ProductCatalogPricingMethodEnum.ts new file mode 100644 index 0000000..c31146d --- /dev/null +++ b/src/models/ProductCatalogPricingMethodEnum.ts @@ -0,0 +1,16 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export enum ProductCatalogPricingMethodEnum { + NUMBER_0 = 0, + NUMBER_1 = 1, + NUMBER_2 = 2 +} diff --git a/src/models/ProductCatalogSearchCatalogItemResponse.ts b/src/models/ProductCatalogSearchCatalogItemResponse.ts new file mode 100644 index 0000000..2e45f6b --- /dev/null +++ b/src/models/ProductCatalogSearchCatalogItemResponse.ts @@ -0,0 +1,214 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ProductCatalogSearchCatalogItemResponseCustomFieldsInner } from '../models/ProductCatalogSearchCatalogItemResponseCustomFieldsInner'; +import { ProductCatalogSearchCatalogItemResponseImagesInner } from '../models/ProductCatalogSearchCatalogItemResponseImagesInner'; +import { ProductCatalogSearchCatalogItemResponseTiersInner } from '../models/ProductCatalogSearchCatalogItemResponseTiersInner'; +import { ProductCatalogTypeEnum } from '../models/ProductCatalogTypeEnum'; +import { HttpFile } from '../http/http'; + +export class ProductCatalogSearchCatalogItemResponse { + 'billingCycle'?: number | null; + 'billingType'?: string; + 'bundleItemsCount'?: number; + 'workspaceId'?: string; + 'categoryId'?: string | null; + 'categoryName'?: string | null; + 'createdBy'?: string; + 'cost'?: number | null; + 'currency'?: string; + 'customFields'?: Array | null; + 'dateCreated'?: Date; + 'dateModified'?: Date | null; + 'description'?: string | null; + 'imageSrc'?: string | null; + 'images'?: Array | null; + 'maxTierValue'?: number | null; + 'minTierValue'?: number | null; + 'modifiedBy'?: string; + 'price'?: number | null; + 'pricingMethod'?: number; + 'sku'?: string; + 'title'?: string; + 'tiers'?: Array | null; + 'type'?: ProductCatalogTypeEnum; + 'uuid'?: string; + 'highlights'?: { [key: string]: any; } | null; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "billingCycle", + "baseName": "billing_cycle", + "type": "number", + "format": "" + }, + { + "name": "billingType", + "baseName": "billing_type", + "type": "string", + "format": "" + }, + { + "name": "bundleItemsCount", + "baseName": "bundle_items_count", + "type": "number", + "format": "" + }, + { + "name": "workspaceId", + "baseName": "workspace_id", + "type": "string", + "format": "" + }, + { + "name": "categoryId", + "baseName": "category_id", + "type": "string", + "format": "" + }, + { + "name": "categoryName", + "baseName": "category_name", + "type": "string", + "format": "" + }, + { + "name": "createdBy", + "baseName": "created_by", + "type": "string", + "format": "" + }, + { + "name": "cost", + "baseName": "cost", + "type": "number", + "format": "" + }, + { + "name": "currency", + "baseName": "currency", + "type": "string", + "format": "" + }, + { + "name": "customFields", + "baseName": "custom_fields", + "type": "Array", + "format": "" + }, + { + "name": "dateCreated", + "baseName": "date_created", + "type": "Date", + "format": "date-time" + }, + { + "name": "dateModified", + "baseName": "date_modified", + "type": "Date", + "format": "date-time" + }, + { + "name": "description", + "baseName": "description", + "type": "string", + "format": "" + }, + { + "name": "imageSrc", + "baseName": "image_src", + "type": "string", + "format": "" + }, + { + "name": "images", + "baseName": "images", + "type": "Array", + "format": "" + }, + { + "name": "maxTierValue", + "baseName": "max_tier_value", + "type": "number", + "format": "" + }, + { + "name": "minTierValue", + "baseName": "min_tier_value", + "type": "number", + "format": "" + }, + { + "name": "modifiedBy", + "baseName": "modified_by", + "type": "string", + "format": "" + }, + { + "name": "price", + "baseName": "price", + "type": "number", + "format": "" + }, + { + "name": "pricingMethod", + "baseName": "pricing_method", + "type": "number", + "format": "" + }, + { + "name": "sku", + "baseName": "sku", + "type": "string", + "format": "" + }, + { + "name": "title", + "baseName": "title", + "type": "string", + "format": "" + }, + { + "name": "tiers", + "baseName": "tiers", + "type": "Array", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "ProductCatalogTypeEnum", + "format": "" + }, + { + "name": "uuid", + "baseName": "uuid", + "type": "string", + "format": "uuid" + }, + { + "name": "highlights", + "baseName": "highlights", + "type": "{ [key: string]: any; }", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ProductCatalogSearchCatalogItemResponse.attributeTypeMap; + } + + public constructor() { + } +} + + diff --git a/src/models/ProductCatalogSearchCatalogItemResponseCustomFieldsInner.ts b/src/models/ProductCatalogSearchCatalogItemResponseCustomFieldsInner.ts new file mode 100644 index 0000000..48ff5b8 --- /dev/null +++ b/src/models/ProductCatalogSearchCatalogItemResponseCustomFieldsInner.ts @@ -0,0 +1,40 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class ProductCatalogSearchCatalogItemResponseCustomFieldsInner { + 'name'?: string; + 'value'?: string | null; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "value", + "baseName": "value", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ProductCatalogSearchCatalogItemResponseCustomFieldsInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/ProductCatalogSearchCatalogItemResponseImagesInner.ts b/src/models/ProductCatalogSearchCatalogItemResponseImagesInner.ts new file mode 100644 index 0000000..98e90c1 --- /dev/null +++ b/src/models/ProductCatalogSearchCatalogItemResponseImagesInner.ts @@ -0,0 +1,47 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class ProductCatalogSearchCatalogItemResponseImagesInner { + 'isMain'?: boolean | null; + 'order'?: number; + 'src'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "isMain", + "baseName": "is_main", + "type": "boolean", + "format": "" + }, + { + "name": "order", + "baseName": "order", + "type": "number", + "format": "" + }, + { + "name": "src", + "baseName": "src", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return ProductCatalogSearchCatalogItemResponseImagesInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/QuoteUpdateRequestDiscounts.ts b/src/models/ProductCatalogSearchCatalogItemResponseTiersInner.ts similarity index 68% rename from src/models/QuoteUpdateRequestDiscounts.ts rename to src/models/ProductCatalogSearchCatalogItemResponseTiersInner.ts index 61f6eca..0442122 100644 --- a/src/models/QuoteUpdateRequestDiscounts.ts +++ b/src/models/ProductCatalogSearchCatalogItemResponseTiersInner.ts @@ -9,17 +9,19 @@ import { HttpFile } from '../http/http'; -export class QuoteUpdateRequestDiscounts { - 'type'?: QuoteUpdateRequestDiscountsTypeEnum; +export class ProductCatalogSearchCatalogItemResponseTiersInner { + 'minQty'?: number; 'value'?: number; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { - "name": "type", - "baseName": "type", - "type": "QuoteUpdateRequestDiscountsTypeEnum", + "name": "minQty", + "baseName": "min_qty", + "type": "number", "format": "" }, { @@ -30,13 +32,9 @@ export class QuoteUpdateRequestDiscounts { } ]; static getAttributeTypeMap() { - return QuoteUpdateRequestDiscounts.attributeTypeMap; + return ProductCatalogSearchCatalogItemResponseTiersInner.attributeTypeMap; } public constructor() { } } - - -export type QuoteUpdateRequestDiscountsTypeEnum = "percent" | "flat" ; - diff --git a/src/models/ProductCatalogTypeEnum.ts b/src/models/ProductCatalogTypeEnum.ts new file mode 100644 index 0000000..1917e0e --- /dev/null +++ b/src/models/ProductCatalogTypeEnum.ts @@ -0,0 +1,15 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export enum ProductCatalogTypeEnum { + Regular = 'regular', + Bundle = 'bundle' +} diff --git a/src/models/QuoteResponse.ts b/src/models/QuoteResponse.ts index d69a5df..6b8ad71 100644 --- a/src/models/QuoteResponse.ts +++ b/src/models/QuoteResponse.ts @@ -7,10 +7,10 @@ * Do not edit the class manually. */ -import { QuoteResponseMergeRules } from './QuoteResponseMergeRules'; -import { QuoteResponseSections } from './QuoteResponseSections'; -import { QuoteResponseSettings } from './QuoteResponseSettings'; -import { QuoteResponseSummary } from './QuoteResponseSummary'; +import { QuoteResponseMergeRulesInner } from '../models/QuoteResponseMergeRulesInner'; +import { QuoteResponseSectionsInner } from '../models/QuoteResponseSectionsInner'; +import { QuoteResponseSettings } from '../models/QuoteResponseSettings'; +import { QuoteResponseSummary } from '../models/QuoteResponseSummary'; import { HttpFile } from '../http/http'; export class QuoteResponse { @@ -18,12 +18,14 @@ export class QuoteResponse { 'currency'?: string; 'total'?: string; 'summary'?: QuoteResponseSummary; - 'sections'?: Array; - 'mergeRules'?: Array; + 'sections'?: Array; + 'mergeRules'?: Array; 'settings'?: QuoteResponseSettings; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -52,13 +54,13 @@ export class QuoteResponse { { "name": "sections", "baseName": "sections", - "type": "Array", + "type": "Array", "format": "" }, { "name": "mergeRules", "baseName": "merge_rules", - "type": "Array", + "type": "Array", "format": "" }, { @@ -75,4 +77,3 @@ export class QuoteResponse { public constructor() { } } - diff --git a/src/models/QuoteResponseMergeRules.ts b/src/models/QuoteResponseMergeRulesInner.ts similarity index 63% rename from src/models/QuoteResponseMergeRules.ts rename to src/models/QuoteResponseMergeRulesInner.ts index 27c1df7..713d480 100644 --- a/src/models/QuoteResponseMergeRules.ts +++ b/src/models/QuoteResponseMergeRulesInner.ts @@ -7,18 +7,20 @@ * Do not edit the class manually. */ -import { QuoteResponseAction } from './QuoteResponseAction'; -import { QuoteResponseCondition } from './QuoteResponseCondition'; +import { QuoteResponseMergeRulesInnerAction } from '../models/QuoteResponseMergeRulesInnerAction'; +import { QuoteResponseMergeRulesInnerCondition } from '../models/QuoteResponseMergeRulesInnerCondition'; import { HttpFile } from '../http/http'; -export class QuoteResponseMergeRules { +export class QuoteResponseMergeRulesInner { 'id'?: string; 'enabled'?: boolean; - 'action'?: QuoteResponseAction; - 'condition'?: QuoteResponseCondition; + 'action'?: QuoteResponseMergeRulesInnerAction; + 'condition'?: QuoteResponseMergeRulesInnerCondition; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -35,21 +37,20 @@ export class QuoteResponseMergeRules { { "name": "action", "baseName": "action", - "type": "QuoteResponseAction", + "type": "QuoteResponseMergeRulesInnerAction", "format": "" }, { "name": "condition", "baseName": "condition", - "type": "QuoteResponseCondition", + "type": "QuoteResponseMergeRulesInnerCondition", "format": "" } ]; static getAttributeTypeMap() { - return QuoteResponseMergeRules.attributeTypeMap; + return QuoteResponseMergeRulesInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/QuoteResponseAction.ts b/src/models/QuoteResponseMergeRulesInnerAction.ts similarity index 81% rename from src/models/QuoteResponseAction.ts rename to src/models/QuoteResponseMergeRulesInnerAction.ts index c58bb6f..5dfbd4f 100644 --- a/src/models/QuoteResponseAction.ts +++ b/src/models/QuoteResponseMergeRulesInnerAction.ts @@ -9,12 +9,14 @@ import { HttpFile } from '../http/http'; -export class QuoteResponseAction { +export class QuoteResponseMergeRulesInnerAction { 'type'?: string; 'sectionId'?: string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "type", @@ -30,10 +32,9 @@ export class QuoteResponseAction { } ]; static getAttributeTypeMap() { - return QuoteResponseAction.attributeTypeMap; + return QuoteResponseMergeRulesInnerAction.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/QuoteResponseCondition.ts b/src/models/QuoteResponseMergeRulesInnerCondition.ts similarity index 66% rename from src/models/QuoteResponseCondition.ts rename to src/models/QuoteResponseMergeRulesInnerCondition.ts index a7dc5b8..c317020 100644 --- a/src/models/QuoteResponseCondition.ts +++ b/src/models/QuoteResponseMergeRulesInnerCondition.ts @@ -7,16 +7,18 @@ * Do not edit the class manually. */ -import { QuoteResponseConditionComparison } from './QuoteResponseConditionComparison'; +import { QuoteResponseMergeRulesInnerConditionComparisonInner } from '../models/QuoteResponseMergeRulesInnerConditionComparisonInner'; import { HttpFile } from '../http/http'; -export class QuoteResponseCondition { +export class QuoteResponseMergeRulesInnerCondition { 'fieldName'?: string; 'type'?: string; - 'comparison'?: Array; + 'comparison'?: Array; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "fieldName", @@ -33,15 +35,14 @@ export class QuoteResponseCondition { { "name": "comparison", "baseName": "comparison", - "type": "Array", + "type": "Array", "format": "" } ]; static getAttributeTypeMap() { - return QuoteResponseCondition.attributeTypeMap; + return QuoteResponseMergeRulesInnerCondition.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/QuoteResponseConditionComparison.ts b/src/models/QuoteResponseMergeRulesInnerConditionComparisonInner.ts similarity index 78% rename from src/models/QuoteResponseConditionComparison.ts rename to src/models/QuoteResponseMergeRulesInnerConditionComparisonInner.ts index d2cf657..b8c02ac 100644 --- a/src/models/QuoteResponseConditionComparison.ts +++ b/src/models/QuoteResponseMergeRulesInnerConditionComparisonInner.ts @@ -9,12 +9,14 @@ import { HttpFile } from '../http/http'; -export class QuoteResponseConditionComparison { +export class QuoteResponseMergeRulesInnerConditionComparisonInner { 'type'?: string; 'value'?: string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "type", @@ -30,10 +32,9 @@ export class QuoteResponseConditionComparison { } ]; static getAttributeTypeMap() { - return QuoteResponseConditionComparison.attributeTypeMap; + return QuoteResponseMergeRulesInnerConditionComparisonInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/QuoteResponseSectionColumn.ts b/src/models/QuoteResponseSectionColumn.ts index 81683f1..ced5648 100644 --- a/src/models/QuoteResponseSectionColumn.ts +++ b/src/models/QuoteResponseSectionColumn.ts @@ -10,13 +10,15 @@ import { HttpFile } from '../http/http'; export class QuoteResponseSectionColumn { - 'header'?: string; + 'header'?: string | null; 'name'?: string; - 'mergeName'?: string; + 'mergeName'?: string | null; 'hidden'?: string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "header", @@ -50,4 +52,3 @@ export class QuoteResponseSectionColumn { public constructor() { } } - diff --git a/src/models/QuoteResponseSectionItem.ts b/src/models/QuoteResponseSectionItem.ts index 62b51b6..9a0764e 100644 --- a/src/models/QuoteResponseSectionItem.ts +++ b/src/models/QuoteResponseSectionItem.ts @@ -7,34 +7,37 @@ * Do not edit the class manually. */ -import { QuoteResponseOptions } from './QuoteResponseOptions'; -import { QuoteResponseSummaryDiscounts } from './QuoteResponseSummaryDiscounts'; +import { QuoteResponseSectionItemOptions } from '../models/QuoteResponseSectionItemOptions'; +import { QuoteResponseSummaryDiscountsValue } from '../models/QuoteResponseSummaryDiscountsValue'; import { HttpFile } from '../http/http'; export class QuoteResponseSectionItem { - 'id'?: string; - 'sku'?: string; - 'name'?: string; - 'description'?: string; - 'qty'?: string; - 'price'?: string; - 'cost'?: string; - 'billingFrequency'?: string; - 'contractTerm'?: string; - 'pricingMethod'?: string; - 'type'?: string; - 'referenceType'?: string; - 'options'?: QuoteResponseOptions; - 'customColumns'?: { [key: string]: string; }; - 'discounts'?: { [key: string]: QuoteResponseSummaryDiscounts; }; - 'taxes'?: { [key: string]: QuoteResponseSummaryDiscounts; }; - 'fees'?: { [key: string]: QuoteResponseSummaryDiscounts; }; - 'multipliers'?: { [key: string]: string; }; - 'total'?: string; - 'overallTotal'?: string; + 'id'?: string | null; + 'sku'?: string | null; + 'name'?: string | null; + 'description'?: string | null; + 'qty'?: string | null; + 'price'?: string | null; + 'cost'?: string | null; + 'billingFrequency'?: string | null; + 'contractTerm'?: string | null; + 'pricingMethod'?: string | null; + 'type'?: string | null; + 'referenceType'?: string | null; + 'options'?: QuoteResponseSectionItemOptions | null; + 'customColumns'?: { [key: string]: string; } | null; + 'externalColumns'?: { [key: string]: string; }; + 'discounts'?: { [key: string]: QuoteResponseSummaryDiscountsValue; } | null; + 'taxes'?: { [key: string]: QuoteResponseSummaryDiscountsValue; } | null; + 'fees'?: { [key: string]: QuoteResponseSummaryDiscountsValue; } | null; + 'multipliers'?: { [key: string]: string; } | null; + 'total'?: string | null; + 'overallTotal'?: string | null; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -111,7 +114,7 @@ export class QuoteResponseSectionItem { { "name": "options", "baseName": "options", - "type": "QuoteResponseOptions", + "type": "QuoteResponseSectionItemOptions", "format": "" }, { @@ -120,22 +123,28 @@ export class QuoteResponseSectionItem { "type": "{ [key: string]: string; }", "format": "" }, + { + "name": "externalColumns", + "baseName": "external_columns", + "type": "{ [key: string]: string; }", + "format": "" + }, { "name": "discounts", "baseName": "discounts", - "type": "{ [key: string]: QuoteResponseSummaryDiscounts; }", + "type": "{ [key: string]: QuoteResponseSummaryDiscountsValue; }", "format": "" }, { "name": "taxes", "baseName": "taxes", - "type": "{ [key: string]: QuoteResponseSummaryDiscounts; }", + "type": "{ [key: string]: QuoteResponseSummaryDiscountsValue; }", "format": "" }, { "name": "fees", "baseName": "fees", - "type": "{ [key: string]: QuoteResponseSummaryDiscounts; }", + "type": "{ [key: string]: QuoteResponseSummaryDiscountsValue; }", "format": "" }, { @@ -164,4 +173,3 @@ export class QuoteResponseSectionItem { public constructor() { } } - diff --git a/src/models/QuoteResponseOptions.ts b/src/models/QuoteResponseSectionItemOptions.ts similarity index 76% rename from src/models/QuoteResponseOptions.ts rename to src/models/QuoteResponseSectionItemOptions.ts index c83d358..e10ed31 100644 --- a/src/models/QuoteResponseOptions.ts +++ b/src/models/QuoteResponseSectionItemOptions.ts @@ -9,12 +9,14 @@ import { HttpFile } from '../http/http'; -export class QuoteResponseOptions { - 'selected'?: boolean; - 'qtyEditable'?: boolean; +export class QuoteResponseSectionItemOptions { + 'selected'?: boolean | null; + 'qtyEditable'?: boolean | null; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "selected", @@ -30,10 +32,9 @@ export class QuoteResponseOptions { } ]; static getAttributeTypeMap() { - return QuoteResponseOptions.attributeTypeMap; + return QuoteResponseSectionItemOptions.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/QuoteResponseSectionSummary.ts b/src/models/QuoteResponseSectionSummary.ts index 3f7f082..eceae65 100644 --- a/src/models/QuoteResponseSectionSummary.ts +++ b/src/models/QuoteResponseSectionSummary.ts @@ -7,23 +7,25 @@ * Do not edit the class manually. */ -import { QuoteResponseSummaryRecurringSubtotal } from './QuoteResponseSummaryRecurringSubtotal'; +import { QuoteResponseSummaryRecurringSubtotalInner } from '../models/QuoteResponseSummaryRecurringSubtotalInner'; import { HttpFile } from '../http/http'; export class QuoteResponseSectionSummary { 'total'?: string; - 'subtotal'?: string; - 'oneTimeSubtotal'?: string; - 'recurringSubtotal'?: Array; - 'totalQty'?: string; - 'discounts'?: any; - 'taxes'?: any; - 'fees'?: any; - 'customFields'?: { [key: string]: string; }; - 'totalSectionValue'?: string; + 'subtotal'?: string | null; + 'oneTimeSubtotal'?: string | null; + 'recurringSubtotal'?: Array | null; + 'totalQty'?: string | null; + 'discounts'?: any | null; + 'taxes'?: any | null; + 'fees'?: any | null; + 'customFields'?: { [key: string]: string; } | null; + 'totalSectionValue'?: string | null; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "total", @@ -46,7 +48,7 @@ export class QuoteResponseSectionSummary { { "name": "recurringSubtotal", "baseName": "recurring_subtotal", - "type": "Array", + "type": "Array", "format": "" }, { @@ -93,4 +95,3 @@ export class QuoteResponseSectionSummary { public constructor() { } } - diff --git a/src/models/QuoteResponseSections.ts b/src/models/QuoteResponseSectionsInner.ts similarity index 76% rename from src/models/QuoteResponseSections.ts rename to src/models/QuoteResponseSectionsInner.ts index 8a5db1a..63e9dbb 100644 --- a/src/models/QuoteResponseSections.ts +++ b/src/models/QuoteResponseSectionsInner.ts @@ -7,23 +7,25 @@ * Do not edit the class manually. */ -import { QuoteResponseSectionColumn } from './QuoteResponseSectionColumn'; -import { QuoteResponseSectionItem } from './QuoteResponseSectionItem'; -import { QuoteResponseSectionSummary } from './QuoteResponseSectionSummary'; -import { QuoteSectionSettings } from './QuoteSectionSettings'; +import { QuoteResponseSectionColumn } from '../models/QuoteResponseSectionColumn'; +import { QuoteResponseSectionItem } from '../models/QuoteResponseSectionItem'; +import { QuoteResponseSectionSummary } from '../models/QuoteResponseSectionSummary'; +import { QuoteSectionSettings } from '../models/QuoteSectionSettings'; import { HttpFile } from '../http/http'; -export class QuoteResponseSections { +export class QuoteResponseSectionsInner { 'id'?: string; 'name'?: string; 'summary'?: QuoteResponseSectionSummary; 'columns'?: Array; - 'items'?: Array; + 'items'?: Array | null; 'total'?: string; 'settings'?: QuoteSectionSettings; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -69,10 +71,9 @@ export class QuoteResponseSections { } ]; static getAttributeTypeMap() { - return QuoteResponseSections.attributeTypeMap; + return QuoteResponseSectionsInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/QuoteResponseSettings.ts b/src/models/QuoteResponseSettings.ts index d9c89d1..20e30aa 100644 --- a/src/models/QuoteResponseSettings.ts +++ b/src/models/QuoteResponseSettings.ts @@ -14,6 +14,8 @@ export class QuoteResponseSettings { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "selectionType", @@ -30,6 +32,9 @@ export class QuoteResponseSettings { } } - -export type QuoteResponseSettingsSelectionTypeEnum = "custom" | "single" | "multiple" ; +export enum QuoteResponseSettingsSelectionTypeEnum { + Custom = 'custom', + Single = 'single', + Multiple = 'multiple' +} diff --git a/src/models/QuoteResponseSummary.ts b/src/models/QuoteResponseSummary.ts index c5a1bd6..7912bac 100644 --- a/src/models/QuoteResponseSummary.ts +++ b/src/models/QuoteResponseSummary.ts @@ -7,28 +7,30 @@ * Do not edit the class manually. */ -import { QuoteResponseSummaryDiscounts } from './QuoteResponseSummaryDiscounts'; -import { QuoteResponseSummaryRecurringSubtotal } from './QuoteResponseSummaryRecurringSubtotal'; +import { QuoteResponseSummaryDiscountsValue } from '../models/QuoteResponseSummaryDiscountsValue'; +import { QuoteResponseSummaryRecurringSubtotalInner } from '../models/QuoteResponseSummaryRecurringSubtotalInner'; import { HttpFile } from '../http/http'; export class QuoteResponseSummary { 'total'?: string; - 'subtotal'?: string; - 'oneTimeSubtotal'?: string; - 'recurringSubtotal'?: Array; - 'totalQty'?: string; - 'discounts'?: { [key: string]: QuoteResponseSummaryDiscounts; }; - 'taxes'?: any; - 'fees'?: any; - 'customFields'?: { [key: string]: string; }; - 'totalDiscount'?: string; - 'totalTax'?: string; - 'totalFee'?: string; - 'totalSavings'?: string; - 'totalContractValue'?: string; + 'subtotal'?: string | null; + 'oneTimeSubtotal'?: string | null; + 'recurringSubtotal'?: Array | null; + 'totalQty'?: string | null; + 'discounts'?: { [key: string]: QuoteResponseSummaryDiscountsValue; } | null; + 'taxes'?: any | null; + 'fees'?: any | null; + 'customFields'?: { [key: string]: string; } | null; + 'totalDiscount'?: string | null; + 'totalTax'?: string | null; + 'totalFee'?: string | null; + 'totalSavings'?: string | null; + 'totalContractValue'?: string | null; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "total", @@ -51,7 +53,7 @@ export class QuoteResponseSummary { { "name": "recurringSubtotal", "baseName": "recurring_subtotal", - "type": "Array", + "type": "Array", "format": "" }, { @@ -63,7 +65,7 @@ export class QuoteResponseSummary { { "name": "discounts", "baseName": "discounts", - "type": "{ [key: string]: QuoteResponseSummaryDiscounts; }", + "type": "{ [key: string]: QuoteResponseSummaryDiscountsValue; }", "format": "" }, { @@ -122,4 +124,3 @@ export class QuoteResponseSummary { public constructor() { } } - diff --git a/src/models/PricingTableResponseDiscount.ts b/src/models/QuoteResponseSummaryDiscountsValue.ts similarity index 76% rename from src/models/PricingTableResponseDiscount.ts rename to src/models/QuoteResponseSummaryDiscountsValue.ts index 0c8b00e..3e01029 100644 --- a/src/models/PricingTableResponseDiscount.ts +++ b/src/models/QuoteResponseSummaryDiscountsValue.ts @@ -9,31 +9,32 @@ import { HttpFile } from '../http/http'; -export class PricingTableResponseDiscount { - 'value'?: string; - 'type'?: string; +export class QuoteResponseSummaryDiscountsValue { + 'type'?: string | null; + 'value'?: string | null; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { - "name": "value", - "baseName": "value", + "name": "type", + "baseName": "type", "type": "string", "format": "" }, { - "name": "type", - "baseName": "type", + "name": "value", + "baseName": "value", "type": "string", "format": "" } ]; static getAttributeTypeMap() { - return PricingTableResponseDiscount.attributeTypeMap; + return QuoteResponseSummaryDiscountsValue.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/QuoteResponseSummaryRecurringSubtotal.ts b/src/models/QuoteResponseSummaryRecurringSubtotalInner.ts similarity index 80% rename from src/models/QuoteResponseSummaryRecurringSubtotal.ts rename to src/models/QuoteResponseSummaryRecurringSubtotalInner.ts index 2268b39..12ca5fa 100644 --- a/src/models/QuoteResponseSummaryRecurringSubtotal.ts +++ b/src/models/QuoteResponseSummaryRecurringSubtotalInner.ts @@ -9,12 +9,14 @@ import { HttpFile } from '../http/http'; -export class QuoteResponseSummaryRecurringSubtotal { +export class QuoteResponseSummaryRecurringSubtotalInner { 'billingCycle'?: string; 'value'?: string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "billingCycle", @@ -30,10 +32,9 @@ export class QuoteResponseSummaryRecurringSubtotal { } ]; static getAttributeTypeMap() { - return QuoteResponseSummaryRecurringSubtotal.attributeTypeMap; + return QuoteResponseSummaryRecurringSubtotalInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/QuoteSectionSettings.ts b/src/models/QuoteSectionSettings.ts index 414a2b8..9b741fd 100644 --- a/src/models/QuoteSectionSettings.ts +++ b/src/models/QuoteSectionSettings.ts @@ -16,6 +16,8 @@ export class QuoteSectionSettings { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "optional", @@ -44,6 +46,9 @@ export class QuoteSectionSettings { } } - -export type QuoteSectionSettingsSelectionTypeEnum = "custom" | "single" | "multiple" ; +export enum QuoteSectionSettingsSelectionTypeEnum { + Custom = 'custom', + Single = 'single', + Multiple = 'multiple' +} diff --git a/src/models/QuoteUpdateRequest.ts b/src/models/QuoteUpdateRequest.ts index 514c29c..4697da8 100644 --- a/src/models/QuoteUpdateRequest.ts +++ b/src/models/QuoteUpdateRequest.ts @@ -7,8 +7,8 @@ * Do not edit the class manually. */ -import { QuoteUpdateRequestSettings1 } from './QuoteUpdateRequestSettings1'; -import { UpdateIntegrationQuoteSection } from './UpdateIntegrationQuoteSection'; +import { QuoteUpdateRequestSettings } from '../models/QuoteUpdateRequestSettings'; +import { UpdateIntegrationQuoteSection } from '../models/UpdateIntegrationQuoteSection'; import { HttpFile } from '../http/http'; export class QuoteUpdateRequest { @@ -16,10 +16,12 @@ export class QuoteUpdateRequest { * Quote sections - this property overrides existing sections in the specified order. If you want to change only one section, you must still pass other sections IDs. Otherwise these sections will be removed. */ 'sections'?: Array; - 'settings'?: QuoteUpdateRequestSettings1; + 'settings'?: QuoteUpdateRequestSettings; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "sections", @@ -30,7 +32,7 @@ export class QuoteUpdateRequest { { "name": "settings", "baseName": "settings", - "type": "QuoteUpdateRequestSettings1", + "type": "QuoteUpdateRequestSettings", "format": "" } ]; @@ -41,4 +43,3 @@ export class QuoteUpdateRequest { public constructor() { } } - diff --git a/src/models/QuoteUpdateRequestBillingFrequencyEnum.ts b/src/models/QuoteUpdateRequestBillingFrequencyEnum.ts new file mode 100644 index 0000000..6e425f5 --- /dev/null +++ b/src/models/QuoteUpdateRequestBillingFrequencyEnum.ts @@ -0,0 +1,18 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export enum QuoteUpdateRequestBillingFrequencyEnum { + Weekly = 'weekly', + Monthly = 'monthly', + Annually = 'annually', + Quarterly = 'quarterly', + Semiannualy = 'semiannualy' +} diff --git a/src/models/QuoteUpdateRequestDiscountTypeEnum.ts b/src/models/QuoteUpdateRequestDiscountTypeEnum.ts new file mode 100644 index 0000000..3aa20ec --- /dev/null +++ b/src/models/QuoteUpdateRequestDiscountTypeEnum.ts @@ -0,0 +1,15 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export enum QuoteUpdateRequestDiscountTypeEnum { + Percent = 'percent', + Flat = 'flat' +} diff --git a/src/models/QuoteUpdateRequestSettings.ts b/src/models/QuoteUpdateRequestSettings.ts index 6039c55..3abca40 100644 --- a/src/models/QuoteUpdateRequestSettings.ts +++ b/src/models/QuoteUpdateRequestSettings.ts @@ -7,35 +7,24 @@ * Do not edit the class manually. */ +import { QuoteUpdateRequestSettingsSelectionTypeTypeEnum } from '../models/QuoteUpdateRequestSettingsSelectionTypeTypeEnum'; import { HttpFile } from '../http/http'; /** -* Section settings. Denotes whether a section is optional or selected, and selection type inside the section - single, multiple, or custom. +* Quote settings. Denotes whether a quote is optional or selected, and selection type inside the section - single, multiple, or custom. */ export class QuoteUpdateRequestSettings { - 'optional'?: boolean; - 'selected'?: boolean; - 'selectionType'?: QuoteUpdateRequestSettingsSelectionTypeEnum; + 'selectionType'?: QuoteUpdateRequestSettingsSelectionTypeTypeEnum; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ - { - "name": "optional", - "baseName": "optional", - "type": "boolean", - "format": "" - }, - { - "name": "selected", - "baseName": "selected", - "type": "boolean", - "format": "" - }, { "name": "selectionType", "baseName": "selection_type", - "type": "QuoteUpdateRequestSettingsSelectionTypeEnum", + "type": "QuoteUpdateRequestSettingsSelectionTypeTypeEnum", "format": "" } ]; @@ -48,5 +37,3 @@ export class QuoteUpdateRequestSettings { } -export type QuoteUpdateRequestSettingsSelectionTypeEnum = "custom" | "single" | "multiple" ; - diff --git a/src/models/QuoteUpdateRequestSettings1.ts b/src/models/QuoteUpdateRequestSettings1.ts deleted file mode 100644 index c6b7191..0000000 --- a/src/models/QuoteUpdateRequestSettings1.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * PandaDoc Public API - * PandaDoc Public API documentation - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { HttpFile } from '../http/http'; - -/** -* Quote settings. Denotes whether a quote is optional or selected, and selection type inside the section - single, multiple, or custom. -*/ -export class QuoteUpdateRequestSettings1 { - 'selectionType'?: QuoteUpdateRequestSettings1SelectionTypeEnum; - - static readonly discriminator: string | undefined = undefined; - - static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ - { - "name": "selectionType", - "baseName": "selection_type", - "type": "QuoteUpdateRequestSettings1SelectionTypeEnum", - "format": "" - } ]; - - static getAttributeTypeMap() { - return QuoteUpdateRequestSettings1.attributeTypeMap; - } - - public constructor() { - } -} - - -export type QuoteUpdateRequestSettings1SelectionTypeEnum = "custom" | "single" | "multiple" ; - diff --git a/src/models/QuoteUpdateRequestSettingsSelectionTypeTypeEnum.ts b/src/models/QuoteUpdateRequestSettingsSelectionTypeTypeEnum.ts new file mode 100644 index 0000000..6625c80 --- /dev/null +++ b/src/models/QuoteUpdateRequestSettingsSelectionTypeTypeEnum.ts @@ -0,0 +1,16 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export enum QuoteUpdateRequestSettingsSelectionTypeTypeEnum { + Custom = 'custom', + Single = 'single', + Multiple = 'multiple' +} diff --git a/src/models/RadioButtons.ts b/src/models/RadioButtons.ts new file mode 100644 index 0000000..e31d358 --- /dev/null +++ b/src/models/RadioButtons.ts @@ -0,0 +1,104 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { BaseFieldAssignedTo } from '../models/BaseFieldAssignedTo'; +import { HttpFile } from '../http/http'; + +export class RadioButtons { + 'uuid'?: string; + /** + * Name of a field + */ + 'name'?: string; + 'title'?: string; + /** + * Placeholder of a field + */ + 'placeholder'?: string; + 'assignedTo'?: BaseFieldAssignedTo; + 'fieldId'?: string; + 'type'?: RadioButtonsTypeEnum; + /** + * Value of the Radio Buttons field. + */ + 'value'?: string; + 'mergeField'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "uuid", + "baseName": "uuid", + "type": "string", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "title", + "baseName": "title", + "type": "string", + "format": "" + }, + { + "name": "placeholder", + "baseName": "placeholder", + "type": "string", + "format": "" + }, + { + "name": "assignedTo", + "baseName": "assigned_to", + "type": "BaseFieldAssignedTo", + "format": "" + }, + { + "name": "fieldId", + "baseName": "field_id", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "RadioButtonsTypeEnum", + "format": "" + }, + { + "name": "value", + "baseName": "value", + "type": "string", + "format": "" + }, + { + "name": "mergeField", + "baseName": "merge_field", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return RadioButtons.attributeTypeMap; + } + + public constructor() { + } +} + +export enum RadioButtonsTypeEnum { + RadioButtons = 'radio_buttons' +} + diff --git a/src/models/RecipientAssignedTo.ts b/src/models/RecipientAssignedTo.ts new file mode 100644 index 0000000..3fe8a37 --- /dev/null +++ b/src/models/RecipientAssignedTo.ts @@ -0,0 +1,127 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AssignedToRecipientDeliveryMethods } from '../models/AssignedToRecipientDeliveryMethods'; +import { RecipientRedirectSettings } from '../models/RecipientRedirectSettings'; +import { HttpFile } from '../http/http'; + +/** +* Recipient +*/ +export class RecipientAssignedTo { + 'id'?: string; + 'email'?: string; + 'recipientType'?: string; + 'roles'?: Array; + 'signingOrder'?: number; + 'hasCompleted'?: boolean; + 'firstName'?: string; + 'lastName'?: string; + 'phone'?: string; + 'role'?: string; + 'deliveryMethods'?: AssignedToRecipientDeliveryMethods; + 'redirect'?: RecipientRedirectSettings; + 'type'?: RecipientAssignedToTypeEnum; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "email" + }, + { + "name": "recipientType", + "baseName": "recipient_type", + "type": "string", + "format": "" + }, + { + "name": "roles", + "baseName": "roles", + "type": "Array", + "format": "" + }, + { + "name": "signingOrder", + "baseName": "signing_order", + "type": "number", + "format": "" + }, + { + "name": "hasCompleted", + "baseName": "has_completed", + "type": "boolean", + "format": "" + }, + { + "name": "firstName", + "baseName": "first_name", + "type": "string", + "format": "" + }, + { + "name": "lastName", + "baseName": "last_name", + "type": "string", + "format": "" + }, + { + "name": "phone", + "baseName": "phone", + "type": "string", + "format": "" + }, + { + "name": "role", + "baseName": "role", + "type": "string", + "format": "" + }, + { + "name": "deliveryMethods", + "baseName": "delivery_methods", + "type": "AssignedToRecipientDeliveryMethods", + "format": "" + }, + { + "name": "redirect", + "baseName": "redirect", + "type": "RecipientRedirectSettings", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "RecipientAssignedToTypeEnum", + "format": "" + } ]; + + static getAttributeTypeMap() { + return RecipientAssignedTo.attributeTypeMap; + } + + public constructor() { + } +} + +export enum RecipientAssignedToTypeEnum { + Recipient = 'recipient' +} + diff --git a/src/models/RecipientAssignmentDetails.ts b/src/models/RecipientAssignmentDetails.ts new file mode 100644 index 0000000..91ba93a --- /dev/null +++ b/src/models/RecipientAssignmentDetails.ts @@ -0,0 +1,68 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class RecipientAssignmentDetails { + 'id'?: string; + 'email'?: string; + 'recipientType'?: string; + 'roles'?: Array; + 'signingOrder'?: number; + 'hasCompleted'?: boolean; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "email" + }, + { + "name": "recipientType", + "baseName": "recipient_type", + "type": "string", + "format": "" + }, + { + "name": "roles", + "baseName": "roles", + "type": "Array", + "format": "" + }, + { + "name": "signingOrder", + "baseName": "signing_order", + "type": "number", + "format": "" + }, + { + "name": "hasCompleted", + "baseName": "has_completed", + "type": "boolean", + "format": "" + } ]; + + static getAttributeTypeMap() { + return RecipientAssignmentDetails.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/RicipientDeliveryMethods.ts b/src/models/RecipientDeliveryMethods.ts similarity index 82% rename from src/models/RicipientDeliveryMethods.ts rename to src/models/RecipientDeliveryMethods.ts index d274233..7a896cb 100644 --- a/src/models/RicipientDeliveryMethods.ts +++ b/src/models/RecipientDeliveryMethods.ts @@ -9,12 +9,14 @@ import { HttpFile } from '../http/http'; -export class RicipientDeliveryMethods { +export class RecipientDeliveryMethods { 'email'?: boolean; 'sms'?: boolean; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "email", @@ -30,10 +32,9 @@ export class RicipientDeliveryMethods { } ]; static getAttributeTypeMap() { - return RicipientDeliveryMethods.attributeTypeMap; + return RecipientDeliveryMethods.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/RecipientKindEnum.ts b/src/models/RecipientKindEnum.ts new file mode 100644 index 0000000..f5342db --- /dev/null +++ b/src/models/RecipientKindEnum.ts @@ -0,0 +1,15 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export enum RecipientKindEnum { + Contact = 'contact', + ContactGroup = 'contact_group' +} diff --git a/src/models/RecipientPersonalDetails.ts b/src/models/RecipientPersonalDetails.ts new file mode 100644 index 0000000..3f5ab7c --- /dev/null +++ b/src/models/RecipientPersonalDetails.ts @@ -0,0 +1,78 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +/** +* Actor +*/ +export class RecipientPersonalDetails { + 'id'?: string; + 'recipientType'?: string; + 'role'?: string; + 'roles'?: Array; + 'signingOrder'?: number | null; + 'email'?: string | null; + 'hasCompleted'?: boolean; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "recipientType", + "baseName": "recipient_type", + "type": "string", + "format": "" + }, + { + "name": "role", + "baseName": "role", + "type": "string", + "format": "" + }, + { + "name": "roles", + "baseName": "roles", + "type": "Array", + "format": "" + }, + { + "name": "signingOrder", + "baseName": "signing_order", + "type": "number", + "format": "" + }, + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "" + }, + { + "name": "hasCompleted", + "baseName": "has_completed", + "type": "boolean", + "format": "" + } ]; + + static getAttributeTypeMap() { + return RecipientPersonalDetails.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/RecipientRedirect.ts b/src/models/RecipientRedirect.ts index e56d04a..65f094f 100644 --- a/src/models/RecipientRedirect.ts +++ b/src/models/RecipientRedirect.ts @@ -11,10 +11,15 @@ import { HttpFile } from '../http/http'; export class RecipientRedirect { 'isEnabled': boolean; - 'url': string; + /** + * A URL to redirect to after the document is signed. + */ + 'url': string | null; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "isEnabled", @@ -36,4 +41,3 @@ export class RecipientRedirect { public constructor() { } } - diff --git a/src/models/RecipientRedirectSettings.ts b/src/models/RecipientRedirectSettings.ts new file mode 100644 index 0000000..36a7a28 --- /dev/null +++ b/src/models/RecipientRedirectSettings.ts @@ -0,0 +1,40 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class RecipientRedirectSettings { + 'isEnabled'?: boolean; + 'url'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "isEnabled", + "baseName": "is_enabled", + "type": "boolean", + "format": "" + }, + { + "name": "url", + "baseName": "url", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return RecipientRedirectSettings.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/RecipientVerificationPlaceEnum.ts b/src/models/RecipientVerificationPlaceEnum.ts new file mode 100644 index 0000000..75a5f66 --- /dev/null +++ b/src/models/RecipientVerificationPlaceEnum.ts @@ -0,0 +1,18 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +/** +* Specifies when a recipient must complete the verification process: - `before_open` (before opening the document), - `before_sign` (before signing the document). +*/ +export enum RecipientVerificationPlaceEnum { + BeforeOpen = 'before_open', + BeforeSign = 'before_sign' +} diff --git a/src/models/RecipientVerificationSettings.ts b/src/models/RecipientVerificationSettings.ts index 00476c7..415a5ec 100644 --- a/src/models/RecipientVerificationSettings.ts +++ b/src/models/RecipientVerificationSettings.ts @@ -7,25 +7,32 @@ * Do not edit the class manually. */ -import { RecipientVerificationSettingsPasscodeVerification } from './RecipientVerificationSettingsPasscodeVerification'; -import { RecipientVerificationSettingsPhoneVerification } from './RecipientVerificationSettingsPhoneVerification'; +import { RecipientVerificationPlaceEnum } from '../models/RecipientVerificationPlaceEnum'; +import { RecipientVerificationSettingsIdVerification } from '../models/RecipientVerificationSettingsIdVerification'; +import { RecipientVerificationSettingsKbaVerification } from '../models/RecipientVerificationSettingsKbaVerification'; +import { RecipientVerificationSettingsPasscodeVerification } from '../models/RecipientVerificationSettingsPasscodeVerification'; +import { RecipientVerificationSettingsPhoneVerification } from '../models/RecipientVerificationSettingsPhoneVerification'; import { HttpFile } from '../http/http'; +/** +* To set up recipient verification, fill in verification_place and specify the type: passcode_verification, phone_verification, kba_verification or id_verification. - For passcode_verification, provide the passcode. - For phone_verification, provide the phone_number. - For kba_verification and id_verification, set the enabled parameter to true. +*/ export class RecipientVerificationSettings { - /** - * Verification place - */ - 'verificationPlace'?: RecipientVerificationSettingsVerificationPlaceEnum; - 'passcodeVerification'?: RecipientVerificationSettingsPasscodeVerification; + 'verificationPlace'?: RecipientVerificationPlaceEnum; + 'passcodeVerification'?: RecipientVerificationSettingsPasscodeVerification | null; 'phoneVerification'?: RecipientVerificationSettingsPhoneVerification; + 'kbaVerification'?: RecipientVerificationSettingsKbaVerification; + 'idVerification'?: RecipientVerificationSettingsIdVerification; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "verificationPlace", "baseName": "verification_place", - "type": "RecipientVerificationSettingsVerificationPlaceEnum", + "type": "RecipientVerificationPlaceEnum", "format": "" }, { @@ -39,6 +46,18 @@ export class RecipientVerificationSettings { "baseName": "phone_verification", "type": "RecipientVerificationSettingsPhoneVerification", "format": "" + }, + { + "name": "kbaVerification", + "baseName": "kba_verification", + "type": "RecipientVerificationSettingsKbaVerification", + "format": "" + }, + { + "name": "idVerification", + "baseName": "id_verification", + "type": "RecipientVerificationSettingsIdVerification", + "format": "" } ]; static getAttributeTypeMap() { @@ -50,5 +69,3 @@ export class RecipientVerificationSettings { } -export type RecipientVerificationSettingsVerificationPlaceEnum = "before_open" | "before_sign" ; - diff --git a/src/models/RecipientVerificationSettingsIdVerification.ts b/src/models/RecipientVerificationSettingsIdVerification.ts new file mode 100644 index 0000000..6c1179b --- /dev/null +++ b/src/models/RecipientVerificationSettingsIdVerification.ts @@ -0,0 +1,36 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +/** +* Sets the ID verification. +*/ +export class RecipientVerificationSettingsIdVerification { + 'enabled'?: boolean; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "enabled", + "baseName": "enabled", + "type": "boolean", + "format": "" + } ]; + + static getAttributeTypeMap() { + return RecipientVerificationSettingsIdVerification.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/RecipientVerificationSettingsKbaVerification.ts b/src/models/RecipientVerificationSettingsKbaVerification.ts new file mode 100644 index 0000000..72c560e --- /dev/null +++ b/src/models/RecipientVerificationSettingsKbaVerification.ts @@ -0,0 +1,50 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +/** +* Sets the KBA verification. +*/ +export class RecipientVerificationSettingsKbaVerification { + 'timeLimitSec'?: number; + 'scoreThreshold'?: number; + 'maxAttemptsCount'?: number; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "timeLimitSec", + "baseName": "time_limit_sec", + "type": "number", + "format": "" + }, + { + "name": "scoreThreshold", + "baseName": "score_threshold", + "type": "number", + "format": "" + }, + { + "name": "maxAttemptsCount", + "baseName": "max_attempts_count", + "type": "number", + "format": "" + } ]; + + static getAttributeTypeMap() { + return RecipientVerificationSettingsKbaVerification.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/RecipientVerificationSettingsPasscodeVerification.ts b/src/models/RecipientVerificationSettingsPasscodeVerification.ts index 0c2c9ab..a290c8b 100644 --- a/src/models/RecipientVerificationSettingsPasscodeVerification.ts +++ b/src/models/RecipientVerificationSettingsPasscodeVerification.ts @@ -9,11 +9,19 @@ import { HttpFile } from '../http/http'; +/** +* Sets the passcode. +*/ export class RecipientVerificationSettingsPasscodeVerification { + /** + * Document passcode. + */ 'passcode': string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "passcode", @@ -29,4 +37,3 @@ export class RecipientVerificationSettingsPasscodeVerification { public constructor() { } } - diff --git a/src/models/RecipientVerificationSettingsPhoneVerification.ts b/src/models/RecipientVerificationSettingsPhoneVerification.ts index 4c103cd..b4efa2b 100644 --- a/src/models/RecipientVerificationSettingsPhoneVerification.ts +++ b/src/models/RecipientVerificationSettingsPhoneVerification.ts @@ -9,11 +9,19 @@ import { HttpFile } from '../http/http'; +/** +* Sets the phone number to send a passcode to. +*/ export class RecipientVerificationSettingsPhoneVerification { + /** + * A phone number to send a passcode to. + */ 'phoneNumber': string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "phoneNumber", @@ -29,4 +37,3 @@ export class RecipientVerificationSettingsPhoneVerification { public constructor() { } } - diff --git a/src/models/RecipientsGroupAssignedTo.ts b/src/models/RecipientsGroupAssignedTo.ts new file mode 100644 index 0000000..f7005b2 --- /dev/null +++ b/src/models/RecipientsGroupAssignedTo.ts @@ -0,0 +1,98 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RecipientsGroupAssignedToAllOfMembers } from '../models/RecipientsGroupAssignedToAllOfMembers'; +import { HttpFile } from '../http/http'; + +/** +* Collection of Recipients +*/ +export class RecipientsGroupAssignedTo { + 'id'?: string; + 'email'?: string; + 'recipientType'?: string; + 'roles'?: Array; + 'signingOrder'?: number; + 'hasCompleted'?: boolean; + 'name'?: string; + 'members'?: Array; + 'type'?: RecipientsGroupAssignedToTypeEnum; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "email" + }, + { + "name": "recipientType", + "baseName": "recipient_type", + "type": "string", + "format": "" + }, + { + "name": "roles", + "baseName": "roles", + "type": "Array", + "format": "" + }, + { + "name": "signingOrder", + "baseName": "signing_order", + "type": "number", + "format": "" + }, + { + "name": "hasCompleted", + "baseName": "has_completed", + "type": "boolean", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "members", + "baseName": "members", + "type": "Array", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "RecipientsGroupAssignedToTypeEnum", + "format": "" + } ]; + + static getAttributeTypeMap() { + return RecipientsGroupAssignedTo.attributeTypeMap; + } + + public constructor() { + } +} + +export enum RecipientsGroupAssignedToTypeEnum { + RecipientGroup = 'recipient_group' +} + diff --git a/src/models/TemplateDetailsResponsePreassignedPerson.ts b/src/models/RecipientsGroupAssignedToAllOfMembers.ts similarity index 62% rename from src/models/TemplateDetailsResponsePreassignedPerson.ts rename to src/models/RecipientsGroupAssignedToAllOfMembers.ts index ceff3f0..a7026fe 100644 --- a/src/models/TemplateDetailsResponsePreassignedPerson.ts +++ b/src/models/RecipientsGroupAssignedToAllOfMembers.ts @@ -9,45 +9,46 @@ import { HttpFile } from '../http/http'; -export class TemplateDetailsResponsePreassignedPerson { +export class RecipientsGroupAssignedToAllOfMembers { + 'id'?: string; 'email'?: string; - 'type'?: string; - 'placeholderName'?: string; - 'placeholderSource'?: string; + 'firstName'?: string; + 'lastName'?: string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { - "name": "email", - "baseName": "email", + "name": "id", + "baseName": "id", "type": "string", - "format": "" + "format": "uuid" }, { - "name": "type", - "baseName": "type", + "name": "email", + "baseName": "email", "type": "string", - "format": "" + "format": "email" }, { - "name": "placeholderName", - "baseName": "placeholder_name", + "name": "firstName", + "baseName": "first_name", "type": "string", "format": "" }, { - "name": "placeholderSource", - "baseName": "placeholder_source", + "name": "lastName", + "baseName": "last_name", "type": "string", "format": "" } ]; static getAttributeTypeMap() { - return TemplateDetailsResponsePreassignedPerson.attributeTypeMap; + return RecipientsGroupAssignedToAllOfMembers.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/RemoveMember400Response.ts b/src/models/RemoveMember400Response.ts new file mode 100644 index 0000000..4361f20 --- /dev/null +++ b/src/models/RemoveMember400Response.ts @@ -0,0 +1,40 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class RemoveMember400Response { + 'type'?: string; + 'detail'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "type", + "baseName": "type", + "type": "string", + "format": "" + }, + { + "name": "detail", + "baseName": "detail", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return RemoveMember400Response.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/RemoveMember404Response.ts b/src/models/RemoveMember404Response.ts new file mode 100644 index 0000000..c806f74 --- /dev/null +++ b/src/models/RemoveMember404Response.ts @@ -0,0 +1,40 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class RemoveMember404Response { + 'type'?: string; + 'detail'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "type", + "baseName": "type", + "type": "string", + "format": "" + }, + { + "name": "detail", + "baseName": "detail", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return RemoveMember404Response.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/SearchCatalogItems401Response.ts b/src/models/SearchCatalogItems401Response.ts new file mode 100644 index 0000000..cef077b --- /dev/null +++ b/src/models/SearchCatalogItems401Response.ts @@ -0,0 +1,41 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ListNotaries400ResponseDetailsInner } from '../models/ListNotaries400ResponseDetailsInner'; +import { HttpFile } from '../http/http'; + +export class SearchCatalogItems401Response { + 'code'?: string; + 'details'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "code", + "baseName": "code", + "type": "string", + "format": "" + }, + { + "name": "details", + "baseName": "details", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return SearchCatalogItems401Response.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/SectionInfoResponse.ts b/src/models/SectionInfoResponse.ts index b4c5399..b1cd9a0 100644 --- a/src/models/SectionInfoResponse.ts +++ b/src/models/SectionInfoResponse.ts @@ -16,6 +16,8 @@ export class SectionInfoResponse { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "uuid", @@ -43,4 +45,3 @@ export class SectionInfoResponse { public constructor() { } } - diff --git a/src/models/Signature.ts b/src/models/Signature.ts new file mode 100644 index 0000000..7d9cf26 --- /dev/null +++ b/src/models/Signature.ts @@ -0,0 +1,97 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { BaseFieldAssignedTo } from '../models/BaseFieldAssignedTo'; +import { HttpFile } from '../http/http'; + +export class Signature { + 'uuid'?: string; + /** + * Name of a field + */ + 'name'?: string; + 'title'?: string; + /** + * Placeholder of a field + */ + 'placeholder'?: string; + 'assignedTo'?: BaseFieldAssignedTo; + 'fieldId'?: string; + 'type'?: SignatureTypeEnum; + /** + * Value of the Signature field. Always empty object. + */ + 'value'?: any; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "uuid", + "baseName": "uuid", + "type": "string", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "title", + "baseName": "title", + "type": "string", + "format": "" + }, + { + "name": "placeholder", + "baseName": "placeholder", + "type": "string", + "format": "" + }, + { + "name": "assignedTo", + "baseName": "assigned_to", + "type": "BaseFieldAssignedTo", + "format": "" + }, + { + "name": "fieldId", + "baseName": "field_id", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "SignatureTypeEnum", + "format": "" + }, + { + "name": "value", + "baseName": "value", + "type": "any", + "format": "" + } ]; + + static getAttributeTypeMap() { + return Signature.attributeTypeMap; + } + + public constructor() { + } +} + +export enum SignatureTypeEnum { + Signature = 'signature' +} + diff --git a/src/models/Stamp.ts b/src/models/Stamp.ts new file mode 100644 index 0000000..89dd653 --- /dev/null +++ b/src/models/Stamp.ts @@ -0,0 +1,97 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { BaseFieldAssignedTo } from '../models/BaseFieldAssignedTo'; +import { HttpFile } from '../http/http'; + +export class Stamp { + 'uuid'?: string; + /** + * Name of a field + */ + 'name'?: string; + 'title'?: string; + /** + * Placeholder of a field + */ + 'placeholder'?: string; + 'assignedTo'?: BaseFieldAssignedTo; + 'fieldId'?: string; + 'type'?: StampTypeEnum; + /** + * Value of the Stamp field. Always empty object. + */ + 'value'?: any; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "uuid", + "baseName": "uuid", + "type": "string", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "title", + "baseName": "title", + "type": "string", + "format": "" + }, + { + "name": "placeholder", + "baseName": "placeholder", + "type": "string", + "format": "" + }, + { + "name": "assignedTo", + "baseName": "assigned_to", + "type": "BaseFieldAssignedTo", + "format": "" + }, + { + "name": "fieldId", + "baseName": "field_id", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "StampTypeEnum", + "format": "" + }, + { + "name": "value", + "baseName": "value", + "type": "any", + "format": "" + } ]; + + static getAttributeTypeMap() { + return Stamp.attributeTypeMap; + } + + public constructor() { + } +} + +export enum StampTypeEnum { + Stamp = 'stamp' +} + diff --git a/src/models/StatusDocument404Response.ts b/src/models/StatusDocument404Response.ts new file mode 100644 index 0000000..0b216a7 --- /dev/null +++ b/src/models/StatusDocument404Response.ts @@ -0,0 +1,40 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class StatusDocument404Response { + 'type'?: string; + 'detail'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "type", + "baseName": "type", + "type": "string", + "format": "" + }, + { + "name": "detail", + "baseName": "detail", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return StatusDocument404Response.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/StatusDocumentAutoReminder400Response.ts b/src/models/StatusDocumentAutoReminder400Response.ts new file mode 100644 index 0000000..58fc322 --- /dev/null +++ b/src/models/StatusDocumentAutoReminder400Response.ts @@ -0,0 +1,40 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class StatusDocumentAutoReminder400Response { + 'type'?: string; + 'detail'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "type", + "baseName": "type", + "type": "string", + "format": "" + }, + { + "name": "detail", + "baseName": "detail", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return StatusDocumentAutoReminder400Response.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/TableCell.ts b/src/models/TableCell.ts new file mode 100644 index 0000000..d37c89f --- /dev/null +++ b/src/models/TableCell.ts @@ -0,0 +1,59 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +/** +* Defines a single cell in the table, which can appear in either the header or the rows. +*/ +export class TableCell { + /** + * Cell text. + */ + 'text': string; + /** + * Represents how many columns the cell occupies. + */ + 'colSpan'?: number | null; + /** + * Represents the number of rows the cell occupies. + */ + 'rowSpan'?: number | null; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "text", + "baseName": "text", + "type": "string", + "format": "" + }, + { + "name": "colSpan", + "baseName": "col_span", + "type": "number", + "format": "" + }, + { + "name": "rowSpan", + "baseName": "row_span", + "type": "number", + "format": "" + } ]; + + static getAttributeTypeMap() { + return TableCell.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/TableRequest.ts b/src/models/TableRequest.ts new file mode 100644 index 0000000..021e1c4 --- /dev/null +++ b/src/models/TableRequest.ts @@ -0,0 +1,44 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { TableRequestData } from '../models/TableRequestData'; +import { HttpFile } from '../http/http'; + +export class TableRequest { + /** + * Name of the table. + */ + 'name': string; + 'data': TableRequestData; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "data", + "baseName": "data", + "type": "TableRequestData", + "format": "" + } ]; + + static getAttributeTypeMap() { + return TableRequest.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/TableRequestData.ts b/src/models/TableRequestData.ts new file mode 100644 index 0000000..bb54cc8 --- /dev/null +++ b/src/models/TableRequestData.ts @@ -0,0 +1,34 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { TableRequestDataSectionsInner } from '../models/TableRequestDataSectionsInner'; +import { HttpFile } from '../http/http'; + +export class TableRequestData { + 'sections': Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "sections", + "baseName": "sections", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return TableRequestData.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/TableRequestDataSectionsInner.ts b/src/models/TableRequestDataSectionsInner.ts new file mode 100644 index 0000000..dec818a --- /dev/null +++ b/src/models/TableRequestDataSectionsInner.ts @@ -0,0 +1,41 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { TableCell } from '../models/TableCell'; +import { HttpFile } from '../http/http'; + +export class TableRequestDataSectionsInner { + 'header': Array; + 'rows': Array>; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "header", + "baseName": "header", + "type": "Array", + "format": "" + }, + { + "name": "rows", + "baseName": "rows", + "type": "Array>", + "format": "" + } ]; + + static getAttributeTypeMap() { + return TableRequestDataSectionsInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/TemplateListResponseResults.ts b/src/models/TemplateCreateResponse.ts similarity index 74% rename from src/models/TemplateListResponseResults.ts rename to src/models/TemplateCreateResponse.ts index 41c68a2..bac5f88 100644 --- a/src/models/TemplateListResponseResults.ts +++ b/src/models/TemplateCreateResponse.ts @@ -9,16 +9,18 @@ import { HttpFile } from '../http/http'; -export class TemplateListResponseResults { +export class TemplateCreateResponse { 'id'?: string; 'name'?: string; - 'dateCreated'?: string; - 'dateModified'?: string; + 'dateCreated'?: Date; + 'dateModified'?: Date; 'version'?: string; - 'contentDateModified'?: string; + 'contentDateModified'?: Date; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -35,14 +37,14 @@ export class TemplateListResponseResults { { "name": "dateCreated", "baseName": "date_created", - "type": "string", - "format": "" + "type": "Date", + "format": "date-time" }, { "name": "dateModified", "baseName": "date_modified", - "type": "string", - "format": "" + "type": "Date", + "format": "date-time" }, { "name": "version", @@ -53,15 +55,14 @@ export class TemplateListResponseResults { { "name": "contentDateModified", "baseName": "content_date_modified", - "type": "string", - "format": "" + "type": "Date", + "format": "date-time" } ]; static getAttributeTypeMap() { - return TemplateListResponseResults.attributeTypeMap; + return TemplateCreateResponse.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/TemplateDetailsResponse.ts b/src/models/TemplateDetailsResponse.ts index d729cba..cd18879 100644 --- a/src/models/TemplateDetailsResponse.ts +++ b/src/models/TemplateDetailsResponse.ts @@ -7,33 +7,41 @@ * Do not edit the class manually. */ -import { ContentLibraryItemResponseCreatedBy } from './ContentLibraryItemResponseCreatedBy'; -import { PricingResponse } from './PricingResponse'; -import { TemplateDetailsResponseContentPlaceholders } from './TemplateDetailsResponseContentPlaceholders'; -import { TemplateDetailsResponseImages } from './TemplateDetailsResponseImages'; -import { TemplateDetailsResponseRoles } from './TemplateDetailsResponseRoles'; -import { TemplateDetailsResponseTokens } from './TemplateDetailsResponseTokens'; +import { ContentLibraryItemResponseCreatedBy } from '../models/ContentLibraryItemResponseCreatedBy'; +import { DocumentDetailsResponseTablesInner } from '../models/DocumentDetailsResponseTablesInner'; +import { PricingResponse } from '../models/PricingResponse'; +import { TemplateDetailsResponseContentPlaceholdersInner } from '../models/TemplateDetailsResponseContentPlaceholdersInner'; +import { TemplateDetailsResponseImagesInner } from '../models/TemplateDetailsResponseImagesInner'; +import { TemplateDetailsResponseRolesInner } from '../models/TemplateDetailsResponseRolesInner'; +import { TemplateDetailsResponseTokensInner } from '../models/TemplateDetailsResponseTokensInner'; import { HttpFile } from '../http/http'; export class TemplateDetailsResponse { 'id'?: string; 'name'?: string; + 'folderUuid'?: string; 'dateCreated'?: string; 'dateModified'?: string; 'contentDateModified'?: string; 'createdBy'?: ContentLibraryItemResponseCreatedBy; 'metadata'?: any; - 'tokens'?: Array; + 'tokens'?: Array; 'fields'?: Array; 'pricing'?: PricingResponse; 'tags'?: Array; - 'roles'?: Array; + 'roles'?: Array; 'version'?: string; - 'contentPlaceholders'?: Array; - 'images'?: Array; + 'contentPlaceholders'?: Array; + /** + * Document tables. + */ + 'tables'?: Array; + 'images'?: Array; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -47,6 +55,12 @@ export class TemplateDetailsResponse { "type": "string", "format": "" }, + { + "name": "folderUuid", + "baseName": "folder_uuid", + "type": "string", + "format": "" + }, { "name": "dateCreated", "baseName": "date_created", @@ -80,7 +94,7 @@ export class TemplateDetailsResponse { { "name": "tokens", "baseName": "tokens", - "type": "Array", + "type": "Array", "format": "" }, { @@ -104,7 +118,7 @@ export class TemplateDetailsResponse { { "name": "roles", "baseName": "roles", - "type": "Array", + "type": "Array", "format": "" }, { @@ -116,13 +130,19 @@ export class TemplateDetailsResponse { { "name": "contentPlaceholders", "baseName": "content_placeholders", - "type": "Array", + "type": "Array", + "format": "" + }, + { + "name": "tables", + "baseName": "tables", + "type": "Array", "format": "" }, { "name": "images", "baseName": "images", - "type": "Array", + "type": "Array", "format": "" } ]; @@ -133,4 +153,3 @@ export class TemplateDetailsResponse { public constructor() { } } - diff --git a/src/models/TemplateDetailsResponseContentPlaceholders.ts b/src/models/TemplateDetailsResponseContentPlaceholdersInner.ts similarity index 82% rename from src/models/TemplateDetailsResponseContentPlaceholders.ts rename to src/models/TemplateDetailsResponseContentPlaceholdersInner.ts index 2213bf9..0eab8ba 100644 --- a/src/models/TemplateDetailsResponseContentPlaceholders.ts +++ b/src/models/TemplateDetailsResponseContentPlaceholdersInner.ts @@ -9,13 +9,15 @@ import { HttpFile } from '../http/http'; -export class TemplateDetailsResponseContentPlaceholders { +export class TemplateDetailsResponseContentPlaceholdersInner { 'uuid'?: string; 'blockId'?: string; 'description'?: string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "uuid", @@ -37,10 +39,9 @@ export class TemplateDetailsResponseContentPlaceholders { } ]; static getAttributeTypeMap() { - return TemplateDetailsResponseContentPlaceholders.attributeTypeMap; + return TemplateDetailsResponseContentPlaceholdersInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/TemplateDetailsResponseImages.ts b/src/models/TemplateDetailsResponseImagesInner.ts similarity index 81% rename from src/models/TemplateDetailsResponseImages.ts rename to src/models/TemplateDetailsResponseImagesInner.ts index 4a1b1b4..add5379 100644 --- a/src/models/TemplateDetailsResponseImages.ts +++ b/src/models/TemplateDetailsResponseImagesInner.ts @@ -9,13 +9,15 @@ import { HttpFile } from '../http/http'; -export class TemplateDetailsResponseImages { - 'name'?: string; +export class TemplateDetailsResponseImagesInner { + 'name'?: string | null; 'blockUuid'?: string; 'urls'?: Array; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "name", @@ -37,10 +39,9 @@ export class TemplateDetailsResponseImages { } ]; static getAttributeTypeMap() { - return TemplateDetailsResponseImages.attributeTypeMap; + return TemplateDetailsResponseImagesInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/TemplateDetailsResponseRoles.ts b/src/models/TemplateDetailsResponseRolesInner.ts similarity index 68% rename from src/models/TemplateDetailsResponseRoles.ts rename to src/models/TemplateDetailsResponseRolesInner.ts index d295ab2..58cc053 100644 --- a/src/models/TemplateDetailsResponseRoles.ts +++ b/src/models/TemplateDetailsResponseRolesInner.ts @@ -7,17 +7,19 @@ * Do not edit the class manually. */ -import { TemplateDetailsResponsePreassignedPerson } from './TemplateDetailsResponsePreassignedPerson'; +import { TemplateDetailsResponseRolesInnerPreassignedPerson } from '../models/TemplateDetailsResponseRolesInnerPreassignedPerson'; import { HttpFile } from '../http/http'; -export class TemplateDetailsResponseRoles { +export class TemplateDetailsResponseRolesInner { 'id'?: string; 'name'?: string; - 'signingOrder'?: string; - 'preassignedPerson'?: TemplateDetailsResponsePreassignedPerson; + 'signingOrder'?: string | null; + 'preassignedPerson'?: TemplateDetailsResponseRolesInnerPreassignedPerson | null; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -40,15 +42,14 @@ export class TemplateDetailsResponseRoles { { "name": "preassignedPerson", "baseName": "preassigned_person", - "type": "TemplateDetailsResponsePreassignedPerson", + "type": "TemplateDetailsResponseRolesInnerPreassignedPerson", "format": "" } ]; static getAttributeTypeMap() { - return TemplateDetailsResponseRoles.attributeTypeMap; + return TemplateDetailsResponseRolesInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/TemplateDetailsResponseRolesInnerPreassignedPerson.ts b/src/models/TemplateDetailsResponseRolesInnerPreassignedPerson.ts new file mode 100644 index 0000000..f0b64ea --- /dev/null +++ b/src/models/TemplateDetailsResponseRolesInnerPreassignedPerson.ts @@ -0,0 +1,79 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { TemplateDetailsResponseRolesInnerPreassignedPersonMembersInner } from '../models/TemplateDetailsResponseRolesInnerPreassignedPersonMembersInner'; +import { HttpFile } from '../http/http'; + +export class TemplateDetailsResponseRolesInnerPreassignedPerson { + 'email'?: string | null; + 'firstName'?: string | null; + 'lastName'?: string | null; + 'type'?: string; + 'placeholderName'?: string | null; + 'placeholderSource'?: string | null; + /** + * List of contacts in the group. Only present for type \"preassigned contact group\". + */ + 'members'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "" + }, + { + "name": "firstName", + "baseName": "first_name", + "type": "string", + "format": "" + }, + { + "name": "lastName", + "baseName": "last_name", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "string", + "format": "" + }, + { + "name": "placeholderName", + "baseName": "placeholder_name", + "type": "string", + "format": "" + }, + { + "name": "placeholderSource", + "baseName": "placeholder_source", + "type": "string", + "format": "" + }, + { + "name": "members", + "baseName": "members", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return TemplateDetailsResponseRolesInnerPreassignedPerson.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/TemplateDetailsResponseRolesInnerPreassignedPersonMembersInner.ts b/src/models/TemplateDetailsResponseRolesInnerPreassignedPersonMembersInner.ts new file mode 100644 index 0000000..f2eee46 --- /dev/null +++ b/src/models/TemplateDetailsResponseRolesInnerPreassignedPersonMembersInner.ts @@ -0,0 +1,47 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class TemplateDetailsResponseRolesInnerPreassignedPersonMembersInner { + 'email'?: string | null; + 'firstName'?: string | null; + 'lastName'?: string | null; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "" + }, + { + "name": "firstName", + "baseName": "first_name", + "type": "string", + "format": "" + }, + { + "name": "lastName", + "baseName": "last_name", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return TemplateDetailsResponseRolesInnerPreassignedPersonMembersInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/TemplateDetailsResponseTokens.ts b/src/models/TemplateDetailsResponseTokensInner.ts similarity index 81% rename from src/models/TemplateDetailsResponseTokens.ts rename to src/models/TemplateDetailsResponseTokensInner.ts index b09624e..31ddc33 100644 --- a/src/models/TemplateDetailsResponseTokens.ts +++ b/src/models/TemplateDetailsResponseTokensInner.ts @@ -9,12 +9,14 @@ import { HttpFile } from '../http/http'; -export class TemplateDetailsResponseTokens { +export class TemplateDetailsResponseTokensInner { 'name'?: string; 'value'?: string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "name", @@ -30,10 +32,9 @@ export class TemplateDetailsResponseTokens { } ]; static getAttributeTypeMap() { - return TemplateDetailsResponseTokens.attributeTypeMap; + return TemplateDetailsResponseTokensInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/TemplateListResponse.ts b/src/models/TemplateListResponse.ts index 78aaef9..4b97091 100644 --- a/src/models/TemplateListResponse.ts +++ b/src/models/TemplateListResponse.ts @@ -7,19 +7,21 @@ * Do not edit the class manually. */ -import { TemplateListResponseResults } from './TemplateListResponseResults'; +import { TemplateCreateResponse } from '../models/TemplateCreateResponse'; import { HttpFile } from '../http/http'; export class TemplateListResponse { - 'results'?: Array; + 'results'?: Array; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "results", "baseName": "results", - "type": "Array", + "type": "Array", "format": "" } ]; @@ -30,4 +32,3 @@ export class TemplateListResponse { public constructor() { } } - diff --git a/src/models/TemplateSettingsResponse.ts b/src/models/TemplateSettingsResponse.ts new file mode 100644 index 0000000..5d805f4 --- /dev/null +++ b/src/models/TemplateSettingsResponse.ts @@ -0,0 +1,39 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentLanguageEnum } from '../models/DocumentLanguageEnum'; +import { HttpFile } from '../http/http'; + +/** +* Template settings response. +*/ +export class TemplateSettingsResponse { + 'language': DocumentLanguageEnum; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "language", + "baseName": "language", + "type": "DocumentLanguageEnum", + "format": "" + } ]; + + static getAttributeTypeMap() { + return TemplateSettingsResponse.attributeTypeMap; + } + + public constructor() { + } +} + + diff --git a/src/models/TemplateStatusResponse.ts b/src/models/TemplateStatusResponse.ts new file mode 100644 index 0000000..69b96a5 --- /dev/null +++ b/src/models/TemplateStatusResponse.ts @@ -0,0 +1,75 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class TemplateStatusResponse { + 'id'?: string; + 'name'?: string; + 'dateCreated'?: string; + 'dateModified'?: string; + 'version'?: string; + 'status'?: TemplateStatusResponseStatusEnum; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "dateCreated", + "baseName": "date_created", + "type": "string", + "format": "" + }, + { + "name": "dateModified", + "baseName": "date_modified", + "type": "string", + "format": "" + }, + { + "name": "version", + "baseName": "version", + "type": "string", + "format": "" + }, + { + "name": "status", + "baseName": "status", + "type": "TemplateStatusResponseStatusEnum", + "format": "" + } ]; + + static getAttributeTypeMap() { + return TemplateStatusResponse.attributeTypeMap; + } + + public constructor() { + } +} + +export enum TemplateStatusResponseStatusEnum { + TemplateProcessed = 'template.PROCESSED', + TemplateUploaded = 'template.UPLOADED', + TemplateError = 'template.ERROR' +} + diff --git a/src/models/TemplateUpdateRequest.ts b/src/models/TemplateUpdateRequest.ts new file mode 100644 index 0000000..48f3974 --- /dev/null +++ b/src/models/TemplateUpdateRequest.ts @@ -0,0 +1,37 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentUpdateRequestTokensInner } from '../models/DocumentUpdateRequestTokensInner'; +import { HttpFile } from '../http/http'; + +export class TemplateUpdateRequest { + /** + * Create or initialize multiple CUSTOM variables with their values using tokens/values list. Template\'s predefined variables are read-only. Any attempts to do so will be ignored. + */ + 'tokens'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "tokens", + "baseName": "tokens", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return TemplateUpdateRequest.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/TemplatesFolderCreateRequest.ts b/src/models/TemplatesFolderCreateRequest.ts index df894ec..499618f 100644 --- a/src/models/TemplatesFolderCreateRequest.ts +++ b/src/models/TemplatesFolderCreateRequest.ts @@ -21,6 +21,8 @@ export class TemplatesFolderCreateRequest { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "name", @@ -42,4 +44,3 @@ export class TemplatesFolderCreateRequest { public constructor() { } } - diff --git a/src/models/TemplatesFolderCreateResponse.ts b/src/models/TemplatesFolderCreateResponse.ts index 135795c..2e362c8 100644 --- a/src/models/TemplatesFolderCreateResponse.ts +++ b/src/models/TemplatesFolderCreateResponse.ts @@ -16,6 +16,8 @@ export class TemplatesFolderCreateResponse { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "uuid", @@ -43,4 +45,3 @@ export class TemplatesFolderCreateResponse { public constructor() { } } - diff --git a/src/models/TemplatesFolderListResponse.ts b/src/models/TemplatesFolderListResponse.ts index 1c47867..32eaf4a 100644 --- a/src/models/TemplatesFolderListResponse.ts +++ b/src/models/TemplatesFolderListResponse.ts @@ -7,19 +7,21 @@ * Do not edit the class manually. */ -import { TemplatesFolderListResponseResults } from './TemplatesFolderListResponseResults'; +import { TemplatesFolderListResponseResultsInner } from '../models/TemplatesFolderListResponseResultsInner'; import { HttpFile } from '../http/http'; export class TemplatesFolderListResponse { - 'results'?: Array; + 'results'?: Array; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "results", "baseName": "results", - "type": "Array", + "type": "Array", "format": "" } ]; @@ -30,4 +32,3 @@ export class TemplatesFolderListResponse { public constructor() { } } - diff --git a/src/models/TemplatesFolderListResponseResults.ts b/src/models/TemplatesFolderListResponseResultsInner.ts similarity index 86% rename from src/models/TemplatesFolderListResponseResults.ts rename to src/models/TemplatesFolderListResponseResultsInner.ts index a483a17..ab4c867 100644 --- a/src/models/TemplatesFolderListResponseResults.ts +++ b/src/models/TemplatesFolderListResponseResultsInner.ts @@ -9,7 +9,7 @@ import { HttpFile } from '../http/http'; -export class TemplatesFolderListResponseResults { +export class TemplatesFolderListResponseResultsInner { 'uuid'?: string; 'name'?: string; 'dateCreated'?: string; @@ -18,6 +18,8 @@ export class TemplatesFolderListResponseResults { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "uuid", @@ -51,10 +53,9 @@ export class TemplatesFolderListResponseResults { } ]; static getAttributeTypeMap() { - return TemplatesFolderListResponseResults.attributeTypeMap; + return TemplatesFolderListResponseResultsInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/TemplatesFolderRenameRequest.ts b/src/models/TemplatesFolderRenameRequest.ts index 660f9de..2964ac5 100644 --- a/src/models/TemplatesFolderRenameRequest.ts +++ b/src/models/TemplatesFolderRenameRequest.ts @@ -17,6 +17,8 @@ export class TemplatesFolderRenameRequest { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "name", @@ -32,4 +34,3 @@ export class TemplatesFolderRenameRequest { public constructor() { } } - diff --git a/src/models/TemplatesFolderRenameResponse.ts b/src/models/TemplatesFolderRenameResponse.ts index dc0fde3..7c419a8 100644 --- a/src/models/TemplatesFolderRenameResponse.ts +++ b/src/models/TemplatesFolderRenameResponse.ts @@ -16,6 +16,8 @@ export class TemplatesFolderRenameResponse { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "uuid", @@ -43,4 +45,3 @@ export class TemplatesFolderRenameResponse { public constructor() { } } - diff --git a/src/models/Text.ts b/src/models/Text.ts new file mode 100644 index 0000000..a612c4b --- /dev/null +++ b/src/models/Text.ts @@ -0,0 +1,104 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { BaseFieldAssignedTo } from '../models/BaseFieldAssignedTo'; +import { HttpFile } from '../http/http'; + +export class Text { + 'uuid'?: string; + /** + * Name of a field + */ + 'name'?: string; + 'title'?: string; + /** + * Placeholder of a field + */ + 'placeholder'?: string; + 'assignedTo'?: BaseFieldAssignedTo; + 'fieldId'?: string; + 'type'?: TextTypeEnum; + /** + * Value of the Text field. + */ + 'value'?: string; + 'mergeField'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "uuid", + "baseName": "uuid", + "type": "string", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "title", + "baseName": "title", + "type": "string", + "format": "" + }, + { + "name": "placeholder", + "baseName": "placeholder", + "type": "string", + "format": "" + }, + { + "name": "assignedTo", + "baseName": "assigned_to", + "type": "BaseFieldAssignedTo", + "format": "" + }, + { + "name": "fieldId", + "baseName": "field_id", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "TextTypeEnum", + "format": "" + }, + { + "name": "value", + "baseName": "value", + "type": "string", + "format": "" + }, + { + "name": "mergeField", + "baseName": "merge_field", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return Text.attributeTypeMap; + } + + public constructor() { + } +} + +export enum TextTypeEnum { + Text = 'text' +} + diff --git a/src/models/UpdateDocument400Response.ts b/src/models/UpdateDocument400Response.ts new file mode 100644 index 0000000..a420d33 --- /dev/null +++ b/src/models/UpdateDocument400Response.ts @@ -0,0 +1,40 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class UpdateDocument400Response { + 'type'?: string; + 'detail'?: any; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "type", + "baseName": "type", + "type": "string", + "format": "" + }, + { + "name": "detail", + "baseName": "detail", + "type": "any", + "format": "" + } ]; + + static getAttributeTypeMap() { + return UpdateDocument400Response.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/UpdateDocumentActor.ts b/src/models/UpdateDocumentActor.ts new file mode 100644 index 0000000..ac45ae2 --- /dev/null +++ b/src/models/UpdateDocumentActor.ts @@ -0,0 +1,142 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { BaseIdentity } from '../models/BaseIdentity'; +import { RecipientDeliveryMethods } from '../models/RecipientDeliveryMethods'; +import { RecipientRedirect } from '../models/RecipientRedirect'; +import { UpdateDocumentRecipient } from '../models/UpdateDocumentRecipient'; +import { UpdateDocumentRecipientGroup } from '../models/UpdateDocumentRecipientGroup'; +import { HttpFile } from '../http/http'; + +export class UpdateDocumentActor { + /** + * A recipient\'s role in the document from the template. A recipient will be added in CC if a role parameter is not provided. + */ + 'role'?: string; + /** + * Set a signing order for a recipient. Learn more: https://developers.pandadoc.com/docs/set-signing-order + */ + 'signingOrder'?: number; + /** + * A recipient\'s email address. + */ + 'email'?: string | null; + /** + * A recipient\'s phone number. + */ + 'phone'?: string | null; + /** + * A recipient\'s first name. We automatically take the first name from contact data if this field is missed. + */ + 'firstName'?: string; + /** + * A recipient\'s last name. We automatically take the last name from contact data if this field is missed. + */ + 'lastName'?: string; + 'id'?: string; + 'deliveryMethods'?: RecipientDeliveryMethods | null; + 'redirect'?: RecipientRedirect; + 'type'?: UpdateDocumentActorTypeEnum; + 'name': string; + 'members'?: Array; + + static readonly discriminator: string | undefined = "type"; + + static readonly mapping: {[index: string]: string} | undefined = { + "recipient": "UpdateDocumentRecipient", + "recipient_group": "UpdateDocumentRecipientGroup", + }; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "role", + "baseName": "role", + "type": "string", + "format": "" + }, + { + "name": "signingOrder", + "baseName": "signing_order", + "type": "number", + "format": "" + }, + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "" + }, + { + "name": "phone", + "baseName": "phone", + "type": "string", + "format": "" + }, + { + "name": "firstName", + "baseName": "first_name", + "type": "string", + "format": "" + }, + { + "name": "lastName", + "baseName": "last_name", + "type": "string", + "format": "" + }, + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "deliveryMethods", + "baseName": "delivery_methods", + "type": "RecipientDeliveryMethods", + "format": "" + }, + { + "name": "redirect", + "baseName": "redirect", + "type": "RecipientRedirect", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "UpdateDocumentActorTypeEnum", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "members", + "baseName": "members", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return UpdateDocumentActor.attributeTypeMap; + } + + public constructor() { + } +} + +export enum UpdateDocumentActorTypeEnum { + Recipient = 'recipient', + RecipientGroup = 'recipient_group' +} + diff --git a/src/models/UpdateDocumentAutoRemindersRequest.ts b/src/models/UpdateDocumentAutoRemindersRequest.ts new file mode 100644 index 0000000..c21b5f0 --- /dev/null +++ b/src/models/UpdateDocumentAutoRemindersRequest.ts @@ -0,0 +1,76 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentDeliveryMethodEnum } from '../models/DocumentDeliveryMethodEnum'; +import { HttpFile } from '../http/http'; + +export class UpdateDocumentAutoRemindersRequest { + /** + * Toggles auto-reminders for the document. If `true`, reminders are scheduled based on the configuration. + */ + 'enabled': boolean; + 'deliveryMethod'?: DocumentDeliveryMethodEnum; + /** + * Number of days to wait after sending the document before the first reminder is sent. + */ + 'initialDelayDays'?: number; + /** + * If `true`, reminders will be sent repeatedly at specified intervals after the initial reminder. + */ + 'isRecurring'?: boolean; + /** + * Number of days between recurring reminders, applicable if `is_recurring` is `true`. + */ + 'recurrenceFrequencyDays'?: number; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "enabled", + "baseName": "enabled", + "type": "boolean", + "format": "" + }, + { + "name": "deliveryMethod", + "baseName": "delivery_method", + "type": "DocumentDeliveryMethodEnum", + "format": "" + }, + { + "name": "initialDelayDays", + "baseName": "initial_delay_days", + "type": "number", + "format": "" + }, + { + "name": "isRecurring", + "baseName": "is_recurring", + "type": "boolean", + "format": "" + }, + { + "name": "recurrenceFrequencyDays", + "baseName": "recurrence_frequency_days", + "type": "number", + "format": "" + } ]; + + static getAttributeTypeMap() { + return UpdateDocumentAutoRemindersRequest.attributeTypeMap; + } + + public constructor() { + } +} + + diff --git a/src/models/UpdateDocumentAutoRemindersResponse.ts b/src/models/UpdateDocumentAutoRemindersResponse.ts new file mode 100644 index 0000000..253bbd7 --- /dev/null +++ b/src/models/UpdateDocumentAutoRemindersResponse.ts @@ -0,0 +1,76 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentDeliveryMethodEnum } from '../models/DocumentDeliveryMethodEnum'; +import { HttpFile } from '../http/http'; + +export class UpdateDocumentAutoRemindersResponse { + /** + * Toggles auto-reminders for the document. If `true`, reminders are scheduled based on the configuration. + */ + 'enabled': boolean; + 'deliveryMethod'?: DocumentDeliveryMethodEnum; + /** + * Number of days to wait after sending the document before the first reminder is sent. + */ + 'initialDelayDays'?: number; + /** + * If `true`, reminders will be sent repeatedly at specified intervals after the initial reminder. + */ + 'isRecurring'?: boolean; + /** + * Number of days between recurring reminders, applicable if `is_recurring` is `true`. + */ + 'recurrenceFrequencyDays'?: number; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "enabled", + "baseName": "enabled", + "type": "boolean", + "format": "" + }, + { + "name": "deliveryMethod", + "baseName": "delivery_method", + "type": "DocumentDeliveryMethodEnum", + "format": "" + }, + { + "name": "initialDelayDays", + "baseName": "initial_delay_days", + "type": "number", + "format": "" + }, + { + "name": "isRecurring", + "baseName": "is_recurring", + "type": "boolean", + "format": "" + }, + { + "name": "recurrenceFrequencyDays", + "baseName": "recurrence_frequency_days", + "type": "number", + "format": "" + } ]; + + static getAttributeTypeMap() { + return UpdateDocumentAutoRemindersResponse.attributeTypeMap; + } + + public constructor() { + } +} + + diff --git a/src/models/UpdateDocumentRecipient.ts b/src/models/UpdateDocumentRecipient.ts new file mode 100644 index 0000000..acefdbf --- /dev/null +++ b/src/models/UpdateDocumentRecipient.ts @@ -0,0 +1,121 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RecipientDeliveryMethods } from '../models/RecipientDeliveryMethods'; +import { RecipientRedirect } from '../models/RecipientRedirect'; +import { HttpFile } from '../http/http'; + +export class UpdateDocumentRecipient { + /** + * A recipient\'s role in the document from the template. A recipient will be added in CC if a role parameter is not provided. + */ + 'role'?: string; + /** + * Set a signing order for a recipient. Learn more: https://developers.pandadoc.com/docs/set-signing-order + */ + 'signingOrder'?: number; + /** + * A recipient\'s email address. + */ + 'email'?: string | null; + /** + * A recipient\'s phone number. + */ + 'phone'?: string | null; + /** + * A recipient\'s first name. We automatically take the first name from contact data if this field is missed. + */ + 'firstName'?: string; + /** + * A recipient\'s last name. We automatically take the last name from contact data if this field is missed. + */ + 'lastName'?: string; + 'id'?: string; + 'deliveryMethods'?: RecipientDeliveryMethods | null; + 'redirect'?: RecipientRedirect; + 'type'?: UpdateDocumentRecipientTypeEnum; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "role", + "baseName": "role", + "type": "string", + "format": "" + }, + { + "name": "signingOrder", + "baseName": "signing_order", + "type": "number", + "format": "" + }, + { + "name": "email", + "baseName": "email", + "type": "string", + "format": "" + }, + { + "name": "phone", + "baseName": "phone", + "type": "string", + "format": "" + }, + { + "name": "firstName", + "baseName": "first_name", + "type": "string", + "format": "" + }, + { + "name": "lastName", + "baseName": "last_name", + "type": "string", + "format": "" + }, + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "deliveryMethods", + "baseName": "delivery_methods", + "type": "RecipientDeliveryMethods", + "format": "" + }, + { + "name": "redirect", + "baseName": "redirect", + "type": "RecipientRedirect", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "UpdateDocumentRecipientTypeEnum", + "format": "" + } ]; + + static getAttributeTypeMap() { + return UpdateDocumentRecipient.attributeTypeMap; + } + + public constructor() { + } +} + +export enum UpdateDocumentRecipientTypeEnum { + Recipient = 'recipient' +} + diff --git a/src/models/UpdateDocumentRecipientGroup.ts b/src/models/UpdateDocumentRecipientGroup.ts new file mode 100644 index 0000000..f463bb6 --- /dev/null +++ b/src/models/UpdateDocumentRecipientGroup.ts @@ -0,0 +1,80 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { BaseIdentity } from '../models/BaseIdentity'; +import { HttpFile } from '../http/http'; + +export class UpdateDocumentRecipientGroup { + /** + * A recipient\'s role in the document from the template. A recipient will be added in CC if a role parameter is not provided. + */ + 'role'?: string; + /** + * Set a signing order for a recipient. Learn more: https://developers.pandadoc.com/docs/set-signing-order + */ + 'signingOrder'?: number; + 'id'?: string; + 'name': string; + 'type'?: UpdateDocumentRecipientGroupTypeEnum; + 'members'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "role", + "baseName": "role", + "type": "string", + "format": "" + }, + { + "name": "signingOrder", + "baseName": "signing_order", + "type": "number", + "format": "" + }, + { + "name": "id", + "baseName": "id", + "type": "string", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "type", + "baseName": "type", + "type": "UpdateDocumentRecipientGroupTypeEnum", + "format": "" + }, + { + "name": "members", + "baseName": "members", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return UpdateDocumentRecipientGroup.attributeTypeMap; + } + + public constructor() { + } +} + +export enum UpdateDocumentRecipientGroupTypeEnum { + RecipientGroup = 'recipient_group' +} + diff --git a/src/models/UpdateDocumentSettingsRequest.ts b/src/models/UpdateDocumentSettingsRequest.ts new file mode 100644 index 0000000..99ce41b --- /dev/null +++ b/src/models/UpdateDocumentSettingsRequest.ts @@ -0,0 +1,59 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentLanguageEnum } from '../models/DocumentLanguageEnum'; +import { HttpFile } from '../http/http'; + +/** +* Document settings update request. +*/ +export class UpdateDocumentSettingsRequest { + 'language'?: DocumentLanguageEnum; + /** + * Indicates whether the document requires a Qualified Electronic Signature (QES) during the signing process. If `true`, signers must complete the document using a third-party qualified electronic signature provider according to supported verification rules. + */ + 'qualifiedElectronicSignature'?: boolean; + /** + * Document expiration in days. Minimum is 1 day. + */ + 'expiresIn'?: number; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "language", + "baseName": "language", + "type": "DocumentLanguageEnum", + "format": "" + }, + { + "name": "qualifiedElectronicSignature", + "baseName": "qualified_electronic_signature", + "type": "boolean", + "format": "" + }, + { + "name": "expiresIn", + "baseName": "expires_in", + "type": "number", + "format": "int32" + } ]; + + static getAttributeTypeMap() { + return UpdateDocumentSettingsRequest.attributeTypeMap; + } + + public constructor() { + } +} + + diff --git a/src/models/UpdateIntegrationQuoteSection.ts b/src/models/UpdateIntegrationQuoteSection.ts index d36463e..03f2636 100644 --- a/src/models/UpdateIntegrationQuoteSection.ts +++ b/src/models/UpdateIntegrationQuoteSection.ts @@ -7,8 +7,8 @@ * Do not edit the class manually. */ -import { QuoteUpdateRequestSettings } from './QuoteUpdateRequestSettings'; -import { UpdateIntegrationQuoteSectionItem } from './UpdateIntegrationQuoteSectionItem'; +import { UpdateIntegrationQuoteSectionItem } from '../models/UpdateIntegrationQuoteSectionItem'; +import { UpdateIntegrationQuoteSectionSettings } from '../models/UpdateIntegrationQuoteSectionSettings'; import { HttpFile } from '../http/http'; export class UpdateIntegrationQuoteSection { @@ -19,15 +19,17 @@ export class UpdateIntegrationQuoteSection { /** * Name of the quotes section. If you create a section without providing a value, it will have the default value. */ - 'name'?: string; + 'name'?: string | null; /** * Section items - this property overrides the existing items in the order specified. If you want to change only one item, you must still pass other items IDs. Otherwise these items will be removed. */ 'items'?: Array; - 'settings'?: QuoteUpdateRequestSettings; + 'settings'?: UpdateIntegrationQuoteSectionSettings; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -50,7 +52,7 @@ export class UpdateIntegrationQuoteSection { { "name": "settings", "baseName": "settings", - "type": "QuoteUpdateRequestSettings", + "type": "UpdateIntegrationQuoteSectionSettings", "format": "" } ]; @@ -61,4 +63,3 @@ export class UpdateIntegrationQuoteSection { public constructor() { } } - diff --git a/src/models/UpdateIntegrationQuoteSectionItem.ts b/src/models/UpdateIntegrationQuoteSectionItem.ts index 890456f..a0eda99 100644 --- a/src/models/UpdateIntegrationQuoteSectionItem.ts +++ b/src/models/UpdateIntegrationQuoteSectionItem.ts @@ -7,9 +7,10 @@ * Do not edit the class manually. */ -import { QuoteUpdateRequestDiscounts } from './QuoteUpdateRequestDiscounts'; -import { QuoteUpdateRequestOptions } from './QuoteUpdateRequestOptions'; -import { QuoteUpdateRequestPriceSettings } from './QuoteUpdateRequestPriceSettings'; +import { QuoteUpdateRequestBillingFrequencyEnum } from '../models/QuoteUpdateRequestBillingFrequencyEnum'; +import { UpdateIntegrationQuoteSectionItemDiscountsValue } from '../models/UpdateIntegrationQuoteSectionItemDiscountsValue'; +import { UpdateIntegrationQuoteSectionItemOptions } from '../models/UpdateIntegrationQuoteSectionItemOptions'; +import { UpdateIntegrationQuoteSectionItemPriceSettings } from '../models/UpdateIntegrationQuoteSectionItemPriceSettings'; import { HttpFile } from '../http/http'; export class UpdateIntegrationQuoteSectionItem { @@ -37,34 +38,36 @@ export class UpdateIntegrationQuoteSectionItem { * Item price. If you create an item without providing a value, it will have the default value. If `price_settings` is passed, this value may change after the quote is updated. */ 'price'?: number; - 'priceSettings'?: QuoteUpdateRequestPriceSettings; + 'priceSettings'?: UpdateIntegrationQuoteSectionItemPriceSettings; /** * Item cost. If you create an item without providing a value, it will have the default value. */ 'cost'?: number; - 'billingFrequency'?: UpdateIntegrationQuoteSectionItemBillingFrequencyEnum; + 'billingFrequency'?: QuoteUpdateRequestBillingFrequencyEnum | null; /** * Contract term. Measured in units set in the `billing_frequency` parameter. */ - 'contractTerm'?: number; + 'contractTerm'?: number | null; /** * Use this field to pass an id that references this item in external systems. */ - 'referenceId'?: string; - 'options'?: QuoteUpdateRequestOptions; + 'referenceId'?: string | null; + 'options'?: UpdateIntegrationQuoteSectionItemOptions; 'customColumns'?: { [key: string]: string; }; + 'externalColumns'?: { [key: string]: string; }; + 'textColumns'?: { [key: string]: string; }; /** * Item discounts. */ - 'discounts'?: { [key: string]: QuoteUpdateRequestDiscounts; }; + 'discounts'?: { [key: string]: UpdateIntegrationQuoteSectionItemDiscountsValue; }; /** * Item taxes. */ - 'taxes'?: { [key: string]: QuoteUpdateRequestDiscounts; }; + 'taxes'?: { [key: string]: UpdateIntegrationQuoteSectionItemDiscountsValue; }; /** * Item fees. */ - 'fees'?: { [key: string]: QuoteUpdateRequestDiscounts; }; + 'fees'?: { [key: string]: UpdateIntegrationQuoteSectionItemDiscountsValue; }; /** * Item multipliers. */ @@ -72,6 +75,8 @@ export class UpdateIntegrationQuoteSectionItem { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -112,7 +117,7 @@ export class UpdateIntegrationQuoteSectionItem { { "name": "priceSettings", "baseName": "price_settings", - "type": "QuoteUpdateRequestPriceSettings", + "type": "UpdateIntegrationQuoteSectionItemPriceSettings", "format": "" }, { @@ -124,7 +129,7 @@ export class UpdateIntegrationQuoteSectionItem { { "name": "billingFrequency", "baseName": "billing_frequency", - "type": "UpdateIntegrationQuoteSectionItemBillingFrequencyEnum", + "type": "QuoteUpdateRequestBillingFrequencyEnum", "format": "" }, { @@ -142,7 +147,7 @@ export class UpdateIntegrationQuoteSectionItem { { "name": "options", "baseName": "options", - "type": "QuoteUpdateRequestOptions", + "type": "UpdateIntegrationQuoteSectionItemOptions", "format": "" }, { @@ -151,22 +156,34 @@ export class UpdateIntegrationQuoteSectionItem { "type": "{ [key: string]: string; }", "format": "" }, + { + "name": "externalColumns", + "baseName": "external_columns", + "type": "{ [key: string]: string; }", + "format": "" + }, + { + "name": "textColumns", + "baseName": "text_columns", + "type": "{ [key: string]: string; }", + "format": "" + }, { "name": "discounts", "baseName": "discounts", - "type": "{ [key: string]: QuoteUpdateRequestDiscounts; }", + "type": "{ [key: string]: UpdateIntegrationQuoteSectionItemDiscountsValue; }", "format": "" }, { "name": "taxes", "baseName": "taxes", - "type": "{ [key: string]: QuoteUpdateRequestDiscounts; }", + "type": "{ [key: string]: UpdateIntegrationQuoteSectionItemDiscountsValue; }", "format": "" }, { "name": "fees", "baseName": "fees", - "type": "{ [key: string]: QuoteUpdateRequestDiscounts; }", + "type": "{ [key: string]: UpdateIntegrationQuoteSectionItemDiscountsValue; }", "format": "" }, { @@ -185,5 +202,3 @@ export class UpdateIntegrationQuoteSectionItem { } -export type UpdateIntegrationQuoteSectionItemBillingFrequencyEnum = "weekly" | "monthly" | "annually" | "quarterly" | "semiannualy" ; - diff --git a/src/models/UpdateIntegrationQuoteSectionItemDiscountsValue.ts b/src/models/UpdateIntegrationQuoteSectionItemDiscountsValue.ts new file mode 100644 index 0000000..249ee83 --- /dev/null +++ b/src/models/UpdateIntegrationQuoteSectionItemDiscountsValue.ts @@ -0,0 +1,43 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { QuoteUpdateRequestDiscountTypeEnum } from '../models/QuoteUpdateRequestDiscountTypeEnum'; +import { HttpFile } from '../http/http'; + +export class UpdateIntegrationQuoteSectionItemDiscountsValue { + 'type'?: QuoteUpdateRequestDiscountTypeEnum; + 'value'?: number; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "type", + "baseName": "type", + "type": "QuoteUpdateRequestDiscountTypeEnum", + "format": "" + }, + { + "name": "value", + "baseName": "value", + "type": "number", + "format": "" + } ]; + + static getAttributeTypeMap() { + return UpdateIntegrationQuoteSectionItemDiscountsValue.attributeTypeMap; + } + + public constructor() { + } +} + + diff --git a/src/models/QuoteUpdateRequestOptions.ts b/src/models/UpdateIntegrationQuoteSectionItemOptions.ts similarity index 84% rename from src/models/QuoteUpdateRequestOptions.ts rename to src/models/UpdateIntegrationQuoteSectionItemOptions.ts index 7e87897..bd9e64c 100644 --- a/src/models/QuoteUpdateRequestOptions.ts +++ b/src/models/UpdateIntegrationQuoteSectionItemOptions.ts @@ -12,13 +12,15 @@ import { HttpFile } from '../http/http'; /** * Denotes whether an item is selected, optional, and has editable quantity. */ -export class QuoteUpdateRequestOptions { +export class UpdateIntegrationQuoteSectionItemOptions { 'selected'?: boolean; 'qtyEditable': boolean; 'optional'?: boolean; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "selected", @@ -40,10 +42,9 @@ export class QuoteUpdateRequestOptions { } ]; static getAttributeTypeMap() { - return QuoteUpdateRequestOptions.attributeTypeMap; + return UpdateIntegrationQuoteSectionItemOptions.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/QuoteUpdateRequestPriceSettings.ts b/src/models/UpdateIntegrationQuoteSectionItemPriceSettings.ts similarity index 66% rename from src/models/QuoteUpdateRequestPriceSettings.ts rename to src/models/UpdateIntegrationQuoteSectionItemPriceSettings.ts index aeffd7e..634cdd9 100644 --- a/src/models/QuoteUpdateRequestPriceSettings.ts +++ b/src/models/UpdateIntegrationQuoteSectionItemPriceSettings.ts @@ -7,21 +7,23 @@ * Do not edit the class manually. */ -import { QuoteUpdateRequestPriceSettingsTiers } from './QuoteUpdateRequestPriceSettingsTiers'; +import { UpdateIntegrationQuoteSectionItemPriceSettingsTiersInner } from '../models/UpdateIntegrationQuoteSectionItemPriceSettingsTiersInner'; import { HttpFile } from '../http/http'; /** * Price settings if the price is not flat rate. If it is null, the price is flat rate. */ -export class QuoteUpdateRequestPriceSettings { +export class UpdateIntegrationQuoteSectionItemPriceSettings { /** * Base value for volume discount pricing. If set, tiers are treated like percentage of discount on this value. If not set, tiers are treated like a flat value discount of chosen currency. */ - 'baseValue': number; - 'tiers': Array; + 'baseValue': number | null; + 'tiers': Array; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "baseValue", @@ -32,15 +34,14 @@ export class QuoteUpdateRequestPriceSettings { { "name": "tiers", "baseName": "tiers", - "type": "Array", + "type": "Array", "format": "" } ]; static getAttributeTypeMap() { - return QuoteUpdateRequestPriceSettings.attributeTypeMap; + return UpdateIntegrationQuoteSectionItemPriceSettings.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/UpdateIntegrationQuoteSectionItemPriceSettingsTiersInner.ts b/src/models/UpdateIntegrationQuoteSectionItemPriceSettingsTiersInner.ts new file mode 100644 index 0000000..29c1d45 --- /dev/null +++ b/src/models/UpdateIntegrationQuoteSectionItemPriceSettingsTiersInner.ts @@ -0,0 +1,40 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class UpdateIntegrationQuoteSectionItemPriceSettingsTiersInner { + 'minQty': number; + 'value': number; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "minQty", + "baseName": "min_qty", + "type": "number", + "format": "" + }, + { + "name": "value", + "baseName": "value", + "type": "number", + "format": "" + } ]; + + static getAttributeTypeMap() { + return UpdateIntegrationQuoteSectionItemPriceSettingsTiersInner.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/UpdateIntegrationQuoteSectionSettings.ts b/src/models/UpdateIntegrationQuoteSectionSettings.ts new file mode 100644 index 0000000..f8dafb8 --- /dev/null +++ b/src/models/UpdateIntegrationQuoteSectionSettings.ts @@ -0,0 +1,53 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { QuoteUpdateRequestSettingsSelectionTypeTypeEnum } from '../models/QuoteUpdateRequestSettingsSelectionTypeTypeEnum'; +import { HttpFile } from '../http/http'; + +/** +* Section settings. Denotes whether a section is optional or selected, and selection type inside the section - single, multiple, or custom. +*/ +export class UpdateIntegrationQuoteSectionSettings { + 'optional'?: boolean; + 'selected'?: boolean; + 'selectionType'?: QuoteUpdateRequestSettingsSelectionTypeTypeEnum; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "optional", + "baseName": "optional", + "type": "boolean", + "format": "" + }, + { + "name": "selected", + "baseName": "selected", + "type": "boolean", + "format": "" + }, + { + "name": "selectionType", + "baseName": "selection_type", + "type": "QuoteUpdateRequestSettingsSelectionTypeTypeEnum", + "format": "" + } ]; + + static getAttributeTypeMap() { + return UpdateIntegrationQuoteSectionSettings.attributeTypeMap; + } + + public constructor() { + } +} + + diff --git a/src/models/UpdateTemplateSettingsRequest.ts b/src/models/UpdateTemplateSettingsRequest.ts new file mode 100644 index 0000000..d646425 --- /dev/null +++ b/src/models/UpdateTemplateSettingsRequest.ts @@ -0,0 +1,39 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { DocumentLanguageEnum } from '../models/DocumentLanguageEnum'; +import { HttpFile } from '../http/http'; + +/** +* Template settings update request. +*/ +export class UpdateTemplateSettingsRequest { + 'language'?: DocumentLanguageEnum; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "language", + "baseName": "language", + "type": "DocumentLanguageEnum", + "format": "" + } ]; + + static getAttributeTypeMap() { + return UpdateTemplateSettingsRequest.attributeTypeMap; + } + + public constructor() { + } +} + + diff --git a/src/models/UploadSectionBase.ts b/src/models/UploadSectionBase.ts new file mode 100644 index 0000000..d0c8934 --- /dev/null +++ b/src/models/UploadSectionBase.ts @@ -0,0 +1,68 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CreateDocumentActor } from '../models/CreateDocumentActor'; +import { DocumentUpdateRequestTokensInner } from '../models/DocumentUpdateRequestTokensInner'; +import { HttpFile } from '../http/http'; + +export class UploadSectionBase { + /** + * Name the document you are creating. + */ + 'name'?: string; + /** + * The list of recipients you\'re sending the document to. Every object must contain the `email` parameter. The `role`, `first_name` and `last_name` parameters are optional. If the `role` parameter is passed, a person is assigned all fields matching their corresponding role. If a role was not passed, a person receives a read-only link to view the document. If the `first_name` and `last_name` are not passed, the system does this 1. Creates a new contact, if none exists with the given `email`; or 2. Gets the existing contact with the given `email` that already exists. + */ + 'recipients': Array; + /** + * You may pass a list of tokens/values to pre-fill tokens (variables) used in a template. Name is a token (variable) name in a template. Value is a real value you would like to replace a token (variable) with. + */ + 'tokens'?: Array; + /** + * Mark your document with one or several tags. + */ + 'tags'?: Array; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "recipients", + "baseName": "recipients", + "type": "Array", + "format": "" + }, + { + "name": "tokens", + "baseName": "tokens", + "type": "Array", + "format": "" + }, + { + "name": "tags", + "baseName": "tags", + "type": "Array", + "format": "" + } ]; + + static getAttributeTypeMap() { + return UploadSectionBase.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/UploadSectionByPdfRequest.ts b/src/models/UploadSectionByPdfRequest.ts deleted file mode 100644 index 10a08db..0000000 --- a/src/models/UploadSectionByPdfRequest.ts +++ /dev/null @@ -1,83 +0,0 @@ -/** - * PandaDoc Public API - * PandaDoc Public API documentation - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { DocumentCreateByTemplateRequestRecipients } from './DocumentCreateByTemplateRequestRecipients'; -import { HttpFile } from '../http/http'; - -export class UploadSectionByPdfRequest { - /** - * Use a URL to specify the PDF. We support only URLs starting with https. - */ - 'url': string; - /** - * The list of recipients you're sending the document to. Every object must contain the email parameter. The `role`, `first_name` and `last_name` parameters are optional. If the `role` parameter passed, a person is assigned all fields matching their corresponding role. If not passed, a person will receive a read-only link to view the document. If the `first_name` and `last_name` not passed the system 1. creates a new contact, if none exists with the given `email`; or 2. gets the existing contact with the given `email` that already exists. - */ - 'recipients': Array; - /** - * Set this parameter as `true` if you create a document from a PDF with form fields and as `false` if you upload a PDF with field tags. - */ - 'parseFormFields'?: boolean; - 'name'?: string; - /** - * Mark your document with one or several tags. - */ - 'tags'?: Array; - /** - * If you are upload a section from a PDF with field tags, you can pass a list of the fields you'd like to pre-fill in the document. If you are upload a section from a PDF with form fields, list all the fields and provide the `role` parameter so that the fields are assigned to document recipients. You can provide empty value for the field so that it's not pre-filled: \"value\": \"\". - */ - 'fields'?: any; - - static readonly discriminator: string | undefined = undefined; - - static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ - { - "name": "url", - "baseName": "url", - "type": "string", - "format": "" - }, - { - "name": "recipients", - "baseName": "recipients", - "type": "Array", - "format": "" - }, - { - "name": "parseFormFields", - "baseName": "parse_form_fields", - "type": "boolean", - "format": "" - }, - { - "name": "name", - "baseName": "name", - "type": "string", - "format": "" - }, - { - "name": "tags", - "baseName": "tags", - "type": "Array", - "format": "" - }, - { - "name": "fields", - "baseName": "fields", - "type": "any", - "format": "" - } ]; - - static getAttributeTypeMap() { - return UploadSectionByPdfRequest.attributeTypeMap; - } - - public constructor() { - } -} - diff --git a/src/models/UploadSectionByTemplateRequest.ts b/src/models/UploadSectionByTemplateRequest.ts index 46664d4..92e7740 100644 --- a/src/models/UploadSectionByTemplateRequest.ts +++ b/src/models/UploadSectionByTemplateRequest.ts @@ -7,63 +7,79 @@ * Do not edit the class manually. */ -import { DocumentCreateByTemplateRequestContentPlaceholders } from './DocumentCreateByTemplateRequestContentPlaceholders'; -import { DocumentCreateByTemplateRequestRecipients } from './DocumentCreateByTemplateRequestRecipients'; -import { DocumentCreateByTemplateRequestTokens } from './DocumentCreateByTemplateRequestTokens'; -import { PricingTableRequest } from './PricingTableRequest'; +import { CreateDocumentActor } from '../models/CreateDocumentActor'; +import { DocumentUpdateRequestTokensInner } from '../models/DocumentUpdateRequestTokensInner'; +import { PricingTableRequest } from '../models/PricingTableRequest'; +import { UploadSectionByTemplateRequestAllOfContentPlaceholders } from '../models/UploadSectionByTemplateRequestAllOfContentPlaceholders'; import { HttpFile } from '../http/http'; export class UploadSectionByTemplateRequest { /** - * The ID of a template you want to use. You can copy it from an in app template url such as `https://app.pandadoc.com/a/#/templates/{ID}/content`. A template ID is also obtained by listing templates. + * Name the document you are creating. */ - 'templateUuid': string; + 'name'?: string; /** - * The list of recipients you're sending the document to. Every object must contain the email parameter. The `role`, `first_name` and `last_name` parameters are optional. If the `role` parameter passed, a person is assigned all fields matching their corresponding role. If not passed, a person will receive a read-only link to view the document. If the `first_name` and `last_name` not passed the system 1. creates a new contact, if none exists with the given `email`; or 2. gets the existing contact with the given `email` that already exists. + * The list of recipients you\'re sending the document to. Every object must contain the `email` parameter. The `role`, `first_name` and `last_name` parameters are optional. If the `role` parameter is passed, a person is assigned all fields matching their corresponding role. If a role was not passed, a person receives a read-only link to view the document. If the `first_name` and `last_name` are not passed, the system does this 1. Creates a new contact, if none exists with the given `email`; or 2. Gets the existing contact with the given `email` that already exists. */ - 'recipients': Array; + 'recipients': Array; /** - * You can pass a list of tokens/values to pre-fill tokens used in a template. Name is a token name in a template. Value is a real value you would like to replace a token with. + * You may pass a list of tokens/values to pre-fill tokens (variables) used in a template. Name is a token (variable) name in a template. Value is a real value you would like to replace a token (variable) with. */ - 'tokens'?: Array; + 'tokens'?: Array; /** - * You can pass a list of fields/values to pre-fill fields used in a template. Note that the Signature field can't be pre-filled. + * Mark your document with one or several tags. */ - 'fields'?: any; + 'tags'?: Array; + /** + * The ID of a template you want to use. You can copy it from an in app template url such as `https://app.pandadoc.com/a/#/templates/{ID}/content`. A template ID is also obtained by listing templates. + */ + 'templateUuid': string; /** - * Information to construct or populate a pricing table can be passed when creating a document. All product information must be passed when creating a new document. Products stored in PandaDoc cannot be used to populate table rows at this time. Keep in mind that this is an array, so multiple table objects can be passed to a document. Make sure that \"Automatically add products to this table\" is enabled in the PandaDoc template pricing tables you wish to populate via API. + * Information to construct or populate a pricing table can be passed when creating a document. All product information must be passed when creating a new document. Products stored in PandaDoc cannot be used to populate table rows at this time. Keep in mind that this is an array, so multiple table objects can be passed to a document. Make sure that \"Automatically add products to this table\" is enabled in the PandaDoc template pricing tables you wish to populate via API. Each pricing table must have a unique name to populate it with data correctly. */ 'pricingTables'?: Array; /** * You may replace Content Library Item Placeholders with a few content library items each and pre-fill fields/variables values, pricing table items, and assign recipients to roles from there. */ - 'contentPlaceholders'?: Array; + 'contentPlaceholders'?: Array; + /** + * You can pass a list of fields/values to pre-fill fields used in a template. Note that the Signature field can\'t be pre-filled. Field values with the same merge id will override field values of the whole document by default, unless you set the merge_field_scope=upload query parameter. + */ + 'fields'?: any; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { - "name": "templateUuid", - "baseName": "template_uuid", + "name": "name", + "baseName": "name", "type": "string", "format": "" }, { "name": "recipients", "baseName": "recipients", - "type": "Array", + "type": "Array", "format": "" }, { "name": "tokens", "baseName": "tokens", - "type": "Array", + "type": "Array", "format": "" }, { - "name": "fields", - "baseName": "fields", - "type": "any", + "name": "tags", + "baseName": "tags", + "type": "Array", + "format": "" + }, + { + "name": "templateUuid", + "baseName": "template_uuid", + "type": "string", "format": "" }, { @@ -75,7 +91,13 @@ export class UploadSectionByTemplateRequest { { "name": "contentPlaceholders", "baseName": "content_placeholders", - "type": "Array", + "type": "Array", + "format": "" + }, + { + "name": "fields", + "baseName": "fields", + "type": "any", "format": "" } ]; @@ -86,4 +108,3 @@ export class UploadSectionByTemplateRequest { public constructor() { } } - diff --git a/src/models/DocumentCreateRequestContentLibraryItems.ts b/src/models/UploadSectionByTemplateRequestAllOfContentLibraryItems.ts similarity index 60% rename from src/models/DocumentCreateRequestContentLibraryItems.ts rename to src/models/UploadSectionByTemplateRequestAllOfContentLibraryItems.ts index 47fd559..79229c7 100644 --- a/src/models/DocumentCreateRequestContentLibraryItems.ts +++ b/src/models/UploadSectionByTemplateRequestAllOfContentLibraryItems.ts @@ -7,21 +7,20 @@ * Do not edit the class manually. */ -import { DocumentCreateByTemplateRequestRecipients } from './DocumentCreateByTemplateRequestRecipients'; -import { PricingTableRequest } from './PricingTableRequest'; +import { DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInnerRecipientsInner } from '../models/DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInnerRecipientsInner'; +import { PricingTableRequest } from '../models/PricingTableRequest'; import { HttpFile } from '../http/http'; -export class DocumentCreateRequestContentLibraryItems { - /** - * Content library item id - */ +export class UploadSectionByTemplateRequestAllOfContentLibraryItems { 'id': string; - 'pricingTables'?: Array; 'fields'?: any; - 'recipients'?: Array; + 'pricingTables'?: Array; + 'recipients'?: Array; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "id", @@ -29,30 +28,29 @@ export class DocumentCreateRequestContentLibraryItems { "type": "string", "format": "" }, - { - "name": "pricingTables", - "baseName": "pricing_tables", - "type": "Array", - "format": "" - }, { "name": "fields", "baseName": "fields", "type": "any", "format": "" }, + { + "name": "pricingTables", + "baseName": "pricing_tables", + "type": "Array", + "format": "" + }, { "name": "recipients", "baseName": "recipients", - "type": "Array", + "type": "Array", "format": "" } ]; static getAttributeTypeMap() { - return DocumentCreateRequestContentLibraryItems.attributeTypeMap; + return UploadSectionByTemplateRequestAllOfContentLibraryItems.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/DocumentCreateRequestContentPlaceholders.ts b/src/models/UploadSectionByTemplateRequestAllOfContentPlaceholders.ts similarity index 58% rename from src/models/DocumentCreateRequestContentPlaceholders.ts rename to src/models/UploadSectionByTemplateRequestAllOfContentPlaceholders.ts index 9e9d16b..df0bd28 100644 --- a/src/models/DocumentCreateRequestContentPlaceholders.ts +++ b/src/models/UploadSectionByTemplateRequestAllOfContentPlaceholders.ts @@ -7,37 +7,35 @@ * Do not edit the class manually. */ -import { DocumentCreateRequestContentLibraryItems } from './DocumentCreateRequestContentLibraryItems'; +import { UploadSectionByTemplateRequestAllOfContentLibraryItems } from '../models/UploadSectionByTemplateRequestAllOfContentLibraryItems'; import { HttpFile } from '../http/http'; -export class DocumentCreateRequestContentPlaceholders { - /** - * Content placeholder block id - */ - 'blockId'?: string; - 'contentLibraryItems'?: Array; +export class UploadSectionByTemplateRequestAllOfContentPlaceholders { + 'contentLibraryItems'?: Array; + 'blockId': string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { - "name": "blockId", - "baseName": "block_id", - "type": "string", + "name": "contentLibraryItems", + "baseName": "content_library_items", + "type": "Array", "format": "" }, { - "name": "contentLibraryItems", - "baseName": "content_library_items", - "type": "Array", + "name": "blockId", + "baseName": "block_id", + "type": "string", "format": "" } ]; static getAttributeTypeMap() { - return DocumentCreateRequestContentPlaceholders.attributeTypeMap; + return UploadSectionByTemplateRequestAllOfContentPlaceholders.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/UploadSectionListResponse.ts b/src/models/UploadSectionListResponse.ts index a71c4db..c06b19a 100644 --- a/src/models/UploadSectionListResponse.ts +++ b/src/models/UploadSectionListResponse.ts @@ -7,19 +7,21 @@ * Do not edit the class manually. */ -import { UploadSectionListResponseResults } from './UploadSectionListResponseResults'; +import { UploadSectionListResponseResultsInner } from '../models/UploadSectionListResponseResultsInner'; import { HttpFile } from '../http/http'; export class UploadSectionListResponse { - 'results'?: Array; + 'results'?: Array; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "results", "baseName": "results", - "type": "Array", + "type": "Array", "format": "" } ]; @@ -30,4 +32,3 @@ export class UploadSectionListResponse { public constructor() { } } - diff --git a/src/models/UploadSectionListResponseResults.ts b/src/models/UploadSectionListResponseResultsInner.ts similarity index 80% rename from src/models/UploadSectionListResponseResults.ts rename to src/models/UploadSectionListResponseResultsInner.ts index bc39a03..98cf8ab 100644 --- a/src/models/UploadSectionListResponseResults.ts +++ b/src/models/UploadSectionListResponseResultsInner.ts @@ -9,12 +9,14 @@ import { HttpFile } from '../http/http'; -export class UploadSectionListResponseResults { +export class UploadSectionListResponseResultsInner { 'uuid'?: string; 'name'?: string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "uuid", @@ -30,10 +32,9 @@ export class UploadSectionListResponseResults { } ]; static getAttributeTypeMap() { - return UploadSectionListResponseResults.attributeTypeMap; + return UploadSectionListResponseResultsInner.attributeTypeMap; } public constructor() { } } - diff --git a/src/models/UploadSectionRequest.ts b/src/models/UploadSectionRequest.ts index 7aa6bab..7626d34 100644 --- a/src/models/UploadSectionRequest.ts +++ b/src/models/UploadSectionRequest.ts @@ -7,123 +7,24 @@ * Do not edit the class manually. */ -import { DocumentCreateByTemplateRequestTokens } from './DocumentCreateByTemplateRequestTokens'; -import { DocumentCreateRequestContentPlaceholders } from './DocumentCreateRequestContentPlaceholders'; -import { DocumentCreateRequestRecipients } from './DocumentCreateRequestRecipients'; -import { PricingTableRequest } from './PricingTableRequest'; +import { UploadSectionByTemplateRequest } from '../models/UploadSectionByTemplateRequest'; +import { UploadSectionRequestOneOf } from '../models/UploadSectionRequestOneOf'; import { HttpFile } from '../http/http'; -export class UploadSectionRequest { - /** - * Name the section you are creating. - */ - 'name'?: string; - /** - * ID of the template you want to use. You can copy it from an in-app template URL such as `https://app.pandadoc.com/a/#/templates/{ID}/content`. A template ID is also obtained by listing templates. - */ - 'templateUuid'?: string; - /** - * The list of recipients you're sending the document to. Every object must contain the `email` parameter. The `role`, `first_name` and `last_name` parameters are optional. If the `role` parameter is passed, a person is assigned all fields matching their corresponding role. If a role was not passed, a person receives a read-only link to view the document. If the `first_name` and `last_name` are not passed, the system does this 1. Creates a new contact, if none exists with the given `email`; or 2. Gets the existing contact with the given `email` that already exists. - */ - 'recipients'?: Array; - /** - * You can pass a list of tokens/values to pre-fill tokens used in a template. Name is a token name in a template. Value is a real value you would like to replace a token with. - */ - 'tokens'?: Array; - /** - * You can pass a list of fields/values to pre-fill fields used in a template. Please note Signature field can't be pre-filled. - */ - 'fields'?: any; - /** - * Mark your document with one or several tags. - */ - 'tags'?: Array; - /** - * Information to construct or populate a pricing table can be passed when creating a document. All product information must be passed when creating a new document. Products stored in PandaDoc cannot be used to populate table rows at this time. Keep in mind that this is an array, so multiple table objects can be passed to a document. - */ - 'pricingTables'?: Array; - /** - * You may replace Content Library Item Placeholders with a few content library items each and pre-fill fields/variables values, pricing table items, and assign recipients to roles from there. - */ - 'contentPlaceholders'?: Array; - /** - * Use a URL to specify the PDF. We support only URLs starting with https. - */ - 'url'?: string; - /** - * Set this parameter as true if you create a document from a PDF with form fields and as false if you upload a PDF with field tags. - */ - 'parseFormFields'?: boolean; +/** + * @type UploadSectionRequest + * Type + * @export + */ +export type UploadSectionRequest = UploadSectionByTemplateRequest | UploadSectionRequestOneOf; +/** +* @type UploadSectionRequestClass +* @export +*/ +export class UploadSectionRequestClass { static readonly discriminator: string | undefined = undefined; - static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string", - "format": "" - }, - { - "name": "templateUuid", - "baseName": "template_uuid", - "type": "string", - "format": "" - }, - { - "name": "recipients", - "baseName": "recipients", - "type": "Array", - "format": "" - }, - { - "name": "tokens", - "baseName": "tokens", - "type": "Array", - "format": "" - }, - { - "name": "fields", - "baseName": "fields", - "type": "any", - "format": "" - }, - { - "name": "tags", - "baseName": "tags", - "type": "Array", - "format": "" - }, - { - "name": "pricingTables", - "baseName": "pricing_tables", - "type": "Array", - "format": "" - }, - { - "name": "contentPlaceholders", - "baseName": "content_placeholders", - "type": "Array", - "format": "" - }, - { - "name": "url", - "baseName": "url", - "type": "string", - "format": "" - }, - { - "name": "parseFormFields", - "baseName": "parse_form_fields", - "type": "boolean", - "format": "" - } ]; - - static getAttributeTypeMap() { - return UploadSectionRequest.attributeTypeMap; - } - - public constructor() { - } + static readonly mapping: {[index: string]: string} | undefined = undefined; } diff --git a/src/models/UploadSectionRequestOneOf.ts b/src/models/UploadSectionRequestOneOf.ts new file mode 100644 index 0000000..f57a4fe --- /dev/null +++ b/src/models/UploadSectionRequestOneOf.ts @@ -0,0 +1,98 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CreateDocumentActor } from '../models/CreateDocumentActor'; +import { DocumentUpdateRequestTokensInner } from '../models/DocumentUpdateRequestTokensInner'; +import { HttpFile } from '../http/http'; + +export class UploadSectionRequestOneOf { + /** + * Set this parameter as `true` if you create a document from a PDF with form fields and as `false` if you upload a PDF with field tags. + */ + 'parseFormFields'?: boolean; + /** + * If you are upload a section from a PDF with field tags, you can pass a list of the fields you\'d like to pre-fill in the document. If you are upload a section from a PDF with form fields, list all the fields and provide the `role` parameter so that the fields are assigned to document recipients. You can provide empty value for the field so that it\'s not pre-filled: \"value\": \"\". Please note Signature field can\'t be pre-filled. + */ + 'fields'?: any; + /** + * Name the document you are creating. + */ + 'name'?: string; + /** + * The list of recipients you\'re sending the document to. Every object must contain the `email` parameter. The `role`, `first_name` and `last_name` parameters are optional. If the `role` parameter is passed, a person is assigned all fields matching their corresponding role. If a role was not passed, a person receives a read-only link to view the document. If the `first_name` and `last_name` are not passed, the system does this 1. Creates a new contact, if none exists with the given `email`; or 2. Gets the existing contact with the given `email` that already exists. + */ + 'recipients': Array; + /** + * You may pass a list of tokens/values to pre-fill tokens (variables) used in a template. Name is a token (variable) name in a template. Value is a real value you would like to replace a token (variable) with. + */ + 'tokens'?: Array; + /** + * Mark your document with one or several tags. + */ + 'tags'?: Array; + /** + * Secure (HTTPS) and publicly accessible URL to the PDF document. + */ + 'url': string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "parseFormFields", + "baseName": "parse_form_fields", + "type": "boolean", + "format": "" + }, + { + "name": "fields", + "baseName": "fields", + "type": "any", + "format": "" + }, + { + "name": "name", + "baseName": "name", + "type": "string", + "format": "" + }, + { + "name": "recipients", + "baseName": "recipients", + "type": "Array", + "format": "" + }, + { + "name": "tokens", + "baseName": "tokens", + "type": "Array", + "format": "" + }, + { + "name": "tags", + "baseName": "tags", + "type": "Array", + "format": "" + }, + { + "name": "url", + "baseName": "url", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return UploadSectionRequestOneOf.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/src/models/UploadSectionResponse.ts b/src/models/UploadSectionResponse.ts index bcba30f..d199b10 100644 --- a/src/models/UploadSectionResponse.ts +++ b/src/models/UploadSectionResponse.ts @@ -7,7 +7,7 @@ * Do not edit the class manually. */ -import { UploadSectionStatusEnum } from './UploadSectionStatusEnum'; +import { UploadSectionStatusEnum } from '../models/UploadSectionStatusEnum'; import { HttpFile } from '../http/http'; export class UploadSectionResponse { @@ -15,14 +15,15 @@ export class UploadSectionResponse { 'name'?: string; 'documentUuid'?: string; 'status'?: UploadSectionStatusEnum; - 'sectionsUuids'?: Array; 'dateCreated'?: string; 'dateModified'?: string; - 'dateCompleted'?: string; + 'dateCompleted'?: string | null; 'infoMessage'?: string; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "uuid", @@ -48,12 +49,6 @@ export class UploadSectionResponse { "type": "UploadSectionStatusEnum", "format": "" }, - { - "name": "sectionsUuids", - "baseName": "sections_uuids", - "type": "Array", - "format": "" - }, { "name": "dateCreated", "baseName": "date_created", @@ -87,3 +82,4 @@ export class UploadSectionResponse { } } + diff --git a/src/models/UploadSectionStatusEnum.ts b/src/models/UploadSectionStatusEnum.ts index 842ce85..3e30cf2 100644 --- a/src/models/UploadSectionStatusEnum.ts +++ b/src/models/UploadSectionStatusEnum.ts @@ -9,4 +9,8 @@ import { HttpFile } from '../http/http'; -export type UploadSectionStatusEnum = "document_sections_upload.UPLOADED" | "document_sections_upload.PROCESSED" | "document_sections_upload.ERROR" ; +export enum UploadSectionStatusEnum { + DocumentSectionsUploadUploaded = 'document_sections_upload.UPLOADED', + DocumentSectionsUploadProcessed = 'document_sections_upload.PROCESSED', + DocumentSectionsUploadError = 'document_sections_upload.ERROR' +} diff --git a/src/models/UploadSectionStatusResponse.ts b/src/models/UploadSectionStatusResponse.ts index 9adf921..30b932d 100644 --- a/src/models/UploadSectionStatusResponse.ts +++ b/src/models/UploadSectionStatusResponse.ts @@ -7,7 +7,7 @@ * Do not edit the class manually. */ -import { UploadSectionStatusEnum } from './UploadSectionStatusEnum'; +import { UploadSectionStatusEnum } from '../models/UploadSectionStatusEnum'; import { HttpFile } from '../http/http'; export class UploadSectionStatusResponse { @@ -21,6 +21,8 @@ export class UploadSectionStatusResponse { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "uuid", @@ -73,3 +75,4 @@ export class UploadSectionStatusResponse { } } + diff --git a/src/models/UserLicenseEnum.ts b/src/models/UserLicenseEnum.ts new file mode 100644 index 0000000..edf16be --- /dev/null +++ b/src/models/UserLicenseEnum.ts @@ -0,0 +1,18 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export enum UserLicenseEnum { + Full = 'Full', + ESign = 'eSign', + ReadOnly = 'Read-only', + Creator = 'Creator', + Guest = 'Guest' +} diff --git a/src/models/WebhookEventDetailsResponse.ts b/src/models/WebhookEventDetailsResponse.ts index 25364b9..6d6a0cc 100644 --- a/src/models/WebhookEventDetailsResponse.ts +++ b/src/models/WebhookEventDetailsResponse.ts @@ -7,15 +7,15 @@ * Do not edit the class manually. */ -import { WebhookEventErrorEnum } from './WebhookEventErrorEnum'; -import { WebhookEventTriggerEnum } from './WebhookEventTriggerEnum'; +import { WebhookEventErrorEnum } from '../models/WebhookEventErrorEnum'; +import { WebhookEventTriggerEnum } from '../models/WebhookEventTriggerEnum'; import { HttpFile } from '../http/http'; export class WebhookEventDetailsResponse { /** * Unique webhook subscription event identifier */ - 'uuid'?: string; + 'uuid'?: string | null; /** * Webhook subscription name */ @@ -24,8 +24,8 @@ export class WebhookEventDetailsResponse { /** * Webhook subscription event response http status code */ - 'httpStatusCode'?: number; - 'error'?: WebhookEventErrorEnum; + 'httpStatusCode'?: number | null; + 'error'?: WebhookEventErrorEnum | null; /** * Webhook subscription event delivery time */ @@ -45,11 +45,11 @@ export class WebhookEventDetailsResponse { /** * Webhook subscription response body */ - 'responseBody'?: string; + 'responseBody'?: string | null; /** * Webhook subscription response headers */ - 'responseHeaders'?: string; + 'responseHeaders'?: string | null; /** * Webhook subscription event trigger time */ @@ -57,6 +57,8 @@ export class WebhookEventDetailsResponse { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "uuid", @@ -139,3 +141,4 @@ export class WebhookEventDetailsResponse { } } + diff --git a/src/models/WebhookEventErrorEnum.ts b/src/models/WebhookEventErrorEnum.ts index 52d5aff..9b0db91 100644 --- a/src/models/WebhookEventErrorEnum.ts +++ b/src/models/WebhookEventErrorEnum.ts @@ -9,4 +9,9 @@ import { HttpFile } from '../http/http'; -export type WebhookEventErrorEnum = "INTERNAL_ERROR" | "NOT_VALID_URL" | "CONNECT_ERROR" | "TIMEOUT_ERROR" ; +export enum WebhookEventErrorEnum { + InternalError = 'INTERNAL_ERROR', + NotValidUrl = 'NOT_VALID_URL', + ConnectError = 'CONNECT_ERROR', + TimeoutError = 'TIMEOUT_ERROR' +} diff --git a/src/models/WebhookEventHttpStatusCodeGroupEnum.ts b/src/models/WebhookEventHttpStatusCodeGroupEnum.ts index cf794a8..9429b59 100644 --- a/src/models/WebhookEventHttpStatusCodeGroupEnum.ts +++ b/src/models/WebhookEventHttpStatusCodeGroupEnum.ts @@ -9,4 +9,10 @@ import { HttpFile } from '../http/http'; -export type WebhookEventHttpStatusCodeGroupEnum = "100" | "200" | "300" | "400" | "500" ; +export enum WebhookEventHttpStatusCodeGroupEnum { + NUMBER_100 = 100, + NUMBER_200 = 200, + NUMBER_300 = 300, + NUMBER_400 = 400, + NUMBER_500 = 500 +} diff --git a/src/models/WebhookEventItemResponse.ts b/src/models/WebhookEventItemResponse.ts index 77adfb7..cdfe9c0 100644 --- a/src/models/WebhookEventItemResponse.ts +++ b/src/models/WebhookEventItemResponse.ts @@ -7,15 +7,15 @@ * Do not edit the class manually. */ -import { WebhookEventErrorEnum } from './WebhookEventErrorEnum'; -import { WebhookEventTriggerEnum } from './WebhookEventTriggerEnum'; +import { WebhookEventErrorEnum } from '../models/WebhookEventErrorEnum'; +import { WebhookEventTriggerEnum } from '../models/WebhookEventTriggerEnum'; import { HttpFile } from '../http/http'; export class WebhookEventItemResponse { /** * Unique webhook subscription event identifier */ - 'uuid'?: string; + 'uuid'?: string | null; /** * Webhook subscription name */ @@ -24,8 +24,8 @@ export class WebhookEventItemResponse { /** * Webhook subscription event response http status code */ - 'httpStatusCode'?: number; - 'error'?: WebhookEventErrorEnum; + 'httpStatusCode'?: number | null; + 'error'?: WebhookEventErrorEnum | null; /** * Webhook subscription event delivery time */ @@ -33,6 +33,8 @@ export class WebhookEventItemResponse { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "uuid", @@ -79,3 +81,4 @@ export class WebhookEventItemResponse { } } + diff --git a/src/models/WebhookEventPageResponse.ts b/src/models/WebhookEventPageResponse.ts index 8e43c07..bfda655 100644 --- a/src/models/WebhookEventPageResponse.ts +++ b/src/models/WebhookEventPageResponse.ts @@ -7,7 +7,7 @@ * Do not edit the class manually. */ -import { WebhookEventItemResponse } from './WebhookEventItemResponse'; +import { WebhookEventItemResponse } from '../models/WebhookEventItemResponse'; import { HttpFile } from '../http/http'; export class WebhookEventPageResponse { @@ -15,6 +15,8 @@ export class WebhookEventPageResponse { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "items", @@ -30,4 +32,3 @@ export class WebhookEventPageResponse { public constructor() { } } - diff --git a/src/models/WebhookEventTriggerEnum.ts b/src/models/WebhookEventTriggerEnum.ts index 336380b..e9e196a 100644 --- a/src/models/WebhookEventTriggerEnum.ts +++ b/src/models/WebhookEventTriggerEnum.ts @@ -9,4 +9,18 @@ import { HttpFile } from '../http/http'; -export type WebhookEventTriggerEnum = "recipient_completed" | "document_updated" | "document_deleted" | "document_state_changed" | "document_creation_failed" | "quote_updated" | "template_created" | "template_modified" ; +export enum WebhookEventTriggerEnum { + RecipientCompleted = 'recipient_completed', + DocumentUpdated = 'document_updated', + DocumentDeleted = 'document_deleted', + DocumentStateChanged = 'document_state_changed', + DocumentCreationFailed = 'document_creation_failed', + DocumentCompletedPdfReady = 'document_completed_pdf_ready', + DocumentSectionAdded = 'document_section_added', + QuoteUpdated = 'quote_updated', + TemplateCreated = 'template_created', + TemplateUpdated = 'template_updated', + TemplateDeleted = 'template_deleted', + ContentLibraryItemCreated = 'content_library_item_created', + ContentLibraryItemCreationFailed = 'content_library_item_creation_failed' +} diff --git a/src/models/WebhookSubscriptionCreateRequest.ts b/src/models/WebhookSubscriptionCreateRequest.ts index e956fa2..a18482e 100644 --- a/src/models/WebhookSubscriptionCreateRequest.ts +++ b/src/models/WebhookSubscriptionCreateRequest.ts @@ -7,18 +7,36 @@ * Do not edit the class manually. */ -import { WebhookSubscriptionPayloadEnum } from './WebhookSubscriptionPayloadEnum'; -import { WebhookSubscriptionTriggerEnum } from './WebhookSubscriptionTriggerEnum'; +import { WebhookSubscriptionPayloadEnum } from '../models/WebhookSubscriptionPayloadEnum'; +import { WebhookSubscriptionTriggerEnum } from '../models/WebhookSubscriptionTriggerEnum'; import { HttpFile } from '../http/http'; export class WebhookSubscriptionCreateRequest { + /** + * Set a name for the Webhooks subscription. + */ 'name': string; + /** + * Set the Webhooks subscription URL. + */ 'url': string; - 'payload'?: Array; - 'triggers': Array; + /** + * Set the status of the Webhooks subscription. + */ + 'active'?: boolean; + /** + * Set a payload structure. + */ + 'payload'?: Array | null; + /** + * Set trigger events for the Webhooks subscription. + */ + 'triggers': Array | null; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "name", @@ -32,6 +50,12 @@ export class WebhookSubscriptionCreateRequest { "type": "string", "format": "url" }, + { + "name": "active", + "baseName": "active", + "type": "boolean", + "format": "" + }, { "name": "payload", "baseName": "payload", @@ -52,4 +76,3 @@ export class WebhookSubscriptionCreateRequest { public constructor() { } } - diff --git a/src/models/WebhookSubscriptionItemResponse.ts b/src/models/WebhookSubscriptionItemResponse.ts index 1354a77..309a4e6 100644 --- a/src/models/WebhookSubscriptionItemResponse.ts +++ b/src/models/WebhookSubscriptionItemResponse.ts @@ -7,24 +7,26 @@ * Do not edit the class manually. */ -import { WebhookSubscriptionPayloadEnum } from './WebhookSubscriptionPayloadEnum'; -import { WebhookSubscriptionStatusEnum } from './WebhookSubscriptionStatusEnum'; -import { WebhookSubscriptionTriggerEnum } from './WebhookSubscriptionTriggerEnum'; +import { WebhookSubscriptionPayloadEnum } from '../models/WebhookSubscriptionPayloadEnum'; +import { WebhookSubscriptionStatusEnum } from '../models/WebhookSubscriptionStatusEnum'; +import { WebhookSubscriptionTriggerEnum } from '../models/WebhookSubscriptionTriggerEnum'; import { HttpFile } from '../http/http'; export class WebhookSubscriptionItemResponse { - 'uuid'?: string; + 'uuid'?: string | null; 'name'?: string; 'url'?: string; 'active'?: boolean; - 'payload'?: Array; - 'triggers'?: Array; + 'payload'?: Array | null; + 'triggers'?: Array | null; 'workspaceId'?: string; 'sharedKey'?: string; 'status'?: WebhookSubscriptionStatusEnum; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "uuid", @@ -89,3 +91,4 @@ export class WebhookSubscriptionItemResponse { } } + diff --git a/src/models/WebhookSubscriptionListResponse.ts b/src/models/WebhookSubscriptionListResponse.ts index 2ceb7d9..f928544 100644 --- a/src/models/WebhookSubscriptionListResponse.ts +++ b/src/models/WebhookSubscriptionListResponse.ts @@ -7,7 +7,7 @@ * Do not edit the class manually. */ -import { WebhookSubscriptionItemResponse } from './WebhookSubscriptionItemResponse'; +import { WebhookSubscriptionItemResponse } from '../models/WebhookSubscriptionItemResponse'; import { HttpFile } from '../http/http'; export class WebhookSubscriptionListResponse { @@ -15,6 +15,8 @@ export class WebhookSubscriptionListResponse { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "items", @@ -30,4 +32,3 @@ export class WebhookSubscriptionListResponse { public constructor() { } } - diff --git a/src/models/WebhookSubscriptionPatchRequest.ts b/src/models/WebhookSubscriptionPatchRequest.ts index a4634d1..5196729 100644 --- a/src/models/WebhookSubscriptionPatchRequest.ts +++ b/src/models/WebhookSubscriptionPatchRequest.ts @@ -7,19 +7,36 @@ * Do not edit the class manually. */ -import { WebhookSubscriptionPayloadEnum } from './WebhookSubscriptionPayloadEnum'; -import { WebhookSubscriptionTriggerEnum } from './WebhookSubscriptionTriggerEnum'; +import { WebhookSubscriptionPayloadEnum } from '../models/WebhookSubscriptionPayloadEnum'; +import { WebhookSubscriptionTriggerEnum } from '../models/WebhookSubscriptionTriggerEnum'; import { HttpFile } from '../http/http'; export class WebhookSubscriptionPatchRequest { + /** + * Set a new name for the Webhooks subscription. + */ 'name'?: string; + /** + * Set the new Webhooks subscription URL. + */ 'url'?: string; + /** + * Set the status of the Webhooks subscription. + */ 'active'?: boolean; - 'payload'?: Array; - 'triggers'?: Array; + /** + * Set a new payload structure. + */ + 'payload'?: Array | null; + /** + * Set trigger events for the Webhooks subscription. + */ + 'triggers'?: Array | null; static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "name", @@ -59,4 +76,3 @@ export class WebhookSubscriptionPatchRequest { public constructor() { } } - diff --git a/src/models/WebhookSubscriptionPayloadEnum.ts b/src/models/WebhookSubscriptionPayloadEnum.ts index e7e0581..2904efd 100644 --- a/src/models/WebhookSubscriptionPayloadEnum.ts +++ b/src/models/WebhookSubscriptionPayloadEnum.ts @@ -9,4 +9,10 @@ import { HttpFile } from '../http/http'; -export type WebhookSubscriptionPayloadEnum = "metadata" | "fields" | "products" | "tokens" | "pricing" ; +export enum WebhookSubscriptionPayloadEnum { + Metadata = 'metadata', + Fields = 'fields', + Products = 'products', + Tokens = 'tokens', + Pricing = 'pricing' +} diff --git a/src/models/WebhookSubscriptionSharedKeyResponse.ts b/src/models/WebhookSubscriptionSharedKeyResponse.ts index ab74985..6355f50 100644 --- a/src/models/WebhookSubscriptionSharedKeyResponse.ts +++ b/src/models/WebhookSubscriptionSharedKeyResponse.ts @@ -14,6 +14,8 @@ export class WebhookSubscriptionSharedKeyResponse { static readonly discriminator: string | undefined = undefined; + static readonly mapping: {[index: string]: string} | undefined = undefined; + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "sharedKey", @@ -29,4 +31,3 @@ export class WebhookSubscriptionSharedKeyResponse { public constructor() { } } - diff --git a/src/models/WebhookSubscriptionStatusEnum.ts b/src/models/WebhookSubscriptionStatusEnum.ts index 7e7df95..6cd8d2b 100644 --- a/src/models/WebhookSubscriptionStatusEnum.ts +++ b/src/models/WebhookSubscriptionStatusEnum.ts @@ -9,4 +9,8 @@ import { HttpFile } from '../http/http'; -export type WebhookSubscriptionStatusEnum = "ACTIVE" | "INACTIVE" | "DEACTIVATED" ; +export enum WebhookSubscriptionStatusEnum { + Active = 'ACTIVE', + Inactive = 'INACTIVE', + Deactivated = 'DEACTIVATED' +} diff --git a/src/models/WebhookSubscriptionTriggerEnum.ts b/src/models/WebhookSubscriptionTriggerEnum.ts index 442576e..4d104ee 100644 --- a/src/models/WebhookSubscriptionTriggerEnum.ts +++ b/src/models/WebhookSubscriptionTriggerEnum.ts @@ -9,4 +9,18 @@ import { HttpFile } from '../http/http'; -export type WebhookSubscriptionTriggerEnum = "recipient_completed" | "document_updated" | "document_deleted" | "document_state_changed" | "document_creation_failed" | "quote_updated" | "template_created" | "template_modified" ; +export enum WebhookSubscriptionTriggerEnum { + RecipientCompleted = 'recipient_completed', + DocumentUpdated = 'document_updated', + DocumentDeleted = 'document_deleted', + DocumentStateChanged = 'document_state_changed', + DocumentCreationFailed = 'document_creation_failed', + DocumentCompletedPdfReady = 'document_completed_pdf_ready', + DocumentSectionAdded = 'document_section_added', + QuoteUpdated = 'quote_updated', + TemplateCreated = 'template_created', + TemplateUpdated = 'template_updated', + TemplateDeleted = 'template_deleted', + ContentLibraryItemCreated = 'content_library_item_created', + ContentLibraryItemCreationFailed = 'content_library_item_creation_failed' +} diff --git a/src/models/WorkspaceMemberRoleEnum.ts b/src/models/WorkspaceMemberRoleEnum.ts new file mode 100644 index 0000000..aaf11ed --- /dev/null +++ b/src/models/WorkspaceMemberRoleEnum.ts @@ -0,0 +1,20 @@ +/** + * PandaDoc Public API + * PandaDoc Public API documentation + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +/** +* Role for a member. +*/ +export enum WorkspaceMemberRoleEnum { + Admin = 'Admin', + Manager = 'Manager', + Member = 'Member', + Collaborator = 'Collaborator' +} diff --git a/src/models/all.ts b/src/models/all.ts index 275ccb2..538786b 100644 --- a/src/models/all.ts +++ b/src/models/all.ts @@ -1,155 +1,366 @@ -export * from './APILogDetailsResponse' -export * from './APILogListResponse' -export * from './APILogListResponseResults' -export * from './AddMemberRequest' -export * from './AddMemberResponse' -export * from './ContactCreateRequest' -export * from './ContactDetailsResponse' -export * from './ContactListResponse' -export * from './ContactUpdateRequest' -export * from './ContentLibraryItemListResponse' -export * from './ContentLibraryItemListResponseResults' -export * from './ContentLibraryItemResponse' -export * from './ContentLibraryItemResponseCreatedBy' -export * from './CreateUserRequest' -export * from './CreateUserRequestUser' -export * from './CreateUserRequestWorkspaces' -export * from './CreateUserResponse' -export * from './CreateWorkspaceRequest' -export * from './CreateWorkspaceResponse' -export * from './DocumentAttachmentResponse' -export * from './DocumentAttachmentResponseCreatedBy' -export * from './DocumentCreateByPdfRequest' -export * from './DocumentCreateByTemplateRequest' -export * from './DocumentCreateByTemplateRequestContentLibraryItems' -export * from './DocumentCreateByTemplateRequestContentPlaceholders' -export * from './DocumentCreateByTemplateRequestImages' -export * from './DocumentCreateByTemplateRequestRecipients' -export * from './DocumentCreateByTemplateRequestTokens' -export * from './DocumentCreateLinkRequest' -export * from './DocumentCreateLinkResponse' -export * from './DocumentCreateRequest' -export * from './DocumentCreateRequestContentLibraryItems' -export * from './DocumentCreateRequestContentPlaceholders' -export * from './DocumentCreateRequestImages' -export * from './DocumentCreateRequestRecipients' -export * from './DocumentCreateResponse' -export * from './DocumentCreateResponseLinks' -export * from './DocumentDetailsResponse' -export * from './DocumentDetailsResponseCreatedBy' -export * from './DocumentDetailsResponseGrandTotal' -export * from './DocumentDetailsResponseLinkedObjects' -export * from './DocumentDetailsResponseRecipients' -export * from './DocumentDetailsResponseTemplate' -export * from './DocumentListResponse' -export * from './DocumentListResponseResults' -export * from './DocumentOrderingFieldsEnum' -export * from './DocumentRecipientCreateRequest' -export * from './DocumentRecipientEditRequest' -export * from './DocumentRecipientResponse' -export * from './DocumentSendRequest' -export * from './DocumentSendRequestForwardingSettings' -export * from './DocumentSendRequestSelectedApprovers' -export * from './DocumentSendRequestSelectedApproversGroup' -export * from './DocumentSendRequestSelectedApproversGroupAssignees' -export * from './DocumentSendRequestSelectedApproversSteps' -export * from './DocumentSendResponse' -export * from './DocumentSendResponseRecipients' -export * from './DocumentStatusChangeRequest' -export * from './DocumentStatusEnum' -export * from './DocumentStatusRequestEnum' -export * from './DocumentStatusResponse' -export * from './DocumentTransferAllOwnershipRequest' -export * from './DocumentTransferOwnershipRequest' -export * from './DocumentUpdateRequest' -export * from './DocumentUpdateRequestRecipients' -export * from './DocumentsFolderCreateRequest' -export * from './DocumentsFolderCreateResponse' -export * from './DocumentsFolderListResponse' -export * from './DocumentsFolderListResponseResults' -export * from './DocumentsFolderRenameRequest' -export * from './DocumentsFolderRenameResponse' -export * from './FormListResponse' -export * from './FormListResponseResults' -export * from './LinkedObjectCreateRequest' -export * from './LinkedObjectCreateResponse' -export * from './LinkedObjectListResponse' -export * from './MemberDetailsResponse' -export * from './MemberListResponse' -export * from './OAuth2AccessTokenResponse' -export * from './PricingResponse' -export * from './PricingTableRequest' -export * from './PricingTableRequestRowOptions' -export * from './PricingTableRequestRows' -export * from './PricingTableRequestSections' -export * from './PricingTableResponse' -export * from './PricingTableResponseDiscount' -export * from './PricingTableResponseItems' -export * from './PricingTableResponseOptions' -export * from './PricingTableResponseSummary' -export * from './QuoteResponse' -export * from './QuoteResponseAction' -export * from './QuoteResponseCondition' -export * from './QuoteResponseConditionComparison' -export * from './QuoteResponseMergeRules' -export * from './QuoteResponseOptions' -export * from './QuoteResponseSectionColumn' -export * from './QuoteResponseSectionItem' -export * from './QuoteResponseSectionSummary' -export * from './QuoteResponseSections' -export * from './QuoteResponseSettings' -export * from './QuoteResponseSummary' -export * from './QuoteResponseSummaryDiscounts' -export * from './QuoteResponseSummaryRecurringSubtotal' -export * from './QuoteSectionSettings' -export * from './QuoteUpdateRequest' -export * from './QuoteUpdateRequestDiscounts' -export * from './QuoteUpdateRequestOptions' -export * from './QuoteUpdateRequestPriceSettings' -export * from './QuoteUpdateRequestPriceSettingsTiers' -export * from './QuoteUpdateRequestSettings' -export * from './QuoteUpdateRequestSettings1' -export * from './RecipientRedirect' -export * from './RecipientVerificationSettings' -export * from './RecipientVerificationSettingsPasscodeVerification' -export * from './RecipientVerificationSettingsPhoneVerification' -export * from './RicipientDeliveryMethods' -export * from './SectionInfoResponse' -export * from './TemplateDetailsResponse' -export * from './TemplateDetailsResponseContentPlaceholders' -export * from './TemplateDetailsResponseImages' -export * from './TemplateDetailsResponsePreassignedPerson' -export * from './TemplateDetailsResponseRoles' -export * from './TemplateDetailsResponseTokens' -export * from './TemplateListResponse' -export * from './TemplateListResponseResults' -export * from './TemplatesFolderCreateRequest' -export * from './TemplatesFolderCreateResponse' -export * from './TemplatesFolderListResponse' -export * from './TemplatesFolderListResponseResults' -export * from './TemplatesFolderRenameRequest' -export * from './TemplatesFolderRenameResponse' -export * from './UpdateIntegrationQuoteSection' -export * from './UpdateIntegrationQuoteSectionItem' -export * from './UploadSectionByPdfRequest' -export * from './UploadSectionByTemplateRequest' -export * from './UploadSectionListResponse' -export * from './UploadSectionListResponseResults' -export * from './UploadSectionRequest' -export * from './UploadSectionResponse' -export * from './UploadSectionStatusEnum' -export * from './UploadSectionStatusResponse' -export * from './WebhookEventDetailsResponse' -export * from './WebhookEventErrorEnum' -export * from './WebhookEventHttpStatusCodeGroupEnum' -export * from './WebhookEventItemResponse' -export * from './WebhookEventPageResponse' -export * from './WebhookEventTriggerEnum' -export * from './WebhookSubscriptionCreateRequest' -export * from './WebhookSubscriptionItemResponse' -export * from './WebhookSubscriptionListResponse' -export * from './WebhookSubscriptionPatchRequest' -export * from './WebhookSubscriptionPayloadEnum' -export * from './WebhookSubscriptionSharedKeyResponse' -export * from './WebhookSubscriptionStatusEnum' -export * from './WebhookSubscriptionTriggerEnum' +export * from '../models/APILogDetailsResponse' +export * from '../models/APILogListResponse' +export * from '../models/APILogListResponseResultsInner' +export * from '../models/AccessToken400Response' +export * from '../models/AddDsvNamedItemsRequest' +export * from '../models/AddDsvNamedItemsRequestItemsInner' +export * from '../models/AddDsvNamedItemsResponse' +export * from '../models/AddDsvNamedItemsResponseResultsInner' +export * from '../models/AddMember400Response' +export * from '../models/AddMemberRequest' +export * from '../models/AddMemberResponse' +export * from '../models/ApiKeyTypeEnum' +export * from '../models/ApiLogEnvironmentTypeEnum' +export * from '../models/ApiLogMethodEnum' +export * from '../models/ApiLogStatusEnum' +export * from '../models/AppendCLIDataRequest' +export * from '../models/AppendCLIDataRequestCli' +export * from '../models/AppendCLIDataRequestCliPagesInner' +export * from '../models/AppendCLIDataResponse' +export * from '../models/AppendCLIDataResponseBlockMapping' +export * from '../models/AppendCLIDataResponseBlockMappingImagesInner' +export * from '../models/AppendCLIDataResponseBlockMappingPricingTablesInner' +export * from '../models/AppendCLIDataResponseBlockMappingTablesInner' +export * from '../models/AppendCLIDataResponseBlockMappingTextsInner' +export * from '../models/AppendCLIDataResponseCli' +export * from '../models/AppendCLIDataResponseCliPagesInner' +export * from '../models/AssignedToRecipientDeliveryMethods' +export * from '../models/AutoReminders' +export * from '../models/BaseActor' +export * from '../models/BaseEditingSessionResponse' +export * from '../models/BaseField' +export * from '../models/BaseFieldAssignedTo' +export * from '../models/BaseIdentity' +export * from '../models/ChangeDocumentStatus409Response' +export * from '../models/Checkbox' +export * from '../models/CollectFile' +export * from '../models/CollectFileAllOfValue' +export * from '../models/ContactCreateRequest' +export * from '../models/ContactDetailsResponse' +export * from '../models/ContactListResponse' +export * from '../models/ContactUpdateRequest' +export * from '../models/ContentLibraryItemCreateFromUrlRequest' +export * from '../models/ContentLibraryItemCreateRequest' +export * from '../models/ContentLibraryItemListResponse' +export * from '../models/ContentLibraryItemListResponseResultsInner' +export * from '../models/ContentLibraryItemResponse' +export * from '../models/ContentLibraryItemResponseCreatedBy' +export * from '../models/ContentLibraryResponse' +export * from '../models/CreateApiKeyRequest' +export * from '../models/CreateApiKeyResponse' +export * from '../models/CreateDocument400Response' +export * from '../models/CreateDocumentActor' +export * from '../models/CreateDocumentEditingSession201Response' +export * from '../models/CreateDocumentFieldsRequest' +export * from '../models/CreateDocumentFieldsResponse' +export * from '../models/CreateDocumentRecipient' +export * from '../models/CreateDocumentRecipientGroup' +export * from '../models/CreateMemberTokenRequest' +export * from '../models/CreateMemberTokenResponse' +export * from '../models/CreateNotarizationRequest' +export * from '../models/CreateNotarizationRequestInvitation' +export * from '../models/CreateNotarizationRequestInvitationInviteesInner' +export * from '../models/CreateNotarizationRequestNotary' +export * from '../models/CreateNotarizationResponse' +export * from '../models/CreateNotarizationResponseCreatedBy' +export * from '../models/CreateNotarizationResponseInviteesInner' +export * from '../models/CreateTemplateEditingSession201Response' +export * from '../models/CreateTemplateFromUrlRequest' +export * from '../models/CreateTemplateRequest' +export * from '../models/CreateTemplateRequestOwner' +export * from '../models/CreateUser400Response' +export * from '../models/CreateUserRequest' +export * from '../models/CreateUserRequestUser' +export * from '../models/CreateUserRequestWorkspacesInner' +export * from '../models/CreateUserResponse' +export * from '../models/CreateUserResponseWorkspacesInner' +export * from '../models/CreateWorkspaceRequest' +export * from '../models/CreateWorkspaceResponse' +export * from '../models/DeleteNotarizationRequest404Response' +export * from '../models/DocumentAttachmentMetadata' +export * from '../models/DocumentAttachmentRequest' +export * from '../models/DocumentAttachmentResponse' +export * from '../models/DocumentAttachmentResponseCreatedBy' +export * from '../models/DocumentAuditTrailResponse' +export * from '../models/DocumentAuditTrailResponseResultsInner' +export * from '../models/DocumentAuditTrailResponseResultsInnerUser' +export * from '../models/DocumentAutoRemindersResponse' +export * from '../models/DocumentAutoRemindersResponse400' +export * from '../models/DocumentAutoRemindersResponseResultInner' +export * from '../models/DocumentCreateByPdfRequest' +export * from '../models/DocumentCreateByTemplateRequest' +export * from '../models/DocumentCreateByTemplateRequestContentPlaceholdersInner' +export * from '../models/DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInner' +export * from '../models/DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInnerRecipientsInner' +export * from '../models/DocumentCreateByTemplateRequestFieldsValue' +export * from '../models/DocumentCreateByTemplateRequestFieldsValueValue' +export * from '../models/DocumentCreateByTemplateRequestImagesInner' +export * from '../models/DocumentCreateByTemplateRequestOwner' +export * from '../models/DocumentCreateByTemplateRequestTextsInner' +export * from '../models/DocumentCreateByTemplateRequestTokensInner' +export * from '../models/DocumentCreateLinkRequest' +export * from '../models/DocumentCreateLinkResponse' +export * from '../models/DocumentCreateRequest' +export * from '../models/DocumentCreateRequestOneOf' +export * from '../models/DocumentCreateRequestOneOf1' +export * from '../models/DocumentCreateResponse' +export * from '../models/DocumentCreateResponseLinksInner' +export * from '../models/DocumentDeliveryMethodEnum' +export * from '../models/DocumentDetailsRecipient' +export * from '../models/DocumentDetailsRecipientGroup' +export * from '../models/DocumentDetailsRecipientGroupMember' +export * from '../models/DocumentDetailsResponse' +export * from '../models/DocumentDetailsResponseCreatedBy' +export * from '../models/DocumentDetailsResponseGrandTotal' +export * from '../models/DocumentDetailsResponseImagesInner' +export * from '../models/DocumentDetailsResponseLinkedObjectsInner' +export * from '../models/DocumentDetailsResponseLinkedObjectsInnerChildrenInner' +export * from '../models/DocumentDetailsResponseRecipientsInner' +export * from '../models/DocumentDetailsResponseTablesInner' +export * from '../models/DocumentDetailsResponseTemplate' +export * from '../models/DocumentDetailsResponseTextsInner' +export * from '../models/DocumentDocxExport' +export * from '../models/DocumentDocxExportStatusEnum' +export * from '../models/DocumentESignDisclosure' +export * from '../models/DocumentESignDisclosureResult' +export * from '../models/DocumentFieldAnchorPointEnum' +export * from '../models/DocumentFieldTypeEnum' +export * from '../models/DocumentFieldsField' +export * from '../models/DocumentFieldsFieldAssignedTo' +export * from '../models/DocumentFieldsFieldCreate' +export * from '../models/DocumentFieldsLayout' +export * from '../models/DocumentFieldsLayoutPosition' +export * from '../models/DocumentFieldsLayoutStyle' +export * from '../models/DocumentLanguageEnum' +export * from '../models/DocumentListResponse' +export * from '../models/DocumentListResponseResultsInner' +export * from '../models/DocumentOrderingFieldsEnum' +export * from '../models/DocumentRecipientCreateRequest' +export * from '../models/DocumentRecipientEditRequest' +export * from '../models/DocumentRecipientResponse' +export * from '../models/DocumentRevertToDraftResponse' +export * from '../models/DocumentSendManualReminder200Response' +export * from '../models/DocumentSendManualReminder200ResponseResultInner' +export * from '../models/DocumentSendManualReminder200ResponseResultInnerEmail' +export * from '../models/DocumentSendManualReminder200ResponseResultInnerEmailCustomization' +export * from '../models/DocumentSendManualReminder200ResponseResultInnerSms' +export * from '../models/DocumentSendManualReminder409Response' +export * from '../models/DocumentSendManualReminderRequest' +export * from '../models/DocumentSendManualReminderRequestRemindersInner' +export * from '../models/DocumentSendManualReminderRequestRemindersInnerEmailCustomization' +export * from '../models/DocumentSendRequest' +export * from '../models/DocumentSendRequestForwardingSettings' +export * from '../models/DocumentSendRequestSelectedApprovers' +export * from '../models/DocumentSendRequestSelectedApproversStepsInner' +export * from '../models/DocumentSendRequestSelectedApproversStepsInnerGroup' +export * from '../models/DocumentSendRequestSelectedApproversStepsInnerGroupAssigneesInner' +export * from '../models/DocumentSendRequestSender' +export * from '../models/DocumentSendResponse' +export * from '../models/DocumentSendResponseRecipientsInner' +export * from '../models/DocumentSettingsResponse' +export * from '../models/DocumentStatusChangeRequest' +export * from '../models/DocumentStatusChangeRequestStatusEnum' +export * from '../models/DocumentStatusEnum' +export * from '../models/DocumentStatusRequestEnum' +export * from '../models/DocumentStatusResponse' +export * from '../models/DocumentTransferAllOwnershipRequest' +export * from '../models/DocumentTransferOwnershipRequest' +export * from '../models/DocumentUpdateRequest' +export * from '../models/DocumentUpdateRequestFieldValue' +export * from '../models/DocumentUpdateRequestImagesInner' +export * from '../models/DocumentUpdateRequestTextsInner' +export * from '../models/DocumentUpdateRequestTokensInner' +export * from '../models/DocumentsFolderCreateRequest' +export * from '../models/DocumentsFolderCreateResponse' +export * from '../models/DocumentsFolderListResponse' +export * from '../models/DocumentsFolderListResponseResultsInner' +export * from '../models/DocumentsFolderRenameRequest' +export * from '../models/DocumentsFolderRenameResponse' +export * from '../models/DocxExportTaskResponse' +export * from '../models/DocxExportTaskResponseAllOfDocxItems' +export * from '../models/Dropdown' +export * from '../models/EditingSessionRequest' +export * from '../models/Field' +export * from '../models/FormListResponse' +export * from '../models/FormListResponseResultsInner' +export * from '../models/Initials' +export * from '../models/LinkedObjectChild' +export * from '../models/LinkedObjectCreateRequest' +export * from '../models/LinkedObjectCreateResponse' +export * from '../models/LinkedObjectListResponse' +export * from '../models/ListCatalogItemsSearchResponse' +export * from '../models/ListDocumentFieldsResponse' +export * from '../models/ListDocuments400Response' +export * from '../models/ListDocuments401Response' +export * from '../models/ListDocuments403Response' +export * from '../models/ListDocuments403ResponseLinksInner' +export * from '../models/ListDocuments429Response' +export * from '../models/ListDocumentsByLinkedObjectsResponseInner' +export * from '../models/ListNotaries400Response' +export * from '../models/ListNotaries400ResponseDetailsInner' +export * from '../models/ListNotaries403Response' +export * from '../models/ListNotaries429Response' +export * from '../models/ListNotariesResponse' +export * from '../models/ListNotariesResponseResultsInner' +export * from '../models/ListSmsOptOutChangelogResponse' +export * from '../models/ListSmsOptOutChangelogResponseResultsInner' +export * from '../models/ListUsersResponse' +export * from '../models/ListUsersResponseResultsInner' +export * from '../models/ListUsersResponseResultsInnerWorkspacesInner' +export * from '../models/ListWorkspacesResponse' +export * from '../models/ListWorkspacesResponseResultsInner' +export * from '../models/MemberDetailsResponse' +export * from '../models/MemberListResponse' +export * from '../models/ModelDate' +export * from '../models/NotarizationRequestDetailsResponse' +export * from '../models/NotarizationRequestDetailsResponseCreatedBy' +export * from '../models/NotarizationRequestDetailsResponseInviteesInner' +export * from '../models/NotarizationRequestDetailsResponseRecording' +export * from '../models/NotarizationRequestDetailsResponseSignedDocumentsInner' +export * from '../models/OAuth2AccessTokenResponse' +export * from '../models/Payment' +export * from '../models/PricingResponse' +export * from '../models/PricingTableRequest' +export * from '../models/PricingTableRequestRowOptions' +export * from '../models/PricingTableRequestSectionsInner' +export * from '../models/PricingTableRequestSectionsInnerRowsInner' +export * from '../models/PricingTableResponse' +export * from '../models/PricingTableResponseItemsInner' +export * from '../models/PricingTableResponseItemsInnerDiscount' +export * from '../models/PricingTableResponseItemsInnerOptions' +export * from '../models/PricingTableResponseSummary' +export * from '../models/ProductCatalogCatalogCustomBundleItem' +export * from '../models/ProductCatalogCatalogItemInBundle' +export * from '../models/ProductCatalogCustomBundleItemNoId' +export * from '../models/ProductCatalogCustomCatalogItemInBundle' +export * from '../models/ProductCatalogItemPatchRequest' +export * from '../models/ProductCatalogItemPatchRequestBundleItemsInner' +export * from '../models/ProductCatalogItemPatchRequestBundleItemsInnerItemOrUuid' +export * from '../models/ProductCatalogItemPatchRequestProductVariant' +export * from '../models/ProductCatalogItemPriceConfiguration' +export * from '../models/ProductCatalogItemPriceTier' +export * from '../models/ProductCatalogItemRequest' +export * from '../models/ProductCatalogItemRequestBundleItemsInner' +export * from '../models/ProductCatalogItemRequestBundleItemsInnerItemOrUuid' +export * from '../models/ProductCatalogItemRequestCustomFieldsInner' +export * from '../models/ProductCatalogItemRequestImagesInner' +export * from '../models/ProductCatalogItemResponse' +export * from '../models/ProductCatalogItemResponseBundleItemsInner' +export * from '../models/ProductCatalogItemResponseBundleItemsInnerItem' +export * from '../models/ProductCatalogItemResponseDefaultPriceConfiguration' +export * from '../models/ProductCatalogItemResponseVariantsInner' +export * from '../models/ProductCatalogPricingMethodEnum' +export * from '../models/ProductCatalogSearchCatalogItemResponse' +export * from '../models/ProductCatalogSearchCatalogItemResponseCustomFieldsInner' +export * from '../models/ProductCatalogSearchCatalogItemResponseImagesInner' +export * from '../models/ProductCatalogSearchCatalogItemResponseTiersInner' +export * from '../models/ProductCatalogTypeEnum' +export * from '../models/QuoteResponse' +export * from '../models/QuoteResponseMergeRulesInner' +export * from '../models/QuoteResponseMergeRulesInnerAction' +export * from '../models/QuoteResponseMergeRulesInnerCondition' +export * from '../models/QuoteResponseMergeRulesInnerConditionComparisonInner' +export * from '../models/QuoteResponseSectionColumn' +export * from '../models/QuoteResponseSectionItem' +export * from '../models/QuoteResponseSectionItemOptions' +export * from '../models/QuoteResponseSectionSummary' +export * from '../models/QuoteResponseSectionsInner' +export * from '../models/QuoteResponseSettings' +export * from '../models/QuoteResponseSummary' +export * from '../models/QuoteResponseSummaryDiscountsValue' +export * from '../models/QuoteResponseSummaryRecurringSubtotalInner' +export * from '../models/QuoteSectionSettings' +export * from '../models/QuoteUpdateRequest' +export * from '../models/QuoteUpdateRequestBillingFrequencyEnum' +export * from '../models/QuoteUpdateRequestDiscountTypeEnum' +export * from '../models/QuoteUpdateRequestSettings' +export * from '../models/QuoteUpdateRequestSettingsSelectionTypeTypeEnum' +export * from '../models/RadioButtons' +export * from '../models/RecipientAssignedTo' +export * from '../models/RecipientAssignmentDetails' +export * from '../models/RecipientDeliveryMethods' +export * from '../models/RecipientKindEnum' +export * from '../models/RecipientPersonalDetails' +export * from '../models/RecipientRedirect' +export * from '../models/RecipientRedirectSettings' +export * from '../models/RecipientVerificationPlaceEnum' +export * from '../models/RecipientVerificationSettings' +export * from '../models/RecipientVerificationSettingsIdVerification' +export * from '../models/RecipientVerificationSettingsKbaVerification' +export * from '../models/RecipientVerificationSettingsPasscodeVerification' +export * from '../models/RecipientVerificationSettingsPhoneVerification' +export * from '../models/RecipientsGroupAssignedTo' +export * from '../models/RecipientsGroupAssignedToAllOfMembers' +export * from '../models/RemoveMember400Response' +export * from '../models/RemoveMember404Response' +export * from '../models/SearchCatalogItems401Response' +export * from '../models/SectionInfoResponse' +export * from '../models/Signature' +export * from '../models/Stamp' +export * from '../models/StatusDocument404Response' +export * from '../models/StatusDocumentAutoReminder400Response' +export * from '../models/TableCell' +export * from '../models/TableRequest' +export * from '../models/TableRequestData' +export * from '../models/TableRequestDataSectionsInner' +export * from '../models/TemplateCreateResponse' +export * from '../models/TemplateDetailsResponse' +export * from '../models/TemplateDetailsResponseContentPlaceholdersInner' +export * from '../models/TemplateDetailsResponseImagesInner' +export * from '../models/TemplateDetailsResponseRolesInner' +export * from '../models/TemplateDetailsResponseRolesInnerPreassignedPerson' +export * from '../models/TemplateDetailsResponseRolesInnerPreassignedPersonMembersInner' +export * from '../models/TemplateDetailsResponseTokensInner' +export * from '../models/TemplateListResponse' +export * from '../models/TemplateSettingsResponse' +export * from '../models/TemplateStatusResponse' +export * from '../models/TemplateUpdateRequest' +export * from '../models/TemplatesFolderCreateRequest' +export * from '../models/TemplatesFolderCreateResponse' +export * from '../models/TemplatesFolderListResponse' +export * from '../models/TemplatesFolderListResponseResultsInner' +export * from '../models/TemplatesFolderRenameRequest' +export * from '../models/TemplatesFolderRenameResponse' +export * from '../models/Text' +export * from '../models/UpdateDocument400Response' +export * from '../models/UpdateDocumentActor' +export * from '../models/UpdateDocumentAutoRemindersRequest' +export * from '../models/UpdateDocumentAutoRemindersResponse' +export * from '../models/UpdateDocumentRecipient' +export * from '../models/UpdateDocumentRecipientGroup' +export * from '../models/UpdateDocumentSettingsRequest' +export * from '../models/UpdateIntegrationQuoteSection' +export * from '../models/UpdateIntegrationQuoteSectionItem' +export * from '../models/UpdateIntegrationQuoteSectionItemDiscountsValue' +export * from '../models/UpdateIntegrationQuoteSectionItemOptions' +export * from '../models/UpdateIntegrationQuoteSectionItemPriceSettings' +export * from '../models/UpdateIntegrationQuoteSectionItemPriceSettingsTiersInner' +export * from '../models/UpdateIntegrationQuoteSectionSettings' +export * from '../models/UpdateTemplateSettingsRequest' +export * from '../models/UploadSectionBase' +export * from '../models/UploadSectionByTemplateRequest' +export * from '../models/UploadSectionByTemplateRequestAllOfContentLibraryItems' +export * from '../models/UploadSectionByTemplateRequestAllOfContentPlaceholders' +export * from '../models/UploadSectionListResponse' +export * from '../models/UploadSectionListResponseResultsInner' +export * from '../models/UploadSectionRequest' +export * from '../models/UploadSectionRequestOneOf' +export * from '../models/UploadSectionResponse' +export * from '../models/UploadSectionStatusEnum' +export * from '../models/UploadSectionStatusResponse' +export * from '../models/UserLicenseEnum' +export * from '../models/WebhookEventDetailsResponse' +export * from '../models/WebhookEventErrorEnum' +export * from '../models/WebhookEventHttpStatusCodeGroupEnum' +export * from '../models/WebhookEventItemResponse' +export * from '../models/WebhookEventPageResponse' +export * from '../models/WebhookEventTriggerEnum' +export * from '../models/WebhookSubscriptionCreateRequest' +export * from '../models/WebhookSubscriptionItemResponse' +export * from '../models/WebhookSubscriptionListResponse' +export * from '../models/WebhookSubscriptionPatchRequest' +export * from '../models/WebhookSubscriptionPayloadEnum' +export * from '../models/WebhookSubscriptionSharedKeyResponse' +export * from '../models/WebhookSubscriptionStatusEnum' +export * from '../models/WebhookSubscriptionTriggerEnum' +export * from '../models/WorkspaceMemberRoleEnum' diff --git a/src/pandadoc/httpErrorBody.ts b/src/pandadoc/httpErrorBody.ts new file mode 100644 index 0000000..06e0034 --- /dev/null +++ b/src/pandadoc/httpErrorBody.ts @@ -0,0 +1,36 @@ +import { ResponseContext } from "../http/http"; +import { ObjectSerializer } from "../models/ObjectSerializer"; + +export type RawBodyAndParsed = { + rawBody: string; + rawBodyParsed: any; +}; + +/** + * Best-effort parse of an HTTP response body as "any", using the generator's ObjectSerializer. + * Falls back to returning the raw string when parsing fails. + */ +export function tryParseRawBody(rawBody: string, contentType: string | undefined): any { + if (!contentType) return rawBody; + try { + return ObjectSerializer.parse(rawBody, contentType); + } catch (_e) { + return rawBody; + } +} + +/** + * Reads a response body as text exactly once, and returns both raw and parsed forms. + * + * Intended for error handling, where the OpenAPI schema may not model the real error payload. + */ +export async function readRawBodyAndParse( + response: ResponseContext, + contentType: string | undefined +): Promise { + const rawBody = await response.body.text(); + const rawBodyParsed = tryParseRawBody(rawBody, contentType); + return { rawBody, rawBodyParsed }; +} + + diff --git a/src/pandadoc/oneOfTypeResolver.ts b/src/pandadoc/oneOfTypeResolver.ts new file mode 100644 index 0000000..f219c0a --- /dev/null +++ b/src/pandadoc/oneOfTypeResolver.ts @@ -0,0 +1,23 @@ +/** + * PandaDoc runtime helpers for generated polymorphic models. + * + * Goal: keep generator-template / postgenerate patches tiny, and put real logic here in TypeScript. + */ + +/** + * `DocumentCreateRequest` is generated as a oneOf `type` union, but the generator may map + * `typeMap["DocumentCreateRequest"]` to a stub class without `getAttributeTypeMap()`. + * + * We resolve the concrete oneOf type based on the request payload shape. + */ +export function resolveTypeForAttributeMap(type: string, data: any): string { + if (type !== "DocumentCreateRequest") return type; + if (!data || typeof data !== "object") return type; + + if ((data as any).templateUuid !== undefined) return "DocumentCreateRequestOneOf"; + if ((data as any).url !== undefined) return "DocumentCreateRequestOneOf1"; + + return type; +} + + diff --git a/src/servers.ts b/src/servers.ts index d306855..b549f9a 100644 --- a/src/servers.ts +++ b/src/servers.ts @@ -14,9 +14,11 @@ export class ServerConfiguration implements public constructor(private url: string, private variableConfiguration: T) {} /** - * Sets the value of the variables of this server. + * Sets the value of the variables of this server. Variables are included in + * the `url` of this ServerConfiguration in the form `{variableName}` * - * @param variableConfiguration a partial variable configuration for the variables contained in the url + * @param variableConfiguration a partial variable configuration for the + * variables contained in the url */ public setVariables(variableConfiguration: Partial) { Object.assign(this.variableConfiguration, variableConfiguration); @@ -28,9 +30,8 @@ export class ServerConfiguration implements private getUrl() { let replacedUrl = this.url; - for (const key in this.variableConfiguration) { - var re = new RegExp("{" + key + "}","g"); - replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]); + for (const [key, value] of Object.entries(this.variableConfiguration)) { + replacedUrl = replacedUrl.replaceAll(`{${key}}`, value); } return replacedUrl } diff --git a/src/types/ObjectParamAPI.ts b/src/types/ObjectParamAPI.ts index 2ddffec..6612759 100644 --- a/src/types/ObjectParamAPI.ts +++ b/src/types/ObjectParamAPI.ts @@ -1,148 +1,358 @@ -import { ResponseContext, RequestContext, HttpFile } from '../http/http'; -import * as models from '../models/all'; -import { Configuration} from '../configuration' +import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; +import { Configuration, ConfigurationOptions } from '../configuration' +import type { Middleware } from '../middleware'; import { APILogDetailsResponse } from '../models/APILogDetailsResponse'; import { APILogListResponse } from '../models/APILogListResponse'; -import { APILogListResponseResults } from '../models/APILogListResponseResults'; +import { APILogListResponseResultsInner } from '../models/APILogListResponseResultsInner'; +import { AccessToken400Response } from '../models/AccessToken400Response'; +import { AddDsvNamedItemsRequest } from '../models/AddDsvNamedItemsRequest'; +import { AddDsvNamedItemsRequestItemsInner } from '../models/AddDsvNamedItemsRequestItemsInner'; +import { AddDsvNamedItemsResponse } from '../models/AddDsvNamedItemsResponse'; +import { AddDsvNamedItemsResponseResultsInner } from '../models/AddDsvNamedItemsResponseResultsInner'; +import { AddMember400Response } from '../models/AddMember400Response'; import { AddMemberRequest } from '../models/AddMemberRequest'; import { AddMemberResponse } from '../models/AddMemberResponse'; +import { ApiKeyTypeEnum } from '../models/ApiKeyTypeEnum'; +import { ApiLogEnvironmentTypeEnum } from '../models/ApiLogEnvironmentTypeEnum'; +import { ApiLogMethodEnum } from '../models/ApiLogMethodEnum'; +import { ApiLogStatusEnum } from '../models/ApiLogStatusEnum'; +import { AppendCLIDataRequest } from '../models/AppendCLIDataRequest'; +import { AppendCLIDataRequestCli } from '../models/AppendCLIDataRequestCli'; +import { AppendCLIDataRequestCliPagesInner } from '../models/AppendCLIDataRequestCliPagesInner'; +import { AppendCLIDataResponse } from '../models/AppendCLIDataResponse'; +import { AppendCLIDataResponseBlockMapping } from '../models/AppendCLIDataResponseBlockMapping'; +import { AppendCLIDataResponseBlockMappingImagesInner } from '../models/AppendCLIDataResponseBlockMappingImagesInner'; +import { AppendCLIDataResponseBlockMappingPricingTablesInner } from '../models/AppendCLIDataResponseBlockMappingPricingTablesInner'; +import { AppendCLIDataResponseBlockMappingTablesInner } from '../models/AppendCLIDataResponseBlockMappingTablesInner'; +import { AppendCLIDataResponseBlockMappingTextsInner } from '../models/AppendCLIDataResponseBlockMappingTextsInner'; +import { AppendCLIDataResponseCli } from '../models/AppendCLIDataResponseCli'; +import { AppendCLIDataResponseCliPagesInner } from '../models/AppendCLIDataResponseCliPagesInner'; +import { AssignedToRecipientDeliveryMethods } from '../models/AssignedToRecipientDeliveryMethods'; +import { AutoReminders } from '../models/AutoReminders'; +import { BaseActor } from '../models/BaseActor'; +import { BaseEditingSessionResponse } from '../models/BaseEditingSessionResponse'; +import { BaseField } from '../models/BaseField'; +import { BaseFieldAssignedTo } from '../models/BaseFieldAssignedTo'; +import { BaseIdentity } from '../models/BaseIdentity'; +import { ChangeDocumentStatus409Response } from '../models/ChangeDocumentStatus409Response'; +import { Checkbox } from '../models/Checkbox'; +import { CollectFile } from '../models/CollectFile'; +import { CollectFileAllOfValue } from '../models/CollectFileAllOfValue'; import { ContactCreateRequest } from '../models/ContactCreateRequest'; import { ContactDetailsResponse } from '../models/ContactDetailsResponse'; import { ContactListResponse } from '../models/ContactListResponse'; import { ContactUpdateRequest } from '../models/ContactUpdateRequest'; +import { ContentLibraryItemCreateFromUrlRequest } from '../models/ContentLibraryItemCreateFromUrlRequest'; +import { ContentLibraryItemCreateRequest } from '../models/ContentLibraryItemCreateRequest'; import { ContentLibraryItemListResponse } from '../models/ContentLibraryItemListResponse'; -import { ContentLibraryItemListResponseResults } from '../models/ContentLibraryItemListResponseResults'; +import { ContentLibraryItemListResponseResultsInner } from '../models/ContentLibraryItemListResponseResultsInner'; import { ContentLibraryItemResponse } from '../models/ContentLibraryItemResponse'; import { ContentLibraryItemResponseCreatedBy } from '../models/ContentLibraryItemResponseCreatedBy'; +import { ContentLibraryResponse } from '../models/ContentLibraryResponse'; +import { CreateApiKeyRequest } from '../models/CreateApiKeyRequest'; +import { CreateApiKeyResponse } from '../models/CreateApiKeyResponse'; +import { CreateDocument400Response } from '../models/CreateDocument400Response'; +import { CreateDocumentActor } from '../models/CreateDocumentActor'; +import { CreateDocumentEditingSession201Response } from '../models/CreateDocumentEditingSession201Response'; +import { CreateDocumentFieldsRequest } from '../models/CreateDocumentFieldsRequest'; +import { CreateDocumentFieldsResponse } from '../models/CreateDocumentFieldsResponse'; +import { CreateDocumentRecipient } from '../models/CreateDocumentRecipient'; +import { CreateDocumentRecipientGroup } from '../models/CreateDocumentRecipientGroup'; +import { CreateMemberTokenRequest } from '../models/CreateMemberTokenRequest'; +import { CreateMemberTokenResponse } from '../models/CreateMemberTokenResponse'; +import { CreateNotarizationRequest } from '../models/CreateNotarizationRequest'; +import { CreateNotarizationRequestInvitation } from '../models/CreateNotarizationRequestInvitation'; +import { CreateNotarizationRequestInvitationInviteesInner } from '../models/CreateNotarizationRequestInvitationInviteesInner'; +import { CreateNotarizationRequestNotary } from '../models/CreateNotarizationRequestNotary'; +import { CreateNotarizationResponse } from '../models/CreateNotarizationResponse'; +import { CreateNotarizationResponseCreatedBy } from '../models/CreateNotarizationResponseCreatedBy'; +import { CreateNotarizationResponseInviteesInner } from '../models/CreateNotarizationResponseInviteesInner'; +import { CreateTemplateEditingSession201Response } from '../models/CreateTemplateEditingSession201Response'; +import { CreateTemplateFromUrlRequest } from '../models/CreateTemplateFromUrlRequest'; +import { CreateTemplateRequest } from '../models/CreateTemplateRequest'; +import { CreateTemplateRequestOwner } from '../models/CreateTemplateRequestOwner'; +import { CreateUser400Response } from '../models/CreateUser400Response'; import { CreateUserRequest } from '../models/CreateUserRequest'; import { CreateUserRequestUser } from '../models/CreateUserRequestUser'; -import { CreateUserRequestWorkspaces } from '../models/CreateUserRequestWorkspaces'; +import { CreateUserRequestWorkspacesInner } from '../models/CreateUserRequestWorkspacesInner'; import { CreateUserResponse } from '../models/CreateUserResponse'; +import { CreateUserResponseWorkspacesInner } from '../models/CreateUserResponseWorkspacesInner'; import { CreateWorkspaceRequest } from '../models/CreateWorkspaceRequest'; import { CreateWorkspaceResponse } from '../models/CreateWorkspaceResponse'; +import { DeleteNotarizationRequest404Response } from '../models/DeleteNotarizationRequest404Response'; +import { DocumentAttachmentMetadata } from '../models/DocumentAttachmentMetadata'; +import { DocumentAttachmentRequest } from '../models/DocumentAttachmentRequest'; import { DocumentAttachmentResponse } from '../models/DocumentAttachmentResponse'; import { DocumentAttachmentResponseCreatedBy } from '../models/DocumentAttachmentResponseCreatedBy'; +import { DocumentAuditTrailResponse } from '../models/DocumentAuditTrailResponse'; +import { DocumentAuditTrailResponseResultsInner } from '../models/DocumentAuditTrailResponseResultsInner'; +import { DocumentAuditTrailResponseResultsInnerUser } from '../models/DocumentAuditTrailResponseResultsInnerUser'; +import { DocumentAutoRemindersResponse } from '../models/DocumentAutoRemindersResponse'; +import { DocumentAutoRemindersResponse400 } from '../models/DocumentAutoRemindersResponse400'; +import { DocumentAutoRemindersResponseResultInner } from '../models/DocumentAutoRemindersResponseResultInner'; import { DocumentCreateByPdfRequest } from '../models/DocumentCreateByPdfRequest'; import { DocumentCreateByTemplateRequest } from '../models/DocumentCreateByTemplateRequest'; -import { DocumentCreateByTemplateRequestContentLibraryItems } from '../models/DocumentCreateByTemplateRequestContentLibraryItems'; -import { DocumentCreateByTemplateRequestContentPlaceholders } from '../models/DocumentCreateByTemplateRequestContentPlaceholders'; -import { DocumentCreateByTemplateRequestImages } from '../models/DocumentCreateByTemplateRequestImages'; -import { DocumentCreateByTemplateRequestRecipients } from '../models/DocumentCreateByTemplateRequestRecipients'; -import { DocumentCreateByTemplateRequestTokens } from '../models/DocumentCreateByTemplateRequestTokens'; +import { DocumentCreateByTemplateRequestContentPlaceholdersInner } from '../models/DocumentCreateByTemplateRequestContentPlaceholdersInner'; +import { DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInner } from '../models/DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInner'; +import { DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInnerRecipientsInner } from '../models/DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInnerRecipientsInner'; +import { DocumentCreateByTemplateRequestFieldsValue } from '../models/DocumentCreateByTemplateRequestFieldsValue'; +import { DocumentCreateByTemplateRequestFieldsValueValue } from '../models/DocumentCreateByTemplateRequestFieldsValueValue'; +import { DocumentCreateByTemplateRequestImagesInner } from '../models/DocumentCreateByTemplateRequestImagesInner'; +import { DocumentCreateByTemplateRequestOwner } from '../models/DocumentCreateByTemplateRequestOwner'; +import { DocumentCreateByTemplateRequestTextsInner } from '../models/DocumentCreateByTemplateRequestTextsInner'; +import { DocumentCreateByTemplateRequestTokensInner } from '../models/DocumentCreateByTemplateRequestTokensInner'; import { DocumentCreateLinkRequest } from '../models/DocumentCreateLinkRequest'; import { DocumentCreateLinkResponse } from '../models/DocumentCreateLinkResponse'; import { DocumentCreateRequest } from '../models/DocumentCreateRequest'; -import { DocumentCreateRequestContentLibraryItems } from '../models/DocumentCreateRequestContentLibraryItems'; -import { DocumentCreateRequestContentPlaceholders } from '../models/DocumentCreateRequestContentPlaceholders'; -import { DocumentCreateRequestImages } from '../models/DocumentCreateRequestImages'; -import { DocumentCreateRequestRecipients } from '../models/DocumentCreateRequestRecipients'; +import { DocumentCreateRequestOneOf } from '../models/DocumentCreateRequestOneOf'; +import { DocumentCreateRequestOneOf1 } from '../models/DocumentCreateRequestOneOf1'; import { DocumentCreateResponse } from '../models/DocumentCreateResponse'; -import { DocumentCreateResponseLinks } from '../models/DocumentCreateResponseLinks'; +import { DocumentCreateResponseLinksInner } from '../models/DocumentCreateResponseLinksInner'; +import { DocumentDeliveryMethodEnum } from '../models/DocumentDeliveryMethodEnum'; +import { DocumentDetailsRecipient } from '../models/DocumentDetailsRecipient'; +import { DocumentDetailsRecipientGroup } from '../models/DocumentDetailsRecipientGroup'; +import { DocumentDetailsRecipientGroupMember } from '../models/DocumentDetailsRecipientGroupMember'; import { DocumentDetailsResponse } from '../models/DocumentDetailsResponse'; import { DocumentDetailsResponseCreatedBy } from '../models/DocumentDetailsResponseCreatedBy'; import { DocumentDetailsResponseGrandTotal } from '../models/DocumentDetailsResponseGrandTotal'; -import { DocumentDetailsResponseLinkedObjects } from '../models/DocumentDetailsResponseLinkedObjects'; -import { DocumentDetailsResponseRecipients } from '../models/DocumentDetailsResponseRecipients'; +import { DocumentDetailsResponseImagesInner } from '../models/DocumentDetailsResponseImagesInner'; +import { DocumentDetailsResponseLinkedObjectsInner } from '../models/DocumentDetailsResponseLinkedObjectsInner'; +import { DocumentDetailsResponseLinkedObjectsInnerChildrenInner } from '../models/DocumentDetailsResponseLinkedObjectsInnerChildrenInner'; +import { DocumentDetailsResponseRecipientsInner } from '../models/DocumentDetailsResponseRecipientsInner'; +import { DocumentDetailsResponseTablesInner } from '../models/DocumentDetailsResponseTablesInner'; import { DocumentDetailsResponseTemplate } from '../models/DocumentDetailsResponseTemplate'; +import { DocumentDetailsResponseTextsInner } from '../models/DocumentDetailsResponseTextsInner'; +import { DocumentDocxExport } from '../models/DocumentDocxExport'; +import { DocumentDocxExportStatusEnum } from '../models/DocumentDocxExportStatusEnum'; +import { DocumentESignDisclosure } from '../models/DocumentESignDisclosure'; +import { DocumentESignDisclosureResult } from '../models/DocumentESignDisclosureResult'; +import { DocumentFieldAnchorPointEnum } from '../models/DocumentFieldAnchorPointEnum'; +import { DocumentFieldTypeEnum } from '../models/DocumentFieldTypeEnum'; +import { DocumentFieldsField } from '../models/DocumentFieldsField'; +import { DocumentFieldsFieldAssignedTo } from '../models/DocumentFieldsFieldAssignedTo'; +import { DocumentFieldsFieldCreate } from '../models/DocumentFieldsFieldCreate'; +import { DocumentFieldsLayout } from '../models/DocumentFieldsLayout'; +import { DocumentFieldsLayoutPosition } from '../models/DocumentFieldsLayoutPosition'; +import { DocumentFieldsLayoutStyle } from '../models/DocumentFieldsLayoutStyle'; +import { DocumentLanguageEnum } from '../models/DocumentLanguageEnum'; import { DocumentListResponse } from '../models/DocumentListResponse'; -import { DocumentListResponseResults } from '../models/DocumentListResponseResults'; +import { DocumentListResponseResultsInner } from '../models/DocumentListResponseResultsInner'; import { DocumentOrderingFieldsEnum } from '../models/DocumentOrderingFieldsEnum'; import { DocumentRecipientCreateRequest } from '../models/DocumentRecipientCreateRequest'; import { DocumentRecipientEditRequest } from '../models/DocumentRecipientEditRequest'; import { DocumentRecipientResponse } from '../models/DocumentRecipientResponse'; +import { DocumentRevertToDraftResponse } from '../models/DocumentRevertToDraftResponse'; +import { DocumentSendManualReminder200Response } from '../models/DocumentSendManualReminder200Response'; +import { DocumentSendManualReminder200ResponseResultInner } from '../models/DocumentSendManualReminder200ResponseResultInner'; +import { DocumentSendManualReminder200ResponseResultInnerEmail } from '../models/DocumentSendManualReminder200ResponseResultInnerEmail'; +import { DocumentSendManualReminder200ResponseResultInnerEmailCustomization } from '../models/DocumentSendManualReminder200ResponseResultInnerEmailCustomization'; +import { DocumentSendManualReminder200ResponseResultInnerSms } from '../models/DocumentSendManualReminder200ResponseResultInnerSms'; +import { DocumentSendManualReminder409Response } from '../models/DocumentSendManualReminder409Response'; +import { DocumentSendManualReminderRequest } from '../models/DocumentSendManualReminderRequest'; +import { DocumentSendManualReminderRequestRemindersInner } from '../models/DocumentSendManualReminderRequestRemindersInner'; +import { DocumentSendManualReminderRequestRemindersInnerEmailCustomization } from '../models/DocumentSendManualReminderRequestRemindersInnerEmailCustomization'; import { DocumentSendRequest } from '../models/DocumentSendRequest'; import { DocumentSendRequestForwardingSettings } from '../models/DocumentSendRequestForwardingSettings'; import { DocumentSendRequestSelectedApprovers } from '../models/DocumentSendRequestSelectedApprovers'; -import { DocumentSendRequestSelectedApproversGroup } from '../models/DocumentSendRequestSelectedApproversGroup'; -import { DocumentSendRequestSelectedApproversGroupAssignees } from '../models/DocumentSendRequestSelectedApproversGroupAssignees'; -import { DocumentSendRequestSelectedApproversSteps } from '../models/DocumentSendRequestSelectedApproversSteps'; +import { DocumentSendRequestSelectedApproversStepsInner } from '../models/DocumentSendRequestSelectedApproversStepsInner'; +import { DocumentSendRequestSelectedApproversStepsInnerGroup } from '../models/DocumentSendRequestSelectedApproversStepsInnerGroup'; +import { DocumentSendRequestSelectedApproversStepsInnerGroupAssigneesInner } from '../models/DocumentSendRequestSelectedApproversStepsInnerGroupAssigneesInner'; +import { DocumentSendRequestSender } from '../models/DocumentSendRequestSender'; import { DocumentSendResponse } from '../models/DocumentSendResponse'; -import { DocumentSendResponseRecipients } from '../models/DocumentSendResponseRecipients'; +import { DocumentSendResponseRecipientsInner } from '../models/DocumentSendResponseRecipientsInner'; +import { DocumentSettingsResponse } from '../models/DocumentSettingsResponse'; import { DocumentStatusChangeRequest } from '../models/DocumentStatusChangeRequest'; +import { DocumentStatusChangeRequestStatusEnum } from '../models/DocumentStatusChangeRequestStatusEnum'; import { DocumentStatusEnum } from '../models/DocumentStatusEnum'; import { DocumentStatusRequestEnum } from '../models/DocumentStatusRequestEnum'; import { DocumentStatusResponse } from '../models/DocumentStatusResponse'; import { DocumentTransferAllOwnershipRequest } from '../models/DocumentTransferAllOwnershipRequest'; import { DocumentTransferOwnershipRequest } from '../models/DocumentTransferOwnershipRequest'; import { DocumentUpdateRequest } from '../models/DocumentUpdateRequest'; -import { DocumentUpdateRequestRecipients } from '../models/DocumentUpdateRequestRecipients'; +import { DocumentUpdateRequestFieldValue } from '../models/DocumentUpdateRequestFieldValue'; +import { DocumentUpdateRequestImagesInner } from '../models/DocumentUpdateRequestImagesInner'; +import { DocumentUpdateRequestTextsInner } from '../models/DocumentUpdateRequestTextsInner'; +import { DocumentUpdateRequestTokensInner } from '../models/DocumentUpdateRequestTokensInner'; import { DocumentsFolderCreateRequest } from '../models/DocumentsFolderCreateRequest'; import { DocumentsFolderCreateResponse } from '../models/DocumentsFolderCreateResponse'; import { DocumentsFolderListResponse } from '../models/DocumentsFolderListResponse'; -import { DocumentsFolderListResponseResults } from '../models/DocumentsFolderListResponseResults'; +import { DocumentsFolderListResponseResultsInner } from '../models/DocumentsFolderListResponseResultsInner'; import { DocumentsFolderRenameRequest } from '../models/DocumentsFolderRenameRequest'; import { DocumentsFolderRenameResponse } from '../models/DocumentsFolderRenameResponse'; +import { DocxExportTaskResponse } from '../models/DocxExportTaskResponse'; +import { DocxExportTaskResponseAllOfDocxItems } from '../models/DocxExportTaskResponseAllOfDocxItems'; +import { Dropdown } from '../models/Dropdown'; +import { EditingSessionRequest } from '../models/EditingSessionRequest'; +import { Field } from '../models/Field'; import { FormListResponse } from '../models/FormListResponse'; -import { FormListResponseResults } from '../models/FormListResponseResults'; +import { FormListResponseResultsInner } from '../models/FormListResponseResultsInner'; +import { Initials } from '../models/Initials'; +import { LinkedObjectChild } from '../models/LinkedObjectChild'; import { LinkedObjectCreateRequest } from '../models/LinkedObjectCreateRequest'; import { LinkedObjectCreateResponse } from '../models/LinkedObjectCreateResponse'; import { LinkedObjectListResponse } from '../models/LinkedObjectListResponse'; +import { ListCatalogItemsSearchResponse } from '../models/ListCatalogItemsSearchResponse'; +import { ListDocumentFieldsResponse } from '../models/ListDocumentFieldsResponse'; +import { ListDocuments400Response } from '../models/ListDocuments400Response'; +import { ListDocuments401Response } from '../models/ListDocuments401Response'; +import { ListDocuments403Response } from '../models/ListDocuments403Response'; +import { ListDocuments403ResponseLinksInner } from '../models/ListDocuments403ResponseLinksInner'; +import { ListDocuments429Response } from '../models/ListDocuments429Response'; +import { ListDocumentsByLinkedObjectsResponseInner } from '../models/ListDocumentsByLinkedObjectsResponseInner'; +import { ListNotaries400Response } from '../models/ListNotaries400Response'; +import { ListNotaries400ResponseDetailsInner } from '../models/ListNotaries400ResponseDetailsInner'; +import { ListNotaries403Response } from '../models/ListNotaries403Response'; +import { ListNotaries429Response } from '../models/ListNotaries429Response'; +import { ListNotariesResponse } from '../models/ListNotariesResponse'; +import { ListNotariesResponseResultsInner } from '../models/ListNotariesResponseResultsInner'; +import { ListSmsOptOutChangelogResponse } from '../models/ListSmsOptOutChangelogResponse'; +import { ListSmsOptOutChangelogResponseResultsInner } from '../models/ListSmsOptOutChangelogResponseResultsInner'; +import { ListUsersResponse } from '../models/ListUsersResponse'; +import { ListUsersResponseResultsInner } from '../models/ListUsersResponseResultsInner'; +import { ListUsersResponseResultsInnerWorkspacesInner } from '../models/ListUsersResponseResultsInnerWorkspacesInner'; +import { ListWorkspacesResponse } from '../models/ListWorkspacesResponse'; +import { ListWorkspacesResponseResultsInner } from '../models/ListWorkspacesResponseResultsInner'; import { MemberDetailsResponse } from '../models/MemberDetailsResponse'; import { MemberListResponse } from '../models/MemberListResponse'; +import { ModelDate } from '../models/ModelDate'; +import { NotarizationRequestDetailsResponse } from '../models/NotarizationRequestDetailsResponse'; +import { NotarizationRequestDetailsResponseCreatedBy } from '../models/NotarizationRequestDetailsResponseCreatedBy'; +import { NotarizationRequestDetailsResponseInviteesInner } from '../models/NotarizationRequestDetailsResponseInviteesInner'; +import { NotarizationRequestDetailsResponseRecording } from '../models/NotarizationRequestDetailsResponseRecording'; +import { NotarizationRequestDetailsResponseSignedDocumentsInner } from '../models/NotarizationRequestDetailsResponseSignedDocumentsInner'; import { OAuth2AccessTokenResponse } from '../models/OAuth2AccessTokenResponse'; +import { Payment } from '../models/Payment'; import { PricingResponse } from '../models/PricingResponse'; import { PricingTableRequest } from '../models/PricingTableRequest'; import { PricingTableRequestRowOptions } from '../models/PricingTableRequestRowOptions'; -import { PricingTableRequestRows } from '../models/PricingTableRequestRows'; -import { PricingTableRequestSections } from '../models/PricingTableRequestSections'; +import { PricingTableRequestSectionsInner } from '../models/PricingTableRequestSectionsInner'; +import { PricingTableRequestSectionsInnerRowsInner } from '../models/PricingTableRequestSectionsInnerRowsInner'; import { PricingTableResponse } from '../models/PricingTableResponse'; -import { PricingTableResponseDiscount } from '../models/PricingTableResponseDiscount'; -import { PricingTableResponseItems } from '../models/PricingTableResponseItems'; -import { PricingTableResponseOptions } from '../models/PricingTableResponseOptions'; +import { PricingTableResponseItemsInner } from '../models/PricingTableResponseItemsInner'; +import { PricingTableResponseItemsInnerDiscount } from '../models/PricingTableResponseItemsInnerDiscount'; +import { PricingTableResponseItemsInnerOptions } from '../models/PricingTableResponseItemsInnerOptions'; import { PricingTableResponseSummary } from '../models/PricingTableResponseSummary'; +import { ProductCatalogCatalogCustomBundleItem } from '../models/ProductCatalogCatalogCustomBundleItem'; +import { ProductCatalogCatalogItemInBundle } from '../models/ProductCatalogCatalogItemInBundle'; +import { ProductCatalogCustomBundleItemNoId } from '../models/ProductCatalogCustomBundleItemNoId'; +import { ProductCatalogCustomCatalogItemInBundle } from '../models/ProductCatalogCustomCatalogItemInBundle'; +import { ProductCatalogItemPatchRequest } from '../models/ProductCatalogItemPatchRequest'; +import { ProductCatalogItemPatchRequestBundleItemsInner } from '../models/ProductCatalogItemPatchRequestBundleItemsInner'; +import { ProductCatalogItemPatchRequestBundleItemsInnerItemOrUuid } from '../models/ProductCatalogItemPatchRequestBundleItemsInnerItemOrUuid'; +import { ProductCatalogItemPatchRequestProductVariant } from '../models/ProductCatalogItemPatchRequestProductVariant'; +import { ProductCatalogItemPriceConfiguration } from '../models/ProductCatalogItemPriceConfiguration'; +import { ProductCatalogItemPriceTier } from '../models/ProductCatalogItemPriceTier'; +import { ProductCatalogItemRequest } from '../models/ProductCatalogItemRequest'; +import { ProductCatalogItemRequestBundleItemsInner } from '../models/ProductCatalogItemRequestBundleItemsInner'; +import { ProductCatalogItemRequestBundleItemsInnerItemOrUuid } from '../models/ProductCatalogItemRequestBundleItemsInnerItemOrUuid'; +import { ProductCatalogItemRequestCustomFieldsInner } from '../models/ProductCatalogItemRequestCustomFieldsInner'; +import { ProductCatalogItemRequestImagesInner } from '../models/ProductCatalogItemRequestImagesInner'; +import { ProductCatalogItemResponse } from '../models/ProductCatalogItemResponse'; +import { ProductCatalogItemResponseBundleItemsInner } from '../models/ProductCatalogItemResponseBundleItemsInner'; +import { ProductCatalogItemResponseBundleItemsInnerItem } from '../models/ProductCatalogItemResponseBundleItemsInnerItem'; +import { ProductCatalogItemResponseDefaultPriceConfiguration } from '../models/ProductCatalogItemResponseDefaultPriceConfiguration'; +import { ProductCatalogItemResponseVariantsInner } from '../models/ProductCatalogItemResponseVariantsInner'; +import { ProductCatalogPricingMethodEnum } from '../models/ProductCatalogPricingMethodEnum'; +import { ProductCatalogSearchCatalogItemResponse } from '../models/ProductCatalogSearchCatalogItemResponse'; +import { ProductCatalogSearchCatalogItemResponseCustomFieldsInner } from '../models/ProductCatalogSearchCatalogItemResponseCustomFieldsInner'; +import { ProductCatalogSearchCatalogItemResponseImagesInner } from '../models/ProductCatalogSearchCatalogItemResponseImagesInner'; +import { ProductCatalogSearchCatalogItemResponseTiersInner } from '../models/ProductCatalogSearchCatalogItemResponseTiersInner'; +import { ProductCatalogTypeEnum } from '../models/ProductCatalogTypeEnum'; import { QuoteResponse } from '../models/QuoteResponse'; -import { QuoteResponseAction } from '../models/QuoteResponseAction'; -import { QuoteResponseCondition } from '../models/QuoteResponseCondition'; -import { QuoteResponseConditionComparison } from '../models/QuoteResponseConditionComparison'; -import { QuoteResponseMergeRules } from '../models/QuoteResponseMergeRules'; -import { QuoteResponseOptions } from '../models/QuoteResponseOptions'; +import { QuoteResponseMergeRulesInner } from '../models/QuoteResponseMergeRulesInner'; +import { QuoteResponseMergeRulesInnerAction } from '../models/QuoteResponseMergeRulesInnerAction'; +import { QuoteResponseMergeRulesInnerCondition } from '../models/QuoteResponseMergeRulesInnerCondition'; +import { QuoteResponseMergeRulesInnerConditionComparisonInner } from '../models/QuoteResponseMergeRulesInnerConditionComparisonInner'; import { QuoteResponseSectionColumn } from '../models/QuoteResponseSectionColumn'; import { QuoteResponseSectionItem } from '../models/QuoteResponseSectionItem'; +import { QuoteResponseSectionItemOptions } from '../models/QuoteResponseSectionItemOptions'; import { QuoteResponseSectionSummary } from '../models/QuoteResponseSectionSummary'; -import { QuoteResponseSections } from '../models/QuoteResponseSections'; +import { QuoteResponseSectionsInner } from '../models/QuoteResponseSectionsInner'; import { QuoteResponseSettings } from '../models/QuoteResponseSettings'; import { QuoteResponseSummary } from '../models/QuoteResponseSummary'; -import { QuoteResponseSummaryDiscounts } from '../models/QuoteResponseSummaryDiscounts'; -import { QuoteResponseSummaryRecurringSubtotal } from '../models/QuoteResponseSummaryRecurringSubtotal'; +import { QuoteResponseSummaryDiscountsValue } from '../models/QuoteResponseSummaryDiscountsValue'; +import { QuoteResponseSummaryRecurringSubtotalInner } from '../models/QuoteResponseSummaryRecurringSubtotalInner'; import { QuoteSectionSettings } from '../models/QuoteSectionSettings'; import { QuoteUpdateRequest } from '../models/QuoteUpdateRequest'; -import { QuoteUpdateRequestDiscounts } from '../models/QuoteUpdateRequestDiscounts'; -import { QuoteUpdateRequestOptions } from '../models/QuoteUpdateRequestOptions'; -import { QuoteUpdateRequestPriceSettings } from '../models/QuoteUpdateRequestPriceSettings'; -import { QuoteUpdateRequestPriceSettingsTiers } from '../models/QuoteUpdateRequestPriceSettingsTiers'; +import { QuoteUpdateRequestBillingFrequencyEnum } from '../models/QuoteUpdateRequestBillingFrequencyEnum'; +import { QuoteUpdateRequestDiscountTypeEnum } from '../models/QuoteUpdateRequestDiscountTypeEnum'; import { QuoteUpdateRequestSettings } from '../models/QuoteUpdateRequestSettings'; -import { QuoteUpdateRequestSettings1 } from '../models/QuoteUpdateRequestSettings1'; +import { QuoteUpdateRequestSettingsSelectionTypeTypeEnum } from '../models/QuoteUpdateRequestSettingsSelectionTypeTypeEnum'; +import { RadioButtons } from '../models/RadioButtons'; +import { RecipientAssignedTo } from '../models/RecipientAssignedTo'; +import { RecipientAssignmentDetails } from '../models/RecipientAssignmentDetails'; +import { RecipientDeliveryMethods } from '../models/RecipientDeliveryMethods'; +import { RecipientKindEnum } from '../models/RecipientKindEnum'; +import { RecipientPersonalDetails } from '../models/RecipientPersonalDetails'; import { RecipientRedirect } from '../models/RecipientRedirect'; +import { RecipientRedirectSettings } from '../models/RecipientRedirectSettings'; +import { RecipientVerificationPlaceEnum } from '../models/RecipientVerificationPlaceEnum'; import { RecipientVerificationSettings } from '../models/RecipientVerificationSettings'; +import { RecipientVerificationSettingsIdVerification } from '../models/RecipientVerificationSettingsIdVerification'; +import { RecipientVerificationSettingsKbaVerification } from '../models/RecipientVerificationSettingsKbaVerification'; import { RecipientVerificationSettingsPasscodeVerification } from '../models/RecipientVerificationSettingsPasscodeVerification'; import { RecipientVerificationSettingsPhoneVerification } from '../models/RecipientVerificationSettingsPhoneVerification'; -import { RicipientDeliveryMethods } from '../models/RicipientDeliveryMethods'; +import { RecipientsGroupAssignedTo } from '../models/RecipientsGroupAssignedTo'; +import { RecipientsGroupAssignedToAllOfMembers } from '../models/RecipientsGroupAssignedToAllOfMembers'; +import { RemoveMember400Response } from '../models/RemoveMember400Response'; +import { RemoveMember404Response } from '../models/RemoveMember404Response'; +import { SearchCatalogItems401Response } from '../models/SearchCatalogItems401Response'; import { SectionInfoResponse } from '../models/SectionInfoResponse'; +import { Signature } from '../models/Signature'; +import { Stamp } from '../models/Stamp'; +import { StatusDocument404Response } from '../models/StatusDocument404Response'; +import { StatusDocumentAutoReminder400Response } from '../models/StatusDocumentAutoReminder400Response'; +import { TableCell } from '../models/TableCell'; +import { TableRequest } from '../models/TableRequest'; +import { TableRequestData } from '../models/TableRequestData'; +import { TableRequestDataSectionsInner } from '../models/TableRequestDataSectionsInner'; +import { TemplateCreateResponse } from '../models/TemplateCreateResponse'; import { TemplateDetailsResponse } from '../models/TemplateDetailsResponse'; -import { TemplateDetailsResponseContentPlaceholders } from '../models/TemplateDetailsResponseContentPlaceholders'; -import { TemplateDetailsResponseImages } from '../models/TemplateDetailsResponseImages'; -import { TemplateDetailsResponsePreassignedPerson } from '../models/TemplateDetailsResponsePreassignedPerson'; -import { TemplateDetailsResponseRoles } from '../models/TemplateDetailsResponseRoles'; -import { TemplateDetailsResponseTokens } from '../models/TemplateDetailsResponseTokens'; +import { TemplateDetailsResponseContentPlaceholdersInner } from '../models/TemplateDetailsResponseContentPlaceholdersInner'; +import { TemplateDetailsResponseImagesInner } from '../models/TemplateDetailsResponseImagesInner'; +import { TemplateDetailsResponseRolesInner } from '../models/TemplateDetailsResponseRolesInner'; +import { TemplateDetailsResponseRolesInnerPreassignedPerson } from '../models/TemplateDetailsResponseRolesInnerPreassignedPerson'; +import { TemplateDetailsResponseRolesInnerPreassignedPersonMembersInner } from '../models/TemplateDetailsResponseRolesInnerPreassignedPersonMembersInner'; +import { TemplateDetailsResponseTokensInner } from '../models/TemplateDetailsResponseTokensInner'; import { TemplateListResponse } from '../models/TemplateListResponse'; -import { TemplateListResponseResults } from '../models/TemplateListResponseResults'; +import { TemplateSettingsResponse } from '../models/TemplateSettingsResponse'; +import { TemplateStatusResponse } from '../models/TemplateStatusResponse'; +import { TemplateUpdateRequest } from '../models/TemplateUpdateRequest'; import { TemplatesFolderCreateRequest } from '../models/TemplatesFolderCreateRequest'; import { TemplatesFolderCreateResponse } from '../models/TemplatesFolderCreateResponse'; import { TemplatesFolderListResponse } from '../models/TemplatesFolderListResponse'; -import { TemplatesFolderListResponseResults } from '../models/TemplatesFolderListResponseResults'; +import { TemplatesFolderListResponseResultsInner } from '../models/TemplatesFolderListResponseResultsInner'; import { TemplatesFolderRenameRequest } from '../models/TemplatesFolderRenameRequest'; import { TemplatesFolderRenameResponse } from '../models/TemplatesFolderRenameResponse'; +import { Text } from '../models/Text'; +import { UpdateDocument400Response } from '../models/UpdateDocument400Response'; +import { UpdateDocumentActor } from '../models/UpdateDocumentActor'; +import { UpdateDocumentAutoRemindersRequest } from '../models/UpdateDocumentAutoRemindersRequest'; +import { UpdateDocumentAutoRemindersResponse } from '../models/UpdateDocumentAutoRemindersResponse'; +import { UpdateDocumentRecipient } from '../models/UpdateDocumentRecipient'; +import { UpdateDocumentRecipientGroup } from '../models/UpdateDocumentRecipientGroup'; +import { UpdateDocumentSettingsRequest } from '../models/UpdateDocumentSettingsRequest'; import { UpdateIntegrationQuoteSection } from '../models/UpdateIntegrationQuoteSection'; import { UpdateIntegrationQuoteSectionItem } from '../models/UpdateIntegrationQuoteSectionItem'; -import { UploadSectionByPdfRequest } from '../models/UploadSectionByPdfRequest'; +import { UpdateIntegrationQuoteSectionItemDiscountsValue } from '../models/UpdateIntegrationQuoteSectionItemDiscountsValue'; +import { UpdateIntegrationQuoteSectionItemOptions } from '../models/UpdateIntegrationQuoteSectionItemOptions'; +import { UpdateIntegrationQuoteSectionItemPriceSettings } from '../models/UpdateIntegrationQuoteSectionItemPriceSettings'; +import { UpdateIntegrationQuoteSectionItemPriceSettingsTiersInner } from '../models/UpdateIntegrationQuoteSectionItemPriceSettingsTiersInner'; +import { UpdateIntegrationQuoteSectionSettings } from '../models/UpdateIntegrationQuoteSectionSettings'; +import { UpdateTemplateSettingsRequest } from '../models/UpdateTemplateSettingsRequest'; +import { UploadSectionBase } from '../models/UploadSectionBase'; import { UploadSectionByTemplateRequest } from '../models/UploadSectionByTemplateRequest'; +import { UploadSectionByTemplateRequestAllOfContentLibraryItems } from '../models/UploadSectionByTemplateRequestAllOfContentLibraryItems'; +import { UploadSectionByTemplateRequestAllOfContentPlaceholders } from '../models/UploadSectionByTemplateRequestAllOfContentPlaceholders'; import { UploadSectionListResponse } from '../models/UploadSectionListResponse'; -import { UploadSectionListResponseResults } from '../models/UploadSectionListResponseResults'; +import { UploadSectionListResponseResultsInner } from '../models/UploadSectionListResponseResultsInner'; import { UploadSectionRequest } from '../models/UploadSectionRequest'; +import { UploadSectionRequestOneOf } from '../models/UploadSectionRequestOneOf'; import { UploadSectionResponse } from '../models/UploadSectionResponse'; import { UploadSectionStatusEnum } from '../models/UploadSectionStatusEnum'; import { UploadSectionStatusResponse } from '../models/UploadSectionStatusResponse'; +import { UserLicenseEnum } from '../models/UserLicenseEnum'; import { WebhookEventDetailsResponse } from '../models/WebhookEventDetailsResponse'; import { WebhookEventErrorEnum } from '../models/WebhookEventErrorEnum'; import { WebhookEventHttpStatusCodeGroupEnum } from '../models/WebhookEventHttpStatusCodeGroupEnum'; @@ -157,6 +367,7 @@ import { WebhookSubscriptionPayloadEnum } from '../models/WebhookSubscriptionPay import { WebhookSubscriptionSharedKeyResponse } from '../models/WebhookSubscriptionSharedKeyResponse'; import { WebhookSubscriptionStatusEnum } from '../models/WebhookSubscriptionStatusEnum'; import { WebhookSubscriptionTriggerEnum } from '../models/WebhookSubscriptionTriggerEnum'; +import { WorkspaceMemberRoleEnum } from '../models/WorkspaceMemberRoleEnum'; import { ObservableAPILogsApi } from "./ObservableAPI"; import { APILogsApiRequestFactory, APILogsApiResponseProcessor} from "../apis/APILogsApi"; @@ -164,6 +375,7 @@ import { APILogsApiRequestFactory, APILogsApiResponseProcessor} from "../apis/AP export interface APILogsApiDetailsLogRequest { /** * Log event id. + * Defaults to: undefined * @type string * @memberof APILogsApidetailsLog */ @@ -173,52 +385,62 @@ export interface APILogsApiDetailsLogRequest { export interface APILogsApiListLogsRequest { /** * Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \"-90d\" (for past 90 days). + * Defaults to: '-90d' * @type string * @memberof APILogsApilistLogs */ since?: string /** * Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \"-10d\" (for past 10 days) or a special \"now\" value. + * Defaults to: undefined * @type string * @memberof APILogsApilistLogs */ to?: string /** * The amount of items on each page. + * Minimum: 1 + * Defaults to: 100 * @type number * @memberof APILogsApilistLogs */ count?: number /** - * Page number of the results returned. + * Returns page of the results by number. + * Minimum: 1 + * Defaults to: 1 * @type number * @memberof APILogsApilistLogs */ page?: number /** - * Returns only the predefined status codes. Allows 1xx, 2xx, 3xx, 4xx, and 5xx. - * @type Array<100 | 200 | 300 | 400 | 500> + * Returns only the predefined status codes. + * Defaults to: undefined + * @type Array<ApiLogStatusEnum> * @memberof APILogsApilistLogs */ - statuses?: Array<100 | 200 | 300 | 400 | 500> + statuses?: Array /** * Returns only the predefined HTTP methods. Allows GET, POST, PUT, PATCH, and DELETE. - * @type Array<'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'> + * Defaults to: undefined + * @type Array<ApiLogMethodEnum> * @memberof APILogsApilistLogs */ - methods?: Array<'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'> + methods?: Array /** * Returns the results containing a string. + * Defaults to: undefined * @type string * @memberof APILogsApilistLogs */ search?: string /** * Returns logs for production/sandbox. - * @type 'PRODUCTION' | 'SANDBOX' + * Defaults to: undefined + * @type ApiLogEnvironmentTypeEnum * @memberof APILogsApilistLogs */ - environmentType?: 'PRODUCTION' | 'SANDBOX' + environmentType?: ApiLogEnvironmentTypeEnum } export class ObjectAPILogsApi { @@ -230,24 +452,89 @@ export class ObjectAPILogsApi { /** * Returns details of the specific API log event. - * Details API Log + * API Log Details * @param param the request object */ - public detailsLog(param: APILogsApiDetailsLogRequest, options?: Configuration): Promise { + public detailsLogWithHttpInfo(param: APILogsApiDetailsLogRequest, options?: ConfigurationOptions): Promise> { + return this.api.detailsLogWithHttpInfo(param.id, options).toPromise(); + } + + /** + * Returns details of the specific API log event. + * API Log Details + * @param param the request object + */ + public detailsLog(param: APILogsApiDetailsLogRequest, options?: ConfigurationOptions): Promise { return this.api.detailsLog(param.id, options).toPromise(); } /** - * Get the list of all logs within the selected workspace. Optionally filter by date, page, and `#` of items per page. + * Get the list of all logs within the selected workspace.\\ Optionally filter by date, page, and `#` of items per page. + * List API Log + * @param param the request object + */ + public listLogsWithHttpInfo(param: APILogsApiListLogsRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.listLogsWithHttpInfo(param.since, param.to, param.count, param.page, param.statuses, param.methods, param.search, param.environmentType, options).toPromise(); + } + + /** + * Get the list of all logs within the selected workspace.\\ Optionally filter by date, page, and `#` of items per page. * List API Log * @param param the request object */ - public listLogs(param: APILogsApiListLogsRequest = {}, options?: Configuration): Promise { + public listLogs(param: APILogsApiListLogsRequest = {}, options?: ConfigurationOptions): Promise { return this.api.listLogs(param.since, param.to, param.count, param.page, param.statuses, param.methods, param.search, param.environmentType, options).toPromise(); } } +import { ObservableCommunicationPreferencesApi } from "./ObservableAPI"; +import { CommunicationPreferencesApiRequestFactory, CommunicationPreferencesApiResponseProcessor} from "../apis/CommunicationPreferencesApi"; + +export interface CommunicationPreferencesApiListRecentSmsOptOutsRequest { + /** + * The start of the timestamp. If no timestamp is provided, 1 hour before the current time will be used. + * Defaults to: undefined + * @type Date + * @memberof CommunicationPreferencesApilistRecentSmsOptOuts + */ + timestampFrom?: Date + /** + * The end of the timestamp range. If no timestamp is provided the current time will be used. + * Defaults to: undefined + * @type Date + * @memberof CommunicationPreferencesApilistRecentSmsOptOuts + */ + timestampTo?: Date +} + +export class ObjectCommunicationPreferencesApi { + private api: ObservableCommunicationPreferencesApi + + public constructor(configuration: Configuration, requestFactory?: CommunicationPreferencesApiRequestFactory, responseProcessor?: CommunicationPreferencesApiResponseProcessor) { + this.api = new ObservableCommunicationPreferencesApi(configuration, requestFactory, responseProcessor); + } + + /** + * Retrieves a list of the most recent SMS opt-out changes for each phone numbers used in your workspace. > 📘 You can filter results by time range using `timestamp_from` and `timestamp_to`. + * Recent SMS Opt-out + * @param param the request object + */ + public listRecentSmsOptOutsWithHttpInfo(param: CommunicationPreferencesApiListRecentSmsOptOutsRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.listRecentSmsOptOutsWithHttpInfo(param.timestampFrom, param.timestampTo, options).toPromise(); + } + + /** + * Retrieves a list of the most recent SMS opt-out changes for each phone numbers used in your workspace. > 📘 You can filter results by time range using `timestamp_from` and `timestamp_to`. + * Recent SMS Opt-out + * @param param the request object + */ + public listRecentSmsOptOuts(param: CommunicationPreferencesApiListRecentSmsOptOutsRequest = {}, options?: ConfigurationOptions): Promise { + return this.api.listRecentSmsOptOuts(param.timestampFrom, param.timestampTo, options).toPromise(); + } + +} + import { ObservableContactsApi } from "./ObservableAPI"; import { ContactsApiRequestFactory, ContactsApiResponseProcessor} from "../apis/ContactsApi"; @@ -263,6 +550,7 @@ export interface ContactsApiCreateContactRequest { export interface ContactsApiDeleteContactRequest { /** * Contact id. + * Defaults to: undefined * @type string * @memberof ContactsApideleteContact */ @@ -272,6 +560,7 @@ export interface ContactsApiDeleteContactRequest { export interface ContactsApiDetailsContactRequest { /** * Contact id. + * Defaults to: undefined * @type string * @memberof ContactsApidetailsContact */ @@ -281,6 +570,7 @@ export interface ContactsApiDetailsContactRequest { export interface ContactsApiListContactsRequest { /** * Optional search parameter. Filter results by exact match. + * Defaults to: undefined * @type string * @memberof ContactsApilistContacts */ @@ -290,6 +580,7 @@ export interface ContactsApiListContactsRequest { export interface ContactsApiUpdateContactRequest { /** * Contact id. + * Defaults to: undefined * @type string * @memberof ContactsApiupdateContact */ @@ -310,42 +601,92 @@ export class ObjectContactsApi { } /** + * This method adds a contact into a contacts list. + * Create contact + * @param param the request object + */ + public createContactWithHttpInfo(param: ContactsApiCreateContactRequest, options?: ConfigurationOptions): Promise> { + return this.api.createContactWithHttpInfo(param.contactCreateRequest, options).toPromise(); + } + + /** + * This method adds a contact into a contacts list. * Create contact * @param param the request object */ - public createContact(param: ContactsApiCreateContactRequest, options?: Configuration): Promise { + public createContact(param: ContactsApiCreateContactRequest, options?: ConfigurationOptions): Promise { return this.api.createContact(param.contactCreateRequest, options).toPromise(); } /** - * Delete contact by id + * This method deletes a contact. + * Delete Contact + * @param param the request object + */ + public deleteContactWithHttpInfo(param: ContactsApiDeleteContactRequest, options?: ConfigurationOptions): Promise> { + return this.api.deleteContactWithHttpInfo(param.id, options).toPromise(); + } + + /** + * This method deletes a contact. + * Delete Contact * @param param the request object */ - public deleteContact(param: ContactsApiDeleteContactRequest, options?: Configuration): Promise { + public deleteContact(param: ContactsApiDeleteContactRequest, options?: ConfigurationOptions): Promise { return this.api.deleteContact(param.id, options).toPromise(); } /** - * Get contact details by id + * Returns contact details by its ID. + * Contact Details + * @param param the request object + */ + public detailsContactWithHttpInfo(param: ContactsApiDetailsContactRequest, options?: ConfigurationOptions): Promise> { + return this.api.detailsContactWithHttpInfo(param.id, options).toPromise(); + } + + /** + * Returns contact details by its ID. + * Contact Details * @param param the request object */ - public detailsContact(param: ContactsApiDetailsContactRequest, options?: Configuration): Promise { + public detailsContact(param: ContactsApiDetailsContactRequest, options?: ConfigurationOptions): Promise { return this.api.detailsContact(param.id, options).toPromise(); } /** + * This method returns a list of contacts associated with a workspace. + * List contacts + * @param param the request object + */ + public listContactsWithHttpInfo(param: ContactsApiListContactsRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.listContactsWithHttpInfo(param.email, options).toPromise(); + } + + /** + * This method returns a list of contacts associated with a workspace. * List contacts * @param param the request object */ - public listContacts(param: ContactsApiListContactsRequest = {}, options?: Configuration): Promise { + public listContacts(param: ContactsApiListContactsRequest = {}, options?: ConfigurationOptions): Promise { return this.api.listContacts(param.email, options).toPromise(); } /** - * Update contact by id + * This method updates a contact details. + * Update Contact + * @param param the request object + */ + public updateContactWithHttpInfo(param: ContactsApiUpdateContactRequest, options?: ConfigurationOptions): Promise> { + return this.api.updateContactWithHttpInfo(param.id, param.contactUpdateRequest, options).toPromise(); + } + + /** + * This method updates a contact details. + * Update Contact * @param param the request object */ - public updateContact(param: ContactsApiUpdateContactRequest, options?: Configuration): Promise { + public updateContact(param: ContactsApiUpdateContactRequest, options?: ConfigurationOptions): Promise { return this.api.updateContact(param.id, param.contactUpdateRequest, options).toPromise(); } @@ -354,9 +695,36 @@ export class ObjectContactsApi { import { ObservableContentLibraryItemsApi } from "./ObservableAPI"; import { ContentLibraryItemsApiRequestFactory, ContentLibraryItemsApiResponseProcessor} from "../apis/ContentLibraryItemsApi"; +export interface ContentLibraryItemsApiCreateContentLibraryItemRequest { + /** + * + * @type ContentLibraryItemCreateFromUrlRequest + * @memberof ContentLibraryItemsApicreateContentLibraryItem + */ + contentLibraryItemCreateFromUrlRequest: ContentLibraryItemCreateFromUrlRequest +} + +export interface ContentLibraryItemsApiCreateContentLibraryItemFromUploadRequest { + /** + * Binary PDF File + * Defaults to: undefined + * @type HttpFile + * @memberof ContentLibraryItemsApicreateContentLibraryItemFromUpload + */ + file?: HttpFile + /** + * JSON as a multipart/form-data request. + * Defaults to: undefined + * @type ContentLibraryItemCreateRequest + * @memberof ContentLibraryItemsApicreateContentLibraryItemFromUpload + */ + data?: ContentLibraryItemCreateRequest +} + export interface ContentLibraryItemsApiDetailsContentLibraryItemRequest { /** * Content Library Item ID + * Defaults to: undefined * @type string * @memberof ContentLibraryItemsApidetailsContentLibraryItem */ @@ -366,48 +734,67 @@ export interface ContentLibraryItemsApiDetailsContentLibraryItemRequest { export interface ContentLibraryItemsApiListContentLibraryItemsRequest { /** * Search query. Filter by content library item name. + * Defaults to: undefined * @type string * @memberof ContentLibraryItemsApilistContentLibraryItems */ q?: string /** * Specify content library item ID. + * Defaults to: undefined * @type string * @memberof ContentLibraryItemsApilistContentLibraryItems */ id?: string /** * Returns only the deleted content library items. + * Defaults to: undefined * @type boolean * @memberof ContentLibraryItemsApilistContentLibraryItems */ deleted?: boolean /** * The UUID of the folder where the content library items are stored. + * Defaults to: undefined * @type string * @memberof ContentLibraryItemsApilistContentLibraryItems */ folderUuid?: string /** * Specify how many content library items to return. Default is 50 content library items, maximum is 100 content library items. + * Minimum: 1 + * Defaults to: undefined * @type number * @memberof ContentLibraryItemsApilistContentLibraryItems */ count?: number /** * Specify which page of the dataset to return. + * Minimum: 1 + * Defaults to: undefined * @type number * @memberof ContentLibraryItemsApilistContentLibraryItems */ page?: number /** * Search tag. Filter by content library item tag. + * Defaults to: undefined * @type string * @memberof ContentLibraryItemsApilistContentLibraryItems */ tag?: string } +export interface ContentLibraryItemsApiStatusContentLibraryItemRequest { + /** + * Content Library Item ID + * Defaults to: undefined + * @type string + * @memberof ContentLibraryItemsApistatusContentLibraryItem + */ + id: string +} + export class ObjectContentLibraryItemsApi { private api: ObservableContentLibraryItemsApi @@ -416,23 +803,95 @@ export class ObjectContentLibraryItemsApi { } /** - * Return detailed data about a content library item. - * Details Content Library Item + * This API endpoint allows users to create an empty item in the content library. No actual content or data is required to be provided in the initial creation. + * Create Content Library Item + * @param param the request object + */ + public createContentLibraryItemWithHttpInfo(param: ContentLibraryItemsApiCreateContentLibraryItemRequest, options?: ConfigurationOptions): Promise> { + return this.api.createContentLibraryItemWithHttpInfo(param.contentLibraryItemCreateFromUrlRequest, options).toPromise(); + } + + /** + * This API endpoint allows users to create an empty item in the content library. No actual content or data is required to be provided in the initial creation. + * Create Content Library Item + * @param param the request object + */ + public createContentLibraryItem(param: ContentLibraryItemsApiCreateContentLibraryItemRequest, options?: ConfigurationOptions): Promise { + return this.api.createContentLibraryItem(param.contentLibraryItemCreateFromUrlRequest, options).toPromise(); + } + + /** + * This asynchronous endpoint allows users to create a new CLI by uploading a file. The uploaded file is processed in the background to generate the CLI. The maximum allowable file size for upload is 100 MB. Field tags and form fields are not supported yet. Once the file is uploaded, the processing will happen asynchronously, and users need to check the status of the CLI creation. + * Create Content Library Item from File Upload + * @param param the request object + */ + public createContentLibraryItemFromUploadWithHttpInfo(param: ContentLibraryItemsApiCreateContentLibraryItemFromUploadRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.createContentLibraryItemFromUploadWithHttpInfo(param.file, param.data, options).toPromise(); + } + + /** + * This asynchronous endpoint allows users to create a new CLI by uploading a file. The uploaded file is processed in the background to generate the CLI. The maximum allowable file size for upload is 100 MB. Field tags and form fields are not supported yet. Once the file is uploaded, the processing will happen asynchronously, and users need to check the status of the CLI creation. + * Create Content Library Item from File Upload + * @param param the request object + */ + public createContentLibraryItemFromUpload(param: ContentLibraryItemsApiCreateContentLibraryItemFromUploadRequest = {}, options?: ConfigurationOptions): Promise { + return this.api.createContentLibraryItemFromUpload(param.file, param.data, options).toPromise(); + } + + /** + * Retrieve detailed information about a specific content library item using its ID. The details include: - **Roles** - **All fields with values** - **All tokens with values** - **Pricing information (pricing tables, products, etc)** - **Metadata** - **Tags** - **Modification Timestamps**: note that `date_modified` means any changes associated with the CLI, while `content_date_modified` logs any changes in CLI content. + * Content Library Item Details + * @param param the request object + */ + public detailsContentLibraryItemWithHttpInfo(param: ContentLibraryItemsApiDetailsContentLibraryItemRequest, options?: ConfigurationOptions): Promise> { + return this.api.detailsContentLibraryItemWithHttpInfo(param.id, options).toPromise(); + } + + /** + * Retrieve detailed information about a specific content library item using its ID. The details include: - **Roles** - **All fields with values** - **All tokens with values** - **Pricing information (pricing tables, products, etc)** - **Metadata** - **Tags** - **Modification Timestamps**: note that `date_modified` means any changes associated with the CLI, while `content_date_modified` logs any changes in CLI content. + * Content Library Item Details * @param param the request object */ - public detailsContentLibraryItem(param: ContentLibraryItemsApiDetailsContentLibraryItemRequest, options?: Configuration): Promise { + public detailsContentLibraryItem(param: ContentLibraryItemsApiDetailsContentLibraryItemRequest, options?: ConfigurationOptions): Promise { return this.api.detailsContentLibraryItem(param.id, options).toPromise(); } /** - * Optionally filter by a search query or tags. + * The endpoint retrieves items from the content library in PandaDoc. This endpoint supports filtering options to narrow down the results, allowing users to search by query, tags, folder, and more. > ### ⚠️ Please avoid empty values for the parameters > API returns \"400\" error when any of the parameters has an empty value. Please remove such a parameter from the request or add a value. + * List Content Library Item + * @param param the request object + */ + public listContentLibraryItemsWithHttpInfo(param: ContentLibraryItemsApiListContentLibraryItemsRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.listContentLibraryItemsWithHttpInfo(param.q, param.id, param.deleted, param.folderUuid, param.count, param.page, param.tag, options).toPromise(); + } + + /** + * The endpoint retrieves items from the content library in PandaDoc. This endpoint supports filtering options to narrow down the results, allowing users to search by query, tags, folder, and more. > ### ⚠️ Please avoid empty values for the parameters > API returns \"400\" error when any of the parameters has an empty value. Please remove such a parameter from the request or add a value. * List Content Library Item * @param param the request object */ - public listContentLibraryItems(param: ContentLibraryItemsApiListContentLibraryItemsRequest = {}, options?: Configuration): Promise { + public listContentLibraryItems(param: ContentLibraryItemsApiListContentLibraryItemsRequest = {}, options?: ConfigurationOptions): Promise { return this.api.listContentLibraryItems(param.q, param.id, param.deleted, param.folderUuid, param.count, param.page, param.tag, options).toPromise(); } + /** + * Requesting the CLI status helps verify that a CLI is in the expected state before invoking additional API methods. ## Available CLI Statuses The following is a complete list of all possible CLI statuses returned: | CLI Status | Status Description | |-----------------|--------------------| | `cli.UPLOADED` | The CLI upload process has been initiated and is currently in progress. It will soon transition to the `cli.PROCESSED` state. | | `cli.PROCESSED` | The CLI has been successfully uploaded and created. At this stage, all aspects of the CLI are editable. | | `cli.ERROR` | The CLI upload process has failed. Please refer to the error details in the response for more information. | + * Content Library Item Status + * @param param the request object + */ + public statusContentLibraryItemWithHttpInfo(param: ContentLibraryItemsApiStatusContentLibraryItemRequest, options?: ConfigurationOptions): Promise> { + return this.api.statusContentLibraryItemWithHttpInfo(param.id, options).toPromise(); + } + + /** + * Requesting the CLI status helps verify that a CLI is in the expected state before invoking additional API methods. ## Available CLI Statuses The following is a complete list of all possible CLI statuses returned: | CLI Status | Status Description | |-----------------|--------------------| | `cli.UPLOADED` | The CLI upload process has been initiated and is currently in progress. It will soon transition to the `cli.PROCESSED` state. | | `cli.PROCESSED` | The CLI has been successfully uploaded and created. At this stage, all aspects of the CLI are editable. | | `cli.ERROR` | The CLI upload process has failed. Please refer to the error details in the response for more information. | + * Content Library Item Status + * @param param the request object + */ + public statusContentLibraryItem(param: ContentLibraryItemsApiStatusContentLibraryItemRequest, options?: ConfigurationOptions): Promise { + return this.api.statusContentLibraryItem(param.id, options).toPromise(); + } + } import { ObservableDocumentAttachmentsApi } from "./ObservableAPI"; @@ -441,39 +900,54 @@ import { DocumentAttachmentsApiRequestFactory, DocumentAttachmentsApiResponsePro export interface DocumentAttachmentsApiCreateDocumentAttachmentRequest { /** * Document UUID + * Defaults to: undefined * @type string * @memberof DocumentAttachmentsApicreateDocumentAttachment */ id: string /** - * Binary file to be attached to a document - * @type HttpFile + * + * @type DocumentAttachmentRequest * @memberof DocumentAttachmentsApicreateDocumentAttachment */ - file?: HttpFile + documentAttachmentRequest: DocumentAttachmentRequest +} + +export interface DocumentAttachmentsApiCreateDocumentAttachmentFromFileUploadRequest { /** - * URL link to the file to be attached to a document + * Document UUID + * Defaults to: undefined * @type string - * @memberof DocumentAttachmentsApicreateDocumentAttachment + * @memberof DocumentAttachmentsApicreateDocumentAttachmentFromFileUpload + */ + id: string + /** + * Binary file to be attached to a document + * Defaults to: undefined + * @type HttpFile + * @memberof DocumentAttachmentsApicreateDocumentAttachmentFromFileUpload */ - source?: string + file?: HttpFile /** * Optional name to set for uploaded file + * Defaults to: undefined * @type string - * @memberof DocumentAttachmentsApicreateDocumentAttachment + * @memberof DocumentAttachmentsApicreateDocumentAttachmentFromFileUpload */ name?: string } export interface DocumentAttachmentsApiDeleteDocumentAttachmentRequest { /** - * Document UUID + * Document UUID. + * Defaults to: undefined * @type string * @memberof DocumentAttachmentsApideleteDocumentAttachment */ id: string /** - * Attachment UUID + * Attachment UUID. + * Defaults to: undefined * @type string * @memberof DocumentAttachmentsApideleteDocumentAttachment */ @@ -482,13 +956,15 @@ export interface DocumentAttachmentsApiDeleteDocumentAttachmentRequest { export interface DocumentAttachmentsApiDetailsDocumentAttachmentRequest { /** - * Document UUID + * Document UUID. + * Defaults to: undefined * @type string * @memberof DocumentAttachmentsApidetailsDocumentAttachment */ id: string /** - * Attachment UUID + * Attachment UUID. + * Defaults to: undefined * @type string * @memberof DocumentAttachmentsApidetailsDocumentAttachment */ @@ -497,13 +973,15 @@ export interface DocumentAttachmentsApiDetailsDocumentAttachmentRequest { export interface DocumentAttachmentsApiDownloadDocumentAttachmentRequest { /** - * Document UUID + * Document UUID. + * Defaults to: undefined * @type string * @memberof DocumentAttachmentsApidownloadDocumentAttachment */ id: string /** - * Attachment UUID + * Attachment UUID. + * Defaults to: undefined * @type string * @memberof DocumentAttachmentsApidownloadDocumentAttachment */ @@ -513,6 +991,7 @@ export interface DocumentAttachmentsApiDownloadDocumentAttachmentRequest { export interface DocumentAttachmentsApiListDocumentAttachmentsRequest { /** * Document UUID + * Defaults to: undefined * @type string * @memberof DocumentAttachmentsApilistDocumentAttachments */ @@ -528,179 +1007,1043 @@ export class ObjectDocumentAttachmentsApi { /** * Creates an attachment for a particular document - * Document Attachment Create + * Create Document Attachment + * @param param the request object + */ + public createDocumentAttachmentWithHttpInfo(param: DocumentAttachmentsApiCreateDocumentAttachmentRequest, options?: ConfigurationOptions): Promise> { + return this.api.createDocumentAttachmentWithHttpInfo(param.id, param.documentAttachmentRequest, options).toPromise(); + } + + /** + * Creates an attachment for a particular document + * Create Document Attachment + * @param param the request object + */ + public createDocumentAttachment(param: DocumentAttachmentsApiCreateDocumentAttachmentRequest, options?: ConfigurationOptions): Promise { + return this.api.createDocumentAttachment(param.id, param.documentAttachmentRequest, options).toPromise(); + } + + /** + * Creates an attachment for a particular document + * Create Document Attachment From Upload + * @param param the request object + */ + public createDocumentAttachmentFromFileUploadWithHttpInfo(param: DocumentAttachmentsApiCreateDocumentAttachmentFromFileUploadRequest, options?: ConfigurationOptions): Promise> { + return this.api.createDocumentAttachmentFromFileUploadWithHttpInfo(param.id, param.file, param.name, options).toPromise(); + } + + /** + * Creates an attachment for a particular document + * Create Document Attachment From Upload * @param param the request object */ - public createDocumentAttachment(param: DocumentAttachmentsApiCreateDocumentAttachmentRequest, options?: Configuration): Promise { - return this.api.createDocumentAttachment(param.id, param.file, param.source, param.name, options).toPromise(); + public createDocumentAttachmentFromFileUpload(param: DocumentAttachmentsApiCreateDocumentAttachmentFromFileUploadRequest, options?: ConfigurationOptions): Promise { + return this.api.createDocumentAttachmentFromFileUpload(param.id, param.file, param.name, options).toPromise(); } /** - * Deletes specific document's attachment - * Document Attachment Delete + * Deletes an attachment from the document. + * Delete Document Attachment * @param param the request object */ - public deleteDocumentAttachment(param: DocumentAttachmentsApiDeleteDocumentAttachmentRequest, options?: Configuration): Promise { + public deleteDocumentAttachmentWithHttpInfo(param: DocumentAttachmentsApiDeleteDocumentAttachmentRequest, options?: ConfigurationOptions): Promise> { + return this.api.deleteDocumentAttachmentWithHttpInfo(param.id, param.attachmentId, options).toPromise(); + } + + /** + * Deletes an attachment from the document. + * Delete Document Attachment + * @param param the request object + */ + public deleteDocumentAttachment(param: DocumentAttachmentsApiDeleteDocumentAttachmentRequest, options?: ConfigurationOptions): Promise { return this.api.deleteDocumentAttachment(param.id, param.attachmentId, options).toPromise(); } /** - * Returns details of the specific document's attachment + * Returns details of the specific document\'s attachment. + * Document Attachment Details + * @param param the request object + */ + public detailsDocumentAttachmentWithHttpInfo(param: DocumentAttachmentsApiDetailsDocumentAttachmentRequest, options?: ConfigurationOptions): Promise> { + return this.api.detailsDocumentAttachmentWithHttpInfo(param.id, param.attachmentId, options).toPromise(); + } + + /** + * Returns details of the specific document\'s attachment. * Document Attachment Details * @param param the request object */ - public detailsDocumentAttachment(param: DocumentAttachmentsApiDetailsDocumentAttachmentRequest, options?: Configuration): Promise { + public detailsDocumentAttachment(param: DocumentAttachmentsApiDetailsDocumentAttachmentRequest, options?: ConfigurationOptions): Promise { return this.api.detailsDocumentAttachment(param.id, param.attachmentId, options).toPromise(); } /** - * Returns document attachment file for download - * Document Attachment Download + * Download an attachment by ID. + * Download Document Attachment + * @param param the request object + */ + public downloadDocumentAttachmentWithHttpInfo(param: DocumentAttachmentsApiDownloadDocumentAttachmentRequest, options?: ConfigurationOptions): Promise> { + return this.api.downloadDocumentAttachmentWithHttpInfo(param.id, param.attachmentId, options).toPromise(); + } + + /** + * Download an attachment by ID. + * Download Document Attachment * @param param the request object */ - public downloadDocumentAttachment(param: DocumentAttachmentsApiDownloadDocumentAttachmentRequest, options?: Configuration): Promise { + public downloadDocumentAttachment(param: DocumentAttachmentsApiDownloadDocumentAttachmentRequest, options?: ConfigurationOptions): Promise { return this.api.downloadDocumentAttachment(param.id, param.attachmentId, options).toPromise(); } /** - * Return list of objects attached to particular document - * Document Attachment List + * Returns a list of attachments associated with a specified document. + * List Document Attachments * @param param the request object */ - public listDocumentAttachments(param: DocumentAttachmentsApiListDocumentAttachmentsRequest, options?: Configuration): Promise> { + public listDocumentAttachmentsWithHttpInfo(param: DocumentAttachmentsApiListDocumentAttachmentsRequest, options?: ConfigurationOptions): Promise>> { + return this.api.listDocumentAttachmentsWithHttpInfo(param.id, options).toPromise(); + } + + /** + * Returns a list of attachments associated with a specified document. + * List Document Attachments + * @param param the request object + */ + public listDocumentAttachments(param: DocumentAttachmentsApiListDocumentAttachmentsRequest, options?: ConfigurationOptions): Promise> { return this.api.listDocumentAttachments(param.id, options).toPromise(); } } -import { ObservableDocumentRecipientsApi } from "./ObservableAPI"; -import { DocumentRecipientsApiRequestFactory, DocumentRecipientsApiResponseProcessor} from "../apis/DocumentRecipientsApi"; +import { ObservableDocumentAuditTrailApi } from "./ObservableAPI"; +import { DocumentAuditTrailApiRequestFactory, DocumentAuditTrailApiResponseProcessor} from "../apis/DocumentAuditTrailApi"; -export interface DocumentRecipientsApiAddDocumentRecipientRequest { +export interface DocumentAuditTrailApiListDocumentAuditTrailRequest { /** - * Document UUID + * Unique identifier of the document to retrieve the audit trail for. + * Defaults to: undefined * @type string - * @memberof DocumentRecipientsApiaddDocumentRecipient + * @memberof DocumentAuditTrailApilistDocumentAuditTrail */ - id: string + documentId: string /** - * - * @type DocumentRecipientCreateRequest - * @memberof DocumentRecipientsApiaddDocumentRecipient + * Maximum number of items to return. + * Minimum: 1 + * Maximum: 100 + * Defaults to: 20 + * @type number + * @memberof DocumentAuditTrailApilistDocumentAuditTrail */ - documentRecipientCreateRequest: DocumentRecipientCreateRequest + limit?: number + /** + * Number of items to skip before starting to collect the result set. + * Minimum: 0 + * Defaults to: 0 + * @type number + * @memberof DocumentAuditTrailApilistDocumentAuditTrail + */ + offset?: number } -export interface DocumentRecipientsApiDeleteDocumentRecipientRequest { +export class ObjectDocumentAuditTrailApi { + private api: ObservableDocumentAuditTrailApi + + public constructor(configuration: Configuration, requestFactory?: DocumentAuditTrailApiRequestFactory, responseProcessor?: DocumentAuditTrailApiResponseProcessor) { + this.api = new ObservableDocumentAuditTrailApi(configuration, requestFactory, responseProcessor); + } + /** - * Document UUID - * @type string - * @memberof DocumentRecipientsApideleteDocumentRecipient + * Retrieves the full audit trail for a specified document. The audit trail includes detailed user actions such as sending, viewing, signing, and editing, along with metadata like timestamps, IP addresses, and user identity. This endpoint is accessible to authorized workspace administrators only. + * List Document Audit Trail + * @param param the request object */ - id: string + public listDocumentAuditTrailWithHttpInfo(param: DocumentAuditTrailApiListDocumentAuditTrailRequest, options?: ConfigurationOptions): Promise> { + return this.api.listDocumentAuditTrailWithHttpInfo(param.documentId, param.limit, param.offset, options).toPromise(); + } + /** - * Recipient UUID - * @type string - * @memberof DocumentRecipientsApideleteDocumentRecipient + * Retrieves the full audit trail for a specified document. The audit trail includes detailed user actions such as sending, viewing, signing, and editing, along with metadata like timestamps, IP addresses, and user identity. This endpoint is accessible to authorized workspace administrators only. + * List Document Audit Trail + * @param param the request object */ - recipientId: string + public listDocumentAuditTrail(param: DocumentAuditTrailApiListDocumentAuditTrailRequest, options?: ConfigurationOptions): Promise { + return this.api.listDocumentAuditTrail(param.documentId, param.limit, param.offset, options).toPromise(); + } + } -export interface DocumentRecipientsApiEditDocumentRecipientRequest { +import { ObservableDocumentFieldsApi } from "./ObservableAPI"; +import { DocumentFieldsApiRequestFactory, DocumentFieldsApiResponseProcessor} from "../apis/DocumentFieldsApi"; + +export interface DocumentFieldsApiCreateDocumentFieldsRequest { /** - * Document UUID + * Document UUID. + * Defaults to: undefined * @type string - * @memberof DocumentRecipientsApieditDocumentRecipient + * @memberof DocumentFieldsApicreateDocumentFields */ id: string - /** - * Recipient UUID - * @type string - * @memberof DocumentRecipientsApieditDocumentRecipient - */ - recipientId: string /** * - * @type DocumentRecipientEditRequest - * @memberof DocumentRecipientsApieditDocumentRecipient + * @type CreateDocumentFieldsRequest + * @memberof DocumentFieldsApicreateDocumentFields */ - documentRecipientEditRequest: DocumentRecipientEditRequest + createDocumentFieldsRequest: CreateDocumentFieldsRequest } -export interface DocumentRecipientsApiReassignDocumentRecipientRequest { +export interface DocumentFieldsApiListDocumentFieldsRequest { /** - * Document UUID + * Document UUID. + * Defaults to: undefined * @type string - * @memberof DocumentRecipientsApireassignDocumentRecipient + * @memberof DocumentFieldsApilistDocumentFields */ id: string - /** - * Recipient UUID - * @type string - * @memberof DocumentRecipientsApireassignDocumentRecipient - */ - recipientId: string - /** - * - * @type DocumentRecipientCreateRequest - * @memberof DocumentRecipientsApireassignDocumentRecipient - */ - documentRecipientCreateRequest: DocumentRecipientCreateRequest } -export class ObjectDocumentRecipientsApi { - private api: ObservableDocumentRecipientsApi +export class ObjectDocumentFieldsApi { + private api: ObservableDocumentFieldsApi - public constructor(configuration: Configuration, requestFactory?: DocumentRecipientsApiRequestFactory, responseProcessor?: DocumentRecipientsApiResponseProcessor) { - this.api = new ObservableDocumentRecipientsApi(configuration, requestFactory, responseProcessor); + public constructor(configuration: Configuration, requestFactory?: DocumentFieldsApiRequestFactory, responseProcessor?: DocumentFieldsApiResponseProcessor) { + this.api = new ObservableDocumentFieldsApi(configuration, requestFactory, responseProcessor); } /** - * Adds recipient as CC to document - * Add Document Recipient + * Creates fields for a particular document. For CFR11-compliant workspaces (21 CFR Part 11), signature fields must have a minimum size of 108×33. + * Create Document Fields * @param param the request object */ - public addDocumentRecipient(param: DocumentRecipientsApiAddDocumentRecipientRequest, options?: Configuration): Promise { - return this.api.addDocumentRecipient(param.id, param.documentRecipientCreateRequest, options).toPromise(); + public createDocumentFieldsWithHttpInfo(param: DocumentFieldsApiCreateDocumentFieldsRequest, options?: ConfigurationOptions): Promise> { + return this.api.createDocumentFieldsWithHttpInfo(param.id, param.createDocumentFieldsRequest, options).toPromise(); } /** - * Deleted recipient from document - * Delete Document Recipient + * Creates fields for a particular document. For CFR11-compliant workspaces (21 CFR Part 11), signature fields must have a minimum size of 108×33. + * Create Document Fields * @param param the request object */ - public deleteDocumentRecipient(param: DocumentRecipientsApiDeleteDocumentRecipientRequest, options?: Configuration): Promise { - return this.api.deleteDocumentRecipient(param.id, param.recipientId, options).toPromise(); + public createDocumentFields(param: DocumentFieldsApiCreateDocumentFieldsRequest, options?: ConfigurationOptions): Promise { + return this.api.createDocumentFields(param.id, param.createDocumentFieldsRequest, options).toPromise(); } /** - * Edit document recipient's details - * Edit Document Recipient + * Return the list of fields for a particular document. + * List Document Fields * @param param the request object */ - public editDocumentRecipient(param: DocumentRecipientsApiEditDocumentRecipientRequest, options?: Configuration): Promise { - return this.api.editDocumentRecipient(param.id, param.recipientId, param.documentRecipientEditRequest, options).toPromise(); + public listDocumentFieldsWithHttpInfo(param: DocumentFieldsApiListDocumentFieldsRequest, options?: ConfigurationOptions): Promise> { + return this.api.listDocumentFieldsWithHttpInfo(param.id, options).toPromise(); } /** - * Replace document recipient with another contact - * Reassign Document Recipient + * Return the list of fields for a particular document. + * List Document Fields * @param param the request object */ - public reassignDocumentRecipient(param: DocumentRecipientsApiReassignDocumentRecipientRequest, options?: Configuration): Promise { - return this.api.reassignDocumentRecipient(param.id, param.recipientId, param.documentRecipientCreateRequest, options).toPromise(); + public listDocumentFields(param: DocumentFieldsApiListDocumentFieldsRequest, options?: ConfigurationOptions): Promise { + return this.api.listDocumentFields(param.id, options).toPromise(); } } -import { ObservableDocumentsApi } from "./ObservableAPI"; -import { DocumentsApiRequestFactory, DocumentsApiResponseProcessor} from "../apis/DocumentsApi"; +import { ObservableDocumentLinkToCRMApi } from "./ObservableAPI"; +import { DocumentLinkToCRMApiRequestFactory, DocumentLinkToCRMApiResponseProcessor} from "../apis/DocumentLinkToCRMApi"; -export interface DocumentsApiChangeDocumentStatusRequest { +export interface DocumentLinkToCRMApiCreateLinkedObjectRequest { /** * Specify document ID. + * Defaults to: undefined * @type string - * @memberof DocumentsApichangeDocumentStatus + * @memberof DocumentLinkToCRMApicreateLinkedObject + */ + id: string + /** + * + * @type LinkedObjectCreateRequest + * @memberof DocumentLinkToCRMApicreateLinkedObject + */ + linkedObjectCreateRequest: LinkedObjectCreateRequest +} + +export interface DocumentLinkToCRMApiDeleteLinkedObjectRequest { + /** + * Specify document ID. + * Defaults to: undefined + * @type string + * @memberof DocumentLinkToCRMApideleteLinkedObject + */ + id: string + /** + * Specify linked object ID. + * Defaults to: undefined + * @type string + * @memberof DocumentLinkToCRMApideleteLinkedObject + */ + linkedObjectId: string +} + +export interface DocumentLinkToCRMApiListDocumentsByLinkedObjectRequest { + /** + * You can get entity id from your integration, for example, from a url of a HubSpot deal. + * Defaults to: undefined + * @type string + * @memberof DocumentLinkToCRMApilistDocumentsByLinkedObject + */ + entityId: string + /** + * See the available entity types: https://developers.pandadoc.com/reference/link-service#examples-of-the-most-popular-crms + * Defaults to: undefined + * @type string + * @memberof DocumentLinkToCRMApilistDocumentsByLinkedObject + */ + entityType: string + /** + * See the available providers: https://developers.pandadoc.com/reference/link-service#examples-of-the-most-popular-crms + * Defaults to: undefined + * @type string + * @memberof DocumentLinkToCRMApilistDocumentsByLinkedObject + */ + provider: string + /** + * + * Defaults to: '-date_created' + * @type string + * @memberof DocumentLinkToCRMApilistDocumentsByLinkedObject + */ + orderBy?: string + /** + * + * Defaults to: undefined + * @type Array<string> + * @memberof DocumentLinkToCRMApilistDocumentsByLinkedObject + */ + ownerIds?: Array +} + +export interface DocumentLinkToCRMApiListLinkedObjectsRequest { + /** + * Specify document ID. + * Defaults to: undefined + * @type string + * @memberof DocumentLinkToCRMApilistLinkedObjects + */ + id: string +} + +export class ObjectDocumentLinkToCRMApi { + private api: ObservableDocumentLinkToCRMApi + + public constructor(configuration: Configuration, requestFactory?: DocumentLinkToCRMApiRequestFactory, responseProcessor?: DocumentLinkToCRMApiResponseProcessor) { + this.api = new ObservableDocumentLinkToCRMApi(configuration, requestFactory, responseProcessor); + } + + /** + * Create a linked object in the document. > 🚧 > > You can only link each document to each CRM once. This ensures the consistent functionality of the [two-way CRM sync](https://support.pandadoc.com/en/articles/9714877-hubspot-crm#h_3a3344e8-2a6e-4fd8-86be-0da8c121e4ac). > > You can, however, link one document to several external systems. + * Create Linked Object + * @param param the request object + */ + public createLinkedObjectWithHttpInfo(param: DocumentLinkToCRMApiCreateLinkedObjectRequest, options?: ConfigurationOptions): Promise> { + return this.api.createLinkedObjectWithHttpInfo(param.id, param.linkedObjectCreateRequest, options).toPromise(); + } + + /** + * Create a linked object in the document. > 🚧 > > You can only link each document to each CRM once. This ensures the consistent functionality of the [two-way CRM sync](https://support.pandadoc.com/en/articles/9714877-hubspot-crm#h_3a3344e8-2a6e-4fd8-86be-0da8c121e4ac). > > You can, however, link one document to several external systems. + * Create Linked Object + * @param param the request object + */ + public createLinkedObject(param: DocumentLinkToCRMApiCreateLinkedObjectRequest, options?: ConfigurationOptions): Promise { + return this.api.createLinkedObject(param.id, param.linkedObjectCreateRequest, options).toPromise(); + } + + /** + * Delete a linked object associated with a document. + * Delete Linked Object + * @param param the request object + */ + public deleteLinkedObjectWithHttpInfo(param: DocumentLinkToCRMApiDeleteLinkedObjectRequest, options?: ConfigurationOptions): Promise> { + return this.api.deleteLinkedObjectWithHttpInfo(param.id, param.linkedObjectId, options).toPromise(); + } + + /** + * Delete a linked object associated with a document. + * Delete Linked Object + * @param param the request object + */ + public deleteLinkedObject(param: DocumentLinkToCRMApiDeleteLinkedObjectRequest, options?: ConfigurationOptions): Promise { + return this.api.deleteLinkedObject(param.id, param.linkedObjectId, options).toPromise(); + } + + /** + * Get a list of documents connected to a linked object - an entity from an integration. + * List Documents by Linked Object + * @param param the request object + */ + public listDocumentsByLinkedObjectWithHttpInfo(param: DocumentLinkToCRMApiListDocumentsByLinkedObjectRequest, options?: ConfigurationOptions): Promise>> { + return this.api.listDocumentsByLinkedObjectWithHttpInfo(param.entityId, param.entityType, param.provider, param.orderBy, param.ownerIds, options).toPromise(); + } + + /** + * Get a list of documents connected to a linked object - an entity from an integration. + * List Documents by Linked Object + * @param param the request object + */ + public listDocumentsByLinkedObject(param: DocumentLinkToCRMApiListDocumentsByLinkedObjectRequest, options?: ConfigurationOptions): Promise> { + return this.api.listDocumentsByLinkedObject(param.entityId, param.entityType, param.provider, param.orderBy, param.ownerIds, options).toPromise(); + } + + /** + * Get a list of linked objects for the document. + * List Linked Objects + * @param param the request object + */ + public listLinkedObjectsWithHttpInfo(param: DocumentLinkToCRMApiListLinkedObjectsRequest, options?: ConfigurationOptions): Promise> { + return this.api.listLinkedObjectsWithHttpInfo(param.id, options).toPromise(); + } + + /** + * Get a list of linked objects for the document. + * List Linked Objects + * @param param the request object + */ + public listLinkedObjects(param: DocumentLinkToCRMApiListLinkedObjectsRequest, options?: ConfigurationOptions): Promise { + return this.api.listLinkedObjects(param.id, options).toPromise(); + } + +} + +import { ObservableDocumentRecipientsApi } from "./ObservableAPI"; +import { DocumentRecipientsApiRequestFactory, DocumentRecipientsApiResponseProcessor} from "../apis/DocumentRecipientsApi"; + +export interface DocumentRecipientsApiAddDocumentRecipientRequest { + /** + * Document UUID + * Defaults to: undefined + * @type string + * @memberof DocumentRecipientsApiaddDocumentRecipient + */ + id: string + /** + * + * @type DocumentRecipientCreateRequest + * @memberof DocumentRecipientsApiaddDocumentRecipient + */ + documentRecipientCreateRequest: DocumentRecipientCreateRequest +} + +export interface DocumentRecipientsApiDeleteDocumentRecipientRequest { + /** + * Document UUID + * Defaults to: undefined + * @type string + * @memberof DocumentRecipientsApideleteDocumentRecipient + */ + id: string + /** + * Recipient UUID + * Defaults to: undefined + * @type string + * @memberof DocumentRecipientsApideleteDocumentRecipient + */ + recipientId: string +} + +export interface DocumentRecipientsApiEditDocumentRecipientRequest { + /** + * Document UUID. + * Defaults to: undefined + * @type string + * @memberof DocumentRecipientsApieditDocumentRecipient + */ + id: string + /** + * Recipient UUID. + * Defaults to: undefined + * @type string + * @memberof DocumentRecipientsApieditDocumentRecipient + */ + recipientId: string + /** + * + * @type DocumentRecipientEditRequest + * @memberof DocumentRecipientsApieditDocumentRecipient + */ + documentRecipientEditRequest: DocumentRecipientEditRequest +} + +export interface DocumentRecipientsApiReassignDocumentRecipientRequest { + /** + * Document UUID + * Defaults to: undefined + * @type string + * @memberof DocumentRecipientsApireassignDocumentRecipient + */ + id: string + /** + * Recipient UUID + * Defaults to: undefined + * @type string + * @memberof DocumentRecipientsApireassignDocumentRecipient + */ + recipientId: string + /** + * + * @type DocumentRecipientCreateRequest + * @memberof DocumentRecipientsApireassignDocumentRecipient + */ + documentRecipientCreateRequest: DocumentRecipientCreateRequest +} + +export class ObjectDocumentRecipientsApi { + private api: ObservableDocumentRecipientsApi + + public constructor(configuration: Configuration, requestFactory?: DocumentRecipientsApiRequestFactory, responseProcessor?: DocumentRecipientsApiResponseProcessor) { + this.api = new ObservableDocumentRecipientsApi(configuration, requestFactory, responseProcessor); + } + + /** + * Add a CC recipient to a document. > 🚧 Before you start > > To add a CC recipient, please ensure that: > > - You have the \'Can Manage Recipients\' permission. > - This recipient is already created in your contacts. If not, add them using the [Create Contact](https://developers.pandadoc.com/reference/create-contact) endpoint. To add a new CC recipient to a document, two parameters must be included in the request body: - `kind`: Set this parameter to `contact` to specify an individual contact. - `id`: Input the ID of the desired contact. To retrieve the contact\'s ID, use the [List Contacts](https://developers.pandadoc.com/reference/list-contacts) endpoint to access a list of all contacts, and then locate the desired contact by searching using the name or email address within the returned list. ### Document status You can add CC recipients in any document status except for the \'Expired\' (`document.voided`) and \'Declined\' (`document.declined`). > 📘 Email notification to access the document > > **Note**: When a document is in one of the following statuses: \'Sent\' (`document.sent`), \'Viewed\' (`document.viewed`), \'Completed\' (`document.completed`), \'Waiting for Payment\' (`document.waiting_pay`), or \'Paid\' (`document.paid`), any added CC recipient will receive an instant notification at their email address, allowing them access to the document. + * Add Document Recipient + * @param param the request object + */ + public addDocumentRecipientWithHttpInfo(param: DocumentRecipientsApiAddDocumentRecipientRequest, options?: ConfigurationOptions): Promise> { + return this.api.addDocumentRecipientWithHttpInfo(param.id, param.documentRecipientCreateRequest, options).toPromise(); + } + + /** + * Add a CC recipient to a document. > 🚧 Before you start > > To add a CC recipient, please ensure that: > > - You have the \'Can Manage Recipients\' permission. > - This recipient is already created in your contacts. If not, add them using the [Create Contact](https://developers.pandadoc.com/reference/create-contact) endpoint. To add a new CC recipient to a document, two parameters must be included in the request body: - `kind`: Set this parameter to `contact` to specify an individual contact. - `id`: Input the ID of the desired contact. To retrieve the contact\'s ID, use the [List Contacts](https://developers.pandadoc.com/reference/list-contacts) endpoint to access a list of all contacts, and then locate the desired contact by searching using the name or email address within the returned list. ### Document status You can add CC recipients in any document status except for the \'Expired\' (`document.voided`) and \'Declined\' (`document.declined`). > 📘 Email notification to access the document > > **Note**: When a document is in one of the following statuses: \'Sent\' (`document.sent`), \'Viewed\' (`document.viewed`), \'Completed\' (`document.completed`), \'Waiting for Payment\' (`document.waiting_pay`), or \'Paid\' (`document.paid`), any added CC recipient will receive an instant notification at their email address, allowing them access to the document. + * Add Document Recipient + * @param param the request object + */ + public addDocumentRecipient(param: DocumentRecipientsApiAddDocumentRecipientRequest, options?: ConfigurationOptions): Promise { + return this.api.addDocumentRecipient(param.id, param.documentRecipientCreateRequest, options).toPromise(); + } + + /** + * Remove a recipient from a document. > 🚧 Before you start > > Please ensure that you have the \'Can Manage Recipients\' permission. To remove a recipient from a document, you must specify their ID in the path parameter (note that this is different from their contact\'s ID). The recipient\'s ID can be retrieved via the [Document Details](https://developers.pandadoc.com/reference/document-details) endpoint. ### Document status - Removing a signer is only possible when the document is in the \'Draft\' (`document.draft`) status and this action will unassign all fields associated with that signer. - Removing a CC recipient is allowed in any document status except for the \'Expired\' (`document.voided`) and \'Declined\' (`document.declined`). If a CC recipient is removed, their access will be revoked. + * Delete Document Recipient + * @param param the request object + */ + public deleteDocumentRecipientWithHttpInfo(param: DocumentRecipientsApiDeleteDocumentRecipientRequest, options?: ConfigurationOptions): Promise> { + return this.api.deleteDocumentRecipientWithHttpInfo(param.id, param.recipientId, options).toPromise(); + } + + /** + * Remove a recipient from a document. > 🚧 Before you start > > Please ensure that you have the \'Can Manage Recipients\' permission. To remove a recipient from a document, you must specify their ID in the path parameter (note that this is different from their contact\'s ID). The recipient\'s ID can be retrieved via the [Document Details](https://developers.pandadoc.com/reference/document-details) endpoint. ### Document status - Removing a signer is only possible when the document is in the \'Draft\' (`document.draft`) status and this action will unassign all fields associated with that signer. - Removing a CC recipient is allowed in any document status except for the \'Expired\' (`document.voided`) and \'Declined\' (`document.declined`). If a CC recipient is removed, their access will be revoked. + * Delete Document Recipient + * @param param the request object + */ + public deleteDocumentRecipient(param: DocumentRecipientsApiDeleteDocumentRecipientRequest, options?: ConfigurationOptions): Promise { + return this.api.deleteDocumentRecipient(param.id, param.recipientId, options).toPromise(); + } + + /** + * Modify recipient\'s personal details. > 🚧 Before you start > > To edit a recipient, please ensure that you have the \'Can Edit Document\' permission. Use this endpoint to easily fix typos in a recipient\'s name or email, or to change any other recipient information in a sent document. > 📘 Please note that changes made to a recipient within a document will also update their `Contact` information. However, these changes will not update information about this recipient in other documents where they have already been added. ### Document status - You can edit a signer in the following document statuses: - \'Draft\' (`document.draft`), - \'Waiting Approval\' (`document.waiting_approval`), - \'Approved\' (`document.approved`), - \'Rejected\' (`document.rejected`), - \'Sent\' (`document.sent`), - \'Viewed\' (`document.viewed`), but only until they have signed the document. - You can edit a CC recipient in any document status **except**: - \'Expired\' (`document.voided`), - \'Declined\' (`document.declined`). > 📘 Updating a recipient\'s email after sending a document > > **Note**: If you update a recipient\'s email address after sending a document, they will receive an instant notification at the new email address, allowing them access to the document. Access via the previous email will be revoked. ### Restrictions for updating a recipient\'s email - You cannot change emails of PandaDoc users. - You cannot use the email addresses of existing contacts. If you need to use an email from an existing contact, use the [Change Signer](https://developers.pandadoc.com/reference/change-signer) endpoint to replace a signer with this contact. + * Update Document Recipient + * @param param the request object + */ + public editDocumentRecipientWithHttpInfo(param: DocumentRecipientsApiEditDocumentRecipientRequest, options?: ConfigurationOptions): Promise> { + return this.api.editDocumentRecipientWithHttpInfo(param.id, param.recipientId, param.documentRecipientEditRequest, options).toPromise(); + } + + /** + * Modify recipient\'s personal details. > 🚧 Before you start > > To edit a recipient, please ensure that you have the \'Can Edit Document\' permission. Use this endpoint to easily fix typos in a recipient\'s name or email, or to change any other recipient information in a sent document. > 📘 Please note that changes made to a recipient within a document will also update their `Contact` information. However, these changes will not update information about this recipient in other documents where they have already been added. ### Document status - You can edit a signer in the following document statuses: - \'Draft\' (`document.draft`), - \'Waiting Approval\' (`document.waiting_approval`), - \'Approved\' (`document.approved`), - \'Rejected\' (`document.rejected`), - \'Sent\' (`document.sent`), - \'Viewed\' (`document.viewed`), but only until they have signed the document. - You can edit a CC recipient in any document status **except**: - \'Expired\' (`document.voided`), - \'Declined\' (`document.declined`). > 📘 Updating a recipient\'s email after sending a document > > **Note**: If you update a recipient\'s email address after sending a document, they will receive an instant notification at the new email address, allowing them access to the document. Access via the previous email will be revoked. ### Restrictions for updating a recipient\'s email - You cannot change emails of PandaDoc users. - You cannot use the email addresses of existing contacts. If you need to use an email from an existing contact, use the [Change Signer](https://developers.pandadoc.com/reference/change-signer) endpoint to replace a signer with this contact. + * Update Document Recipient + * @param param the request object + */ + public editDocumentRecipient(param: DocumentRecipientsApiEditDocumentRecipientRequest, options?: ConfigurationOptions): Promise { + return this.api.editDocumentRecipient(param.id, param.recipientId, param.documentRecipientEditRequest, options).toPromise(); + } + + /** + * Reassign fields to another signer. > 🚧 Before you start > > To change a signer in a document, please ensure that: > > - You have the \'Can Manage Recipients\' permission. > - New signer is already created in your contacts. If not, add them using the [Create Contact](https://developers.pandadoc.com/reference/create-contact) endpoint. You can reassign fields to another signer before the original signer has signed the document. You can choose any person except those recipients who have already signed the document. The endpoint path includes the `recipient_id` of the original signer and the request body must include the following two parameters: - `kind`: Set this parameter to `contact` to specify an individual contact. - `id`: Input the ID of the contact you want to use as a replacement for the original signer. To retrieve the contact\'s ID, use the [List Contacts](https://developers.pandadoc.com/reference/list-contacts) endpoint to access a list of all contacts, and then locate the desired contact by searching using the name or email address within the returned list. Once you execute the call to change the signer, the original signer will be entirely removed from the document. If you wish to retain the original signer as a CC recipient, you can re-add them using the [Add CC Recipient](https://developers.pandadoc.com/reference/add-new-recipient-cc) endpoint. > 🚧 Pre-filled fields > > If you change the signer in a document that has already been sent, the signer\'s pre-filled fields will be completely reset. In the \'Draft\' (`document.draft`) status, pre-filled fields will remain. + * Change Signer (Reassign Document Recipient) + * @param param the request object + */ + public reassignDocumentRecipientWithHttpInfo(param: DocumentRecipientsApiReassignDocumentRecipientRequest, options?: ConfigurationOptions): Promise> { + return this.api.reassignDocumentRecipientWithHttpInfo(param.id, param.recipientId, param.documentRecipientCreateRequest, options).toPromise(); + } + + /** + * Reassign fields to another signer. > 🚧 Before you start > > To change a signer in a document, please ensure that: > > - You have the \'Can Manage Recipients\' permission. > - New signer is already created in your contacts. If not, add them using the [Create Contact](https://developers.pandadoc.com/reference/create-contact) endpoint. You can reassign fields to another signer before the original signer has signed the document. You can choose any person except those recipients who have already signed the document. The endpoint path includes the `recipient_id` of the original signer and the request body must include the following two parameters: - `kind`: Set this parameter to `contact` to specify an individual contact. - `id`: Input the ID of the contact you want to use as a replacement for the original signer. To retrieve the contact\'s ID, use the [List Contacts](https://developers.pandadoc.com/reference/list-contacts) endpoint to access a list of all contacts, and then locate the desired contact by searching using the name or email address within the returned list. Once you execute the call to change the signer, the original signer will be entirely removed from the document. If you wish to retain the original signer as a CC recipient, you can re-add them using the [Add CC Recipient](https://developers.pandadoc.com/reference/add-new-recipient-cc) endpoint. > 🚧 Pre-filled fields > > If you change the signer in a document that has already been sent, the signer\'s pre-filled fields will be completely reset. In the \'Draft\' (`document.draft`) status, pre-filled fields will remain. + * Change Signer (Reassign Document Recipient) + * @param param the request object + */ + public reassignDocumentRecipient(param: DocumentRecipientsApiReassignDocumentRecipientRequest, options?: ConfigurationOptions): Promise { + return this.api.reassignDocumentRecipient(param.id, param.recipientId, param.documentRecipientCreateRequest, options).toPromise(); + } + +} + +import { ObservableDocumentRemindersApi } from "./ObservableAPI"; +import { DocumentRemindersApiRequestFactory, DocumentRemindersApiResponseProcessor} from "../apis/DocumentRemindersApi"; + +export interface DocumentRemindersApiCreateManualReminderRequest { + /** + * The UUID of the document. + * Defaults to: undefined + * @type string + * @memberof DocumentRemindersApicreateManualReminder + */ + documentId: string + /** + * + * @type DocumentSendManualReminderRequest + * @memberof DocumentRemindersApicreateManualReminder + */ + documentSendManualReminderRequest: DocumentSendManualReminderRequest +} + +export interface DocumentRemindersApiGetDocumentAutoReminderSettingsRequest { + /** + * The UUID of the document. + * Defaults to: undefined + * @type string + * @memberof DocumentRemindersApigetDocumentAutoReminderSettings + */ + documentId: string +} + +export interface DocumentRemindersApiStatusDocumentAutoReminderRequest { + /** + * The UUID of the document. + * Defaults to: undefined + * @type string + * @memberof DocumentRemindersApistatusDocumentAutoReminder + */ + documentId: string +} + +export interface DocumentRemindersApiUpdateDocumentAutoReminderSettingsRequest { + /** + * The UUID of the document. + * Defaults to: undefined + * @type string + * @memberof DocumentRemindersApiupdateDocumentAutoReminderSettings + */ + documentId: string + /** + * + * @type UpdateDocumentAutoRemindersRequest + * @memberof DocumentRemindersApiupdateDocumentAutoReminderSettings + */ + updateDocumentAutoRemindersRequest: UpdateDocumentAutoRemindersRequest +} + +export class ObjectDocumentRemindersApi { + private api: ObservableDocumentRemindersApi + + public constructor(configuration: Configuration, requestFactory?: DocumentRemindersApiRequestFactory, responseProcessor?: DocumentRemindersApiResponseProcessor) { + this.api = new ObservableDocumentRemindersApi(configuration, requestFactory, responseProcessor); + } + + /** + * Sends manual reminders to one or more recipients of a specified document. + * Send Manual Reminder + * @param param the request object + */ + public createManualReminderWithHttpInfo(param: DocumentRemindersApiCreateManualReminderRequest, options?: ConfigurationOptions): Promise> { + return this.api.createManualReminderWithHttpInfo(param.documentId, param.documentSendManualReminderRequest, options).toPromise(); + } + + /** + * Sends manual reminders to one or more recipients of a specified document. + * Send Manual Reminder + * @param param the request object + */ + public createManualReminder(param: DocumentRemindersApiCreateManualReminderRequest, options?: ConfigurationOptions): Promise { + return this.api.createManualReminder(param.documentId, param.documentSendManualReminderRequest, options).toPromise(); + } + + /** + * Retrieves the current auto reminder configuration for a specified document. + * Document Auto Reminder Settings + * @param param the request object + */ + public getDocumentAutoReminderSettingsWithHttpInfo(param: DocumentRemindersApiGetDocumentAutoReminderSettingsRequest, options?: ConfigurationOptions): Promise> { + return this.api.getDocumentAutoReminderSettingsWithHttpInfo(param.documentId, options).toPromise(); + } + + /** + * Retrieves the current auto reminder configuration for a specified document. + * Document Auto Reminder Settings + * @param param the request object + */ + public getDocumentAutoReminderSettings(param: DocumentRemindersApiGetDocumentAutoReminderSettingsRequest, options?: ConfigurationOptions): Promise { + return this.api.getDocumentAutoReminderSettings(param.documentId, options).toPromise(); + } + + /** + * Retrieves the current auto reminder status per recipient for a specified document. Recipients who could not receive reminders due to validations (recipient groups, non-signers, etc.) will be skipped and not included in the response. + * Document Auto Reminder Status + * @param param the request object + */ + public statusDocumentAutoReminderWithHttpInfo(param: DocumentRemindersApiStatusDocumentAutoReminderRequest, options?: ConfigurationOptions): Promise> { + return this.api.statusDocumentAutoReminderWithHttpInfo(param.documentId, options).toPromise(); + } + + /** + * Retrieves the current auto reminder status per recipient for a specified document. Recipients who could not receive reminders due to validations (recipient groups, non-signers, etc.) will be skipped and not included in the response. + * Document Auto Reminder Status + * @param param the request object + */ + public statusDocumentAutoReminder(param: DocumentRemindersApiStatusDocumentAutoReminderRequest, options?: ConfigurationOptions): Promise { + return this.api.statusDocumentAutoReminder(param.documentId, options).toPromise(); + } + + /** + * Configures automatic reminders for document recipients. These reminders are sent after the document\'s initial dispatch. Settings include enabling reminders, delivery method (email/SMS), initial delay, and recurrence frequency. + * Update Document Auto Reminder Settings + * @param param the request object + */ + public updateDocumentAutoReminderSettingsWithHttpInfo(param: DocumentRemindersApiUpdateDocumentAutoReminderSettingsRequest, options?: ConfigurationOptions): Promise> { + return this.api.updateDocumentAutoReminderSettingsWithHttpInfo(param.documentId, param.updateDocumentAutoRemindersRequest, options).toPromise(); + } + + /** + * Configures automatic reminders for document recipients. These reminders are sent after the document\'s initial dispatch. Settings include enabling reminders, delivery method (email/SMS), initial delay, and recurrence frequency. + * Update Document Auto Reminder Settings + * @param param the request object + */ + public updateDocumentAutoReminderSettings(param: DocumentRemindersApiUpdateDocumentAutoReminderSettingsRequest, options?: ConfigurationOptions): Promise { + return this.api.updateDocumentAutoReminderSettings(param.documentId, param.updateDocumentAutoRemindersRequest, options).toPromise(); + } + +} + +import { ObservableDocumentSectionsBundlesApi } from "./ObservableAPI"; +import { DocumentSectionsBundlesApiRequestFactory, DocumentSectionsBundlesApiResponseProcessor} from "../apis/DocumentSectionsBundlesApi"; + +export interface DocumentSectionsBundlesApiDeleteSectionRequest { + /** + * Specify document ID. + * Defaults to: undefined + * @type string + * @memberof DocumentSectionsBundlesApideleteSection + */ + documentId: string + /** + * Specify section ID. + * Defaults to: undefined + * @type string + * @memberof DocumentSectionsBundlesApideleteSection + */ + sectionId: string +} + +export interface DocumentSectionsBundlesApiListSectionsRequest { + /** + * Document ID + * Defaults to: undefined + * @type string + * @memberof DocumentSectionsBundlesApilistSections + */ + documentId: string +} + +export interface DocumentSectionsBundlesApiSectionDetailsRequest { + /** + * Document ID. + * Defaults to: undefined + * @type string + * @memberof DocumentSectionsBundlesApisectionDetails + */ + documentId: string + /** + * Upload ID. + * Defaults to: undefined + * @type string + * @memberof DocumentSectionsBundlesApisectionDetails + */ + uploadId: string +} + +export interface DocumentSectionsBundlesApiSectionInfoRequest { + /** + * Document ID. + * Defaults to: undefined + * @type string + * @memberof DocumentSectionsBundlesApisectionInfo + */ + documentId: string + /** + * Section ID. + * Defaults to: undefined + * @type string + * @memberof DocumentSectionsBundlesApisectionInfo + */ + sectionId: string +} + +export interface DocumentSectionsBundlesApiUploadSectionRequest { + /** + * Document ID + * Defaults to: undefined + * @type string + * @memberof DocumentSectionsBundlesApiuploadSection + */ + documentId: string + /** + * + * @type UploadSectionRequest + * @memberof DocumentSectionsBundlesApiuploadSection + */ + uploadSectionRequest: UploadSectionRequest + /** + * Determines how the fields are mapped when creating a section. * document: Default value. The fields of the entire document are updated. * upload: Only the fields from the created section are updated. The merge field is appended with the upload ID. + * Defaults to: undefined + * @type 'document' | 'upload' + * @memberof DocumentSectionsBundlesApiuploadSection + */ + mergeFieldScope?: 'document' | 'upload' +} + +export interface DocumentSectionsBundlesApiUploadSectionWithUploadRequest { + /** + * Document ID + * Defaults to: undefined + * @type string + * @memberof DocumentSectionsBundlesApiuploadSectionWithUpload + */ + documentId: string + /** + * Determines how the fields are mapped when creating a section. * document: Default value. The fields of the entire document are updated. * upload: Only the fields from the created section are updated. The merge field is appended with the upload ID. + * Defaults to: undefined + * @type 'document' | 'upload' + * @memberof DocumentSectionsBundlesApiuploadSectionWithUpload + */ + mergeFieldScope?: 'document' | 'upload' + /** + * Binary PDF/DocX/RTF File. + * Defaults to: undefined + * @type HttpFile + * @memberof DocumentSectionsBundlesApiuploadSectionWithUpload + */ + file?: HttpFile + /** + * JSON as a multipart/form-data string. + * Defaults to: undefined + * @type UploadSectionRequest + * @memberof DocumentSectionsBundlesApiuploadSectionWithUpload + */ + data?: UploadSectionRequest +} + +export class ObjectDocumentSectionsBundlesApi { + private api: ObservableDocumentSectionsBundlesApi + + public constructor(configuration: Configuration, requestFactory?: DocumentSectionsBundlesApiRequestFactory, responseProcessor?: DocumentSectionsBundlesApiResponseProcessor) { + this.api = new ObservableDocumentSectionsBundlesApi(configuration, requestFactory, responseProcessor); + } + + /** + * Removes selected section from the document. + * Delete Document Section + * @param param the request object + */ + public deleteSectionWithHttpInfo(param: DocumentSectionsBundlesApiDeleteSectionRequest, options?: ConfigurationOptions): Promise> { + return this.api.deleteSectionWithHttpInfo(param.documentId, param.sectionId, options).toPromise(); + } + + /** + * Removes selected section from the document. + * Delete Document Section + * @param param the request object + */ + public deleteSection(param: DocumentSectionsBundlesApiDeleteSectionRequest, options?: ConfigurationOptions): Promise { + return this.api.deleteSection(param.documentId, param.sectionId, options).toPromise(); + } + + /** + * Retrieve information about the sections within a document. + * List Document Sections + * @param param the request object + */ + public listSectionsWithHttpInfo(param: DocumentSectionsBundlesApiListSectionsRequest, options?: ConfigurationOptions): Promise> { + return this.api.listSectionsWithHttpInfo(param.documentId, options).toPromise(); + } + + /** + * Retrieve information about the sections within a document. + * List Document Sections + * @param param the request object + */ + public listSections(param: DocumentSectionsBundlesApiListSectionsRequest, options?: ConfigurationOptions): Promise { + return this.api.listSections(param.documentId, options).toPromise(); + } + + /** + * Receive the upload status of the document and sections by their `upload_id`. Requesting document section upload status is useful to ensure a document section upload is in the expected state before calling additional API methods. In response, you receive an array with `sections_uuid`. You can receive information about each section using the [Document Section Info](https://developers.pandadoc.com/reference/document-section-info) endpoint. ```json \"section_uuids\": [ \"H8T8CJofGY6JwTsWsPuDEF\", \"8MwLaU4SaZywqLiDk26mDF\" ] ``` ## Available Document Section Upload Statuses The following is a complete list of all possible document statuses returned: | Document Status | Status Description | | :----------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `document_sections_upload.UPLOADED` | The document section upload process has just been created. It is in processing and will be in `document_sections_upload.PROCESSED` state momentarily. | | `document_sections_upload.PROCESSED` | The document sections upload is processed and the sections are already created in the document. All aspects of the document sections can be edited in this state. | | `document_sections_upload.ERROR` | Document section upload procces has been failed. For more information check error details in the response. | + * Document Section Upload Status + * @param param the request object + */ + public sectionDetailsWithHttpInfo(param: DocumentSectionsBundlesApiSectionDetailsRequest, options?: ConfigurationOptions): Promise> { + return this.api.sectionDetailsWithHttpInfo(param.documentId, param.uploadId, options).toPromise(); + } + + /** + * Receive the upload status of the document and sections by their `upload_id`. Requesting document section upload status is useful to ensure a document section upload is in the expected state before calling additional API methods. In response, you receive an array with `sections_uuid`. You can receive information about each section using the [Document Section Info](https://developers.pandadoc.com/reference/document-section-info) endpoint. ```json \"section_uuids\": [ \"H8T8CJofGY6JwTsWsPuDEF\", \"8MwLaU4SaZywqLiDk26mDF\" ] ``` ## Available Document Section Upload Statuses The following is a complete list of all possible document statuses returned: | Document Status | Status Description | | :----------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `document_sections_upload.UPLOADED` | The document section upload process has just been created. It is in processing and will be in `document_sections_upload.PROCESSED` state momentarily. | | `document_sections_upload.PROCESSED` | The document sections upload is processed and the sections are already created in the document. All aspects of the document sections can be edited in this state. | | `document_sections_upload.ERROR` | Document section upload procces has been failed. For more information check error details in the response. | + * Document Section Upload Status + * @param param the request object + */ + public sectionDetails(param: DocumentSectionsBundlesApiSectionDetailsRequest, options?: ConfigurationOptions): Promise { + return this.api.sectionDetails(param.documentId, param.uploadId, options).toPromise(); + } + + /** + * Receive information about each section. + * Document Section Details + * @param param the request object + */ + public sectionInfoWithHttpInfo(param: DocumentSectionsBundlesApiSectionInfoRequest, options?: ConfigurationOptions): Promise> { + return this.api.sectionInfoWithHttpInfo(param.documentId, param.sectionId, options).toPromise(); + } + + /** + * Receive information about each section. + * Document Section Details + * @param param the request object + */ + public sectionInfo(param: DocumentSectionsBundlesApiSectionInfoRequest, options?: ConfigurationOptions): Promise { + return this.api.sectionInfo(param.documentId, param.sectionId, options).toPromise(); + } + + /** + * With this endpoint, you can add a new section to an existing PandaDoc document (create a bundle). You can upload a section to the document using a PandaDoc template or a file by URL. > ⏱️ Document Section creation is a non-blocking (asynchronous) operation > > The document creation process may take some time. > > With a successful request, you receive a response with the created upload ID and status `document_sections_upload.uploaded`. After processing completes on our servers, usually a few seconds, the document moves to the `document_sections_upload.PROCESSED` status. ## Using a PandaDoc template
> 🚧 Current Version Limitations > > Images in sections are currently not supported. > 📘 Pricing tables note > > Each pricing table must have a unique name to populate it with data correctly. A PandaDoc template is a document template created and edited in the PandaDoc web application. Our [help center](https://support.pandadoc.com/en/articles/9714616-save-time-with-a-reusable-template) has further information on PandaDoc templates. If you don\'t have any PandaDoc Template yet, you can easily create one by clicking [Copy a Sample PandaDoc template](https://app.pandadoc.com/get-this-template/?pt=public_template&pub=eiC3a6qBVfEfbw7VCYgaeN). This will open the PandaDoc application in a new tab, copy the sample template into your account, and create a new document from the template.
## Using a File by URL
Using this endpoint you can add a section to the existing document. The section is created from a file you upload. The file can be a PDF, DocX, or RTF. > 📘 We\'ve prepared two samples that you can use to test the request. > Download them here: > > - [Download a Sample PDF with Form Fields](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) > - [Download a Sample PDF with Field Tags](https://5132871.fs1.hubspotusercontent-na1.net/hubfs/5132871/SamplePandaDocPdf_FieldTags_updated.pdf) > ❗️ Limitations > > * This method does not support multiple documents. > * The maximum supported file size is 50 MB. API returns \"413 Request entity too large\" in case of bigger files. > * PandaDoc does not support creating document from a PDF with encrypted files (to check whether a file is encrypted or not, try Get info -> Secure: Password Encrypted). ### PDF Form Fields PandaDoc recognizes PDF form fields. To enable this feature, pass the optional `parse_form_fields` value as `true` when making a create document section API call. We support Text fields, Dropdowns, and Signature fields. If you would like to pass additional parameters to configure PDF form fields, use the PDF field name as an optId. You can use a PDF editor such as Adobe Acrobat, Foxit to get and edit field names in your PDF. [**Download a Sample PDF with Form Fields**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) ### PDF/DocX/RTF Field Tags This parsing format allows a word processor such as [Microsoft Word](https://support.office.com/en-us/article/Save-as-PDF-d85416c5-7d77-4fd6-a216-6f4bf7c7c110?ui=en-US&rs=en-US&ad=US) or [Google Docs](https://support.google.com/drive/answer/2423534?co=GENIE.Platform%3DDesktop&hl=en) to prepare a document and save it in PDF, DocX or RTF format. Within the text, PandaDoc parses field tags. A field tag starts and ends with brackets. The field tag includes basic information on how to create a form field in the PandaDoc document. The request JSON object `optId` can also extend this information for even greater control. Here is an example of how the field tag in a PDF/DocX/RTF is converted to a text field in the PandaDoc document: ![](https://files.readme.io/38afedf-ex3.png \"ex3.png\") [**Download a Sample PDF with Field Tags**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FieldTags.pdf) #### PDF Field Tag Key ![](https://files.readme.io/a81fbf1-field-tag-structure.png \"field-tag-structure.png\") | Number | Key | Description | Example | | :----- | :---------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------- | | 1 | `fieldType` | Field type from the table documented below | `signature`, or `s` for shorthand | | 2 | `*` | Optional `*` denotes the field is not required | `*` | | 3 | `role` | Role name. Associate the field tag with a recipient role. Roles must be assigned to recipients in the request body. In this case we are using role `s1` to keep the length short and denote the concept of \"signer 1\". `s1` would be the value passed as role in a recipient JSON object. | `s1` | | 4 | `optId` | Optional field Id. Specify more information about the field tag within the post request by using this id. | `sigBox17` | | 5 | `_____` | Use underscores to widen the field if desired. The form fields in PandaDoc will scale to the length and size of your field tag. | `_____` | > 🚧 Role names restrictions > > Underscores are not supported in role names for a file with a Field Tag. #### PDF/DocX/RTF Field Tag Supported Types | Field Type | Short Notation | Is PandaDoc Field | | :---------- | :------------- | :---------------- | | `textfield` | `t` | Field | | `checkbox` | `c` | Field | | `signature` | `s` | Field | | `date` | `d` | Field | | `initials` | `i` | Field | | `dropdown` | `dd` | Field | ```json Field Tags Example \"fields\": { \"textfield\": { \"value\": \"Jane\", \"role\": \"user\" }, \"dropdown\": { \"value\": \"opt1\", \"role\": \"user\", \"options\":[ \"opt1\", \"opt2\", \"opt3\" ] }, \"checkbox\": { \"value\": true, \"role\": \"user\" }, \"date\":{ \"value\": \"2022-05-20\", \"role\": \"user\" }, \"signature\": { \"value\": \"\", \"role\": \"user\" } } ``` > 📘 Fields in PandaDoc > > The following article explains how to use Fields: [Everything you need to know about Fields](https://support.pandadoc.com/en/articles/9714583-fields) ### Signing order Set a signing order for document section sections created from a file. ```json \"recipients\": [ { \"email\": \"josh@example.com\", \"first_name\": \"Josh\", \"last_name\": \"Ron\", \"role\": \"user\", \"signing_order\": 1 } ] ``` > 📘 Signing order in PandaDoc > > The following article explains how to use signing order: [How to use signing order](https://support.pandadoc.com/en/articles/9714771-signing-order) ### Error handling | Error description | Type | Root cause | |---|---|---| | Document version 1 is not supported. | Validation errors: Form fields | The creation document section is supported only for document version 2 | | PDF content hasn\'t been processed: document is broken or locked | Processing errors: Failed to process document content | Document converter service can’t process PDF. This may be caused by locked PDF or if it’s broken. | | Error occurred while parsing PDF field tags. Please try PDF flattening or reach out to support | Processing errors: Field tag / Form field validation error | Doc converter managed to parse PDF and extract tags, but at least 1 of them is invalid (having negative position, for example). Usually we recommend PDF flattening and it helps | | No role=\'{role}\' for field tag specified in `recipients` found, roles passed were {roles} | Validation errors: Field tags | Role is invalid. When the role specified in field tag is empty or wasn’t provided in a payload for any recipient | | All field tags within PDF must be declared within `fields`  object of the JSON Payload. No field with optId=\'{optid}\' found in fields object, fields passed were {optids} | Validation errors: Field tags | Label is invalid. Occurs when **optId** specified in field tag is empty or no field with **name = optId** was provided in a payload | | One of field tags in PDF with type=\'{field}\' doesn\'t have a role | Validation errors: Field tags | Field tag in PDF has no role. One of field tags in PDF with type=% doesn\'t have a role. | | Role for form field with name=\'{role}\' is not provided in payload | Validation errors: Form fields | Role for form field with ‘name’ is not provided. Occurs when `role` for form field with name=%s  is not provided in payload | | Field for form field with name=\'{name}\' is not specified in payload, available names are {names} | Validation errors: Form fields | Field ‘name’ is not specified in payload. Occurs when no field with name = form field name was provided in a payload | | No role=\'{role}\' for form field specified in \'recipients\' found, roles passed were {roles}\" | Validation errors: Form fields | Failed to resolve field actor for `role` in form field with ‘name’.   Occurs when role from the form field is not found in recipient’s from payload | | Failed to download file from link {url}. | Source errors | Error on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload | | Failed to download file from link {url} (status code: {status code}) | Source errors | Error with HTTP status code on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload - remote server responded with the HTTP status code | | Content type=\'{type}\' is not supported, available types are {types} | Source errors | Content type is not supported.  Content type should be one of the following: PDF, ZIP, doc, docx, RTF | | The maximum file size is exceeded, limit is {limit} MB | Source errors | The file size has exceeded the allowed limits. An error occurred while trying to download a file that is too large (limit is 50M) |
+ * Create Document Section + * @param param the request object + */ + public uploadSectionWithHttpInfo(param: DocumentSectionsBundlesApiUploadSectionRequest, options?: ConfigurationOptions): Promise> { + return this.api.uploadSectionWithHttpInfo(param.documentId, param.uploadSectionRequest, param.mergeFieldScope, options).toPromise(); + } + + /** + * With this endpoint, you can add a new section to an existing PandaDoc document (create a bundle). You can upload a section to the document using a PandaDoc template or a file by URL. > ⏱️ Document Section creation is a non-blocking (asynchronous) operation > > The document creation process may take some time. > > With a successful request, you receive a response with the created upload ID and status `document_sections_upload.uploaded`. After processing completes on our servers, usually a few seconds, the document moves to the `document_sections_upload.PROCESSED` status. ## Using a PandaDoc template
> 🚧 Current Version Limitations > > Images in sections are currently not supported. > 📘 Pricing tables note > > Each pricing table must have a unique name to populate it with data correctly. A PandaDoc template is a document template created and edited in the PandaDoc web application. Our [help center](https://support.pandadoc.com/en/articles/9714616-save-time-with-a-reusable-template) has further information on PandaDoc templates. If you don\'t have any PandaDoc Template yet, you can easily create one by clicking [Copy a Sample PandaDoc template](https://app.pandadoc.com/get-this-template/?pt=public_template&pub=eiC3a6qBVfEfbw7VCYgaeN). This will open the PandaDoc application in a new tab, copy the sample template into your account, and create a new document from the template.
## Using a File by URL
Using this endpoint you can add a section to the existing document. The section is created from a file you upload. The file can be a PDF, DocX, or RTF. > 📘 We\'ve prepared two samples that you can use to test the request. > Download them here: > > - [Download a Sample PDF with Form Fields](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) > - [Download a Sample PDF with Field Tags](https://5132871.fs1.hubspotusercontent-na1.net/hubfs/5132871/SamplePandaDocPdf_FieldTags_updated.pdf) > ❗️ Limitations > > * This method does not support multiple documents. > * The maximum supported file size is 50 MB. API returns \"413 Request entity too large\" in case of bigger files. > * PandaDoc does not support creating document from a PDF with encrypted files (to check whether a file is encrypted or not, try Get info -> Secure: Password Encrypted). ### PDF Form Fields PandaDoc recognizes PDF form fields. To enable this feature, pass the optional `parse_form_fields` value as `true` when making a create document section API call. We support Text fields, Dropdowns, and Signature fields. If you would like to pass additional parameters to configure PDF form fields, use the PDF field name as an optId. You can use a PDF editor such as Adobe Acrobat, Foxit to get and edit field names in your PDF. [**Download a Sample PDF with Form Fields**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) ### PDF/DocX/RTF Field Tags This parsing format allows a word processor such as [Microsoft Word](https://support.office.com/en-us/article/Save-as-PDF-d85416c5-7d77-4fd6-a216-6f4bf7c7c110?ui=en-US&rs=en-US&ad=US) or [Google Docs](https://support.google.com/drive/answer/2423534?co=GENIE.Platform%3DDesktop&hl=en) to prepare a document and save it in PDF, DocX or RTF format. Within the text, PandaDoc parses field tags. A field tag starts and ends with brackets. The field tag includes basic information on how to create a form field in the PandaDoc document. The request JSON object `optId` can also extend this information for even greater control. Here is an example of how the field tag in a PDF/DocX/RTF is converted to a text field in the PandaDoc document: ![](https://files.readme.io/38afedf-ex3.png \"ex3.png\") [**Download a Sample PDF with Field Tags**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FieldTags.pdf) #### PDF Field Tag Key ![](https://files.readme.io/a81fbf1-field-tag-structure.png \"field-tag-structure.png\") | Number | Key | Description | Example | | :----- | :---------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------- | | 1 | `fieldType` | Field type from the table documented below | `signature`, or `s` for shorthand | | 2 | `*` | Optional `*` denotes the field is not required | `*` | | 3 | `role` | Role name. Associate the field tag with a recipient role. Roles must be assigned to recipients in the request body. In this case we are using role `s1` to keep the length short and denote the concept of \"signer 1\". `s1` would be the value passed as role in a recipient JSON object. | `s1` | | 4 | `optId` | Optional field Id. Specify more information about the field tag within the post request by using this id. | `sigBox17` | | 5 | `_____` | Use underscores to widen the field if desired. The form fields in PandaDoc will scale to the length and size of your field tag. | `_____` | > 🚧 Role names restrictions > > Underscores are not supported in role names for a file with a Field Tag. #### PDF/DocX/RTF Field Tag Supported Types | Field Type | Short Notation | Is PandaDoc Field | | :---------- | :------------- | :---------------- | | `textfield` | `t` | Field | | `checkbox` | `c` | Field | | `signature` | `s` | Field | | `date` | `d` | Field | | `initials` | `i` | Field | | `dropdown` | `dd` | Field | ```json Field Tags Example \"fields\": { \"textfield\": { \"value\": \"Jane\", \"role\": \"user\" }, \"dropdown\": { \"value\": \"opt1\", \"role\": \"user\", \"options\":[ \"opt1\", \"opt2\", \"opt3\" ] }, \"checkbox\": { \"value\": true, \"role\": \"user\" }, \"date\":{ \"value\": \"2022-05-20\", \"role\": \"user\" }, \"signature\": { \"value\": \"\", \"role\": \"user\" } } ``` > 📘 Fields in PandaDoc > > The following article explains how to use Fields: [Everything you need to know about Fields](https://support.pandadoc.com/en/articles/9714583-fields) ### Signing order Set a signing order for document section sections created from a file. ```json \"recipients\": [ { \"email\": \"josh@example.com\", \"first_name\": \"Josh\", \"last_name\": \"Ron\", \"role\": \"user\", \"signing_order\": 1 } ] ``` > 📘 Signing order in PandaDoc > > The following article explains how to use signing order: [How to use signing order](https://support.pandadoc.com/en/articles/9714771-signing-order) ### Error handling | Error description | Type | Root cause | |---|---|---| | Document version 1 is not supported. | Validation errors: Form fields | The creation document section is supported only for document version 2 | | PDF content hasn\'t been processed: document is broken or locked | Processing errors: Failed to process document content | Document converter service can’t process PDF. This may be caused by locked PDF or if it’s broken. | | Error occurred while parsing PDF field tags. Please try PDF flattening or reach out to support | Processing errors: Field tag / Form field validation error | Doc converter managed to parse PDF and extract tags, but at least 1 of them is invalid (having negative position, for example). Usually we recommend PDF flattening and it helps | | No role=\'{role}\' for field tag specified in `recipients` found, roles passed were {roles} | Validation errors: Field tags | Role is invalid. When the role specified in field tag is empty or wasn’t provided in a payload for any recipient | | All field tags within PDF must be declared within `fields`  object of the JSON Payload. No field with optId=\'{optid}\' found in fields object, fields passed were {optids} | Validation errors: Field tags | Label is invalid. Occurs when **optId** specified in field tag is empty or no field with **name = optId** was provided in a payload | | One of field tags in PDF with type=\'{field}\' doesn\'t have a role | Validation errors: Field tags | Field tag in PDF has no role. One of field tags in PDF with type=% doesn\'t have a role. | | Role for form field with name=\'{role}\' is not provided in payload | Validation errors: Form fields | Role for form field with ‘name’ is not provided. Occurs when `role` for form field with name=%s  is not provided in payload | | Field for form field with name=\'{name}\' is not specified in payload, available names are {names} | Validation errors: Form fields | Field ‘name’ is not specified in payload. Occurs when no field with name = form field name was provided in a payload | | No role=\'{role}\' for form field specified in \'recipients\' found, roles passed were {roles}\" | Validation errors: Form fields | Failed to resolve field actor for `role` in form field with ‘name’.   Occurs when role from the form field is not found in recipient’s from payload | | Failed to download file from link {url}. | Source errors | Error on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload | | Failed to download file from link {url} (status code: {status code}) | Source errors | Error with HTTP status code on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload - remote server responded with the HTTP status code | | Content type=\'{type}\' is not supported, available types are {types} | Source errors | Content type is not supported.  Content type should be one of the following: PDF, ZIP, doc, docx, RTF | | The maximum file size is exceeded, limit is {limit} MB | Source errors | The file size has exceeded the allowed limits. An error occurred while trying to download a file that is too large (limit is 50M) |
+ * Create Document Section + * @param param the request object + */ + public uploadSection(param: DocumentSectionsBundlesApiUploadSectionRequest, options?: ConfigurationOptions): Promise { + return this.api.uploadSection(param.documentId, param.uploadSectionRequest, param.mergeFieldScope, options).toPromise(); + } + + /** + * With this endpoint, you can add a new section to an existing PandaDoc document (create a bundle). The section is created from a file you upload. The file can be a PDF, DocX, or RTF. > 📘 We\'ve prepared two samples that you can use to test the request. > Download them here: > > - [Download a Sample PDF with Form Fields](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) > - [Download a Sample PDF with Field Tags](https://5132871.fs1.hubspotusercontent-na1.net/hubfs/5132871/SamplePandaDocPdf_FieldTags_updated.pdf) > 🚧 Usage specifics > > 1. This method uses a `multipart/form-data` request type instead of the `application/json` typically found in the PandaDoc API. This is to accommodate the upload of the included document. > 2. You can send a URL instead of a file in the document creation request. > In this case, you need to use the `application/json` content type and add the URL parameter in the body request. As an example, see [Create from public PDF](https://developers.pandadoc.com/docs/create-and-send-a-document-from-a-publicly-available-pdf) guide for more details. > 3. A file you upload is not stored in your PandaDoc account, so you have to upload it with every request. > ❗️ Limitations > > 1. This method does not support multiple documents. > 2. The maximum supported file size is 50 MB. API returns \"413 Request entity too large\" in case of bigger files. > 3. PandaDoc does not support creating document from a PDF with encrypted files (to check whether a file is encrypted or not, try Get info -> Secure: Password Encrypted). > ⏱️ Document Section creation is a non-blocking (asynchronous) operation > > The document creation process may take some time. > > With a successful request, you receive a response with the created upload ID and status `document_sections_upload.uploaded`. After processing completes on our servers, usually a few seconds, the document moves to the `document_sections_upload.PROCESSED` status. ## PDF Form Fields PandaDoc recognizes PDF form fields. To enable this feature, pass the optional `parse_form_fields` value as `true` when making a create document section API call. We support Text fields, Dropdowns, and Signature fields. If you would like to pass additional parameters to configure PDF form fields, use the PDF field name as an optId. You can use a PDF editor such as Adobe Acrobat, Foxit to get and edit field names in your PDF. [**Download a Sample PDF with Form Fields**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) ## PDF/DocX/RTF Field Tags This parsing format allows a word processor such as [Microsoft Word](https://support.office.com/en-us/article/Save-as-PDF-d85416c5-7d77-4fd6-a216-6f4bf7c7c110?ui=en-US&rs=en-US&ad=US) or [Google Docs](https://support.google.com/drive/answer/2423534?co=GENIE.Platform%3DDesktop&hl=en) to prepare a document and save it in PDF, DocX or RTF format. Within the text, PandaDoc parses field tags. A field tag starts and ends with brackets. The field tag includes basic information on how to create a form field in the PandaDoc document. The request JSON object `optId` can also extend this information for even greater control. Here is an example of how the field tag in a PDF/DocX/RTF is converted to a text field in the PandaDoc document: ![](https://files.readme.io/38afedf-ex3.png \"ex3.png\") [**Download a Sample PDF with Field Tags**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FieldTags.pdf)
### PDF Field Tag Key ![](https://files.readme.io/a81fbf1-field-tag-structure.png \"field-tag-structure.png\") | Number | Key | Description | Example | | :----- | :---------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------- | | 1 | `fieldType` | Field type from the table documented below | `signature`, or `s` for shorthand | | 2 | `*` | Optional `*` denotes the field is not required | `*` | | 3 | `role` | Role name. Associate the field tag with a recipient role. Roles must be assigned to recipients in the request body. In this case we are using role `s1` to keep the length short and denote the concept of \"signer 1\". `s1` would be the value passed as role in a recipient JSON object. | `s1` | | 4 | `optId` | Optional field Id. Specify more information about the field tag within the post request by using this id. | `sigBox17` | | 5 | `_____` | Use underscores to widen the field if desired. The form fields in PandaDoc will scale to the length and size of your field tag. | `_____` | > 🚧 Role names restrictions > > Underscores are not supported in role names for a file with a Field Tag. ### PDF/DocX/RTF Field Tag Supported Types | Field Type | Short Notation | Is PandaDoc Field | | :---------- | :------------- | :---------------- | | `textfield` | `t` | Field | | `checkbox` | `c` | Field | | `signature` | `s` | Field | | `date` | `d` | Field | | `initials` | `i` | Field | | `dropdown` | `dd` | Field | > 📘 Fields in PandaDoc > > The following article explains how to use Fields: [Everything you need to know about Fields](https://support.pandadoc.com/en/articles/9714583-fields) ```json Field Tags Example \"fields\": { \"textfield\": { \"value\": \"Jane\", \"role\": \"user\" }, \"dropdown\": { \"value\": \"opt1\", \"role\": \"user\", \"options\":[ \"opt1\", \"opt2\", \"opt3\" ] }, \"checkbox\": { \"value\": true, \"role\": \"user\" }, \"date\":{ \"value\": \"2022-05-20\", \"role\": \"user\" }, \"signature\": { \"value\": \"\", \"role\": \"user\" } } ```
## Signing order Set a signing order for document section sections created from a file. ```json \"recipients\": [ { \"email\": \"josh@example.com\", \"first_name\": \"Josh\", \"last_name\": \"Ron\", \"role\": \"user\", \"signing_order\": 1 } ] ``` ## Error handling | Error description | Type | Root cause | |---|---|---| | Document version 1 is not supported. | Validation errors: Form fields | The creation document section is supported only for document version 2 | | PDF content hasn\'t been processed: document is broken or locked | Processing errors: Failed to process document content | Document converter service can’t process PDF. This may be caused by locked PDF or if it’s broken. | | Error occurred while parsing PDF field tags. Please try PDF flattening or reach out to support | Processing errors: Field tag / Form field validation error | Doc converter managed to parse PDF and extract tags, but at least 1 of them is invalid (having negative position, for example). Usually we recommend PDF flattening and it helps | | No role=\'{role}\' for field tag specified in `recipients` found, roles passed were {roles} | Validation errors: Field tags | Role is invalid. When the role specified in field tag is empty or wasn’t provided in a payload for any recipient | | All field tags within PDF must be declared within `fields`  object of the JSON Payload. No field with optId=\'{optid}\' found in fields object, fields passed were {optids} | Validation errors: Field tags | Label is invalid. Occurs when **optId** specified in field tag is empty or no field with **name = optId** was provided in a payload | | One of field tags in PDF with type=\'{field}\' doesn\'t have a role | Validation errors: Field tags | Field tag in PDF has no role. One of field tags in PDF with type=% doesn\'t have a role. | | Role for form field with name=\'{role}\' is not provided in payload | Validation errors: Form fields | Role for form field with ‘name’ is not provided. Occurs when `role` for form field with name=%s  is not provided in payload | | Field for form field with name=\'{name}\' is not specified in payload, available names are {names} | Validation errors: Form fields | Field ‘name’ is not specified in payload. Occurs when no field with name = form field name was provided in a payload | | No role=\'{role}\' for form field specified in \'recipients\' found, roles passed were {roles}\" | Validation errors: Form fields | Failed to resolve field actor for `role` in form field with ‘name’.   Occurs when role from the form field is not found in recipient’s from payload | | Failed to download file from link {url}. | Source errors | Error on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload | | Failed to download file from link {url} (status code: {status code}) | Source errors | Error with HTTP status code on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload - remote server responded with the HTTP status code | | Content type=\'{type}\' is not supported, available types are {types} | Source errors | Content type is not supported.  Content type should be one of the following: PDF, ZIP, doc, docx, RTF | | The maximum file size is exceeded, limit is {limit} MB | Source errors | The file size has exceeded the allowed limits. An error occurred while trying to download a file that is too large (limit is 50M) | + * Create Document Section from File Upload + * @param param the request object + */ + public uploadSectionWithUploadWithHttpInfo(param: DocumentSectionsBundlesApiUploadSectionWithUploadRequest, options?: ConfigurationOptions): Promise> { + return this.api.uploadSectionWithUploadWithHttpInfo(param.documentId, param.mergeFieldScope, param.file, param.data, options).toPromise(); + } + + /** + * With this endpoint, you can add a new section to an existing PandaDoc document (create a bundle). The section is created from a file you upload. The file can be a PDF, DocX, or RTF. > 📘 We\'ve prepared two samples that you can use to test the request. > Download them here: > > - [Download a Sample PDF with Form Fields](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) > - [Download a Sample PDF with Field Tags](https://5132871.fs1.hubspotusercontent-na1.net/hubfs/5132871/SamplePandaDocPdf_FieldTags_updated.pdf) > 🚧 Usage specifics > > 1. This method uses a `multipart/form-data` request type instead of the `application/json` typically found in the PandaDoc API. This is to accommodate the upload of the included document. > 2. You can send a URL instead of a file in the document creation request. > In this case, you need to use the `application/json` content type and add the URL parameter in the body request. As an example, see [Create from public PDF](https://developers.pandadoc.com/docs/create-and-send-a-document-from-a-publicly-available-pdf) guide for more details. > 3. A file you upload is not stored in your PandaDoc account, so you have to upload it with every request. > ❗️ Limitations > > 1. This method does not support multiple documents. > 2. The maximum supported file size is 50 MB. API returns \"413 Request entity too large\" in case of bigger files. > 3. PandaDoc does not support creating document from a PDF with encrypted files (to check whether a file is encrypted or not, try Get info -> Secure: Password Encrypted). > ⏱️ Document Section creation is a non-blocking (asynchronous) operation > > The document creation process may take some time. > > With a successful request, you receive a response with the created upload ID and status `document_sections_upload.uploaded`. After processing completes on our servers, usually a few seconds, the document moves to the `document_sections_upload.PROCESSED` status. ## PDF Form Fields PandaDoc recognizes PDF form fields. To enable this feature, pass the optional `parse_form_fields` value as `true` when making a create document section API call. We support Text fields, Dropdowns, and Signature fields. If you would like to pass additional parameters to configure PDF form fields, use the PDF field name as an optId. You can use a PDF editor such as Adobe Acrobat, Foxit to get and edit field names in your PDF. [**Download a Sample PDF with Form Fields**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) ## PDF/DocX/RTF Field Tags This parsing format allows a word processor such as [Microsoft Word](https://support.office.com/en-us/article/Save-as-PDF-d85416c5-7d77-4fd6-a216-6f4bf7c7c110?ui=en-US&rs=en-US&ad=US) or [Google Docs](https://support.google.com/drive/answer/2423534?co=GENIE.Platform%3DDesktop&hl=en) to prepare a document and save it in PDF, DocX or RTF format. Within the text, PandaDoc parses field tags. A field tag starts and ends with brackets. The field tag includes basic information on how to create a form field in the PandaDoc document. The request JSON object `optId` can also extend this information for even greater control. Here is an example of how the field tag in a PDF/DocX/RTF is converted to a text field in the PandaDoc document: ![](https://files.readme.io/38afedf-ex3.png \"ex3.png\") [**Download a Sample PDF with Field Tags**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FieldTags.pdf)
### PDF Field Tag Key ![](https://files.readme.io/a81fbf1-field-tag-structure.png \"field-tag-structure.png\") | Number | Key | Description | Example | | :----- | :---------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------- | | 1 | `fieldType` | Field type from the table documented below | `signature`, or `s` for shorthand | | 2 | `*` | Optional `*` denotes the field is not required | `*` | | 3 | `role` | Role name. Associate the field tag with a recipient role. Roles must be assigned to recipients in the request body. In this case we are using role `s1` to keep the length short and denote the concept of \"signer 1\". `s1` would be the value passed as role in a recipient JSON object. | `s1` | | 4 | `optId` | Optional field Id. Specify more information about the field tag within the post request by using this id. | `sigBox17` | | 5 | `_____` | Use underscores to widen the field if desired. The form fields in PandaDoc will scale to the length and size of your field tag. | `_____` | > 🚧 Role names restrictions > > Underscores are not supported in role names for a file with a Field Tag. ### PDF/DocX/RTF Field Tag Supported Types | Field Type | Short Notation | Is PandaDoc Field | | :---------- | :------------- | :---------------- | | `textfield` | `t` | Field | | `checkbox` | `c` | Field | | `signature` | `s` | Field | | `date` | `d` | Field | | `initials` | `i` | Field | | `dropdown` | `dd` | Field | > 📘 Fields in PandaDoc > > The following article explains how to use Fields: [Everything you need to know about Fields](https://support.pandadoc.com/en/articles/9714583-fields) ```json Field Tags Example \"fields\": { \"textfield\": { \"value\": \"Jane\", \"role\": \"user\" }, \"dropdown\": { \"value\": \"opt1\", \"role\": \"user\", \"options\":[ \"opt1\", \"opt2\", \"opt3\" ] }, \"checkbox\": { \"value\": true, \"role\": \"user\" }, \"date\":{ \"value\": \"2022-05-20\", \"role\": \"user\" }, \"signature\": { \"value\": \"\", \"role\": \"user\" } } ```
## Signing order Set a signing order for document section sections created from a file. ```json \"recipients\": [ { \"email\": \"josh@example.com\", \"first_name\": \"Josh\", \"last_name\": \"Ron\", \"role\": \"user\", \"signing_order\": 1 } ] ``` ## Error handling | Error description | Type | Root cause | |---|---|---| | Document version 1 is not supported. | Validation errors: Form fields | The creation document section is supported only for document version 2 | | PDF content hasn\'t been processed: document is broken or locked | Processing errors: Failed to process document content | Document converter service can’t process PDF. This may be caused by locked PDF or if it’s broken. | | Error occurred while parsing PDF field tags. Please try PDF flattening or reach out to support | Processing errors: Field tag / Form field validation error | Doc converter managed to parse PDF and extract tags, but at least 1 of them is invalid (having negative position, for example). Usually we recommend PDF flattening and it helps | | No role=\'{role}\' for field tag specified in `recipients` found, roles passed were {roles} | Validation errors: Field tags | Role is invalid. When the role specified in field tag is empty or wasn’t provided in a payload for any recipient | | All field tags within PDF must be declared within `fields`  object of the JSON Payload. No field with optId=\'{optid}\' found in fields object, fields passed were {optids} | Validation errors: Field tags | Label is invalid. Occurs when **optId** specified in field tag is empty or no field with **name = optId** was provided in a payload | | One of field tags in PDF with type=\'{field}\' doesn\'t have a role | Validation errors: Field tags | Field tag in PDF has no role. One of field tags in PDF with type=% doesn\'t have a role. | | Role for form field with name=\'{role}\' is not provided in payload | Validation errors: Form fields | Role for form field with ‘name’ is not provided. Occurs when `role` for form field with name=%s  is not provided in payload | | Field for form field with name=\'{name}\' is not specified in payload, available names are {names} | Validation errors: Form fields | Field ‘name’ is not specified in payload. Occurs when no field with name = form field name was provided in a payload | | No role=\'{role}\' for form field specified in \'recipients\' found, roles passed were {roles}\" | Validation errors: Form fields | Failed to resolve field actor for `role` in form field with ‘name’.   Occurs when role from the form field is not found in recipient’s from payload | | Failed to download file from link {url}. | Source errors | Error on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload | | Failed to download file from link {url} (status code: {status code}) | Source errors | Error with HTTP status code on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload - remote server responded with the HTTP status code | | Content type=\'{type}\' is not supported, available types are {types} | Source errors | Content type is not supported.  Content type should be one of the following: PDF, ZIP, doc, docx, RTF | | The maximum file size is exceeded, limit is {limit} MB | Source errors | The file size has exceeded the allowed limits. An error occurred while trying to download a file that is too large (limit is 50M) | + * Create Document Section from File Upload + * @param param the request object + */ + public uploadSectionWithUpload(param: DocumentSectionsBundlesApiUploadSectionWithUploadRequest, options?: ConfigurationOptions): Promise { + return this.api.uploadSectionWithUpload(param.documentId, param.mergeFieldScope, param.file, param.data, options).toPromise(); + } + +} + +import { ObservableDocumentSettingsApi } from "./ObservableAPI"; +import { DocumentSettingsApiRequestFactory, DocumentSettingsApiResponseProcessor} from "../apis/DocumentSettingsApi"; + +export interface DocumentSettingsApiDocumentSettingsGetRequest { + /** + * Unique identifier of the document to retrieve settings for. + * Defaults to: undefined + * @type string + * @memberof DocumentSettingsApidocumentSettingsGet + */ + documentId: string +} + +export interface DocumentSettingsApiDocumentSettingsUpdateRequest { + /** + * Unique identifier of the document to update settings for. + * Defaults to: undefined + * @type string + * @memberof DocumentSettingsApidocumentSettingsUpdate + */ + documentId: string + /** + * + * @type UpdateDocumentSettingsRequest + * @memberof DocumentSettingsApidocumentSettingsUpdate + */ + updateDocumentSettingsRequest: UpdateDocumentSettingsRequest +} + +export class ObjectDocumentSettingsApi { + private api: ObservableDocumentSettingsApi + + public constructor(configuration: Configuration, requestFactory?: DocumentSettingsApiRequestFactory, responseProcessor?: DocumentSettingsApiResponseProcessor) { + this.api = new ObservableDocumentSettingsApi(configuration, requestFactory, responseProcessor); + } + + /** + * Retrieves the settings for a specified document. Supported fields: language, qualified_electronic_signature, expires_in (in days). + * Get document settings + * @param param the request object + */ + public documentSettingsGetWithHttpInfo(param: DocumentSettingsApiDocumentSettingsGetRequest, options?: ConfigurationOptions): Promise> { + return this.api.documentSettingsGetWithHttpInfo(param.documentId, options).toPromise(); + } + + /** + * Retrieves the settings for a specified document. Supported fields: language, qualified_electronic_signature, expires_in (in days). + * Get document settings + * @param param the request object + */ + public documentSettingsGet(param: DocumentSettingsApiDocumentSettingsGetRequest, options?: ConfigurationOptions): Promise { + return this.api.documentSettingsGet(param.documentId, options).toPromise(); + } + + /** + * Updates the settings for a specified document. Supported fields: language, qualified_electronic_signature, expires_in (in days). + * Update document settings + * @param param the request object + */ + public documentSettingsUpdateWithHttpInfo(param: DocumentSettingsApiDocumentSettingsUpdateRequest, options?: ConfigurationOptions): Promise> { + return this.api.documentSettingsUpdateWithHttpInfo(param.documentId, param.updateDocumentSettingsRequest, options).toPromise(); + } + + /** + * Updates the settings for a specified document. Supported fields: language, qualified_electronic_signature, expires_in (in days). + * Update document settings + * @param param the request object + */ + public documentSettingsUpdate(param: DocumentSettingsApiDocumentSettingsUpdateRequest, options?: ConfigurationOptions): Promise { + return this.api.documentSettingsUpdate(param.documentId, param.updateDocumentSettingsRequest, options).toPromise(); + } + +} + +import { ObservableDocumentsApi } from "./ObservableAPI"; +import { DocumentsApiRequestFactory, DocumentsApiResponseProcessor} from "../apis/DocumentsApi"; + +export interface DocumentsApiAppendContentLibraryItemToDocumentRequest { + /** + * Specify document id. + * Defaults to: undefined + * @type string + * @memberof DocumentsApiappendContentLibraryItemToDocument + */ + id: string + /** + * + * @type AppendCLIDataRequest + * @memberof DocumentsApiappendContentLibraryItemToDocument + */ + appendCLIDataRequest: AppendCLIDataRequest +} + +export interface DocumentsApiChangeDocumentStatusRequest { + /** + * Specify document ID. + * Defaults to: undefined + * @type string + * @memberof DocumentsApichangeDocumentStatus */ id: string /** @@ -711,132 +2054,222 @@ export interface DocumentsApiChangeDocumentStatusRequest { documentStatusChangeRequest: DocumentStatusChangeRequest } +export interface DocumentsApiChangeDocumentStatusWithUploadRequest { + /** + * Specify document ID. + * Defaults to: undefined + * @type string + * @memberof DocumentsApichangeDocumentStatusWithUpload + */ + id: string + /** + * Binary attachment file + * Defaults to: undefined + * @type HttpFile + * @memberof DocumentsApichangeDocumentStatusWithUpload + */ + file?: HttpFile + /** + * JSON as a multipart/form-data string. + * Defaults to: undefined + * @type DocumentStatusChangeRequest + * @memberof DocumentsApichangeDocumentStatusWithUpload + */ + data?: DocumentStatusChangeRequest +} + export interface DocumentsApiCreateDocumentRequest { /** - * Use a PandaDoc template or an existing PDF to create a document. See the creation request examples [by template](/schemas/DocumentCreateByTemplateRequest) and [by pdf](/schemas/DocumentCreateByPdfRequest) + * * @type DocumentCreateRequest * @memberof DocumentsApicreateDocument */ documentCreateRequest: DocumentCreateRequest /** * Set this parameter as `ev1` if you want to create a document from PDF with Classic Editor when both editors are enabled for the workspace. + * Defaults to: undefined * @type string * @memberof DocumentsApicreateDocument */ editorVer?: string + /** + * Set this parameter as `yes` or `1` or `true` (only when upload pdf with form fields) if you want to respect form fields properties, like `required`. + * Defaults to: undefined + * @type string + * @memberof DocumentsApicreateDocument + */ + useFormFieldProperties?: string } -export interface DocumentsApiCreateDocumentLinkRequest { +export interface DocumentsApiCreateDocumentEditingSessionRequest { /** * Document ID + * Defaults to: undefined * @type string - * @memberof DocumentsApicreateDocumentLink + * @memberof DocumentsApicreateDocumentEditingSession */ id: string /** * - * @type DocumentCreateLinkRequest - * @memberof DocumentsApicreateDocumentLink + * @type EditingSessionRequest + * @memberof DocumentsApicreateDocumentEditingSession */ - documentCreateLinkRequest: DocumentCreateLinkRequest + editingSessionRequest: EditingSessionRequest } -export interface DocumentsApiCreateLinkedObjectRequest { +export interface DocumentsApiCreateDocumentFromUploadRequest { /** - * Specify document ID. + * Set this parameter as `ev1` if you want to create a document from PDF with Classic Editor when both editors are enabled for the workspace. + * Defaults to: undefined * @type string - * @memberof DocumentsApicreateLinkedObject + * @memberof DocumentsApicreateDocumentFromUpload */ - id: string + editorVer?: string + /** + * Set this parameter as `yes` or `1` or `true` (only when upload pdf with form fields) if you want to respect form fields properties, like `required`. + * Defaults to: undefined + * @type string + * @memberof DocumentsApicreateDocumentFromUpload + */ + useFormFieldProperties?: string + /** + * Binary PDF File + * Defaults to: undefined + * @type HttpFile + * @memberof DocumentsApicreateDocumentFromUpload + */ + file?: HttpFile /** * - * @type LinkedObjectCreateRequest - * @memberof DocumentsApicreateLinkedObject + * Defaults to: undefined + * @type DocumentCreateByPdfRequest + * @memberof DocumentsApicreateDocumentFromUpload */ - linkedObjectCreateRequest: LinkedObjectCreateRequest + data?: DocumentCreateByPdfRequest } -export interface DocumentsApiDeleteDocumentRequest { +export interface DocumentsApiCreateDocumentLinkRequest { /** * Document ID + * Defaults to: undefined * @type string - * @memberof DocumentsApideleteDocument + * @memberof DocumentsApicreateDocumentLink */ id: string + /** + * + * @type DocumentCreateLinkRequest + * @memberof DocumentsApicreateDocumentLink + */ + documentCreateLinkRequest: DocumentCreateLinkRequest } -export interface DocumentsApiDeleteLinkedObjectRequest { +export interface DocumentsApiCreateExportDocxTaskRequest { /** - * Specify document ID. + * Specify document id. + * Defaults to: undefined * @type string - * @memberof DocumentsApideleteLinkedObject + * @memberof DocumentsApicreateExportDocxTask */ - id: string + documentId: string +} + +export interface DocumentsApiDeleteDocumentRequest { /** - * Specify linked object ID. + * Document ID + * Defaults to: undefined * @type string - * @memberof DocumentsApideleteLinkedObject + * @memberof DocumentsApideleteDocument */ - linkedObjectId: string + id: string } export interface DocumentsApiDetailsDocumentRequest { /** * Document ID + * Defaults to: undefined * @type string * @memberof DocumentsApidetailsDocument */ id: string } +export interface DocumentsApiDocumentESignDisclosureRequest { + /** + * The UUID of the document. + * Defaults to: undefined + * @type string + * @memberof DocumentsApidocumentESignDisclosure + */ + documentId: string +} + export interface DocumentsApiDocumentMoveToFolderRequest { /** * Specify document ID. + * Defaults to: undefined * @type string * @memberof DocumentsApidocumentMoveToFolder */ id: string /** * Specify folder ID. + * Defaults to: undefined * @type string * @memberof DocumentsApidocumentMoveToFolder */ folderId: string } +export interface DocumentsApiDocumentRevertToDraftRequest { + /** + * Specify document ID. + * Defaults to: undefined + * @type string + * @memberof DocumentsApidocumentRevertToDraft + */ + id: string +} + export interface DocumentsApiDownloadDocumentRequest { /** * Specify document ID. + * Defaults to: undefined * @type string * @memberof DocumentsApidownloadDocument */ id: string /** * HEX code (for example `#FF5733`). + * Defaults to: undefined * @type string * @memberof DocumentsApidownloadDocument */ watermarkColor?: string /** * Font size of the watermark. + * Defaults to: undefined * @type number * @memberof DocumentsApidownloadDocument */ watermarkFontSize?: number /** * In range 0.0-1.0 + * Defaults to: undefined * @type number * @memberof DocumentsApidownloadDocument */ watermarkOpacity?: number /** * Specify watermark text. + * Defaults to: undefined * @type string * @memberof DocumentsApidownloadDocument */ watermarkText?: string /** - * Set as `true` if you want to receive a zip file with all documents in separate when document transaction contains more than 1. + * Download document bundle as a zip-archive of separate PDFs (1 file per section). + * Defaults to: false * @type boolean * @memberof DocumentsApidownloadDocument */ @@ -846,159 +2279,192 @@ export interface DocumentsApiDownloadDocumentRequest { export interface DocumentsApiDownloadProtectedDocumentRequest { /** * Specify document ID. + * Defaults to: undefined * @type string * @memberof DocumentsApidownloadProtectedDocument */ id: string /** - * Set as `true` if you want to receive a zip file with all documents in separate when document transaction contains more than 1. + * Download document bundle as a zip-archive of separate PDFs (1 file per section). + * Defaults to: false * @type boolean * @memberof DocumentsApidownloadProtectedDocument */ separateFiles?: boolean } +export interface DocumentsApiGetDocxExportTaskRequest { + /** + * Specify document id. + * Defaults to: undefined + * @type string + * @memberof DocumentsApigetDocxExportTask + */ + documentId: string + /** + * Specify Task id. + * Defaults to: undefined + * @type string + * @memberof DocumentsApigetDocxExportTask + */ + taskId: string +} + export interface DocumentsApiListDocumentsRequest { /** - * Return results where the `date_completed` field (ISO 8601) is greater than or equal to this value. + * Filters by parent template. This Parameter can\'t be used with form_id. + * Defaults to: undefined * @type string * @memberof DocumentsApilistDocuments */ - completedFrom?: string + templateId?: string /** - * Return results where the `date_completed` field (ISO 8601) is less than or equal to this value. + * Filters by parent form. This parameter can\'t be used with template_id. + * Defaults to: undefined * @type string * @memberof DocumentsApilistDocuments */ - completedTo?: string + formId?: string + /** + * Filters by the folder where the documents are stored. + * Defaults to: undefined + * @type string + * @memberof DocumentsApilistDocuments + */ + folderUuid?: string /** - * Returns results where 'contact_id' is present in document as recipient or approver + * Filters by recipient or approver with this \'contact_id\'. + * Defaults to: undefined * @type string * @memberof DocumentsApilistDocuments */ contactId?: string /** - * Specify how many document results to return. Default is 50 documents, maximum is 100 documents. + * Limits the size of the response. Default is 50 documents, maximum is 100 documents. + * Defaults to: undefined * @type number * @memberof DocumentsApilistDocuments */ count?: number /** - * Return results where the `date_created` field (ISO 8601) is greater than or equal to this value. + * Paginates the search result. Increase value to get the next page of results. + * Minimum: 1 + * Defaults to: undefined + * @type number + * @memberof DocumentsApilistDocuments + */ + page?: number + /** + * Defines the sorting of the result. Use `date_created` for ASC and `-date_created` for DESC sorting. + * Defaults to: undefined + * @type DocumentOrderingFieldsEnum + * @memberof DocumentsApilistDocuments + */ + orderBy?: DocumentOrderingFieldsEnum + /** + * Limits results to the documents with the `date_created` greater than or equal to this value. + * Defaults to: undefined * @type string * @memberof DocumentsApilistDocuments */ createdFrom?: string /** - * Return results where the `date_created` field (ISO 8601) is less than this value. + * Limits results to the documents with the `date_created` less than this value. + * Defaults to: undefined * @type string * @memberof DocumentsApilistDocuments */ createdTo?: string /** * Returns only the deleted documents. + * Defaults to: undefined * @type boolean * @memberof DocumentsApilistDocuments */ deleted?: boolean /** * + * Defaults to: undefined * @type string * @memberof DocumentsApilistDocuments */ id?: string /** - * The UUID of the folder where the documents are stored. + * Limits results to the documents with the `date_completed` greater than or equal to this value. + * Defaults to: undefined * @type string * @memberof DocumentsApilistDocuments */ - folderUuid?: string + completedFrom?: string /** - * Specify the form used for documents creation. This parameter can't be used with template_id. + * Limits results to the documents with the `date_completed` less than this value. + * Defaults to: undefined * @type string * @memberof DocumentsApilistDocuments */ - formId?: string + completedTo?: string /** - * Returns results where 'membership_id' is present in document as owner (should be member uuid) + * Filter documents by the owner\'s \'membership_id\'. + * Defaults to: undefined * @type string * @memberof DocumentsApilistDocuments */ membershipId?: string /** - * Specify metadata to filter by in the format of `metadata_{metadata-key}={metadata-value}` such as `metadata_opportunity_id=2181432`. The `metadata_` prefix is always required. + * Filters documents by metadata. Pass metadata in the format of `metadata_{metadata-key}={metadata-value}` such as `metadata_opportunity_id=2181432`. The `metadata_` prefix is always required. + * Defaults to: undefined * @type Array<string> * @memberof DocumentsApilistDocuments */ metadata?: Array /** - * Return results where the `date_modified` field (iso-8601) is greater than or equal to this value. + * Limits results to the documents with the `date_modified` greater than or equal to this value. + * Defaults to: undefined * @type string * @memberof DocumentsApilistDocuments */ modifiedFrom?: string /** - * Return results where the `date_modified` field (iso-8601) is less than this value. + * Limits results to the documents with the `date_modified` less than this value. + * Defaults to: undefined * @type string * @memberof DocumentsApilistDocuments */ modifiedTo?: string /** - * Specify the order of documents to return. Use `value` (for example, `date_created`) for ASC and `-value` (for example, `-date_created`) for DESC. - * @type DocumentOrderingFieldsEnum - * @memberof DocumentsApilistDocuments - */ - orderBy?: DocumentOrderingFieldsEnum - /** - * Specify which page of the dataset to return. - * @type number - * @memberof DocumentsApilistDocuments - */ - page?: number - /** - * Search query. Filter by document reference number (this token is stored on the template level) or name. + * Filters documents by name or reference number (stored on the template level). + * Defaults to: undefined * @type string * @memberof DocumentsApilistDocuments */ q?: string /** - * Specify the status of documents to return. * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review + * Filters documents by the status. * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review + * Defaults to: undefined * @type DocumentStatusRequestEnum * @memberof DocumentsApilistDocuments */ status?: DocumentStatusRequestEnum /** - * Specify the status of documents to return (exclude). * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review + * Exludes documents with this status. * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review + * Defaults to: undefined * @type DocumentStatusRequestEnum * @memberof DocumentsApilistDocuments */ statusNe?: DocumentStatusRequestEnum /** - * Search tag. Filter by document tag. + * Filters documents by tag. + * Defaults to: undefined * @type string * @memberof DocumentsApilistDocuments */ tag?: string - /** - * Specify the template used for documents creation. Parameter can't be used with form_id. - * @type string - * @memberof DocumentsApilistDocuments - */ - templateId?: string -} - -export interface DocumentsApiListLinkedObjectsRequest { - /** - * Specify document ID. - * @type string - * @memberof DocumentsApilistLinkedObjects - */ - id: string } export interface DocumentsApiSendDocumentRequest { /** * Document ID + * Defaults to: undefined * @type string * @memberof DocumentsApisendDocument */ @@ -1014,6 +2480,7 @@ export interface DocumentsApiSendDocumentRequest { export interface DocumentsApiStatusDocumentRequest { /** * Specify document ID. + * Defaults to: undefined * @type string * @memberof DocumentsApistatusDocument */ @@ -1032,445 +2499,1005 @@ export interface DocumentsApiTransferAllDocumentsOwnershipRequest { export interface DocumentsApiTransferDocumentOwnershipRequest { /** * Specify document ID. + * Defaults to: undefined * @type string * @memberof DocumentsApitransferDocumentOwnership */ - id: string + id: string + /** + * + * @type DocumentTransferOwnershipRequest + * @memberof DocumentsApitransferDocumentOwnership + */ + documentTransferOwnershipRequest: DocumentTransferOwnershipRequest +} + +export interface DocumentsApiUpdateDocumentRequest { + /** + * Document ID + * Defaults to: undefined + * @type string + * @memberof DocumentsApiupdateDocument + */ + id: string + /** + * + * @type DocumentUpdateRequest + * @memberof DocumentsApiupdateDocument + */ + documentUpdateRequest: DocumentUpdateRequest +} + +export class ObjectDocumentsApi { + private api: ObservableDocumentsApi + + public constructor(configuration: Configuration, requestFactory?: DocumentsApiRequestFactory, responseProcessor?: DocumentsApiResponseProcessor) { + this.api = new ObservableDocumentsApi(configuration, requestFactory, responseProcessor); + } + + /** + * Appends a Content Library Item (CLI) to a document and provides a name mapping for its content blocks. + * Append Content Library Item to a document + * @param param the request object + */ + public appendContentLibraryItemToDocumentWithHttpInfo(param: DocumentsApiAppendContentLibraryItemToDocumentRequest, options?: ConfigurationOptions): Promise> { + return this.api.appendContentLibraryItemToDocumentWithHttpInfo(param.id, param.appendCLIDataRequest, options).toPromise(); + } + + /** + * Appends a Content Library Item (CLI) to a document and provides a name mapping for its content blocks. + * Append Content Library Item to a document + * @param param the request object + */ + public appendContentLibraryItemToDocument(param: DocumentsApiAppendContentLibraryItemToDocumentRequest, options?: ConfigurationOptions): Promise { + return this.api.appendContentLibraryItemToDocument(param.id, param.appendCLIDataRequest, options).toPromise(); + } + + /** + * PandaDoc has eight document statuses, but you can manually set your document status to only four: ### Document statuses - Completed - `document.completed` - API code `2` - Expired - `document.voided` - code `11` - Paid - `document.paid` - code `10`. **Important**: You can only set it if you have a payment app connected. - Declined - `document.declined` - code `12` > 🚧 Pass a numeric code for the corresponding document status, for example, `2` for `document.completed`. Find more details in [\\[Editor 2.0\\] Manually change document status](https://support.pandadoc.com/en/articles/9714842-manually-change-document-status) topic. | Current Status | To Completed: | To Expired: | To Paid: | To Declined: | |----------------|---------------|-------------|----------|--------------| | Draft | YES | NO | YES | YES | | Approved | NO | NO | NO | NO | | Sent | YES | YES | NO | YES | | Viewed | YES | YES | NO | YES | | Completed (Auto) | NO | NO | NO | YES | | Waithing for payment | NO | NO | YES | YES | | Paid | NO | NO | NO | NO | | Expired | YES | NO | YES | YES | | Declined | YES | NO | YES | NO | > ✅ - from `document.voided` to `document.paid` > > ❌ - from `document.paid` to `document.voided` + * Document Status Change + * @param param the request object + */ + public changeDocumentStatusWithHttpInfo(param: DocumentsApiChangeDocumentStatusRequest, options?: ConfigurationOptions): Promise> { + return this.api.changeDocumentStatusWithHttpInfo(param.id, param.documentStatusChangeRequest, options).toPromise(); + } + + /** + * PandaDoc has eight document statuses, but you can manually set your document status to only four: ### Document statuses - Completed - `document.completed` - API code `2` - Expired - `document.voided` - code `11` - Paid - `document.paid` - code `10`. **Important**: You can only set it if you have a payment app connected. - Declined - `document.declined` - code `12` > 🚧 Pass a numeric code for the corresponding document status, for example, `2` for `document.completed`. Find more details in [\\[Editor 2.0\\] Manually change document status](https://support.pandadoc.com/en/articles/9714842-manually-change-document-status) topic. | Current Status | To Completed: | To Expired: | To Paid: | To Declined: | |----------------|---------------|-------------|----------|--------------| | Draft | YES | NO | YES | YES | | Approved | NO | NO | NO | NO | | Sent | YES | YES | NO | YES | | Viewed | YES | YES | NO | YES | | Completed (Auto) | NO | NO | NO | YES | | Waithing for payment | NO | NO | YES | YES | | Paid | NO | NO | NO | NO | | Expired | YES | NO | YES | YES | | Declined | YES | NO | YES | NO | > ✅ - from `document.voided` to `document.paid` > > ❌ - from `document.paid` to `document.voided` + * Document Status Change + * @param param the request object + */ + public changeDocumentStatus(param: DocumentsApiChangeDocumentStatusRequest, options?: ConfigurationOptions): Promise { + return this.api.changeDocumentStatus(param.id, param.documentStatusChangeRequest, options).toPromise(); + } + + /** + * PandaDoc has eight document statuses, but you can manually set your document status to only four: ### Document statuses - Completed - `document.completed` - API code `2` - Expired - `document.voided` - code `11` - Paid - `document.paid` - code `10`. **Important**: You can only set it if you have a payment app connected. - Declined - `document.declined` - code `12` > 🚧 Pass a numeric code for the corresponding document status, for example, `2` for `document.completed`. Find more details in [\\[Editor 2.0\\] Manually change document status](https://support.pandadoc.com/en/articles/9714842-manually-change-document-status) topic. | Current Status | To Completed: | To Expired: | To Paid: | To Declined: | |----------------|---------------|-------------|----------|--------------| | Draft | YES | NO | YES | YES | | Approved | NO | NO | NO | NO | | Sent | YES | YES | NO | YES | | Viewed | YES | YES | NO | YES | | Completed (Auto) | NO | NO | NO | YES | | Waithing for payment | NO | NO | YES | YES | | Paid | NO | NO | NO | NO | | Expired | YES | NO | YES | YES | | Declined | YES | NO | YES | NO | > ✅ - from `document.voided` to `document.paid` > > ❌ - from `document.paid` to `document.voided` + * Document Status Change with Upload + * @param param the request object + */ + public changeDocumentStatusWithUploadWithHttpInfo(param: DocumentsApiChangeDocumentStatusWithUploadRequest, options?: ConfigurationOptions): Promise> { + return this.api.changeDocumentStatusWithUploadWithHttpInfo(param.id, param.file, param.data, options).toPromise(); + } + + /** + * PandaDoc has eight document statuses, but you can manually set your document status to only four: ### Document statuses - Completed - `document.completed` - API code `2` - Expired - `document.voided` - code `11` - Paid - `document.paid` - code `10`. **Important**: You can only set it if you have a payment app connected. - Declined - `document.declined` - code `12` > 🚧 Pass a numeric code for the corresponding document status, for example, `2` for `document.completed`. Find more details in [\\[Editor 2.0\\] Manually change document status](https://support.pandadoc.com/en/articles/9714842-manually-change-document-status) topic. | Current Status | To Completed: | To Expired: | To Paid: | To Declined: | |----------------|---------------|-------------|----------|--------------| | Draft | YES | NO | YES | YES | | Approved | NO | NO | NO | NO | | Sent | YES | YES | NO | YES | | Viewed | YES | YES | NO | YES | | Completed (Auto) | NO | NO | NO | YES | | Waithing for payment | NO | NO | YES | YES | | Paid | NO | NO | NO | NO | | Expired | YES | NO | YES | YES | | Declined | YES | NO | YES | NO | > ✅ - from `document.voided` to `document.paid` > > ❌ - from `document.paid` to `document.voided` + * Document Status Change with Upload + * @param param the request object + */ + public changeDocumentStatusWithUpload(param: DocumentsApiChangeDocumentStatusWithUploadRequest, options?: ConfigurationOptions): Promise { + return this.api.changeDocumentStatusWithUpload(param.id, param.file, param.data, options).toPromise(); + } + + /** + * ## Create from a template > See the [Create document from template](https://developers.pandadoc.com/docs/create-document-from-template) tutorial for details on how to use this endpoint, as well as a sample template. ## Create from a URL > See the [Create from public PDF](https://developers.pandadoc.com/docs/create-and-send-a-document-from-a-publicly-available-pdf) guide for info about roles and fields, as well as PDF examples. + * Create Document + * @param param the request object + */ + public createDocumentWithHttpInfo(param: DocumentsApiCreateDocumentRequest, options?: ConfigurationOptions): Promise> { + return this.api.createDocumentWithHttpInfo(param.documentCreateRequest, param.editorVer, param.useFormFieldProperties, options).toPromise(); + } + + /** + * ## Create from a template > See the [Create document from template](https://developers.pandadoc.com/docs/create-document-from-template) tutorial for details on how to use this endpoint, as well as a sample template. ## Create from a URL > See the [Create from public PDF](https://developers.pandadoc.com/docs/create-and-send-a-document-from-a-publicly-available-pdf) guide for info about roles and fields, as well as PDF examples. + * Create Document + * @param param the request object + */ + public createDocument(param: DocumentsApiCreateDocumentRequest, options?: ConfigurationOptions): Promise { + return this.api.createDocument(param.documentCreateRequest, param.editorVer, param.useFormFieldProperties, options).toPromise(); + } + + /** + * Creates a new editing session for the Embedded Editor. The response includes an E-Token, which is required to open the document. > 🚧 **Important:** The Embedded Editor can only open documents that have a `draft` status. #### Limitations - **Single Active Session per User-Document Pair** Only one editing session can be active at a time for a specific user and document. Creating a new session for the same user-document pair will automatically invalidate the previous one. - **Weekly Session Cap** A maximum of **250** editing sessions can be created for a single document per week. Any attempt to exceed this limit will result in a `403 Forbidden` error. + * Create Document Editing Session + * @param param the request object + */ + public createDocumentEditingSessionWithHttpInfo(param: DocumentsApiCreateDocumentEditingSessionRequest, options?: ConfigurationOptions): Promise> { + return this.api.createDocumentEditingSessionWithHttpInfo(param.id, param.editingSessionRequest, options).toPromise(); + } + + /** + * Creates a new editing session for the Embedded Editor. The response includes an E-Token, which is required to open the document. > 🚧 **Important:** The Embedded Editor can only open documents that have a `draft` status. #### Limitations - **Single Active Session per User-Document Pair** Only one editing session can be active at a time for a specific user and document. Creating a new session for the same user-document pair will automatically invalidate the previous one. - **Weekly Session Cap** A maximum of **250** editing sessions can be created for a single document per week. Any attempt to exceed this limit will result in a `403 Forbidden` error. + * Create Document Editing Session + * @param param the request object + */ + public createDocumentEditingSession(param: DocumentsApiCreateDocumentEditingSessionRequest, options?: ConfigurationOptions): Promise { + return this.api.createDocumentEditingSession(param.id, param.editingSessionRequest, options).toPromise(); + } + + /** + * ## Create from an upload > See the [Create from PDF](https://developers.pandadoc.com/docs/create-document-from-file) tutorial for the usage specifics and sample PDF files. **Note**: A file you upload is not stored in your PandaDoc account, so you have to upload it with every request. + * Create Document from File Upload + * @param param the request object + */ + public createDocumentFromUploadWithHttpInfo(param: DocumentsApiCreateDocumentFromUploadRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.createDocumentFromUploadWithHttpInfo(param.editorVer, param.useFormFieldProperties, param.file, param.data, options).toPromise(); + } + + /** + * ## Create from an upload > See the [Create from PDF](https://developers.pandadoc.com/docs/create-document-from-file) tutorial for the usage specifics and sample PDF files. **Note**: A file you upload is not stored in your PandaDoc account, so you have to upload it with every request. + * Create Document from File Upload + * @param param the request object + */ + public createDocumentFromUpload(param: DocumentsApiCreateDocumentFromUploadRequest = {}, options?: ConfigurationOptions): Promise { + return this.api.createDocumentFromUpload(param.editorVer, param.useFormFieldProperties, param.file, param.data, options).toPromise(); + } + + /** + * Creates a document session for a recipient to view and sign a document. > 📘 How to create an Embedded Sign session > For more information on how to create an Embedded Sign session, see the [Embedded Signing](https://developers.pandadoc.com/docs/embedded-signing) documentation. + * Create Document Session for Embedded Sign + * @param param the request object + */ + public createDocumentLinkWithHttpInfo(param: DocumentsApiCreateDocumentLinkRequest, options?: ConfigurationOptions): Promise> { + return this.api.createDocumentLinkWithHttpInfo(param.id, param.documentCreateLinkRequest, options).toPromise(); + } + + /** + * Creates a document session for a recipient to view and sign a document. > 📘 How to create an Embedded Sign session > For more information on how to create an Embedded Sign session, see the [Embedded Signing](https://developers.pandadoc.com/docs/embedded-signing) documentation. + * Create Document Session for Embedded Sign + * @param param the request object + */ + public createDocumentLink(param: DocumentsApiCreateDocumentLinkRequest, options?: ConfigurationOptions): Promise { + return this.api.createDocumentLink(param.id, param.documentCreateLinkRequest, options).toPromise(); + } + + /** + * > ⏱️ Export as DOCX is a non-blocking (asynchronous) operation > The document generation process may take some time. > With a successful request, you receive a response with task ID, status **created** and document id. After process completes, usually in a few minutes, the task status moves to the **done** state. > You can download documents up to 300 pages. For documents of 301+ pages, you will receive an error “400: The number of pages more then limit 300” + * [Beta] Create DOCX Export Task + * @param param the request object + */ + public createExportDocxTaskWithHttpInfo(param: DocumentsApiCreateExportDocxTaskRequest, options?: ConfigurationOptions): Promise> { + return this.api.createExportDocxTaskWithHttpInfo(param.documentId, options).toPromise(); + } + + /** + * > ⏱️ Export as DOCX is a non-blocking (asynchronous) operation > The document generation process may take some time. > With a successful request, you receive a response with task ID, status **created** and document id. After process completes, usually in a few minutes, the task status moves to the **done** state. > You can download documents up to 300 pages. For documents of 301+ pages, you will receive an error “400: The number of pages more then limit 300” + * [Beta] Create DOCX Export Task + * @param param the request object + */ + public createExportDocxTask(param: DocumentsApiCreateExportDocxTaskRequest, options?: ConfigurationOptions): Promise { + return this.api.createExportDocxTask(param.documentId, options).toPromise(); + } + + /** + * Delete a document by ID. + * Delete Document + * @param param the request object + */ + public deleteDocumentWithHttpInfo(param: DocumentsApiDeleteDocumentRequest, options?: ConfigurationOptions): Promise> { + return this.api.deleteDocumentWithHttpInfo(param.id, options).toPromise(); + } + + /** + * Delete a document by ID. + * Delete Document + * @param param the request object + */ + public deleteDocument(param: DocumentsApiDeleteDocumentRequest, options?: ConfigurationOptions): Promise { + return this.api.deleteDocument(param.id, options).toPromise(); + } + /** - * - * @type DocumentTransferOwnershipRequest - * @memberof DocumentsApitransferDocumentOwnership + * Return detailed data about a document. Use Document Status for getting just a basic info and status. Get details about a document by its `id`. Details include: - Basic document information (name, document state, owner, sender, grand total, etc.) - Recipients (completion status, signing order, etc.) - Fields with values (incl. Collect Files field) - Tokens (variables) with values - Pricing information (pricing tables, products, quotes, etc.) - Content block names for table, image, and text blocks (tables, images, texts) - Metadata - Tags - Linked objects - [Approval flow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) (if present) - Timestamps associated with a document. Note that `date_modified` means any changes associated with the recipients and document status, while `content_date_modified` reflects any changes in the document content. + * Document Details + * @param param the request object */ - documentTransferOwnershipRequest: DocumentTransferOwnershipRequest -} + public detailsDocumentWithHttpInfo(param: DocumentsApiDetailsDocumentRequest, options?: ConfigurationOptions): Promise> { + return this.api.detailsDocumentWithHttpInfo(param.id, options).toPromise(); + } -export interface DocumentsApiUpdateDocumentRequest { /** - * Document ID - * @type string - * @memberof DocumentsApiupdateDocument + * Return detailed data about a document. Use Document Status for getting just a basic info and status. Get details about a document by its `id`. Details include: - Basic document information (name, document state, owner, sender, grand total, etc.) - Recipients (completion status, signing order, etc.) - Fields with values (incl. Collect Files field) - Tokens (variables) with values - Pricing information (pricing tables, products, quotes, etc.) - Content block names for table, image, and text blocks (tables, images, texts) - Metadata - Tags - Linked objects - [Approval flow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) (if present) - Timestamps associated with a document. Note that `date_modified` means any changes associated with the recipients and document status, while `content_date_modified` reflects any changes in the document content. + * Document Details + * @param param the request object */ - id: string + public detailsDocument(param: DocumentsApiDetailsDocumentRequest, options?: ConfigurationOptions): Promise { + return this.api.detailsDocument(param.id, options).toPromise(); + } + /** - * - * @type DocumentUpdateRequest - * @memberof DocumentsApiupdateDocument + * Retrieves the current version of eSign disclosure text for a specified document. + * Document eSign disclosure + * @param param the request object */ - documentUpdateRequest: DocumentUpdateRequest -} + public documentESignDisclosureWithHttpInfo(param: DocumentsApiDocumentESignDisclosureRequest, options?: ConfigurationOptions): Promise> { + return this.api.documentESignDisclosureWithHttpInfo(param.documentId, options).toPromise(); + } -export class ObjectDocumentsApi { - private api: ObservableDocumentsApi + /** + * Retrieves the current version of eSign disclosure text for a specified document. + * Document eSign disclosure + * @param param the request object + */ + public documentESignDisclosure(param: DocumentsApiDocumentESignDisclosureRequest, options?: ConfigurationOptions): Promise { + return this.api.documentESignDisclosure(param.documentId, options).toPromise(); + } - public constructor(configuration: Configuration, requestFactory?: DocumentsApiRequestFactory, responseProcessor?: DocumentsApiResponseProcessor) { - this.api = new ObservableDocumentsApi(configuration, requestFactory, responseProcessor); + /** + * This operation allows you to move a document to a folder by specifying the document ID and folder ID. + * Document move to folder + * @param param the request object + */ + public documentMoveToFolderWithHttpInfo(param: DocumentsApiDocumentMoveToFolderRequest, options?: ConfigurationOptions): Promise> { + return this.api.documentMoveToFolderWithHttpInfo(param.id, param.folderId, options).toPromise(); } /** - * Document status change + * This operation allows you to move a document to a folder by specifying the document ID and folder ID. + * Document move to folder * @param param the request object */ - public changeDocumentStatus(param: DocumentsApiChangeDocumentStatusRequest, options?: Configuration): Promise { - return this.api.changeDocumentStatus(param.id, param.documentStatusChangeRequest, options).toPromise(); + public documentMoveToFolder(param: DocumentsApiDocumentMoveToFolderRequest, options?: ConfigurationOptions): Promise { + return this.api.documentMoveToFolder(param.id, param.folderId, options).toPromise(); } /** - * Create document + * Revert your document back to draft to continue editing it. > 📘 Returning to Draft works for any document status except Removed. ## After you move your document to the Draft status - `Signature` and `Initials` fields are cleared. All other fields stay filled in. - Recipients are **not** notified that the document is back in Draft. - You\'ll need to resend the document so that recipients can sign the updated version. + * Move Document to Draft * @param param the request object */ - public createDocument(param: DocumentsApiCreateDocumentRequest, options?: Configuration): Promise { - return this.api.createDocument(param.documentCreateRequest, param.editorVer, options).toPromise(); + public documentRevertToDraftWithHttpInfo(param: DocumentsApiDocumentRevertToDraftRequest, options?: ConfigurationOptions): Promise> { + return this.api.documentRevertToDraftWithHttpInfo(param.id, options).toPromise(); } /** - * Create a Document Link + * Revert your document back to draft to continue editing it. > 📘 Returning to Draft works for any document status except Removed. ## After you move your document to the Draft status - `Signature` and `Initials` fields are cleared. All other fields stay filled in. - Recipients are **not** notified that the document is back in Draft. - You\'ll need to resend the document so that recipients can sign the updated version. + * Move Document to Draft * @param param the request object */ - public createDocumentLink(param: DocumentsApiCreateDocumentLinkRequest, options?: Configuration): Promise { - return this.api.createDocumentLink(param.id, param.documentCreateLinkRequest, options).toPromise(); + public documentRevertToDraft(param: DocumentsApiDocumentRevertToDraftRequest, options?: ConfigurationOptions): Promise { + return this.api.documentRevertToDraft(param.id, options).toPromise(); } /** - * Create Linked Object + * Download documents as a PDF. + * Document Download * @param param the request object */ - public createLinkedObject(param: DocumentsApiCreateLinkedObjectRequest, options?: Configuration): Promise { - return this.api.createLinkedObject(param.id, param.linkedObjectCreateRequest, options).toPromise(); + public downloadDocumentWithHttpInfo(param: DocumentsApiDownloadDocumentRequest, options?: ConfigurationOptions): Promise> { + return this.api.downloadDocumentWithHttpInfo(param.id, param.watermarkColor, param.watermarkFontSize, param.watermarkOpacity, param.watermarkText, param.separateFiles, options).toPromise(); } /** - * Delete document by id + * Download documents as a PDF. + * Document Download * @param param the request object */ - public deleteDocument(param: DocumentsApiDeleteDocumentRequest, options?: Configuration): Promise { - return this.api.deleteDocument(param.id, options).toPromise(); + public downloadDocument(param: DocumentsApiDownloadDocumentRequest, options?: ConfigurationOptions): Promise { + return this.api.downloadDocument(param.id, param.watermarkColor, param.watermarkFontSize, param.watermarkOpacity, param.watermarkText, param.separateFiles, options).toPromise(); } /** - * Delete Linked Object + * Download a completed document as a verifiable PDF (Download Protected Document) > 🚧 Production key only > > This endpoint only works with a Production key. You\'ll get a 401 Unauthorized error when trying to use a Sandbox key. Download a signed PDF of a completed document + * Download Completed Document * @param param the request object */ - public deleteLinkedObject(param: DocumentsApiDeleteLinkedObjectRequest, options?: Configuration): Promise { - return this.api.deleteLinkedObject(param.id, param.linkedObjectId, options).toPromise(); + public downloadProtectedDocumentWithHttpInfo(param: DocumentsApiDownloadProtectedDocumentRequest, options?: ConfigurationOptions): Promise> { + return this.api.downloadProtectedDocumentWithHttpInfo(param.id, param.separateFiles, options).toPromise(); } /** - * Document details + * Download a completed document as a verifiable PDF (Download Protected Document) > 🚧 Production key only > > This endpoint only works with a Production key. You\'ll get a 401 Unauthorized error when trying to use a Sandbox key. Download a signed PDF of a completed document + * Download Completed Document * @param param the request object */ - public detailsDocument(param: DocumentsApiDetailsDocumentRequest, options?: Configuration): Promise { - return this.api.detailsDocument(param.id, options).toPromise(); + public downloadProtectedDocument(param: DocumentsApiDownloadProtectedDocumentRequest, options?: ConfigurationOptions): Promise { + return this.api.downloadProtectedDocument(param.id, param.separateFiles, options).toPromise(); } /** - * Document move to folder + * > 📘 This endpoint returns the current state of a DOCX export task for a document. > The endpoint supports downloading only multiple files if the document contains several sections. Downloading as a single file in this case is not possible. + * [Beta] DOCX Export Task * @param param the request object */ - public documentMoveToFolder(param: DocumentsApiDocumentMoveToFolderRequest, options?: Configuration): Promise { - return this.api.documentMoveToFolder(param.id, param.folderId, options).toPromise(); + public getDocxExportTaskWithHttpInfo(param: DocumentsApiGetDocxExportTaskRequest, options?: ConfigurationOptions): Promise> { + return this.api.getDocxExportTaskWithHttpInfo(param.documentId, param.taskId, options).toPromise(); } /** - * Document download + * > 📘 This endpoint returns the current state of a DOCX export task for a document. > The endpoint supports downloading only multiple files if the document contains several sections. Downloading as a single file in this case is not possible. + * [Beta] DOCX Export Task * @param param the request object */ - public downloadDocument(param: DocumentsApiDownloadDocumentRequest, options?: Configuration): Promise { - return this.api.downloadDocument(param.id, param.watermarkColor, param.watermarkFontSize, param.watermarkOpacity, param.watermarkText, param.separateFiles, options).toPromise(); + public getDocxExportTask(param: DocumentsApiGetDocxExportTaskRequest, options?: ConfigurationOptions): Promise { + return this.api.getDocxExportTask(param.documentId, param.taskId, options).toPromise(); } /** - * Download a signed PDF of a completed document - * Download document protected + * This endpoint will let you list and search for the documents. ### [Here](https://developers.pandadoc.com/docs/list-search-documents-api) you can find how to filter, search and order documents. + * List Documents * @param param the request object */ - public downloadProtectedDocument(param: DocumentsApiDownloadProtectedDocumentRequest, options?: Configuration): Promise { - return this.api.downloadProtectedDocument(param.id, param.separateFiles, options).toPromise(); + public listDocumentsWithHttpInfo(param: DocumentsApiListDocumentsRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.listDocumentsWithHttpInfo(param.templateId, param.formId, param.folderUuid, param.contactId, param.count, param.page, param.orderBy, param.createdFrom, param.createdTo, param.deleted, param.id, param.completedFrom, param.completedTo, param.membershipId, param.metadata, param.modifiedFrom, param.modifiedTo, param.q, param.status, param.statusNe, param.tag, options).toPromise(); } /** - * List documents + * This endpoint will let you list and search for the documents. ### [Here](https://developers.pandadoc.com/docs/list-search-documents-api) you can find how to filter, search and order documents. + * List Documents * @param param the request object */ - public listDocuments(param: DocumentsApiListDocumentsRequest = {}, options?: Configuration): Promise { - return this.api.listDocuments(param.completedFrom, param.completedTo, param.contactId, param.count, param.createdFrom, param.createdTo, param.deleted, param.id, param.folderUuid, param.formId, param.membershipId, param.metadata, param.modifiedFrom, param.modifiedTo, param.orderBy, param.page, param.q, param.status, param.statusNe, param.tag, param.templateId, options).toPromise(); + public listDocuments(param: DocumentsApiListDocumentsRequest = {}, options?: ConfigurationOptions): Promise { + return this.api.listDocuments(param.templateId, param.formId, param.folderUuid, param.contactId, param.count, param.page, param.orderBy, param.createdFrom, param.createdTo, param.deleted, param.id, param.completedFrom, param.completedTo, param.membershipId, param.metadata, param.modifiedFrom, param.modifiedTo, param.q, param.status, param.statusNe, param.tag, options).toPromise(); } /** - * List Linked Objects + * > 🚧 Using the Sandbox Key > > When you use a [sandbox API key](https://developers.pandadoc.com/reference/sandbox-key) during the free trial period, the sender and recipient email addresses must be from the same organisation (email domain). ## Document State - You can only send a document in the `document.draft` status. - After creating a new document, it usually retains a `document.uploaded` status for 3-5 seconds while the document syncs across PandaDoc servers. When the document is available for further API calls, it moves to the `document.draft` state. Use [Document Status](/reference/document-status) or [Webhooks](/reference/on-document-status-change) to check document status. - Moving a document to the `document.sent` status finalizes the document structure, before recipients can complete it. - If a template used for the document creation has an approval workflow turned on, the sent document moves to the `document.waiting_approval` status. Once the document is approved, you need to make the call again to move the document to `document.sent` status. ## Send and Silence Notifications - By default, PandaDoc sends a notification email to the recipient, as well as notifications the sender has configured. You may disable all notifications for recipients by passing `silent: true`. This is useful when you are using alternative delivery methods such as linking to the document or embedding the document. - The `silent: true` parameter disables sent, viewed, comment and completed document email notifications. \"Document Approval\" notification won\'t be affected by this parameter. - If you pass `silent: false`, the document is going to be delivered by email and/or SMS. ![Example email. Branding can be changed in workspace settings](https://files.readme.io/cc5a03e-email2.png) ## Select Approver from Group If you have previously set up an approval workflow with selectable groups on the UI, you can select a particular approver from this group. Learn more about [selectable groups](https://support.pandadoc.com/en/articles/9714799-approval-workflow#h_01H4GNY5GSGG38BPYY46XV7GB4). To set an approver, we recommend to follow these steps: 1. Run the [Document Details](https://developers.pandadoc.com/reference/document-details) request. 2. Copy the `steps` part from the `approval_execution` section of the response into the `selected_approvers` field of the Send Document payload. 3. Modify your payload according to business needs: set `is_selected` to true for one approver. > 📘 **Note**: You can change the selected approver only if you revert your document back to the `document.draft` status. + * Send Document * @param param the request object */ - public listLinkedObjects(param: DocumentsApiListLinkedObjectsRequest, options?: Configuration): Promise { - return this.api.listLinkedObjects(param.id, options).toPromise(); + public sendDocumentWithHttpInfo(param: DocumentsApiSendDocumentRequest, options?: ConfigurationOptions): Promise> { + return this.api.sendDocumentWithHttpInfo(param.id, param.documentSendRequest, options).toPromise(); } /** + * > 🚧 Using the Sandbox Key > > When you use a [sandbox API key](https://developers.pandadoc.com/reference/sandbox-key) during the free trial period, the sender and recipient email addresses must be from the same organisation (email domain). ## Document State - You can only send a document in the `document.draft` status. - After creating a new document, it usually retains a `document.uploaded` status for 3-5 seconds while the document syncs across PandaDoc servers. When the document is available for further API calls, it moves to the `document.draft` state. Use [Document Status](/reference/document-status) or [Webhooks](/reference/on-document-status-change) to check document status. - Moving a document to the `document.sent` status finalizes the document structure, before recipients can complete it. - If a template used for the document creation has an approval workflow turned on, the sent document moves to the `document.waiting_approval` status. Once the document is approved, you need to make the call again to move the document to `document.sent` status. ## Send and Silence Notifications - By default, PandaDoc sends a notification email to the recipient, as well as notifications the sender has configured. You may disable all notifications for recipients by passing `silent: true`. This is useful when you are using alternative delivery methods such as linking to the document or embedding the document. - The `silent: true` parameter disables sent, viewed, comment and completed document email notifications. \"Document Approval\" notification won\'t be affected by this parameter. - If you pass `silent: false`, the document is going to be delivered by email and/or SMS. ![Example email. Branding can be changed in workspace settings](https://files.readme.io/cc5a03e-email2.png) ## Select Approver from Group If you have previously set up an approval workflow with selectable groups on the UI, you can select a particular approver from this group. Learn more about [selectable groups](https://support.pandadoc.com/en/articles/9714799-approval-workflow#h_01H4GNY5GSGG38BPYY46XV7GB4). To set an approver, we recommend to follow these steps: 1. Run the [Document Details](https://developers.pandadoc.com/reference/document-details) request. 2. Copy the `steps` part from the `approval_execution` section of the response into the `selected_approvers` field of the Send Document payload. 3. Modify your payload according to business needs: set `is_selected` to true for one approver. > 📘 **Note**: You can change the selected approver only if you revert your document back to the `document.draft` status. * Send Document * @param param the request object */ - public sendDocument(param: DocumentsApiSendDocumentRequest, options?: Configuration): Promise { + public sendDocument(param: DocumentsApiSendDocumentRequest, options?: ConfigurationOptions): Promise { return this.api.sendDocument(param.id, param.documentSendRequest, options).toPromise(); } /** - * Document status + * It is useful to request document status to ensure a document is in the expected state before calling additional API methods. ### Required Document Statuses Here are some common methods and the `document.status` required to proceed: | API Method | Required Document State | | :------------------- | :---------------------- | | Send A Document | `document.draft` | | Get Document Details | `document.draft` | | Embed A Document | `document.sent` | | Download A Document | `document.completed` | > 📘 Polling vs Webhooks > > If you are using the `GET` document status endpoint for [**polling**](https://en.wikipedia.org/wiki/Polling_(computer_science)), we also support and recommend using **webhooks** for event-driven needs: ### Available Document Statuses The following is a complete list of all possible document statuses returned: | Document Status | Status Description | | :-------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `document.uploaded` | The document has just been created or uploaded. It is in processing and will be in `document.draft` state soon. | | `document.error` | The document creation has failed. This status is terminal, you should stop polling after getting it. | `document.draft` | The document is in a draft state. All aspects of the document can be edited in this state. Our API does not support edits after the document has been created, but it can still be edited manually on | | `document.sent` | The document has been \"sealed\" and optionally sent. No further document edits can occur except for document recipient(s) filling out or signing the document. | | `document.viewed` | Document recipient(s) have viewed the sent document. | | `document.waiting_approval` | The document has an [automatic approval workflow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) and has not yet been approved. | | `document.rejected` | The document has an [automatic approval workflow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) and was rejected. | | `document.approved` | The document has an [automatic approval workflow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) and was approved. | | `document.waiting_pay` | The document has a [Stripe payment](https://support.pandadoc.com/en/articles/9714942-stripe-checkout-payments) option and is awaiting payment. | | `document.paid` | The document has a [Stripe payment](https://support.pandadoc.com/en/articles/9714942-stripe-checkout-payments) option and was paid. | | `document.completed` | The document has been completed by all recipients. | | `document.voided` | The document expired and is no longer available for completion or signature. | | `document.declined` | The document was [manually marked](https://support.pandadoc.com/en/articles/9714842-manually-change-document-status) as \"Declined\" | | `document.external_review` | The document is reviewed by it\'s recipient using Suggest Edit feature | + * Document Status + * @param param the request object + */ + public statusDocumentWithHttpInfo(param: DocumentsApiStatusDocumentRequest, options?: ConfigurationOptions): Promise> { + return this.api.statusDocumentWithHttpInfo(param.id, options).toPromise(); + } + + /** + * It is useful to request document status to ensure a document is in the expected state before calling additional API methods. ### Required Document Statuses Here are some common methods and the `document.status` required to proceed: | API Method | Required Document State | | :------------------- | :---------------------- | | Send A Document | `document.draft` | | Get Document Details | `document.draft` | | Embed A Document | `document.sent` | | Download A Document | `document.completed` | > 📘 Polling vs Webhooks > > If you are using the `GET` document status endpoint for [**polling**](https://en.wikipedia.org/wiki/Polling_(computer_science)), we also support and recommend using **webhooks** for event-driven needs: ### Available Document Statuses The following is a complete list of all possible document statuses returned: | Document Status | Status Description | | :-------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `document.uploaded` | The document has just been created or uploaded. It is in processing and will be in `document.draft` state soon. | | `document.error` | The document creation has failed. This status is terminal, you should stop polling after getting it. | `document.draft` | The document is in a draft state. All aspects of the document can be edited in this state. Our API does not support edits after the document has been created, but it can still be edited manually on | | `document.sent` | The document has been \"sealed\" and optionally sent. No further document edits can occur except for document recipient(s) filling out or signing the document. | | `document.viewed` | Document recipient(s) have viewed the sent document. | | `document.waiting_approval` | The document has an [automatic approval workflow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) and has not yet been approved. | | `document.rejected` | The document has an [automatic approval workflow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) and was rejected. | | `document.approved` | The document has an [automatic approval workflow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) and was approved. | | `document.waiting_pay` | The document has a [Stripe payment](https://support.pandadoc.com/en/articles/9714942-stripe-checkout-payments) option and is awaiting payment. | | `document.paid` | The document has a [Stripe payment](https://support.pandadoc.com/en/articles/9714942-stripe-checkout-payments) option and was paid. | | `document.completed` | The document has been completed by all recipients. | | `document.voided` | The document expired and is no longer available for completion or signature. | | `document.declined` | The document was [manually marked](https://support.pandadoc.com/en/articles/9714842-manually-change-document-status) as \"Declined\" | | `document.external_review` | The document is reviewed by it\'s recipient using Suggest Edit feature | + * Document Status * @param param the request object */ - public statusDocument(param: DocumentsApiStatusDocumentRequest, options?: Configuration): Promise { + public statusDocument(param: DocumentsApiStatusDocumentRequest, options?: ConfigurationOptions): Promise { return this.api.statusDocument(param.id, options).toPromise(); } /** + * This method transfers ownership of all documents from one member to another. + * Transfer all documents ownership + * @param param the request object + */ + public transferAllDocumentsOwnershipWithHttpInfo(param: DocumentsApiTransferAllDocumentsOwnershipRequest, options?: ConfigurationOptions): Promise> { + return this.api.transferAllDocumentsOwnershipWithHttpInfo(param.documentTransferAllOwnershipRequest, options).toPromise(); + } + + /** + * This method transfers ownership of all documents from one member to another. * Transfer all documents ownership * @param param the request object */ - public transferAllDocumentsOwnership(param: DocumentsApiTransferAllDocumentsOwnershipRequest, options?: Configuration): Promise { + public transferAllDocumentsOwnership(param: DocumentsApiTransferAllDocumentsOwnershipRequest, options?: ConfigurationOptions): Promise { return this.api.transferAllDocumentsOwnership(param.documentTransferAllOwnershipRequest, options).toPromise(); } /** + * This operation allows transferring the ownership of a document to another user by specifying the document ID and membership ID. + * Update document ownership + * @param param the request object + */ + public transferDocumentOwnershipWithHttpInfo(param: DocumentsApiTransferDocumentOwnershipRequest, options?: ConfigurationOptions): Promise> { + return this.api.transferDocumentOwnershipWithHttpInfo(param.id, param.documentTransferOwnershipRequest, options).toPromise(); + } + + /** + * This operation allows transferring the ownership of a document to another user by specifying the document ID and membership ID. * Update document ownership * @param param the request object */ - public transferDocumentOwnership(param: DocumentsApiTransferDocumentOwnershipRequest, options?: Configuration): Promise { + public transferDocumentOwnership(param: DocumentsApiTransferDocumentOwnershipRequest, options?: ConfigurationOptions): Promise { return this.api.transferDocumentOwnership(param.id, param.documentTransferOwnershipRequest, options).toPromise(); } /** - * Update Document only in the draft status + * Use the PATCH method to update a PandaDoc document. > 🚧 Document status > > You can only update a document in the Draft status (`document.draft`). > > After creating a new document, it usually retains a `document.uploaded` status for 3-5 seconds while the document syncs across PandaDoc servers. When the document is available for further API calls, the document moves to the `document.draft` state. Use [Document Status](https://developers.pandadoc.com/reference/document-status) or Webhooks to check document status. + * Update Document + * @param param the request object + */ + public updateDocumentWithHttpInfo(param: DocumentsApiUpdateDocumentRequest, options?: ConfigurationOptions): Promise> { + return this.api.updateDocumentWithHttpInfo(param.id, param.documentUpdateRequest, options).toPromise(); + } + + /** + * Use the PATCH method to update a PandaDoc document. > 🚧 Document status > > You can only update a document in the Draft status (`document.draft`). > > After creating a new document, it usually retains a `document.uploaded` status for 3-5 seconds while the document syncs across PandaDoc servers. When the document is available for further API calls, the document moves to the `document.draft` state. Use [Document Status](https://developers.pandadoc.com/reference/document-status) or Webhooks to check document status. + * Update Document * @param param the request object */ - public updateDocument(param: DocumentsApiUpdateDocumentRequest, options?: Configuration): Promise { + public updateDocument(param: DocumentsApiUpdateDocumentRequest, options?: ConfigurationOptions): Promise { return this.api.updateDocument(param.id, param.documentUpdateRequest, options).toPromise(); } } -import { ObservableFoldersAPIApi } from "./ObservableAPI"; -import { FoldersAPIApiRequestFactory, FoldersAPIApiResponseProcessor} from "../apis/FoldersAPIApi"; +import { ObservableFoldersApi } from "./ObservableAPI"; +import { FoldersApiRequestFactory, FoldersApiResponseProcessor} from "../apis/FoldersApi"; -export interface FoldersAPIApiCreateDocumentFolderRequest { +export interface FoldersApiCreateDocumentFolderRequest { /** * * @type DocumentsFolderCreateRequest - * @memberof FoldersAPIApicreateDocumentFolder + * @memberof FoldersApicreateDocumentFolder */ documentsFolderCreateRequest: DocumentsFolderCreateRequest } -export interface FoldersAPIApiCreateTemplateFolderRequest { +export interface FoldersApiCreateTemplateFolderRequest { /** * * @type TemplatesFolderCreateRequest - * @memberof FoldersAPIApicreateTemplateFolder + * @memberof FoldersApicreateTemplateFolder */ templatesFolderCreateRequest: TemplatesFolderCreateRequest } -export interface FoldersAPIApiListDocumentFoldersRequest { +export interface FoldersApiListDocumentFoldersRequest { /** * The UUID of the folder containing folders. To list the folders located in the root folder, remove this parameter in the request. + * Defaults to: undefined * @type string - * @memberof FoldersAPIApilistDocumentFolders + * @memberof FoldersApilistDocumentFolders */ parentUuid?: string /** - * Optionally, specify how many folders to return. Default is 50 folders, maximum is 100 folders. + * Optionally, specify how many folders to return. + * Minimum: 1 + * Maximum: 100 + * Defaults to: 50 * @type number - * @memberof FoldersAPIApilistDocumentFolders + * @memberof FoldersApilistDocumentFolders */ count?: number /** * Optionally, specify which page of the dataset to return. + * Minimum: 1 + * Defaults to: undefined * @type number - * @memberof FoldersAPIApilistDocumentFolders + * @memberof FoldersApilistDocumentFolders */ page?: number } -export interface FoldersAPIApiListTemplateFoldersRequest { +export interface FoldersApiListTemplateFoldersRequest { /** * The UUID of the folder containing folders. To list the folders located in the root folder, remove this parameter in the request. + * Defaults to: undefined * @type string - * @memberof FoldersAPIApilistTemplateFolders + * @memberof FoldersApilistTemplateFolders */ parentUuid?: string /** - * Optionally, specify how many folders to return. Default is 50 folders, maximum is 100 folders. + * Optionally, specify how many folders to return. + * Minimum: 1 + * Maximum: 100 + * Defaults to: 50 * @type number - * @memberof FoldersAPIApilistTemplateFolders + * @memberof FoldersApilistTemplateFolders */ count?: number /** * Optionally, specify which page of the dataset to return. + * Minimum: 1 + * Defaults to: undefined * @type number - * @memberof FoldersAPIApilistTemplateFolders + * @memberof FoldersApilistTemplateFolders */ page?: number } -export interface FoldersAPIApiRenameDocumentFolderRequest { +export interface FoldersApiRenameDocumentFolderRequest { /** * The UUID of the folder that you are renaming. + * Defaults to: undefined * @type string - * @memberof FoldersAPIApirenameDocumentFolder + * @memberof FoldersApirenameDocumentFolder */ id: string /** * * @type DocumentsFolderRenameRequest - * @memberof FoldersAPIApirenameDocumentFolder + * @memberof FoldersApirenameDocumentFolder */ documentsFolderRenameRequest: DocumentsFolderRenameRequest } -export interface FoldersAPIApiRenameTemplateFolderRequest { +export interface FoldersApiRenameTemplateFolderRequest { /** * The UUID of the folder which you are renaming. + * Defaults to: undefined * @type string - * @memberof FoldersAPIApirenameTemplateFolder + * @memberof FoldersApirenameTemplateFolder */ id: string /** * * @type TemplatesFolderRenameRequest - * @memberof FoldersAPIApirenameTemplateFolder + * @memberof FoldersApirenameTemplateFolder */ templatesFolderRenameRequest: TemplatesFolderRenameRequest } -export class ObjectFoldersAPIApi { - private api: ObservableFoldersAPIApi +export class ObjectFoldersApi { + private api: ObservableFoldersApi - public constructor(configuration: Configuration, requestFactory?: FoldersAPIApiRequestFactory, responseProcessor?: FoldersAPIApiResponseProcessor) { - this.api = new ObservableFoldersAPIApi(configuration, requestFactory, responseProcessor); + public constructor(configuration: Configuration, requestFactory?: FoldersApiRequestFactory, responseProcessor?: FoldersApiResponseProcessor) { + this.api = new ObservableFoldersApi(configuration, requestFactory, responseProcessor); } /** - * Create a new folder to store your documents. + * Create a new folder to store your documents. For the full list of folder operations and their limitations, see [Organize Documents and Folders](https://developers.pandadoc.com/docs/organize-folders). * Create Documents Folder * @param param the request object */ - public createDocumentFolder(param: FoldersAPIApiCreateDocumentFolderRequest, options?: Configuration): Promise { + public createDocumentFolderWithHttpInfo(param: FoldersApiCreateDocumentFolderRequest, options?: ConfigurationOptions): Promise> { + return this.api.createDocumentFolderWithHttpInfo(param.documentsFolderCreateRequest, options).toPromise(); + } + + /** + * Create a new folder to store your documents. For the full list of folder operations and their limitations, see [Organize Documents and Folders](https://developers.pandadoc.com/docs/organize-folders). + * Create Documents Folder + * @param param the request object + */ + public createDocumentFolder(param: FoldersApiCreateDocumentFolderRequest, options?: ConfigurationOptions): Promise { return this.api.createDocumentFolder(param.documentsFolderCreateRequest, options).toPromise(); } /** - * Create a new folder to store your templates. + * Create a new folder to store your templates. For the full list of folder operations and their limitations, see [Organize Templates and Folders](https://developers.pandadoc.com/docs/organize-folders). + * Create Templates Folder + * @param param the request object + */ + public createTemplateFolderWithHttpInfo(param: FoldersApiCreateTemplateFolderRequest, options?: ConfigurationOptions): Promise> { + return this.api.createTemplateFolderWithHttpInfo(param.templatesFolderCreateRequest, options).toPromise(); + } + + /** + * Create a new folder to store your templates. For the full list of folder operations and their limitations, see [Organize Templates and Folders](https://developers.pandadoc.com/docs/organize-folders). * Create Templates Folder * @param param the request object */ - public createTemplateFolder(param: FoldersAPIApiCreateTemplateFolderRequest, options?: Configuration): Promise { + public createTemplateFolder(param: FoldersApiCreateTemplateFolderRequest, options?: ConfigurationOptions): Promise { return this.api.createTemplateFolder(param.templatesFolderCreateRequest, options).toPromise(); } /** - * Get the list of folders that contain Documents in your account. + * Get the list of folders which contain Documents in your account. > 📘 > > The root folder is not listed in the response. For the full list of folder operations and their limitations, see [Organize Documents and Folders](https://developers.pandadoc.com/docs/organize-folders). + * List Documents Folders + * @param param the request object + */ + public listDocumentFoldersWithHttpInfo(param: FoldersApiListDocumentFoldersRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.listDocumentFoldersWithHttpInfo(param.parentUuid, param.count, param.page, options).toPromise(); + } + + /** + * Get the list of folders which contain Documents in your account. > 📘 > > The root folder is not listed in the response. For the full list of folder operations and their limitations, see [Organize Documents and Folders](https://developers.pandadoc.com/docs/organize-folders). * List Documents Folders * @param param the request object */ - public listDocumentFolders(param: FoldersAPIApiListDocumentFoldersRequest = {}, options?: Configuration): Promise { + public listDocumentFolders(param: FoldersApiListDocumentFoldersRequest = {}, options?: ConfigurationOptions): Promise { return this.api.listDocumentFolders(param.parentUuid, param.count, param.page, options).toPromise(); } /** - * Get the list of folders that contain Templates in your account. + * Get the list of folders that contain Templates in your account. > 📘 > > The root folder is not listed in the response. For the full list of folder operations and their limitations, see [Organize Templates and Folders](https://developers.pandadoc.com/docs/organize-folders). + * List Templates Folders + * @param param the request object + */ + public listTemplateFoldersWithHttpInfo(param: FoldersApiListTemplateFoldersRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.listTemplateFoldersWithHttpInfo(param.parentUuid, param.count, param.page, options).toPromise(); + } + + /** + * Get the list of folders that contain Templates in your account. > 📘 > > The root folder is not listed in the response. For the full list of folder operations and their limitations, see [Organize Templates and Folders](https://developers.pandadoc.com/docs/organize-folders). * List Templates Folders * @param param the request object */ - public listTemplateFolders(param: FoldersAPIApiListTemplateFoldersRequest = {}, options?: Configuration): Promise { + public listTemplateFolders(param: FoldersApiListTemplateFoldersRequest = {}, options?: ConfigurationOptions): Promise { return this.api.listTemplateFolders(param.parentUuid, param.count, param.page, options).toPromise(); } /** - * Rename Documents Folder. + * Rename Documents Folder. For the full list of folder operations and their limitations, see [Organize Documents and Folders](https://developers.pandadoc.com/docs/organize-folders). * Rename Documents Folder * @param param the request object */ - public renameDocumentFolder(param: FoldersAPIApiRenameDocumentFolderRequest, options?: Configuration): Promise { + public renameDocumentFolderWithHttpInfo(param: FoldersApiRenameDocumentFolderRequest, options?: ConfigurationOptions): Promise> { + return this.api.renameDocumentFolderWithHttpInfo(param.id, param.documentsFolderRenameRequest, options).toPromise(); + } + + /** + * Rename Documents Folder. For the full list of folder operations and their limitations, see [Organize Documents and Folders](https://developers.pandadoc.com/docs/organize-folders). + * Rename Documents Folder + * @param param the request object + */ + public renameDocumentFolder(param: FoldersApiRenameDocumentFolderRequest, options?: ConfigurationOptions): Promise { return this.api.renameDocumentFolder(param.id, param.documentsFolderRenameRequest, options).toPromise(); } /** - * Rename a templates folder. + * Rename a templates folder. For the full list of folder operations and their limitations, see [Organize Templates and Folders](https://developers.pandadoc.com/docs/organize-folders). + * Rename Templates Folder + * @param param the request object + */ + public renameTemplateFolderWithHttpInfo(param: FoldersApiRenameTemplateFolderRequest, options?: ConfigurationOptions): Promise> { + return this.api.renameTemplateFolderWithHttpInfo(param.id, param.templatesFolderRenameRequest, options).toPromise(); + } + + /** + * Rename a templates folder. For the full list of folder operations and their limitations, see [Organize Templates and Folders](https://developers.pandadoc.com/docs/organize-folders). * Rename Templates Folder * @param param the request object */ - public renameTemplateFolder(param: FoldersAPIApiRenameTemplateFolderRequest, options?: Configuration): Promise { + public renameTemplateFolder(param: FoldersApiRenameTemplateFolderRequest, options?: ConfigurationOptions): Promise { return this.api.renameTemplateFolder(param.id, param.templatesFolderRenameRequest, options).toPromise(); } } -import { ObservableFormsApi } from "./ObservableAPI"; -import { FormsApiRequestFactory, FormsApiResponseProcessor} from "../apis/FormsApi"; +import { ObservableFormsApi } from "./ObservableAPI"; +import { FormsApiRequestFactory, FormsApiResponseProcessor} from "../apis/FormsApi"; + +export interface FormsApiListFormRequest { + /** + * Specify how many forms to return. Default is 50 forms, maximum is 100 forms. + * Minimum: 1 + * Defaults to: undefined + * @type number + * @memberof FormsApilistForm + */ + count?: number + /** + * Specify which page of the dataset to return. + * Minimum: 1 + * Defaults to: undefined + * @type number + * @memberof FormsApilistForm + */ + page?: number + /** + * Specify which status of the forms dataset to return. + * Defaults to: undefined + * @type Array<'draft' | 'active' | 'disabled'> + * @memberof FormsApilistForm + */ + status?: Array<'draft' | 'active' | 'disabled'> + /** + * Specify the form dataset order to return. + * Defaults to: undefined + * @type 'name' | 'responses' | 'status' | 'created_date' | 'modified_date' + * @memberof FormsApilistForm + */ + orderBy?: 'name' | 'responses' | 'status' | 'created_date' | 'modified_date' + /** + * Specify sorting the result-set in ascending or descending order. + * Defaults to: undefined + * @type boolean + * @memberof FormsApilistForm + */ + asc?: boolean + /** + * Specify the form name. + * Defaults to: undefined + * @type string + * @memberof FormsApilistForm + */ + name?: string +} + +export class ObjectFormsApi { + private api: ObservableFormsApi + + public constructor(configuration: Configuration, requestFactory?: FormsApiRequestFactory, responseProcessor?: FormsApiResponseProcessor) { + this.api = new ObservableFormsApi(configuration, requestFactory, responseProcessor); + } + + /** + * Retrieve a paginated list of forms with optional filtering and sorting options. + * List Forms + * @param param the request object + */ + public listFormWithHttpInfo(param: FormsApiListFormRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.listFormWithHttpInfo(param.count, param.page, param.status, param.orderBy, param.asc, param.name, options).toPromise(); + } + + /** + * Retrieve a paginated list of forms with optional filtering and sorting options. + * List Forms + * @param param the request object + */ + public listForm(param: FormsApiListFormRequest = {}, options?: ConfigurationOptions): Promise { + return this.api.listForm(param.count, param.page, param.status, param.orderBy, param.asc, param.name, options).toPromise(); + } + +} + +import { ObservableMembersApi } from "./ObservableAPI"; +import { MembersApiRequestFactory, MembersApiResponseProcessor} from "../apis/MembersApi"; + +export interface MembersApiCreateMemberTokenRequest { + /** + * Member id. + * Defaults to: undefined + * @type string + * @memberof MembersApicreateMemberToken + */ + memberId: string + /** + * + * @type CreateMemberTokenRequest + * @memberof MembersApicreateMemberToken + */ + createMemberTokenRequest?: CreateMemberTokenRequest +} + +export interface MembersApiDetailsCurrentMemberRequest { +} + +export interface MembersApiDetailsMemberRequest { + /** + * Membership id. + * Defaults to: undefined + * @type string + * @memberof MembersApidetailsMember + */ + id: string +} + +export interface MembersApiListMembersRequest { +} + +export class ObjectMembersApi { + private api: ObservableMembersApi + + public constructor(configuration: Configuration, requestFactory?: MembersApiRequestFactory, responseProcessor?: MembersApiResponseProcessor) { + this.api = new ObservableMembersApi(configuration, requestFactory, responseProcessor); + } + + /** + * > 🚧 > > This endpoint is only exposed upon request. Please reach out to your Account Manager to get access. > 📘 > > Make sure you\'re using Public API keys generated by Org Admin, otherwise you\'ll receive a 403 response. + * Create Member Token + * @param param the request object + */ + public createMemberTokenWithHttpInfo(param: MembersApiCreateMemberTokenRequest, options?: ConfigurationOptions): Promise> { + return this.api.createMemberTokenWithHttpInfo(param.memberId, param.createMemberTokenRequest, options).toPromise(); + } + + /** + * > 🚧 > > This endpoint is only exposed upon request. Please reach out to your Account Manager to get access. > 📘 > > Make sure you\'re using Public API keys generated by Org Admin, otherwise you\'ll receive a 403 response. + * Create Member Token + * @param param the request object + */ + public createMemberToken(param: MembersApiCreateMemberTokenRequest, options?: ConfigurationOptions): Promise { + return this.api.createMemberToken(param.memberId, param.createMemberTokenRequest, options).toPromise(); + } + + /** + * Returns the member details of the current user (the owner of the API key). **User** - is an account with a license in the Organization. **Member** - is a User with a predefined Role in the Workspace. | Parameter | Description | |---|---| | `user_id` | A unique identifier of the `user` in the **organization** | | `membership_id` | A unique identifier of the `user` in the **workspace** | | `email` | A user email address | | `first_name` | A user\'s first name | | `last_name` | A user\'s last name | | `is_active` | A boolean value that identifies if a member is active and not blocked | | `workspace` | A unique identifier of the user\'s current active workspace | | `workspace_name` | A name of the user\'s current active workspace | | `email_verified` | A boolean value that identifies if the email is verified | | `role` | A member\'s role in the workspace | | `user_license` | A user license in the organization: 
`Full (Standard)`; 
`Read-only`; 
`eSignature`; 
`Guest`; 
`Creator` | | `date_created` | A date when a member was added to the workspace | | `date_modified` | Last modified date of a member | + * Current Member Details + * @param param the request object + */ + public detailsCurrentMemberWithHttpInfo(param: MembersApiDetailsCurrentMemberRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.detailsCurrentMemberWithHttpInfo( options).toPromise(); + } + + /** + * Returns the member details of the current user (the owner of the API key). **User** - is an account with a license in the Organization. **Member** - is a User with a predefined Role in the Workspace. | Parameter | Description | |---|---| | `user_id` | A unique identifier of the `user` in the **organization** | | `membership_id` | A unique identifier of the `user` in the **workspace** | | `email` | A user email address | | `first_name` | A user\'s first name | | `last_name` | A user\'s last name | | `is_active` | A boolean value that identifies if a member is active and not blocked | | `workspace` | A unique identifier of the user\'s current active workspace | | `workspace_name` | A name of the user\'s current active workspace | | `email_verified` | A boolean value that identifies if the email is verified | | `role` | A member\'s role in the workspace | | `user_license` | A user license in the organization: 
`Full (Standard)`; 
`Read-only`; 
`eSignature`; 
`Guest`; 
`Creator` | | `date_created` | A date when a member was added to the workspace | | `date_modified` | Last modified date of a member | + * Current Member Details + * @param param the request object + */ + public detailsCurrentMember(param: MembersApiDetailsCurrentMemberRequest = {}, options?: ConfigurationOptions): Promise { + return this.api.detailsCurrentMember( options).toPromise(); + } + + /** + * A method to retrieve a member\'s details by ID. **User** - is an account with a license in the Organization. **Member** - is a User with a predefined Role in the Workspace. | Parameter | Description | |---|---| | `user_id` | A unique identifier of the `user` in the **organization** | | `membership_id` | A unique identifier of the `user` in the **workspace** | | `email` | A user email address | | `first_name` | A user\'s first name | | `last_name` | A user\'s last name | | `is_active` | A boolean value that identifies if a member is active and not blocked | | `workspace` | A unique identifier of the user\'s current active workspace | | `workspace_name` | A name of the user\'s current active workspace | | `email_verified` | A boolean value that identifies if the email is verified | | `role` | A member\'s role in the workspace | | `user_license` | A user license in the organization: 
`Full (Standard)`; 
`Read-only`; 
`eSignature`; 
`Guest`; 
`Creator` | | `date_created` | A date when a member was added to the workspace | | `date_modified` | Last modified date of a member | + * Member Details + * @param param the request object + */ + public detailsMemberWithHttpInfo(param: MembersApiDetailsMemberRequest, options?: ConfigurationOptions): Promise> { + return this.api.detailsMemberWithHttpInfo(param.id, options).toPromise(); + } + + /** + * A method to retrieve a member\'s details by ID. **User** - is an account with a license in the Organization. **Member** - is a User with a predefined Role in the Workspace. | Parameter | Description | |---|---| | `user_id` | A unique identifier of the `user` in the **organization** | | `membership_id` | A unique identifier of the `user` in the **workspace** | | `email` | A user email address | | `first_name` | A user\'s first name | | `last_name` | A user\'s last name | | `is_active` | A boolean value that identifies if a member is active and not blocked | | `workspace` | A unique identifier of the user\'s current active workspace | | `workspace_name` | A name of the user\'s current active workspace | | `email_verified` | A boolean value that identifies if the email is verified | | `role` | A member\'s role in the workspace | | `user_license` | A user license in the organization: 
`Full (Standard)`; 
`Read-only`; 
`eSignature`; 
`Guest`; 
`Creator` | | `date_created` | A date when a member was added to the workspace | | `date_modified` | Last modified date of a member | + * Member Details + * @param param the request object + */ + public detailsMember(param: MembersApiDetailsMemberRequest, options?: ConfigurationOptions): Promise { + return this.api.detailsMember(param.id, options).toPromise(); + } + + /** + * Retrieve all members details of the workspace implied by the OAuth token or API key.\\ For each member, the `workspace` parameter shows their active workspace, that is the workspace they are currently working in.\\ This means the `workspace` value can differ from the workspace implied by your API key. + * List Members + * @param param the request object + */ + public listMembersWithHttpInfo(param: MembersApiListMembersRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.listMembersWithHttpInfo( options).toPromise(); + } + + /** + * Retrieve all members details of the workspace implied by the OAuth token or API key.\\ For each member, the `workspace` parameter shows their active workspace, that is the workspace they are currently working in.\\ This means the `workspace` value can differ from the workspace implied by your API key. + * List Members + * @param param the request object + */ + public listMembers(param: MembersApiListMembersRequest = {}, options?: ConfigurationOptions): Promise { + return this.api.listMembers( options).toPromise(); + } + +} + +import { ObservableNotaryApi } from "./ObservableAPI"; +import { NotaryApiRequestFactory, NotaryApiResponseProcessor} from "../apis/NotaryApi"; + +export interface NotaryApiCreateNotarizationRequestRequest { + /** + * + * @type CreateNotarizationRequest + * @memberof NotaryApicreateNotarizationRequest + */ + createNotarizationRequest: CreateNotarizationRequest +} + +export interface NotaryApiDeleteNotarizationRequestRequest { + /** + * Notarization Request ID. + * Defaults to: undefined + * @type string + * @memberof NotaryApideleteNotarizationRequest + */ + sessionRequestId: string +} -export interface FormsApiListFormRequest { +export interface NotaryApiListNotariesRequest { /** - * Optionally, specify how many forms to return. Default is 50 forms, maximum is 100 forms. - * @type number - * @memberof FormsApilistForm + * Filter by status (comma-separated values supported). Valid values are INVITED, UNDER_REVIEW, ACTIVE, REJECTED, INACTIVE + * Defaults to: undefined + * @type Array<'INVITED' | 'UNDER_REVIEW' | 'ACTIVE' | 'REJECTED' | 'INACTIVE'> + * @memberof NotaryApilistNotaries */ - count?: number + status?: Array<'INVITED' | 'UNDER_REVIEW' | 'ACTIVE' | 'REJECTED' | 'INACTIVE'> /** - * Optionally, specify which page of the dataset to return. - * @type number - * @memberof FormsApilistForm + * Filter by commission state (comma-separated values supported) + * Defaults to: undefined + * @type Array<string> + * @memberof NotaryApilistNotaries */ - page?: number + commissionState?: Array /** - * Optionally, specify which status of the forms dataset to return. - * @type Array<'draft' | 'active' | 'disabled'> - * @memberof FormsApilistForm + * Number of results to skip + * Defaults to: 0 + * @type number + * @memberof NotaryApilistNotaries */ - status?: Array<'draft' | 'active' | 'disabled'> + offset?: number /** - * Optionally, specify the form dataset order to return. - * @type 'name' | 'responses' | 'status' | 'created_date' | 'modified_date' - * @memberof FormsApilistForm + * Maximum number of results to return + * Maximum: 100 + * Defaults to: 50 + * @type number + * @memberof NotaryApilistNotaries */ - orderBy?: 'name' | 'responses' | 'status' | 'created_date' | 'modified_date' + limit?: number /** - * Optionally, specify sorting the result-set in ascending or descending order. - * @type boolean - * @memberof FormsApilistForm + * Sort by name, email, or status (default is email). Use a - prefix for descending order (e.g., -email) + * Defaults to: 'email' + * @type 'email' | '-email' | 'status' | '-status' | 'name' | '-name' + * @memberof NotaryApilistNotaries */ - asc?: boolean + orderBy?: 'email' | '-email' | 'status' | '-status' | 'name' | '-name' +} + +export interface NotaryApiNotarizationRequestDetailsRequest { /** - * Specify the form name. + * Notarization Request ID. + * Defaults to: undefined * @type string - * @memberof FormsApilistForm + * @memberof NotaryApinotarizationRequestDetails */ - name?: string + sessionRequestId: string } -export class ObjectFormsApi { - private api: ObservableFormsApi +export class ObjectNotaryApi { + private api: ObservableNotaryApi - public constructor(configuration: Configuration, requestFactory?: FormsApiRequestFactory, responseProcessor?: FormsApiResponseProcessor) { - this.api = new ObservableFormsApi(configuration, requestFactory, responseProcessor); + public constructor(configuration: Configuration, requestFactory?: NotaryApiRequestFactory, responseProcessor?: NotaryApiResponseProcessor) { + this.api = new ObservableNotaryApi(configuration, requestFactory, responseProcessor); } /** - * List forms. - * Forms + * Create a notarization request to connect with a notary and complete online notarizations for your signers within minutes. > 🚧 **Important:** This endpoint supports only documents in draft status. ## Prerequisites > 🚧 Before you start > > Ensure the following before creating a notarization request: > > - Install the Notary On-Demand or Notary add-on > - Create a document for notarization and get its `document_id`. To create a document, use the [Create Document from Template](https://developers.pandadoc.com/reference/create-document-from-pandadoc-template) or [Create Document from File Upload](https://developers.pandadoc.com/reference/create-document-from-pdf) endpoint. ## Request Details For the notarization request, include in the request body: - `document_id` - At least one `invitees`, specifying their `email`, `first_name`, and `last_name` - Optionally, include a `message` for your signers - Optionally, using `disable_invitees_notifications` you can disable all notifications for invitees including email with invitation for notarization. This is useful when you are using alternative delivery methods. - If in-house notary must be assigned to this request, include the `notary` object with the notary\'s `id`, `scheduled_at` timestamp, and an optional `message` for the notary After the API call is executed, your signers will receive an email invitation for notarization. Alternatively, you can directly share the `notarization_link` with your signers, which is available in the 201 response body. Upon successful notarization, you will receive an email with a link to the notarized document. ## Usage Tips > 📘 Best Practices > > - Ensure that signers are added as both invitees in the request body and recipients in the document to avoid inconveniences during notary sessions > - Signers will receive an email with a notary link upon a successful API call; this link is also in the 201 response > - In case if notary is not specified in the request, signers will use the link to connect with commissioned online notaries, available Mon-Fri, 9 AM - 9 PM Central Time, typically responding within 2 minutes > - If notary is specified, signers will use the link to connect with your in-house notary at the scheduled time ## Limits A maximum of 100 API calls per minute is permitted. Exceeding this limit triggers a 429 Too Many Requests error. ## Troubleshooting **Solutions for 4xx Response Codes:** - **403 Forbidden (Inactive Add-on)**: Ensure the Notary On-Demand or Notary add-on is installed - **403 Forbidden (Transactions Limit)**: Purchase additional transactions either through the Notary UI or by contacting the Sales team - **429 Too Many Requests**: If you hit the limit, hold your API calls, then send them after waiting for the retry time > 📘 To learn more about PandaDoc Notary On-Demand, visit our [website](https://notary.pandadoc.com/notary-on-demand/). + * Create Notarization Request * @param param the request object */ - public listForm(param: FormsApiListFormRequest = {}, options?: Configuration): Promise { - return this.api.listForm(param.count, param.page, param.status, param.orderBy, param.asc, param.name, options).toPromise(); + public createNotarizationRequestWithHttpInfo(param: NotaryApiCreateNotarizationRequestRequest, options?: ConfigurationOptions): Promise> { + return this.api.createNotarizationRequestWithHttpInfo(param.createNotarizationRequest, options).toPromise(); } -} - -import { ObservableMembersApi } from "./ObservableAPI"; -import { MembersApiRequestFactory, MembersApiResponseProcessor} from "../apis/MembersApi"; - -export interface MembersApiDetailsCurrentMemberRequest { -} - -export interface MembersApiDetailsMemberRequest { /** - * Membership id - * @type string - * @memberof MembersApidetailsMember + * Create a notarization request to connect with a notary and complete online notarizations for your signers within minutes. > 🚧 **Important:** This endpoint supports only documents in draft status. ## Prerequisites > 🚧 Before you start > > Ensure the following before creating a notarization request: > > - Install the Notary On-Demand or Notary add-on > - Create a document for notarization and get its `document_id`. To create a document, use the [Create Document from Template](https://developers.pandadoc.com/reference/create-document-from-pandadoc-template) or [Create Document from File Upload](https://developers.pandadoc.com/reference/create-document-from-pdf) endpoint. ## Request Details For the notarization request, include in the request body: - `document_id` - At least one `invitees`, specifying their `email`, `first_name`, and `last_name` - Optionally, include a `message` for your signers - Optionally, using `disable_invitees_notifications` you can disable all notifications for invitees including email with invitation for notarization. This is useful when you are using alternative delivery methods. - If in-house notary must be assigned to this request, include the `notary` object with the notary\'s `id`, `scheduled_at` timestamp, and an optional `message` for the notary After the API call is executed, your signers will receive an email invitation for notarization. Alternatively, you can directly share the `notarization_link` with your signers, which is available in the 201 response body. Upon successful notarization, you will receive an email with a link to the notarized document. ## Usage Tips > 📘 Best Practices > > - Ensure that signers are added as both invitees in the request body and recipients in the document to avoid inconveniences during notary sessions > - Signers will receive an email with a notary link upon a successful API call; this link is also in the 201 response > - In case if notary is not specified in the request, signers will use the link to connect with commissioned online notaries, available Mon-Fri, 9 AM - 9 PM Central Time, typically responding within 2 minutes > - If notary is specified, signers will use the link to connect with your in-house notary at the scheduled time ## Limits A maximum of 100 API calls per minute is permitted. Exceeding this limit triggers a 429 Too Many Requests error. ## Troubleshooting **Solutions for 4xx Response Codes:** - **403 Forbidden (Inactive Add-on)**: Ensure the Notary On-Demand or Notary add-on is installed - **403 Forbidden (Transactions Limit)**: Purchase additional transactions either through the Notary UI or by contacting the Sales team - **429 Too Many Requests**: If you hit the limit, hold your API calls, then send them after waiting for the retry time > 📘 To learn more about PandaDoc Notary On-Demand, visit our [website](https://notary.pandadoc.com/notary-on-demand/). + * Create Notarization Request + * @param param the request object */ - id: string -} + public createNotarizationRequest(param: NotaryApiCreateNotarizationRequestRequest, options?: ConfigurationOptions): Promise { + return this.api.createNotarizationRequest(param.createNotarizationRequest, options).toPromise(); + } -export interface MembersApiListMembersRequest { -} + /** + * Use this method to delete a notarization request. Once notarization request is deleted it cannot be restored. > 🚧 Notarization Request status > > You can only delete a notarization request in status \'SENT\', \'WAITING_FOR_NOTARY\' or \'INCOMPLETE\'. > If the notarization request is in any other status, the request will return a 400 Bad Request error. By default all invitees will receive email notification about deletion of the notarization request. If you want to disable this notification, you can use the `disable_invitees_notifications` parameter when creating request (see [Create Notarization Request](https://developers.pandadoc.com/reference/create-notarization-request)). + * Delete Notarization Request + * @param param the request object + */ + public deleteNotarizationRequestWithHttpInfo(param: NotaryApiDeleteNotarizationRequestRequest, options?: ConfigurationOptions): Promise> { + return this.api.deleteNotarizationRequestWithHttpInfo(param.sessionRequestId, options).toPromise(); + } -export class ObjectMembersApi { - private api: ObservableMembersApi + /** + * Use this method to delete a notarization request. Once notarization request is deleted it cannot be restored. > 🚧 Notarization Request status > > You can only delete a notarization request in status \'SENT\', \'WAITING_FOR_NOTARY\' or \'INCOMPLETE\'. > If the notarization request is in any other status, the request will return a 400 Bad Request error. By default all invitees will receive email notification about deletion of the notarization request. If you want to disable this notification, you can use the `disable_invitees_notifications` parameter when creating request (see [Create Notarization Request](https://developers.pandadoc.com/reference/create-notarization-request)). + * Delete Notarization Request + * @param param the request object + */ + public deleteNotarizationRequest(param: NotaryApiDeleteNotarizationRequestRequest, options?: ConfigurationOptions): Promise { + return this.api.deleteNotarizationRequest(param.sessionRequestId, options).toPromise(); + } - public constructor(configuration: Configuration, requestFactory?: MembersApiRequestFactory, responseProcessor?: MembersApiResponseProcessor) { - this.api = new ObservableMembersApi(configuration, requestFactory, responseProcessor); + /** + * Retrieve a list of notaries associated with your organization. ## Important Notes - At the moment, notaries can be added to organization only manually through the PandaDoc Notary UI. - Organization must have Notary addon enabled to use this endpoint + * List Notaries + * @param param the request object + */ + public listNotariesWithHttpInfo(param: NotaryApiListNotariesRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.listNotariesWithHttpInfo(param.status, param.commissionState, param.offset, param.limit, param.orderBy, options).toPromise(); } /** - * A method to define to whom credentials belong - * Current member details + * Retrieve a list of notaries associated with your organization. ## Important Notes - At the moment, notaries can be added to organization only manually through the PandaDoc Notary UI. - Organization must have Notary addon enabled to use this endpoint + * List Notaries * @param param the request object */ - public detailsCurrentMember(param: MembersApiDetailsCurrentMemberRequest = {}, options?: Configuration): Promise { - return this.api.detailsCurrentMember( options).toPromise(); + public listNotaries(param: NotaryApiListNotariesRequest = {}, options?: ConfigurationOptions): Promise { + return this.api.listNotaries(param.status, param.commissionState, param.offset, param.limit, param.orderBy, options).toPromise(); } /** - * A method to retrieve a member's details by id - * Member details + * Get details about a notarization request by its `id`. Details include: - Basic notarization request information (status, creator, invitees). - Signed documents information with links for downloading. - Notarization session recording information with link for downloading. - Timestamps associated with a notarization request. ## Available Notarization Request Statuses The following is a complete list of all possible notarization request statuses returned: | Notarization Request Status | Status Description | | :-------------------------- | :----------------------------------------------------------------------------------------------------------------- | | SENT | Notarization request has been created. Invitees are notified and can start the process of finding a notary. | | WAITING_FOR_NOTARY | One of the invitees initialised the process of finding a notary. | | ACCEPTED | Notarization request has been accepted by the notary. At this time nobody has joined the notarization session yet. | | LIVE | Notarization session has started. | | COMPLETED | Notarization session is finished. Documents have been successfully signed and ready for downloading. | | INCOMPLETE | Notarization session has started but was not completed successfully. | ## Signed documents Signed documents are the documents that were successfully signed during the notarization session. The signed document\'s info is available only if the notarization request has `COMPLETED` status, otherwise the returned list will be empty. In case you uploaded several documents for notarization then the `signed_documents` list will contain links for downloading for each document separately (with `SINGLE` document type) and link for the combined document (with `COMBINED` document type accordingly). ## Recording Recording is the video of the notarization session. The recording info is available only if the notarization request has `COMPLETED` status and recording is available, otherwise the returned object will be empty. > 📘 Links expire in 1 hour > > **Note**: The signed document and recording links expire in 1 hour. After this time it will be not possible to download files using the returned urls. In this case you need to call endpoint again since each request generates a new link. ## Limits A maximum of 100 API calls per minute is permitted. Exceeding this limit triggers a 429 Too Many Requests error. + * Notarization Request Details * @param param the request object */ - public detailsMember(param: MembersApiDetailsMemberRequest, options?: Configuration): Promise { - return this.api.detailsMember(param.id, options).toPromise(); + public notarizationRequestDetailsWithHttpInfo(param: NotaryApiNotarizationRequestDetailsRequest, options?: ConfigurationOptions): Promise> { + return this.api.notarizationRequestDetailsWithHttpInfo(param.sessionRequestId, options).toPromise(); } /** - * Retrieve all members details of the workspace - * List members + * Get details about a notarization request by its `id`. Details include: - Basic notarization request information (status, creator, invitees). - Signed documents information with links for downloading. - Notarization session recording information with link for downloading. - Timestamps associated with a notarization request. ## Available Notarization Request Statuses The following is a complete list of all possible notarization request statuses returned: | Notarization Request Status | Status Description | | :-------------------------- | :----------------------------------------------------------------------------------------------------------------- | | SENT | Notarization request has been created. Invitees are notified and can start the process of finding a notary. | | WAITING_FOR_NOTARY | One of the invitees initialised the process of finding a notary. | | ACCEPTED | Notarization request has been accepted by the notary. At this time nobody has joined the notarization session yet. | | LIVE | Notarization session has started. | | COMPLETED | Notarization session is finished. Documents have been successfully signed and ready for downloading. | | INCOMPLETE | Notarization session has started but was not completed successfully. | ## Signed documents Signed documents are the documents that were successfully signed during the notarization session. The signed document\'s info is available only if the notarization request has `COMPLETED` status, otherwise the returned list will be empty. In case you uploaded several documents for notarization then the `signed_documents` list will contain links for downloading for each document separately (with `SINGLE` document type) and link for the combined document (with `COMBINED` document type accordingly). ## Recording Recording is the video of the notarization session. The recording info is available only if the notarization request has `COMPLETED` status and recording is available, otherwise the returned object will be empty. > 📘 Links expire in 1 hour > > **Note**: The signed document and recording links expire in 1 hour. After this time it will be not possible to download files using the returned urls. In this case you need to call endpoint again since each request generates a new link. ## Limits A maximum of 100 API calls per minute is permitted. Exceeding this limit triggers a 429 Too Many Requests error. + * Notarization Request Details * @param param the request object */ - public listMembers(param: MembersApiListMembersRequest = {}, options?: Configuration): Promise { - return this.api.listMembers( options).toPromise(); + public notarizationRequestDetails(param: NotaryApiNotarizationRequestDetailsRequest, options?: ConfigurationOptions): Promise { + return this.api.notarizationRequestDetails(param.sessionRequestId, options).toPromise(); } } @@ -1481,36 +3508,42 @@ import { OAuth20AuthenticationApiRequestFactory, OAuth20AuthenticationApiRespons export interface OAuth20AuthenticationApiAccessTokenRequest { /** * This value must be set to `refresh_token`. + * Defaults to: 'refresh_token' * @type string * @memberof OAuth20AuthenticationApiaccessToken */ grantType?: string /** * Client ID that is automatically generated after application creation in the Developer Dashboard. + * Defaults to: undefined * @type string * @memberof OAuth20AuthenticationApiaccessToken */ clientId?: string /** * Client secret that is automatically generated after application creation in the Developer Dashboard. + * Defaults to: undefined * @type string * @memberof OAuth20AuthenticationApiaccessToken */ clientSecret?: string /** * `auth_code` from the server on the previous step (Authorize a PandaDoc User). + * Defaults to: undefined * @type string * @memberof OAuth20AuthenticationApiaccessToken */ code?: string /** * Requested permissions. Use `read+write` as our default value to send documents. + * Defaults to: undefined * @type string * @memberof OAuth20AuthenticationApiaccessToken */ scope?: string /** * `refresh_token` you received and stored from the server when initially creating an `access_token`. + * Defaults to: undefined * @type string * @memberof OAuth20AuthenticationApiaccessToken */ @@ -1525,27 +3558,252 @@ export class ObjectOAuth20AuthenticationApi { } /** + * Create or refresh an access token to make requests on behalf of a user. This endpoint is used to obtain an `access_token` and `refresh_token` for the first time, and to refresh the `access_token` when it expires. This endpoint is part of OAuth 2.0 implementation. You need to configure OAuth App to obtain `client_id` and `client_secret`. Read more about [OAuth 2.0 implementation](https://developers.pandadoc.com/reference/authentication-process). Make sure you\'re sending the header `Content-Type: application/x-www-form-urlencoded`. ## Create Access Token As a result of the OAuth 2.0 user authentication process, you should get a `code` that can be exchanged for an `access_token`. Use this endpoint to do this exchange, and to refresh the token later. > 🚧 Invalid Grant? > > If you receive an `invalid grant` response it is likely because you used the same `code` more than once from the [Authorize a PandaDoc User](ref:authorize-a-user) step above. The `code` parameter is generated for one-time use. A new `code` value must be generated if you wish to change API users, permissions, or simply generate a new `code` value for the same PandaDoc user. > 📘 expires_in > > `expires_in` is based in seconds. Currently, a token expires in 31535999 seconds = 1 year. ## Refresh Access Token Eventually, `access_token` expires and accessing an API method returns **401 unauthorized**. Your application needs to refresh the OAuth2 token with the stored `refresh_token` returned when initially creating an access token. Once refreshed, calls on behalf of the originally authorized user can resume immediately. Use the newly returned `access_token` for all future API requests. > 🚧 Invalid Grant? > > If you receive an `invalid grant` response, it is likely because your `refresh_token` is invalid. * Create/Refresh Access Token * @param param the request object */ - public accessToken(param: OAuth20AuthenticationApiAccessTokenRequest = {}, options?: Configuration): Promise { + public accessTokenWithHttpInfo(param: OAuth20AuthenticationApiAccessTokenRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.accessTokenWithHttpInfo(param.grantType, param.clientId, param.clientSecret, param.code, param.scope, param.refreshToken, options).toPromise(); + } + + /** + * Create or refresh an access token to make requests on behalf of a user. This endpoint is used to obtain an `access_token` and `refresh_token` for the first time, and to refresh the `access_token` when it expires. This endpoint is part of OAuth 2.0 implementation. You need to configure OAuth App to obtain `client_id` and `client_secret`. Read more about [OAuth 2.0 implementation](https://developers.pandadoc.com/reference/authentication-process). Make sure you\'re sending the header `Content-Type: application/x-www-form-urlencoded`. ## Create Access Token As a result of the OAuth 2.0 user authentication process, you should get a `code` that can be exchanged for an `access_token`. Use this endpoint to do this exchange, and to refresh the token later. > 🚧 Invalid Grant? > > If you receive an `invalid grant` response it is likely because you used the same `code` more than once from the [Authorize a PandaDoc User](ref:authorize-a-user) step above. The `code` parameter is generated for one-time use. A new `code` value must be generated if you wish to change API users, permissions, or simply generate a new `code` value for the same PandaDoc user. > 📘 expires_in > > `expires_in` is based in seconds. Currently, a token expires in 31535999 seconds = 1 year. ## Refresh Access Token Eventually, `access_token` expires and accessing an API method returns **401 unauthorized**. Your application needs to refresh the OAuth2 token with the stored `refresh_token` returned when initially creating an access token. Once refreshed, calls on behalf of the originally authorized user can resume immediately. Use the newly returned `access_token` for all future API requests. > 🚧 Invalid Grant? > > If you receive an `invalid grant` response, it is likely because your `refresh_token` is invalid. + * Create/Refresh Access Token + * @param param the request object + */ + public accessToken(param: OAuth20AuthenticationApiAccessTokenRequest = {}, options?: ConfigurationOptions): Promise { return this.api.accessToken(param.grantType, param.clientId, param.clientSecret, param.code, param.scope, param.refreshToken, options).toPromise(); } } +import { ObservableProductCatalogApi } from "./ObservableAPI"; +import { ProductCatalogApiRequestFactory, ProductCatalogApiResponseProcessor} from "../apis/ProductCatalogApi"; + +export interface ProductCatalogApiCreateCatalogItemRequest { + /** + * + * @type ProductCatalogItemRequest + * @memberof ProductCatalogApicreateCatalogItem + */ + productCatalogItemRequest: ProductCatalogItemRequest +} + +export interface ProductCatalogApiDeleteCatalogItemRequest { + /** + * Catalog item UUID + * Defaults to: undefined + * @type string + * @memberof ProductCatalogApideleteCatalogItem + */ + itemUuid: string +} + +export interface ProductCatalogApiGetCatalogItemRequest { + /** + * Catalog item UUID + * Defaults to: undefined + * @type string + * @memberof ProductCatalogApigetCatalogItem + */ + itemUuid: string +} + +export interface ProductCatalogApiSearchCatalogItemsRequest { + /** + * Page number. + * Defaults to: undefined + * @type number + * @memberof ProductCatalogApisearchCatalogItems + */ + page?: number + /** + * Items per page. + * Defaults to: undefined + * @type number + * @memberof ProductCatalogApisearchCatalogItems + */ + perPage?: number + /** + * Search query. Searches the following fields: Title, SKU, description, category name, custom fields name and value. + * Defaults to: undefined + * @type string + * @memberof ProductCatalogApisearchCatalogItems + */ + query?: string + /** + * Ordering principle for displaying search results. + * Defaults to: undefined + * @type 'sku' | '-sku' | 'title' | '-title' | 'price' | '-price' | 'date_modified' | '-date_modified' + * @memberof ProductCatalogApisearchCatalogItems + */ + orderBy?: 'sku' | '-sku' | 'title' | '-title' | 'price' | '-price' | 'date_modified' | '-date_modified' + /** + * Filter by catalog item types. + * Defaults to: undefined + * @type Array<ProductCatalogTypeEnum> + * @memberof ProductCatalogApisearchCatalogItems + */ + types?: Array + /** + * Filter by billing types. + * Defaults to: undefined + * @type Array<'one_time' | 'recurring'> + * @memberof ProductCatalogApisearchCatalogItems + */ + billingTypes?: Array<'one_time' | 'recurring'> + /** + * A list of item uuids to be excluded from search. + * Defaults to: undefined + * @type Array<string> + * @memberof ProductCatalogApisearchCatalogItems + */ + excludeUuids?: Array + /** + * Category id. + * Defaults to: undefined + * @type string + * @memberof ProductCatalogApisearchCatalogItems + */ + categoryId?: string + /** + * + * Defaults to: undefined + * @type boolean + * @memberof ProductCatalogApisearchCatalogItems + */ + noCategory?: boolean +} + +export interface ProductCatalogApiUpdateCatalogItemRequest { + /** + * Catalog item UUID + * Defaults to: undefined + * @type string + * @memberof ProductCatalogApiupdateCatalogItem + */ + itemUuid: string + /** + * + * @type ProductCatalogItemPatchRequest + * @memberof ProductCatalogApiupdateCatalogItem + */ + productCatalogItemPatchRequest: ProductCatalogItemPatchRequest +} + +export class ObjectProductCatalogApi { + private api: ObservableProductCatalogApi + + public constructor(configuration: Configuration, requestFactory?: ProductCatalogApiRequestFactory, responseProcessor?: ProductCatalogApiResponseProcessor) { + this.api = new ObservableProductCatalogApi(configuration, requestFactory, responseProcessor); + } + + /** + * Create a new catalog item. + * Create Catalog Item + * @param param the request object + */ + public createCatalogItemWithHttpInfo(param: ProductCatalogApiCreateCatalogItemRequest, options?: ConfigurationOptions): Promise> { + return this.api.createCatalogItemWithHttpInfo(param.productCatalogItemRequest, options).toPromise(); + } + + /** + * Create a new catalog item. + * Create Catalog Item + * @param param the request object + */ + public createCatalogItem(param: ProductCatalogApiCreateCatalogItemRequest, options?: ConfigurationOptions): Promise { + return this.api.createCatalogItem(param.productCatalogItemRequest, options).toPromise(); + } + + /** + * Delete catalog item. + * Delete Catalog Item + * @param param the request object + */ + public deleteCatalogItemWithHttpInfo(param: ProductCatalogApiDeleteCatalogItemRequest, options?: ConfigurationOptions): Promise> { + return this.api.deleteCatalogItemWithHttpInfo(param.itemUuid, options).toPromise(); + } + + /** + * Delete catalog item. + * Delete Catalog Item + * @param param the request object + */ + public deleteCatalogItem(param: ProductCatalogApiDeleteCatalogItemRequest, options?: ConfigurationOptions): Promise { + return this.api.deleteCatalogItem(param.itemUuid, options).toPromise(); + } + + /** + * Get catalog item. + * Catalog Item Details + * @param param the request object + */ + public getCatalogItemWithHttpInfo(param: ProductCatalogApiGetCatalogItemRequest, options?: ConfigurationOptions): Promise> { + return this.api.getCatalogItemWithHttpInfo(param.itemUuid, options).toPromise(); + } + + /** + * Get catalog item. + * Catalog Item Details + * @param param the request object + */ + public getCatalogItem(param: ProductCatalogApiGetCatalogItemRequest, options?: ConfigurationOptions): Promise { + return this.api.getCatalogItem(param.itemUuid, options).toPromise(); + } + + /** + * This method searches for items in your [product catalog](https://support.pandadoc.com/en/articles/9714691-product-catalog). Use the `query` parameter to search in title, SKU, description, category name, custom fields name and value. You can also search for items by their type, billing type, and category id. Order search results, in both ascending and descending order, by these item properties: - SKU - Name - Price - Modification date Use the `exclude_uuids` parameter to exclude particular uuids from the search request. + * List Catalog Items Search + * @param param the request object + */ + public searchCatalogItemsWithHttpInfo(param: ProductCatalogApiSearchCatalogItemsRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.searchCatalogItemsWithHttpInfo(param.page, param.perPage, param.query, param.orderBy, param.types, param.billingTypes, param.excludeUuids, param.categoryId, param.noCategory, options).toPromise(); + } + + /** + * This method searches for items in your [product catalog](https://support.pandadoc.com/en/articles/9714691-product-catalog). Use the `query` parameter to search in title, SKU, description, category name, custom fields name and value. You can also search for items by their type, billing type, and category id. Order search results, in both ascending and descending order, by these item properties: - SKU - Name - Price - Modification date Use the `exclude_uuids` parameter to exclude particular uuids from the search request. + * List Catalog Items Search + * @param param the request object + */ + public searchCatalogItems(param: ProductCatalogApiSearchCatalogItemsRequest = {}, options?: ConfigurationOptions): Promise { + return this.api.searchCatalogItems(param.page, param.perPage, param.query, param.orderBy, param.types, param.billingTypes, param.excludeUuids, param.categoryId, param.noCategory, options).toPromise(); + } + + /** + * Update catalog item. + * Update Catalog Item + * @param param the request object + */ + public updateCatalogItemWithHttpInfo(param: ProductCatalogApiUpdateCatalogItemRequest, options?: ConfigurationOptions): Promise> { + return this.api.updateCatalogItemWithHttpInfo(param.itemUuid, param.productCatalogItemPatchRequest, options).toPromise(); + } + + /** + * Update catalog item. + * Update Catalog Item + * @param param the request object + */ + public updateCatalogItem(param: ProductCatalogApiUpdateCatalogItemRequest, options?: ConfigurationOptions): Promise { + return this.api.updateCatalogItem(param.itemUuid, param.productCatalogItemPatchRequest, options).toPromise(); + } + +} + import { ObservableQuotesApi } from "./ObservableAPI"; import { QuotesApiRequestFactory, QuotesApiResponseProcessor} from "../apis/QuotesApi"; export interface QuotesApiQuoteUpdateRequest { /** * Document ID + * Defaults to: undefined * @type string * @memberof QuotesApiquoteUpdate */ documentId: string /** * Quote ID + * Defaults to: undefined * @type string * @memberof QuotesApiquoteUpdate */ @@ -1566,125 +3824,162 @@ export class ObjectQuotesApi { } /** + * This operation updates the details of a specific quote within a document by specifying the document ID and quote ID. + * Quote update + * @param param the request object + */ + public quoteUpdateWithHttpInfo(param: QuotesApiQuoteUpdateRequest, options?: ConfigurationOptions): Promise> { + return this.api.quoteUpdateWithHttpInfo(param.documentId, param.quoteId, param.quoteUpdateRequest, options).toPromise(); + } + + /** + * This operation updates the details of a specific quote within a document by specifying the document ID and quote ID. * Quote update * @param param the request object */ - public quoteUpdate(param: QuotesApiQuoteUpdateRequest, options?: Configuration): Promise { + public quoteUpdate(param: QuotesApiQuoteUpdateRequest, options?: ConfigurationOptions): Promise { return this.api.quoteUpdate(param.documentId, param.quoteId, param.quoteUpdateRequest, options).toPromise(); } } -import { ObservableSectionsApi } from "./ObservableAPI"; -import { SectionsApiRequestFactory, SectionsApiResponseProcessor} from "../apis/SectionsApi"; +import { ObservableTemplateSettingsApi } from "./ObservableAPI"; +import { TemplateSettingsApiRequestFactory, TemplateSettingsApiResponseProcessor} from "../apis/TemplateSettingsApi"; -export interface SectionsApiListSectionsRequest { +export interface TemplateSettingsApiTemplateSettingsGetRequest { /** - * Document ID + * Unique identifier of the template to retrieve settings for. + * Defaults to: undefined * @type string - * @memberof SectionsApilistSections + * @memberof TemplateSettingsApitemplateSettingsGet */ - documentId: string + templateId: string } -export interface SectionsApiSectionDetailsRequest { +export interface TemplateSettingsApiTemplateSettingsUpdateRequest { /** - * Document ID + * Unique identifier of the template to update settings for. + * Defaults to: undefined * @type string - * @memberof SectionsApisectionDetails + * @memberof TemplateSettingsApitemplateSettingsUpdate */ - documentId: string + templateId: string /** - * Upload ID - * @type string - * @memberof SectionsApisectionDetails + * + * @type UpdateTemplateSettingsRequest + * @memberof TemplateSettingsApitemplateSettingsUpdate */ - uploadId: string + updateTemplateSettingsRequest: UpdateTemplateSettingsRequest } -export interface SectionsApiSectionInfoRequest { - /** - * Document ID - * @type string - * @memberof SectionsApisectionInfo - */ - documentId: string - /** - * Section ID - * @type string - * @memberof SectionsApisectionInfo - */ - sectionId: string -} +export class ObjectTemplateSettingsApi { + private api: ObservableTemplateSettingsApi + + public constructor(configuration: Configuration, requestFactory?: TemplateSettingsApiRequestFactory, responseProcessor?: TemplateSettingsApiResponseProcessor) { + this.api = new ObservableTemplateSettingsApi(configuration, requestFactory, responseProcessor); + } -export interface SectionsApiUploadSectionRequest { - /** - * Document ID - * @type string - * @memberof SectionsApiuploadSection - */ - documentId: string - /** - * Use a PandaDoc template or an existing PDF to upload a section. See the creation request examples [by template](/schemas/UploadSectionByTemplateRequest) and [by pdf](/schemas/UploadSectionByPdfRequest) - * @type UploadSectionRequest - * @memberof SectionsApiuploadSection - */ - uploadSectionRequest: UploadSectionRequest /** - * Determines how the fields are mapped when creating a section. * document: Default value. The fields of the entire document are updated. * upload: Only the fields from the created section are updated. The merge field is appended with the upload ID. - * @type 'document' | 'upload' - * @memberof SectionsApiuploadSection + * Retrieves the settings for a specified template. Only the language field is currently supported. + * Get template settings + * @param param the request object */ - mergeFieldScope?: 'document' | 'upload' -} - -export class ObjectSectionsApi { - private api: ObservableSectionsApi - - public constructor(configuration: Configuration, requestFactory?: SectionsApiRequestFactory, responseProcessor?: SectionsApiResponseProcessor) { - this.api = new ObservableSectionsApi(configuration, requestFactory, responseProcessor); + public templateSettingsGetWithHttpInfo(param: TemplateSettingsApiTemplateSettingsGetRequest, options?: ConfigurationOptions): Promise> { + return this.api.templateSettingsGetWithHttpInfo(param.templateId, options).toPromise(); } /** - * List sections + * Retrieves the settings for a specified template. Only the language field is currently supported. + * Get template settings * @param param the request object */ - public listSections(param: SectionsApiListSectionsRequest, options?: Configuration): Promise { - return this.api.listSections(param.documentId, options).toPromise(); + public templateSettingsGet(param: TemplateSettingsApiTemplateSettingsGetRequest, options?: ConfigurationOptions): Promise { + return this.api.templateSettingsGet(param.templateId, options).toPromise(); } /** - * Section details + * Updates the settings for a specified template. Only the language field is currently supported. + * Update template settings * @param param the request object */ - public sectionDetails(param: SectionsApiSectionDetailsRequest, options?: Configuration): Promise { - return this.api.sectionDetails(param.documentId, param.uploadId, options).toPromise(); + public templateSettingsUpdateWithHttpInfo(param: TemplateSettingsApiTemplateSettingsUpdateRequest, options?: ConfigurationOptions): Promise> { + return this.api.templateSettingsUpdateWithHttpInfo(param.templateId, param.updateTemplateSettingsRequest, options).toPromise(); } /** - * Section Info + * Updates the settings for a specified template. Only the language field is currently supported. + * Update template settings * @param param the request object */ - public sectionInfo(param: SectionsApiSectionInfoRequest, options?: Configuration): Promise { - return this.api.sectionInfo(param.documentId, param.sectionId, options).toPromise(); + public templateSettingsUpdate(param: TemplateSettingsApiTemplateSettingsUpdateRequest, options?: ConfigurationOptions): Promise { + return this.api.templateSettingsUpdate(param.templateId, param.updateTemplateSettingsRequest, options).toPromise(); } +} + +import { ObservableTemplatesApi } from "./ObservableAPI"; +import { TemplatesApiRequestFactory, TemplatesApiResponseProcessor} from "../apis/TemplatesApi"; + +export interface TemplatesApiCreateTemplateRequest { + /** + * + * @type CreateTemplateFromUrlRequest + * @memberof TemplatesApicreateTemplate + */ + createTemplateFromUrlRequest: CreateTemplateFromUrlRequest + /** + * A comma-separated list of additional fields to include in the response. + * Defaults to: undefined + * @type Array<'content_date_modified'> + * @memberof TemplatesApicreateTemplate + */ + fields?: Array<'content_date_modified'> +} + +export interface TemplatesApiCreateTemplateEditingSessionRequest { + /** + * Template ID + * Defaults to: undefined + * @type string + * @memberof TemplatesApicreateTemplateEditingSession + */ + id: string + /** + * + * @type EditingSessionRequest + * @memberof TemplatesApicreateTemplateEditingSession + */ + editingSessionRequest: EditingSessionRequest +} + +export interface TemplatesApiCreateTemplateWithUploadRequest { + /** + * A comma-separated list of additional fields to include in the response. + * Defaults to: undefined + * @type Array<'content_date_modified'> + * @memberof TemplatesApicreateTemplateWithUpload + */ + fields?: Array<'content_date_modified'> + /** + * Binary PDF/DocX/RTF File. + * Defaults to: undefined + * @type HttpFile + * @memberof TemplatesApicreateTemplateWithUpload + */ + file?: HttpFile /** - * Upload section - * @param param the request object + * JSON as a multipart/form-data string. + * Defaults to: undefined + * @type CreateTemplateRequest + * @memberof TemplatesApicreateTemplateWithUpload */ - public uploadSection(param: SectionsApiUploadSectionRequest, options?: Configuration): Promise { - return this.api.uploadSection(param.documentId, param.uploadSectionRequest, param.mergeFieldScope, options).toPromise(); - } - + data?: CreateTemplateRequest } -import { ObservableTemplatesApi } from "./ObservableAPI"; -import { TemplatesApiRequestFactory, TemplatesApiResponseProcessor} from "../apis/TemplatesApi"; - export interface TemplatesApiDeleteTemplateRequest { /** * Template ID + * Defaults to: undefined * @type string * @memberof TemplatesApideleteTemplate */ @@ -1694,6 +3989,7 @@ export interface TemplatesApiDeleteTemplateRequest { export interface TemplatesApiDetailsTemplateRequest { /** * Template ID + * Defaults to: undefined * @type string * @memberof TemplatesApidetailsTemplate */ @@ -1702,59 +3998,97 @@ export interface TemplatesApiDetailsTemplateRequest { export interface TemplatesApiListTemplatesRequest { /** - * Optional search query. Filter by template name. + * Search query. Filter by template name. + * Defaults to: undefined * @type string * @memberof TemplatesApilistTemplates */ q?: string /** * Returns only the shared templates. + * Defaults to: undefined * @type boolean * @memberof TemplatesApilistTemplates */ shared?: boolean /** - * Optional. Returns only the deleted templates. + * Returns only the deleted templates. + * Defaults to: undefined * @type boolean * @memberof TemplatesApilistTemplates */ deleted?: boolean /** - * Optionally, specify how many templates to return. Default is 50 templates, maximum is 100 templates. + * Specify how many templates to return. + * Minimum: 1 + * Maximum: 100 + * Defaults to: 50 * @type number * @memberof TemplatesApilistTemplates */ count?: number /** - * Optionally, specify which page of the dataset to return. + * Specify which page of the dataset to return. + * Minimum: 1 + * Defaults to: undefined * @type number * @memberof TemplatesApilistTemplates */ page?: number /** - * Optionally, specify template ID. + * Specify template ID. + * Defaults to: undefined * @type string * @memberof TemplatesApilistTemplates */ id?: string /** * UUID of the folder where the templates are stored. + * Defaults to: undefined * @type string * @memberof TemplatesApilistTemplates */ folderUuid?: string /** - * Optional search tag. Filter by template tag. + * Search tag. Filter by template tag. + * Defaults to: undefined * @type Array<string> * @memberof TemplatesApilistTemplates */ tag?: Array /** - * A comma-separated list of additional fields to include in the response. Each field must be a valid template property. Currently, only one additional field, `content_date_modified`, is supported. For example, `GET /templates?fields=content_date_modified`. - * @type string + * A comma-separated list of additional fields to include in the response. + * Defaults to: undefined + * @type Array<'content_date_modified'> * @memberof TemplatesApilistTemplates */ - fields?: string + fields?: Array<'content_date_modified'> +} + +export interface TemplatesApiStatusTemplateRequest { + /** + * Template ID + * Defaults to: undefined + * @type string + * @memberof TemplatesApistatusTemplate + */ + id: string +} + +export interface TemplatesApiUpdateTemplateRequest { + /** + * Template ID + * Defaults to: undefined + * @type string + * @memberof TemplatesApiupdateTemplate + */ + id: string + /** + * + * @type TemplateUpdateRequest + * @memberof TemplatesApiupdateTemplate + */ + templateUpdateRequest: TemplateUpdateRequest } export class ObjectTemplatesApi { @@ -1764,33 +4098,150 @@ export class ObjectTemplatesApi { this.api = new ObservableTemplatesApi(configuration, requestFactory, responseProcessor); } + /** + * This operation allows you to create a new template by providing the necessary template details. + * Create Template + * @param param the request object + */ + public createTemplateWithHttpInfo(param: TemplatesApiCreateTemplateRequest, options?: ConfigurationOptions): Promise> { + return this.api.createTemplateWithHttpInfo(param.createTemplateFromUrlRequest, param.fields, options).toPromise(); + } + + /** + * This operation allows you to create a new template by providing the necessary template details. + * Create Template + * @param param the request object + */ + public createTemplate(param: TemplatesApiCreateTemplateRequest, options?: ConfigurationOptions): Promise { + return this.api.createTemplate(param.createTemplateFromUrlRequest, param.fields, options).toPromise(); + } + + /** + * Creates a new editing session for the Embedded Editor. The response includes an E-Token, which is required to open the template. #### Limitations - **Single Active Session per User-Template Pair** Only one editing session can be active at a time for a specific user and template. Creating a new session for the same user-template pair will automatically invalidate the previous one. - **Weekly Session Cap** A maximum of **250** editing sessions can be created for a single template per week. Any attempt to exceed this limit will result in a `403 Forbidden` error. + * Create Template Editing Session + * @param param the request object + */ + public createTemplateEditingSessionWithHttpInfo(param: TemplatesApiCreateTemplateEditingSessionRequest, options?: ConfigurationOptions): Promise> { + return this.api.createTemplateEditingSessionWithHttpInfo(param.id, param.editingSessionRequest, options).toPromise(); + } + + /** + * Creates a new editing session for the Embedded Editor. The response includes an E-Token, which is required to open the template. #### Limitations - **Single Active Session per User-Template Pair** Only one editing session can be active at a time for a specific user and template. Creating a new session for the same user-template pair will automatically invalidate the previous one. - **Weekly Session Cap** A maximum of **250** editing sessions can be created for a single template per week. Any attempt to exceed this limit will result in a `403 Forbidden` error. + * Create Template Editing Session + * @param param the request object + */ + public createTemplateEditingSession(param: TemplatesApiCreateTemplateEditingSessionRequest, options?: ConfigurationOptions): Promise { + return this.api.createTemplateEditingSession(param.id, param.editingSessionRequest, options).toPromise(); + } + + /** + * This asynchronous endpoint allows users to create a new template by uploading a file. The uploaded file is processed in the background to generate the template. The maximum allowable file size for upload is 100 MB. Field tags and form fields are not supported yet. Once the file is uploaded, the processing will happen asynchronously, and users need to check [the status of the template](https://developers.pandadoc.com/reference/template-status) creation. + * Create Template from File Upload + * @param param the request object + */ + public createTemplateWithUploadWithHttpInfo(param: TemplatesApiCreateTemplateWithUploadRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.createTemplateWithUploadWithHttpInfo(param.fields, param.file, param.data, options).toPromise(); + } + + /** + * This asynchronous endpoint allows users to create a new template by uploading a file. The uploaded file is processed in the background to generate the template. The maximum allowable file size for upload is 100 MB. Field tags and form fields are not supported yet. Once the file is uploaded, the processing will happen asynchronously, and users need to check [the status of the template](https://developers.pandadoc.com/reference/template-status) creation. + * Create Template from File Upload + * @param param the request object + */ + public createTemplateWithUpload(param: TemplatesApiCreateTemplateWithUploadRequest = {}, options?: ConfigurationOptions): Promise { + return this.api.createTemplateWithUpload(param.fields, param.file, param.data, options).toPromise(); + } + + /** + * Delete a template + * Delete Template + * @param param the request object + */ + public deleteTemplateWithHttpInfo(param: TemplatesApiDeleteTemplateRequest, options?: ConfigurationOptions): Promise> { + return this.api.deleteTemplateWithHttpInfo(param.id, options).toPromise(); + } + /** * Delete a template * Delete Template * @param param the request object */ - public deleteTemplate(param: TemplatesApiDeleteTemplateRequest, options?: Configuration): Promise { + public deleteTemplate(param: TemplatesApiDeleteTemplateRequest, options?: ConfigurationOptions): Promise { return this.api.deleteTemplate(param.id, options).toPromise(); } /** - * Return detailed data about a template. - * Details Template + * Get details about a template by `id`. Details include: - Basic template information (name, author, etc) - Roles - All fields with values - All tokens with values - Pricing information (pricing tables, products, quotes) - Template metadata - Template tags - Content placeholders - Modification timestamps. Note that `date_modified` means any changes associated with the template roles, while `content_date_modified` logs any changes in the template content. + * Template Details + * @param param the request object + */ + public detailsTemplateWithHttpInfo(param: TemplatesApiDetailsTemplateRequest, options?: ConfigurationOptions): Promise> { + return this.api.detailsTemplateWithHttpInfo(param.id, options).toPromise(); + } + + /** + * Get details about a template by `id`. Details include: - Basic template information (name, author, etc) - Roles - All fields with values - All tokens with values - Pricing information (pricing tables, products, quotes) - Template metadata - Template tags - Content placeholders - Modification timestamps. Note that `date_modified` means any changes associated with the template roles, while `content_date_modified` logs any changes in the template content. + * Template Details * @param param the request object */ - public detailsTemplate(param: TemplatesApiDetailsTemplateRequest, options?: Configuration): Promise { + public detailsTemplate(param: TemplatesApiDetailsTemplateRequest, options?: ConfigurationOptions): Promise { return this.api.detailsTemplate(param.id, options).toPromise(); } /** - * Optionally, filter by a search query or tags. + * Retrieves a list of templates. You can filter results by a search query, tags, or fields. + * List Templates + * @param param the request object + */ + public listTemplatesWithHttpInfo(param: TemplatesApiListTemplatesRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.listTemplatesWithHttpInfo(param.q, param.shared, param.deleted, param.count, param.page, param.id, param.folderUuid, param.tag, param.fields, options).toPromise(); + } + + /** + * Retrieves a list of templates. You can filter results by a search query, tags, or fields. * List Templates * @param param the request object */ - public listTemplates(param: TemplatesApiListTemplatesRequest = {}, options?: Configuration): Promise { + public listTemplates(param: TemplatesApiListTemplatesRequest = {}, options?: ConfigurationOptions): Promise { return this.api.listTemplates(param.q, param.shared, param.deleted, param.count, param.page, param.id, param.folderUuid, param.tag, param.fields, options).toPromise(); } + /** + * ## Available Template Statuses The following is a complete list of all possible template statuses returned: | Template Status | Status Description | | :------------------- | :-------------------------------------------------------------------------------------------------------------------------------------- | | `template.UPLOADED` | The template upload process has been initiated and is currently in progress. It will soon transition to the `template.PROCESSED` state. | | `template.PROCESSED` | The template has been successfully uploaded and created. At this stage, all aspects of the template are editable. | | `template.ERROR` | The template upload process has failed. Please refer to the error details in the response for more information. | + * Template Status + * @param param the request object + */ + public statusTemplateWithHttpInfo(param: TemplatesApiStatusTemplateRequest, options?: ConfigurationOptions): Promise> { + return this.api.statusTemplateWithHttpInfo(param.id, options).toPromise(); + } + + /** + * ## Available Template Statuses The following is a complete list of all possible template statuses returned: | Template Status | Status Description | | :------------------- | :-------------------------------------------------------------------------------------------------------------------------------------- | | `template.UPLOADED` | The template upload process has been initiated and is currently in progress. It will soon transition to the `template.PROCESSED` state. | | `template.PROCESSED` | The template has been successfully uploaded and created. At this stage, all aspects of the template are editable. | | `template.ERROR` | The template upload process has failed. Please refer to the error details in the response for more information. | + * Template Status + * @param param the request object + */ + public statusTemplate(param: TemplatesApiStatusTemplateRequest, options?: ConfigurationOptions): Promise { + return this.api.statusTemplate(param.id, options).toPromise(); + } + + /** + * > 🚧 Template status > > You can only update a template in the PROCESSED status (`template.PROCESSED`). > > After creating a new template, it usually retains a `template.uploaded` status for 3-5 seconds while the template syncs across PandaDoc servers. When the template is available for further API calls, the template moves to the `template.PROCESSED` state. Use [Template Status](https://developers.pandadoc.com/reference/template-status) or Webhooks to check template status. + * Template Update + * @param param the request object + */ + public updateTemplateWithHttpInfo(param: TemplatesApiUpdateTemplateRequest, options?: ConfigurationOptions): Promise> { + return this.api.updateTemplateWithHttpInfo(param.id, param.templateUpdateRequest, options).toPromise(); + } + + /** + * > 🚧 Template status > > You can only update a template in the PROCESSED status (`template.PROCESSED`). > > After creating a new template, it usually retains a `template.uploaded` status for 3-5 seconds while the template syncs across PandaDoc servers. When the template is available for further API calls, the template moves to the `template.PROCESSED` state. Use [Template Status](https://developers.pandadoc.com/reference/template-status) or Webhooks to check template status. + * Template Update + * @param param the request object + */ + public updateTemplate(param: TemplatesApiUpdateTemplateRequest, options?: ConfigurationOptions): Promise { + return this.api.updateTemplate(param.id, param.templateUpdateRequest, options).toPromise(); + } + } import { ObservableUserAndWorkspaceManagementApi } from "./ObservableAPI"; @@ -1799,6 +4250,7 @@ import { UserAndWorkspaceManagementApiRequestFactory, UserAndWorkspaceManagement export interface UserAndWorkspaceManagementApiAddMemberRequest { /** * + * Defaults to: undefined * @type string * @memberof UserAndWorkspaceManagementApiaddMember */ @@ -1811,18 +4263,36 @@ export interface UserAndWorkspaceManagementApiAddMemberRequest { addMemberRequest: AddMemberRequest /** * Send a confirmation email to the user that was added to workspace(s). + * Defaults to: undefined * @type boolean * @memberof UserAndWorkspaceManagementApiaddMember */ notifyUser?: boolean /** * Send a confirmation email to all workspace admins indicating that the user has been added to the workspace. + * Defaults to: undefined * @type boolean * @memberof UserAndWorkspaceManagementApiaddMember */ notifyWsAdmins?: boolean } +export interface UserAndWorkspaceManagementApiCreateApiKeyRequest { + /** + * Workspace id. + * Defaults to: undefined + * @type string + * @memberof UserAndWorkspaceManagementApicreateApiKey + */ + workspaceId: string + /** + * + * @type CreateApiKeyRequest + * @memberof UserAndWorkspaceManagementApicreateApiKey + */ + createApiKeyRequest: CreateApiKeyRequest +} + export interface UserAndWorkspaceManagementApiCreateUserRequest { /** * @@ -1832,12 +4302,14 @@ export interface UserAndWorkspaceManagementApiCreateUserRequest { createUserRequest: CreateUserRequest /** * Send a confirmation email to the user that was added to workspace(s). + * Defaults to: undefined * @type boolean * @memberof UserAndWorkspaceManagementApicreateUser */ notifyUser?: boolean /** * Send a confirmation email to all workspace admins indicating that the user has been added to the workspace. + * Defaults to: undefined * @type boolean * @memberof UserAndWorkspaceManagementApicreateUser */ @@ -1853,6 +4325,86 @@ export interface UserAndWorkspaceManagementApiCreateWorkspaceRequest { createWorkspaceRequest: CreateWorkspaceRequest } +export interface UserAndWorkspaceManagementApiDeactivateWorkspaceRequest { + /** + * + * Defaults to: undefined + * @type string + * @memberof UserAndWorkspaceManagementApideactivateWorkspace + */ + workspaceId: string + /** + * + * @type any + * @memberof UserAndWorkspaceManagementApideactivateWorkspace + */ + body?: any +} + +export interface UserAndWorkspaceManagementApiGetWorkspacesListRequest { + /** + * Number of elements in page. + * Minimum: 1 + * Maximum: 100 + * Defaults to: 50 + * @type number + * @memberof UserAndWorkspaceManagementApigetWorkspacesList + */ + count?: number + /** + * Page number. + * Minimum: 1 + * Defaults to: 1 + * @type number + * @memberof UserAndWorkspaceManagementApigetWorkspacesList + */ + page?: number +} + +export interface UserAndWorkspaceManagementApiListUsersRequest { + /** + * Number of elements in page. + * Minimum: 0 + * Maximum: 50 + * Defaults to: 50 + * @type number + * @memberof UserAndWorkspaceManagementApilistUsers + */ + count?: number + /** + * Page number. + * Minimum: 0 + * Defaults to: 1 + * @type number + * @memberof UserAndWorkspaceManagementApilistUsers + */ + page?: number + /** + * Filter option - show users with removed memberships. + * Defaults to: true + * @type boolean + * @memberof UserAndWorkspaceManagementApilistUsers + */ + showRemoved?: boolean +} + +export interface UserAndWorkspaceManagementApiRemoveMemberRequest { + /** + * Workspace id + * Defaults to: undefined + * @type string + * @memberof UserAndWorkspaceManagementApiremoveMember + */ + workspaceId: string + /** + * Member id + * Defaults to: undefined + * @type string + * @memberof UserAndWorkspaceManagementApiremoveMember + */ + memberId: string +} + export class ObjectUserAndWorkspaceManagementApi { private api: ObservableUserAndWorkspaceManagementApi @@ -1861,29 +4413,149 @@ export class ObjectUserAndWorkspaceManagementApi { } /** - * Add member + * Add an existing user to a workspace. - You must be an organization admin or a workspace admin to add members. + * Add Member to Workspace + * @param param the request object + */ + public addMemberWithHttpInfo(param: UserAndWorkspaceManagementApiAddMemberRequest, options?: ConfigurationOptions): Promise> { + return this.api.addMemberWithHttpInfo(param.workspaceId, param.addMemberRequest, param.notifyUser, param.notifyWsAdmins, options).toPromise(); + } + + /** + * Add an existing user to a workspace. - You must be an organization admin or a workspace admin to add members. + * Add Member to Workspace * @param param the request object */ - public addMember(param: UserAndWorkspaceManagementApiAddMemberRequest, options?: Configuration): Promise { + public addMember(param: UserAndWorkspaceManagementApiAddMemberRequest, options?: ConfigurationOptions): Promise { return this.api.addMember(param.workspaceId, param.addMemberRequest, param.notifyUser, param.notifyWsAdmins, options).toPromise(); } /** + * Generate a new API key for the workspace. Check out [API Key Authentication article](https://developers.pandadoc.com/reference/api-key-authentication-process) for detailed API Keys description. > 📘 > - Only an **Org Admin** can generate an API keys. > - To make another user a key\'s owner, pass `user_id` of this user. The user should has an **Admin** role in the workspace. > - Generating a new key invalidates existing key with the same type. Using this request, you can deactivate the key you\'re using for the request. + * Create API Key + * @param param the request object + */ + public createApiKeyWithHttpInfo(param: UserAndWorkspaceManagementApiCreateApiKeyRequest, options?: ConfigurationOptions): Promise> { + return this.api.createApiKeyWithHttpInfo(param.workspaceId, param.createApiKeyRequest, options).toPromise(); + } + + /** + * Generate a new API key for the workspace. Check out [API Key Authentication article](https://developers.pandadoc.com/reference/api-key-authentication-process) for detailed API Keys description. > 📘 > - Only an **Org Admin** can generate an API keys. > - To make another user a key\'s owner, pass `user_id` of this user. The user should has an **Admin** role in the workspace. > - Generating a new key invalidates existing key with the same type. Using this request, you can deactivate the key you\'re using for the request. + * Create API Key + * @param param the request object + */ + public createApiKey(param: UserAndWorkspaceManagementApiCreateApiKeyRequest, options?: ConfigurationOptions): Promise { + return this.api.createApiKey(param.workspaceId, param.createApiKeyRequest, options).toPromise(); + } + + /** + * Create users, and assign them roles, licenses, and workspaces. - You must be an organization admin to create users. - We check that the user email domain matches your organization domain. - We check that the user email and phone number have a valid format. + * Create User + * @param param the request object + */ + public createUserWithHttpInfo(param: UserAndWorkspaceManagementApiCreateUserRequest, options?: ConfigurationOptions): Promise> { + return this.api.createUserWithHttpInfo(param.createUserRequest, param.notifyUser, param.notifyWsAdmins, options).toPromise(); + } + + /** + * Create users, and assign them roles, licenses, and workspaces. - You must be an organization admin to create users. - We check that the user email domain matches your organization domain. - We check that the user email and phone number have a valid format. * Create User * @param param the request object */ - public createUser(param: UserAndWorkspaceManagementApiCreateUserRequest, options?: Configuration): Promise { + public createUser(param: UserAndWorkspaceManagementApiCreateUserRequest, options?: ConfigurationOptions): Promise { return this.api.createUser(param.createUserRequest, param.notifyUser, param.notifyWsAdmins, options).toPromise(); } /** + * Create a workspace in your organization. - You need to be an Org Admin to create a workspace. - You will be added to the new workspace with an Admin role. * Create Workspace * @param param the request object */ - public createWorkspace(param: UserAndWorkspaceManagementApiCreateWorkspaceRequest, options?: Configuration): Promise { + public createWorkspaceWithHttpInfo(param: UserAndWorkspaceManagementApiCreateWorkspaceRequest, options?: ConfigurationOptions): Promise> { + return this.api.createWorkspaceWithHttpInfo(param.createWorkspaceRequest, options).toPromise(); + } + + /** + * Create a workspace in your organization. - You need to be an Org Admin to create a workspace. - You will be added to the new workspace with an Admin role. + * Create Workspace + * @param param the request object + */ + public createWorkspace(param: UserAndWorkspaceManagementApiCreateWorkspaceRequest, options?: ConfigurationOptions): Promise { return this.api.createWorkspace(param.createWorkspaceRequest, options).toPromise(); } + /** + * Deactivate the workspace, remove all the members from it and make it unavailable. + * Deactivate Workspace + * @param param the request object + */ + public deactivateWorkspaceWithHttpInfo(param: UserAndWorkspaceManagementApiDeactivateWorkspaceRequest, options?: ConfigurationOptions): Promise> { + return this.api.deactivateWorkspaceWithHttpInfo(param.workspaceId, param.body, options).toPromise(); + } + + /** + * Deactivate the workspace, remove all the members from it and make it unavailable. + * Deactivate Workspace + * @param param the request object + */ + public deactivateWorkspace(param: UserAndWorkspaceManagementApiDeactivateWorkspaceRequest, options?: ConfigurationOptions): Promise { + return this.api.deactivateWorkspace(param.workspaceId, param.body, options).toPromise(); + } + + /** + * Get a list of all the active workspaces in the organization. + * List Workspaces + * @param param the request object + */ + public getWorkspacesListWithHttpInfo(param: UserAndWorkspaceManagementApiGetWorkspacesListRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.getWorkspacesListWithHttpInfo(param.count, param.page, options).toPromise(); + } + + /** + * Get a list of all the active workspaces in the organization. + * List Workspaces + * @param param the request object + */ + public getWorkspacesList(param: UserAndWorkspaceManagementApiGetWorkspacesListRequest = {}, options?: ConfigurationOptions): Promise { + return this.api.getWorkspacesList(param.count, param.page, options).toPromise(); + } + + /** + * Get a list of all users with membership in your organization, with their contact information, license type, and workspace roles. You must be an organization admin to list users. + * List Users + * @param param the request object + */ + public listUsersWithHttpInfo(param: UserAndWorkspaceManagementApiListUsersRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.listUsersWithHttpInfo(param.count, param.page, param.showRemoved, options).toPromise(); + } + + /** + * Get a list of all users with membership in your organization, with their contact information, license type, and workspace roles. You must be an organization admin to list users. + * List Users + * @param param the request object + */ + public listUsers(param: UserAndWorkspaceManagementApiListUsersRequest = {}, options?: ConfigurationOptions): Promise { + return this.api.listUsers(param.count, param.page, param.showRemoved, options).toPromise(); + } + + /** + * This operation removes a specified member from a workspace by providing the workspace ID and member ID. + * Remove Member from Workspace + * @param param the request object + */ + public removeMemberWithHttpInfo(param: UserAndWorkspaceManagementApiRemoveMemberRequest, options?: ConfigurationOptions): Promise> { + return this.api.removeMemberWithHttpInfo(param.workspaceId, param.memberId, options).toPromise(); + } + + /** + * This operation removes a specified member from a workspace by providing the workspace ID and member ID. + * Remove Member from Workspace + * @param param the request object + */ + public removeMember(param: UserAndWorkspaceManagementApiRemoveMemberRequest, options?: ConfigurationOptions): Promise { + return this.api.removeMember(param.workspaceId, param.memberId, options).toPromise(); + } + } import { ObservableWebhookEventsApi } from "./ObservableAPI"; @@ -1891,7 +4563,8 @@ import { WebhookEventsApiRequestFactory, WebhookEventsApiResponseProcessor} from export interface WebhookEventsApiDetailsWebhookEventRequest { /** - * Webhook event uuid + * Webhook event uuid. + * Defaults to: undefined * @type string * @memberof WebhookEventsApidetailsWebhookEvent */ @@ -1900,43 +4573,52 @@ export interface WebhookEventsApiDetailsWebhookEventRequest { export interface WebhookEventsApiListWebhookEventRequest { /** - * Number of element in page + * Specify how many event results to return. + * Minimum: 0 + * Defaults to: undefined * @type number * @memberof WebhookEventsApilistWebhookEvent */ count: number /** - * Page number + * Specify which page of the dataset to return. + * Minimum: 0 + * Defaults to: undefined * @type number * @memberof WebhookEventsApilistWebhookEvent */ page: number /** - * Filter option: all events from specified timestamp + * Return results where the event creation time is greater than or equal to this value. + * Defaults to: undefined * @type Date * @memberof WebhookEventsApilistWebhookEvent */ since?: Date /** - * Filter option: all events up to specified timestamp + * Return results where the event creation time is less than this value. + * Defaults to: undefined * @type Date * @memberof WebhookEventsApilistWebhookEvent */ to?: Date /** - * Filter option: all events of type + * Returns results by the specified event types. + * Defaults to: undefined * @type Array<WebhookEventTriggerEnum> * @memberof WebhookEventsApilistWebhookEvent */ type?: Array /** - * Filter option: all events of http status code + * Returns results with the specified HTTP status codes. + * Defaults to: undefined * @type Array<WebhookEventHttpStatusCodeGroupEnum> * @memberof WebhookEventsApilistWebhookEvent */ httpStatusCode?: Array /** - * Filter option: all events with following error + * Returns results with the following errors. + * Defaults to: undefined * @type Array<WebhookEventErrorEnum> * @memberof WebhookEventsApilistWebhookEvent */ @@ -1951,18 +4633,38 @@ export class ObjectWebhookEventsApi { } /** - * Get webhook event by uuid + * This operation fetches detailed information about a specific webhook event using its unique identifier. + * Webhook Event Details + * @param param the request object + */ + public detailsWebhookEventWithHttpInfo(param: WebhookEventsApiDetailsWebhookEventRequest, options?: ConfigurationOptions): Promise> { + return this.api.detailsWebhookEventWithHttpInfo(param.id, options).toPromise(); + } + + /** + * This operation fetches detailed information about a specific webhook event using its unique identifier. + * Webhook Event Details * @param param the request object */ - public detailsWebhookEvent(param: WebhookEventsApiDetailsWebhookEventRequest, options?: Configuration): Promise { + public detailsWebhookEvent(param: WebhookEventsApiDetailsWebhookEventRequest, options?: ConfigurationOptions): Promise { return this.api.detailsWebhookEvent(param.id, options).toPromise(); } /** - * Get webhook event page + * This operation retrieves a paginated list of all webhook events. + * List Webhook Events + * @param param the request object + */ + public listWebhookEventWithHttpInfo(param: WebhookEventsApiListWebhookEventRequest, options?: ConfigurationOptions): Promise> { + return this.api.listWebhookEventWithHttpInfo(param.count, param.page, param.since, param.to, param.type, param.httpStatusCode, param.error, options).toPromise(); + } + + /** + * This operation retrieves a paginated list of all webhook events. + * List Webhook Events * @param param the request object */ - public listWebhookEvent(param: WebhookEventsApiListWebhookEventRequest, options?: Configuration): Promise { + public listWebhookEvent(param: WebhookEventsApiListWebhookEventRequest, options?: ConfigurationOptions): Promise { return this.api.listWebhookEvent(param.count, param.page, param.since, param.to, param.type, param.httpStatusCode, param.error, options).toPromise(); } @@ -1982,7 +4684,8 @@ export interface WebhookSubscriptionsApiCreateWebhookSubscriptionRequest { export interface WebhookSubscriptionsApiDeleteWebhookSubscriptionRequest { /** - * Webhook subscription uuid + * Webhook subscription uuid. + * Defaults to: undefined * @type string * @memberof WebhookSubscriptionsApideleteWebhookSubscription */ @@ -1992,6 +4695,7 @@ export interface WebhookSubscriptionsApiDeleteWebhookSubscriptionRequest { export interface WebhookSubscriptionsApiDetailsWebhookSubscriptionRequest { /** * Webhook subscription uuid + * Defaults to: undefined * @type string * @memberof WebhookSubscriptionsApidetailsWebhookSubscription */ @@ -2004,6 +4708,7 @@ export interface WebhookSubscriptionsApiListWebhookSubscriptionsRequest { export interface WebhookSubscriptionsApiUpdateWebhookSubscriptionRequest { /** * Webhook subscription uuid + * Defaults to: undefined * @type string * @memberof WebhookSubscriptionsApiupdateWebhookSubscription */ @@ -2019,6 +4724,7 @@ export interface WebhookSubscriptionsApiUpdateWebhookSubscriptionRequest { export interface WebhookSubscriptionsApiUpdateWebhookSubscriptionSharedKeyRequest { /** * Webhook subscription uuid + * Defaults to: undefined * @type string * @memberof WebhookSubscriptionsApiupdateWebhookSubscriptionSharedKey */ @@ -2033,50 +4739,110 @@ export class ObjectWebhookSubscriptionsApi { } /** - * Create webhook subscription + * This operation creates a new webhook subscription by specifying its details. + * Create Webhook Subscription + * @param param the request object + */ + public createWebhookSubscriptionWithHttpInfo(param: WebhookSubscriptionsApiCreateWebhookSubscriptionRequest, options?: ConfigurationOptions): Promise> { + return this.api.createWebhookSubscriptionWithHttpInfo(param.webhookSubscriptionCreateRequest, options).toPromise(); + } + + /** + * This operation creates a new webhook subscription by specifying its details. + * Create Webhook Subscription * @param param the request object */ - public createWebhookSubscription(param: WebhookSubscriptionsApiCreateWebhookSubscriptionRequest, options?: Configuration): Promise { + public createWebhookSubscription(param: WebhookSubscriptionsApiCreateWebhookSubscriptionRequest, options?: ConfigurationOptions): Promise { return this.api.createWebhookSubscription(param.webhookSubscriptionCreateRequest, options).toPromise(); } /** - * Delete webhook subscription + * This operation deletes a specific webhook subscription identified by its UUID. + * Delete Webhook Subscription + * @param param the request object + */ + public deleteWebhookSubscriptionWithHttpInfo(param: WebhookSubscriptionsApiDeleteWebhookSubscriptionRequest, options?: ConfigurationOptions): Promise> { + return this.api.deleteWebhookSubscriptionWithHttpInfo(param.id, options).toPromise(); + } + + /** + * This operation deletes a specific webhook subscription identified by its UUID. + * Delete Webhook Subscription * @param param the request object */ - public deleteWebhookSubscription(param: WebhookSubscriptionsApiDeleteWebhookSubscriptionRequest, options?: Configuration): Promise { + public deleteWebhookSubscription(param: WebhookSubscriptionsApiDeleteWebhookSubscriptionRequest, options?: ConfigurationOptions): Promise { return this.api.deleteWebhookSubscription(param.id, options).toPromise(); } /** - * Get webhook subscription by uuid + * Get webhook subscription by uuid + * Webhook Subscription Details + * @param param the request object + */ + public detailsWebhookSubscriptionWithHttpInfo(param: WebhookSubscriptionsApiDetailsWebhookSubscriptionRequest, options?: ConfigurationOptions): Promise> { + return this.api.detailsWebhookSubscriptionWithHttpInfo(param.id, options).toPromise(); + } + + /** + * Get webhook subscription by uuid + * Webhook Subscription Details * @param param the request object */ - public detailsWebhookSubscription(param: WebhookSubscriptionsApiDetailsWebhookSubscriptionRequest, options?: Configuration): Promise { + public detailsWebhookSubscription(param: WebhookSubscriptionsApiDetailsWebhookSubscriptionRequest, options?: ConfigurationOptions): Promise { return this.api.detailsWebhookSubscription(param.id, options).toPromise(); } /** - * Get all webhook subscriptions + * This operation fetches a paginated list of webhook subscriptions. + * List Webhook Subscriptions + * @param param the request object + */ + public listWebhookSubscriptionsWithHttpInfo(param: WebhookSubscriptionsApiListWebhookSubscriptionsRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.listWebhookSubscriptionsWithHttpInfo( options).toPromise(); + } + + /** + * This operation fetches a paginated list of webhook subscriptions. + * List Webhook Subscriptions * @param param the request object */ - public listWebhookSubscriptions(param: WebhookSubscriptionsApiListWebhookSubscriptionsRequest = {}, options?: Configuration): Promise { + public listWebhookSubscriptions(param: WebhookSubscriptionsApiListWebhookSubscriptionsRequest = {}, options?: ConfigurationOptions): Promise { return this.api.listWebhookSubscriptions( options).toPromise(); } /** - * Update webhook subscription + * This operation updates the details of a webhook subscription. + * Update Webhook Subscription + * @param param the request object + */ + public updateWebhookSubscriptionWithHttpInfo(param: WebhookSubscriptionsApiUpdateWebhookSubscriptionRequest, options?: ConfigurationOptions): Promise> { + return this.api.updateWebhookSubscriptionWithHttpInfo(param.id, param.webhookSubscriptionPatchRequest, options).toPromise(); + } + + /** + * This operation updates the details of a webhook subscription. + * Update Webhook Subscription * @param param the request object */ - public updateWebhookSubscription(param: WebhookSubscriptionsApiUpdateWebhookSubscriptionRequest, options?: Configuration): Promise { + public updateWebhookSubscription(param: WebhookSubscriptionsApiUpdateWebhookSubscriptionRequest, options?: ConfigurationOptions): Promise { return this.api.updateWebhookSubscription(param.id, param.webhookSubscriptionPatchRequest, options).toPromise(); } /** - * Regenerate webhook subscription shared key + * This operation regenerates the shared key for a specific webhook subscription identified by its UUID. + * Update Webhook Subscription Shared Key + * @param param the request object + */ + public updateWebhookSubscriptionSharedKeyWithHttpInfo(param: WebhookSubscriptionsApiUpdateWebhookSubscriptionSharedKeyRequest, options?: ConfigurationOptions): Promise> { + return this.api.updateWebhookSubscriptionSharedKeyWithHttpInfo(param.id, options).toPromise(); + } + + /** + * This operation regenerates the shared key for a specific webhook subscription identified by its UUID. + * Update Webhook Subscription Shared Key * @param param the request object */ - public updateWebhookSubscriptionSharedKey(param: WebhookSubscriptionsApiUpdateWebhookSubscriptionSharedKeyRequest, options?: Configuration): Promise { + public updateWebhookSubscriptionSharedKey(param: WebhookSubscriptionsApiUpdateWebhookSubscriptionSharedKeyRequest, options?: ConfigurationOptions): Promise { return this.api.updateWebhookSubscriptionSharedKey(param.id, options).toPromise(); } diff --git a/src/types/ObservableAPI.ts b/src/types/ObservableAPI.ts index 10004d2..d94d648 100644 --- a/src/types/ObservableAPI.ts +++ b/src/types/ObservableAPI.ts @@ -1,149 +1,359 @@ -import { ResponseContext, RequestContext, HttpFile } from '../http/http'; -import * as models from '../models/all'; -import { Configuration} from '../configuration' +import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; +import { Configuration, ConfigurationOptions, mergeConfiguration } from '../configuration' +import type { Middleware } from '../middleware'; import { Observable, of, from } from '../rxjsStub'; import {mergeMap, map} from '../rxjsStub'; import { APILogDetailsResponse } from '../models/APILogDetailsResponse'; import { APILogListResponse } from '../models/APILogListResponse'; -import { APILogListResponseResults } from '../models/APILogListResponseResults'; +import { APILogListResponseResultsInner } from '../models/APILogListResponseResultsInner'; +import { AccessToken400Response } from '../models/AccessToken400Response'; +import { AddDsvNamedItemsRequest } from '../models/AddDsvNamedItemsRequest'; +import { AddDsvNamedItemsRequestItemsInner } from '../models/AddDsvNamedItemsRequestItemsInner'; +import { AddDsvNamedItemsResponse } from '../models/AddDsvNamedItemsResponse'; +import { AddDsvNamedItemsResponseResultsInner } from '../models/AddDsvNamedItemsResponseResultsInner'; +import { AddMember400Response } from '../models/AddMember400Response'; import { AddMemberRequest } from '../models/AddMemberRequest'; import { AddMemberResponse } from '../models/AddMemberResponse'; +import { ApiKeyTypeEnum } from '../models/ApiKeyTypeEnum'; +import { ApiLogEnvironmentTypeEnum } from '../models/ApiLogEnvironmentTypeEnum'; +import { ApiLogMethodEnum } from '../models/ApiLogMethodEnum'; +import { ApiLogStatusEnum } from '../models/ApiLogStatusEnum'; +import { AppendCLIDataRequest } from '../models/AppendCLIDataRequest'; +import { AppendCLIDataRequestCli } from '../models/AppendCLIDataRequestCli'; +import { AppendCLIDataRequestCliPagesInner } from '../models/AppendCLIDataRequestCliPagesInner'; +import { AppendCLIDataResponse } from '../models/AppendCLIDataResponse'; +import { AppendCLIDataResponseBlockMapping } from '../models/AppendCLIDataResponseBlockMapping'; +import { AppendCLIDataResponseBlockMappingImagesInner } from '../models/AppendCLIDataResponseBlockMappingImagesInner'; +import { AppendCLIDataResponseBlockMappingPricingTablesInner } from '../models/AppendCLIDataResponseBlockMappingPricingTablesInner'; +import { AppendCLIDataResponseBlockMappingTablesInner } from '../models/AppendCLIDataResponseBlockMappingTablesInner'; +import { AppendCLIDataResponseBlockMappingTextsInner } from '../models/AppendCLIDataResponseBlockMappingTextsInner'; +import { AppendCLIDataResponseCli } from '../models/AppendCLIDataResponseCli'; +import { AppendCLIDataResponseCliPagesInner } from '../models/AppendCLIDataResponseCliPagesInner'; +import { AssignedToRecipientDeliveryMethods } from '../models/AssignedToRecipientDeliveryMethods'; +import { AutoReminders } from '../models/AutoReminders'; +import { BaseActor } from '../models/BaseActor'; +import { BaseEditingSessionResponse } from '../models/BaseEditingSessionResponse'; +import { BaseField } from '../models/BaseField'; +import { BaseFieldAssignedTo } from '../models/BaseFieldAssignedTo'; +import { BaseIdentity } from '../models/BaseIdentity'; +import { ChangeDocumentStatus409Response } from '../models/ChangeDocumentStatus409Response'; +import { Checkbox } from '../models/Checkbox'; +import { CollectFile } from '../models/CollectFile'; +import { CollectFileAllOfValue } from '../models/CollectFileAllOfValue'; import { ContactCreateRequest } from '../models/ContactCreateRequest'; import { ContactDetailsResponse } from '../models/ContactDetailsResponse'; import { ContactListResponse } from '../models/ContactListResponse'; import { ContactUpdateRequest } from '../models/ContactUpdateRequest'; +import { ContentLibraryItemCreateFromUrlRequest } from '../models/ContentLibraryItemCreateFromUrlRequest'; +import { ContentLibraryItemCreateRequest } from '../models/ContentLibraryItemCreateRequest'; import { ContentLibraryItemListResponse } from '../models/ContentLibraryItemListResponse'; -import { ContentLibraryItemListResponseResults } from '../models/ContentLibraryItemListResponseResults'; +import { ContentLibraryItemListResponseResultsInner } from '../models/ContentLibraryItemListResponseResultsInner'; import { ContentLibraryItemResponse } from '../models/ContentLibraryItemResponse'; import { ContentLibraryItemResponseCreatedBy } from '../models/ContentLibraryItemResponseCreatedBy'; +import { ContentLibraryResponse } from '../models/ContentLibraryResponse'; +import { CreateApiKeyRequest } from '../models/CreateApiKeyRequest'; +import { CreateApiKeyResponse } from '../models/CreateApiKeyResponse'; +import { CreateDocument400Response } from '../models/CreateDocument400Response'; +import { CreateDocumentActor } from '../models/CreateDocumentActor'; +import { CreateDocumentEditingSession201Response } from '../models/CreateDocumentEditingSession201Response'; +import { CreateDocumentFieldsRequest } from '../models/CreateDocumentFieldsRequest'; +import { CreateDocumentFieldsResponse } from '../models/CreateDocumentFieldsResponse'; +import { CreateDocumentRecipient } from '../models/CreateDocumentRecipient'; +import { CreateDocumentRecipientGroup } from '../models/CreateDocumentRecipientGroup'; +import { CreateMemberTokenRequest } from '../models/CreateMemberTokenRequest'; +import { CreateMemberTokenResponse } from '../models/CreateMemberTokenResponse'; +import { CreateNotarizationRequest } from '../models/CreateNotarizationRequest'; +import { CreateNotarizationRequestInvitation } from '../models/CreateNotarizationRequestInvitation'; +import { CreateNotarizationRequestInvitationInviteesInner } from '../models/CreateNotarizationRequestInvitationInviteesInner'; +import { CreateNotarizationRequestNotary } from '../models/CreateNotarizationRequestNotary'; +import { CreateNotarizationResponse } from '../models/CreateNotarizationResponse'; +import { CreateNotarizationResponseCreatedBy } from '../models/CreateNotarizationResponseCreatedBy'; +import { CreateNotarizationResponseInviteesInner } from '../models/CreateNotarizationResponseInviteesInner'; +import { CreateTemplateEditingSession201Response } from '../models/CreateTemplateEditingSession201Response'; +import { CreateTemplateFromUrlRequest } from '../models/CreateTemplateFromUrlRequest'; +import { CreateTemplateRequest } from '../models/CreateTemplateRequest'; +import { CreateTemplateRequestOwner } from '../models/CreateTemplateRequestOwner'; +import { CreateUser400Response } from '../models/CreateUser400Response'; import { CreateUserRequest } from '../models/CreateUserRequest'; import { CreateUserRequestUser } from '../models/CreateUserRequestUser'; -import { CreateUserRequestWorkspaces } from '../models/CreateUserRequestWorkspaces'; +import { CreateUserRequestWorkspacesInner } from '../models/CreateUserRequestWorkspacesInner'; import { CreateUserResponse } from '../models/CreateUserResponse'; +import { CreateUserResponseWorkspacesInner } from '../models/CreateUserResponseWorkspacesInner'; import { CreateWorkspaceRequest } from '../models/CreateWorkspaceRequest'; import { CreateWorkspaceResponse } from '../models/CreateWorkspaceResponse'; +import { DeleteNotarizationRequest404Response } from '../models/DeleteNotarizationRequest404Response'; +import { DocumentAttachmentMetadata } from '../models/DocumentAttachmentMetadata'; +import { DocumentAttachmentRequest } from '../models/DocumentAttachmentRequest'; import { DocumentAttachmentResponse } from '../models/DocumentAttachmentResponse'; import { DocumentAttachmentResponseCreatedBy } from '../models/DocumentAttachmentResponseCreatedBy'; +import { DocumentAuditTrailResponse } from '../models/DocumentAuditTrailResponse'; +import { DocumentAuditTrailResponseResultsInner } from '../models/DocumentAuditTrailResponseResultsInner'; +import { DocumentAuditTrailResponseResultsInnerUser } from '../models/DocumentAuditTrailResponseResultsInnerUser'; +import { DocumentAutoRemindersResponse } from '../models/DocumentAutoRemindersResponse'; +import { DocumentAutoRemindersResponse400 } from '../models/DocumentAutoRemindersResponse400'; +import { DocumentAutoRemindersResponseResultInner } from '../models/DocumentAutoRemindersResponseResultInner'; import { DocumentCreateByPdfRequest } from '../models/DocumentCreateByPdfRequest'; import { DocumentCreateByTemplateRequest } from '../models/DocumentCreateByTemplateRequest'; -import { DocumentCreateByTemplateRequestContentLibraryItems } from '../models/DocumentCreateByTemplateRequestContentLibraryItems'; -import { DocumentCreateByTemplateRequestContentPlaceholders } from '../models/DocumentCreateByTemplateRequestContentPlaceholders'; -import { DocumentCreateByTemplateRequestImages } from '../models/DocumentCreateByTemplateRequestImages'; -import { DocumentCreateByTemplateRequestRecipients } from '../models/DocumentCreateByTemplateRequestRecipients'; -import { DocumentCreateByTemplateRequestTokens } from '../models/DocumentCreateByTemplateRequestTokens'; +import { DocumentCreateByTemplateRequestContentPlaceholdersInner } from '../models/DocumentCreateByTemplateRequestContentPlaceholdersInner'; +import { DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInner } from '../models/DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInner'; +import { DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInnerRecipientsInner } from '../models/DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInnerRecipientsInner'; +import { DocumentCreateByTemplateRequestFieldsValue } from '../models/DocumentCreateByTemplateRequestFieldsValue'; +import { DocumentCreateByTemplateRequestFieldsValueValue } from '../models/DocumentCreateByTemplateRequestFieldsValueValue'; +import { DocumentCreateByTemplateRequestImagesInner } from '../models/DocumentCreateByTemplateRequestImagesInner'; +import { DocumentCreateByTemplateRequestOwner } from '../models/DocumentCreateByTemplateRequestOwner'; +import { DocumentCreateByTemplateRequestTextsInner } from '../models/DocumentCreateByTemplateRequestTextsInner'; +import { DocumentCreateByTemplateRequestTokensInner } from '../models/DocumentCreateByTemplateRequestTokensInner'; import { DocumentCreateLinkRequest } from '../models/DocumentCreateLinkRequest'; import { DocumentCreateLinkResponse } from '../models/DocumentCreateLinkResponse'; import { DocumentCreateRequest } from '../models/DocumentCreateRequest'; -import { DocumentCreateRequestContentLibraryItems } from '../models/DocumentCreateRequestContentLibraryItems'; -import { DocumentCreateRequestContentPlaceholders } from '../models/DocumentCreateRequestContentPlaceholders'; -import { DocumentCreateRequestImages } from '../models/DocumentCreateRequestImages'; -import { DocumentCreateRequestRecipients } from '../models/DocumentCreateRequestRecipients'; +import { DocumentCreateRequestOneOf } from '../models/DocumentCreateRequestOneOf'; +import { DocumentCreateRequestOneOf1 } from '../models/DocumentCreateRequestOneOf1'; import { DocumentCreateResponse } from '../models/DocumentCreateResponse'; -import { DocumentCreateResponseLinks } from '../models/DocumentCreateResponseLinks'; +import { DocumentCreateResponseLinksInner } from '../models/DocumentCreateResponseLinksInner'; +import { DocumentDeliveryMethodEnum } from '../models/DocumentDeliveryMethodEnum'; +import { DocumentDetailsRecipient } from '../models/DocumentDetailsRecipient'; +import { DocumentDetailsRecipientGroup } from '../models/DocumentDetailsRecipientGroup'; +import { DocumentDetailsRecipientGroupMember } from '../models/DocumentDetailsRecipientGroupMember'; import { DocumentDetailsResponse } from '../models/DocumentDetailsResponse'; import { DocumentDetailsResponseCreatedBy } from '../models/DocumentDetailsResponseCreatedBy'; import { DocumentDetailsResponseGrandTotal } from '../models/DocumentDetailsResponseGrandTotal'; -import { DocumentDetailsResponseLinkedObjects } from '../models/DocumentDetailsResponseLinkedObjects'; -import { DocumentDetailsResponseRecipients } from '../models/DocumentDetailsResponseRecipients'; +import { DocumentDetailsResponseImagesInner } from '../models/DocumentDetailsResponseImagesInner'; +import { DocumentDetailsResponseLinkedObjectsInner } from '../models/DocumentDetailsResponseLinkedObjectsInner'; +import { DocumentDetailsResponseLinkedObjectsInnerChildrenInner } from '../models/DocumentDetailsResponseLinkedObjectsInnerChildrenInner'; +import { DocumentDetailsResponseRecipientsInner } from '../models/DocumentDetailsResponseRecipientsInner'; +import { DocumentDetailsResponseTablesInner } from '../models/DocumentDetailsResponseTablesInner'; import { DocumentDetailsResponseTemplate } from '../models/DocumentDetailsResponseTemplate'; +import { DocumentDetailsResponseTextsInner } from '../models/DocumentDetailsResponseTextsInner'; +import { DocumentDocxExport } from '../models/DocumentDocxExport'; +import { DocumentDocxExportStatusEnum } from '../models/DocumentDocxExportStatusEnum'; +import { DocumentESignDisclosure } from '../models/DocumentESignDisclosure'; +import { DocumentESignDisclosureResult } from '../models/DocumentESignDisclosureResult'; +import { DocumentFieldAnchorPointEnum } from '../models/DocumentFieldAnchorPointEnum'; +import { DocumentFieldTypeEnum } from '../models/DocumentFieldTypeEnum'; +import { DocumentFieldsField } from '../models/DocumentFieldsField'; +import { DocumentFieldsFieldAssignedTo } from '../models/DocumentFieldsFieldAssignedTo'; +import { DocumentFieldsFieldCreate } from '../models/DocumentFieldsFieldCreate'; +import { DocumentFieldsLayout } from '../models/DocumentFieldsLayout'; +import { DocumentFieldsLayoutPosition } from '../models/DocumentFieldsLayoutPosition'; +import { DocumentFieldsLayoutStyle } from '../models/DocumentFieldsLayoutStyle'; +import { DocumentLanguageEnum } from '../models/DocumentLanguageEnum'; import { DocumentListResponse } from '../models/DocumentListResponse'; -import { DocumentListResponseResults } from '../models/DocumentListResponseResults'; +import { DocumentListResponseResultsInner } from '../models/DocumentListResponseResultsInner'; import { DocumentOrderingFieldsEnum } from '../models/DocumentOrderingFieldsEnum'; import { DocumentRecipientCreateRequest } from '../models/DocumentRecipientCreateRequest'; import { DocumentRecipientEditRequest } from '../models/DocumentRecipientEditRequest'; import { DocumentRecipientResponse } from '../models/DocumentRecipientResponse'; +import { DocumentRevertToDraftResponse } from '../models/DocumentRevertToDraftResponse'; +import { DocumentSendManualReminder200Response } from '../models/DocumentSendManualReminder200Response'; +import { DocumentSendManualReminder200ResponseResultInner } from '../models/DocumentSendManualReminder200ResponseResultInner'; +import { DocumentSendManualReminder200ResponseResultInnerEmail } from '../models/DocumentSendManualReminder200ResponseResultInnerEmail'; +import { DocumentSendManualReminder200ResponseResultInnerEmailCustomization } from '../models/DocumentSendManualReminder200ResponseResultInnerEmailCustomization'; +import { DocumentSendManualReminder200ResponseResultInnerSms } from '../models/DocumentSendManualReminder200ResponseResultInnerSms'; +import { DocumentSendManualReminder409Response } from '../models/DocumentSendManualReminder409Response'; +import { DocumentSendManualReminderRequest } from '../models/DocumentSendManualReminderRequest'; +import { DocumentSendManualReminderRequestRemindersInner } from '../models/DocumentSendManualReminderRequestRemindersInner'; +import { DocumentSendManualReminderRequestRemindersInnerEmailCustomization } from '../models/DocumentSendManualReminderRequestRemindersInnerEmailCustomization'; import { DocumentSendRequest } from '../models/DocumentSendRequest'; import { DocumentSendRequestForwardingSettings } from '../models/DocumentSendRequestForwardingSettings'; import { DocumentSendRequestSelectedApprovers } from '../models/DocumentSendRequestSelectedApprovers'; -import { DocumentSendRequestSelectedApproversGroup } from '../models/DocumentSendRequestSelectedApproversGroup'; -import { DocumentSendRequestSelectedApproversGroupAssignees } from '../models/DocumentSendRequestSelectedApproversGroupAssignees'; -import { DocumentSendRequestSelectedApproversSteps } from '../models/DocumentSendRequestSelectedApproversSteps'; +import { DocumentSendRequestSelectedApproversStepsInner } from '../models/DocumentSendRequestSelectedApproversStepsInner'; +import { DocumentSendRequestSelectedApproversStepsInnerGroup } from '../models/DocumentSendRequestSelectedApproversStepsInnerGroup'; +import { DocumentSendRequestSelectedApproversStepsInnerGroupAssigneesInner } from '../models/DocumentSendRequestSelectedApproversStepsInnerGroupAssigneesInner'; +import { DocumentSendRequestSender } from '../models/DocumentSendRequestSender'; import { DocumentSendResponse } from '../models/DocumentSendResponse'; -import { DocumentSendResponseRecipients } from '../models/DocumentSendResponseRecipients'; +import { DocumentSendResponseRecipientsInner } from '../models/DocumentSendResponseRecipientsInner'; +import { DocumentSettingsResponse } from '../models/DocumentSettingsResponse'; import { DocumentStatusChangeRequest } from '../models/DocumentStatusChangeRequest'; +import { DocumentStatusChangeRequestStatusEnum } from '../models/DocumentStatusChangeRequestStatusEnum'; import { DocumentStatusEnum } from '../models/DocumentStatusEnum'; import { DocumentStatusRequestEnum } from '../models/DocumentStatusRequestEnum'; import { DocumentStatusResponse } from '../models/DocumentStatusResponse'; import { DocumentTransferAllOwnershipRequest } from '../models/DocumentTransferAllOwnershipRequest'; import { DocumentTransferOwnershipRequest } from '../models/DocumentTransferOwnershipRequest'; import { DocumentUpdateRequest } from '../models/DocumentUpdateRequest'; -import { DocumentUpdateRequestRecipients } from '../models/DocumentUpdateRequestRecipients'; +import { DocumentUpdateRequestFieldValue } from '../models/DocumentUpdateRequestFieldValue'; +import { DocumentUpdateRequestImagesInner } from '../models/DocumentUpdateRequestImagesInner'; +import { DocumentUpdateRequestTextsInner } from '../models/DocumentUpdateRequestTextsInner'; +import { DocumentUpdateRequestTokensInner } from '../models/DocumentUpdateRequestTokensInner'; import { DocumentsFolderCreateRequest } from '../models/DocumentsFolderCreateRequest'; import { DocumentsFolderCreateResponse } from '../models/DocumentsFolderCreateResponse'; import { DocumentsFolderListResponse } from '../models/DocumentsFolderListResponse'; -import { DocumentsFolderListResponseResults } from '../models/DocumentsFolderListResponseResults'; +import { DocumentsFolderListResponseResultsInner } from '../models/DocumentsFolderListResponseResultsInner'; import { DocumentsFolderRenameRequest } from '../models/DocumentsFolderRenameRequest'; import { DocumentsFolderRenameResponse } from '../models/DocumentsFolderRenameResponse'; +import { DocxExportTaskResponse } from '../models/DocxExportTaskResponse'; +import { DocxExportTaskResponseAllOfDocxItems } from '../models/DocxExportTaskResponseAllOfDocxItems'; +import { Dropdown } from '../models/Dropdown'; +import { EditingSessionRequest } from '../models/EditingSessionRequest'; +import { Field } from '../models/Field'; import { FormListResponse } from '../models/FormListResponse'; -import { FormListResponseResults } from '../models/FormListResponseResults'; +import { FormListResponseResultsInner } from '../models/FormListResponseResultsInner'; +import { Initials } from '../models/Initials'; +import { LinkedObjectChild } from '../models/LinkedObjectChild'; import { LinkedObjectCreateRequest } from '../models/LinkedObjectCreateRequest'; import { LinkedObjectCreateResponse } from '../models/LinkedObjectCreateResponse'; import { LinkedObjectListResponse } from '../models/LinkedObjectListResponse'; +import { ListCatalogItemsSearchResponse } from '../models/ListCatalogItemsSearchResponse'; +import { ListDocumentFieldsResponse } from '../models/ListDocumentFieldsResponse'; +import { ListDocuments400Response } from '../models/ListDocuments400Response'; +import { ListDocuments401Response } from '../models/ListDocuments401Response'; +import { ListDocuments403Response } from '../models/ListDocuments403Response'; +import { ListDocuments403ResponseLinksInner } from '../models/ListDocuments403ResponseLinksInner'; +import { ListDocuments429Response } from '../models/ListDocuments429Response'; +import { ListDocumentsByLinkedObjectsResponseInner } from '../models/ListDocumentsByLinkedObjectsResponseInner'; +import { ListNotaries400Response } from '../models/ListNotaries400Response'; +import { ListNotaries400ResponseDetailsInner } from '../models/ListNotaries400ResponseDetailsInner'; +import { ListNotaries403Response } from '../models/ListNotaries403Response'; +import { ListNotaries429Response } from '../models/ListNotaries429Response'; +import { ListNotariesResponse } from '../models/ListNotariesResponse'; +import { ListNotariesResponseResultsInner } from '../models/ListNotariesResponseResultsInner'; +import { ListSmsOptOutChangelogResponse } from '../models/ListSmsOptOutChangelogResponse'; +import { ListSmsOptOutChangelogResponseResultsInner } from '../models/ListSmsOptOutChangelogResponseResultsInner'; +import { ListUsersResponse } from '../models/ListUsersResponse'; +import { ListUsersResponseResultsInner } from '../models/ListUsersResponseResultsInner'; +import { ListUsersResponseResultsInnerWorkspacesInner } from '../models/ListUsersResponseResultsInnerWorkspacesInner'; +import { ListWorkspacesResponse } from '../models/ListWorkspacesResponse'; +import { ListWorkspacesResponseResultsInner } from '../models/ListWorkspacesResponseResultsInner'; import { MemberDetailsResponse } from '../models/MemberDetailsResponse'; import { MemberListResponse } from '../models/MemberListResponse'; +import { ModelDate } from '../models/ModelDate'; +import { NotarizationRequestDetailsResponse } from '../models/NotarizationRequestDetailsResponse'; +import { NotarizationRequestDetailsResponseCreatedBy } from '../models/NotarizationRequestDetailsResponseCreatedBy'; +import { NotarizationRequestDetailsResponseInviteesInner } from '../models/NotarizationRequestDetailsResponseInviteesInner'; +import { NotarizationRequestDetailsResponseRecording } from '../models/NotarizationRequestDetailsResponseRecording'; +import { NotarizationRequestDetailsResponseSignedDocumentsInner } from '../models/NotarizationRequestDetailsResponseSignedDocumentsInner'; import { OAuth2AccessTokenResponse } from '../models/OAuth2AccessTokenResponse'; +import { Payment } from '../models/Payment'; import { PricingResponse } from '../models/PricingResponse'; import { PricingTableRequest } from '../models/PricingTableRequest'; import { PricingTableRequestRowOptions } from '../models/PricingTableRequestRowOptions'; -import { PricingTableRequestRows } from '../models/PricingTableRequestRows'; -import { PricingTableRequestSections } from '../models/PricingTableRequestSections'; +import { PricingTableRequestSectionsInner } from '../models/PricingTableRequestSectionsInner'; +import { PricingTableRequestSectionsInnerRowsInner } from '../models/PricingTableRequestSectionsInnerRowsInner'; import { PricingTableResponse } from '../models/PricingTableResponse'; -import { PricingTableResponseDiscount } from '../models/PricingTableResponseDiscount'; -import { PricingTableResponseItems } from '../models/PricingTableResponseItems'; -import { PricingTableResponseOptions } from '../models/PricingTableResponseOptions'; +import { PricingTableResponseItemsInner } from '../models/PricingTableResponseItemsInner'; +import { PricingTableResponseItemsInnerDiscount } from '../models/PricingTableResponseItemsInnerDiscount'; +import { PricingTableResponseItemsInnerOptions } from '../models/PricingTableResponseItemsInnerOptions'; import { PricingTableResponseSummary } from '../models/PricingTableResponseSummary'; +import { ProductCatalogCatalogCustomBundleItem } from '../models/ProductCatalogCatalogCustomBundleItem'; +import { ProductCatalogCatalogItemInBundle } from '../models/ProductCatalogCatalogItemInBundle'; +import { ProductCatalogCustomBundleItemNoId } from '../models/ProductCatalogCustomBundleItemNoId'; +import { ProductCatalogCustomCatalogItemInBundle } from '../models/ProductCatalogCustomCatalogItemInBundle'; +import { ProductCatalogItemPatchRequest } from '../models/ProductCatalogItemPatchRequest'; +import { ProductCatalogItemPatchRequestBundleItemsInner } from '../models/ProductCatalogItemPatchRequestBundleItemsInner'; +import { ProductCatalogItemPatchRequestBundleItemsInnerItemOrUuid } from '../models/ProductCatalogItemPatchRequestBundleItemsInnerItemOrUuid'; +import { ProductCatalogItemPatchRequestProductVariant } from '../models/ProductCatalogItemPatchRequestProductVariant'; +import { ProductCatalogItemPriceConfiguration } from '../models/ProductCatalogItemPriceConfiguration'; +import { ProductCatalogItemPriceTier } from '../models/ProductCatalogItemPriceTier'; +import { ProductCatalogItemRequest } from '../models/ProductCatalogItemRequest'; +import { ProductCatalogItemRequestBundleItemsInner } from '../models/ProductCatalogItemRequestBundleItemsInner'; +import { ProductCatalogItemRequestBundleItemsInnerItemOrUuid } from '../models/ProductCatalogItemRequestBundleItemsInnerItemOrUuid'; +import { ProductCatalogItemRequestCustomFieldsInner } from '../models/ProductCatalogItemRequestCustomFieldsInner'; +import { ProductCatalogItemRequestImagesInner } from '../models/ProductCatalogItemRequestImagesInner'; +import { ProductCatalogItemResponse } from '../models/ProductCatalogItemResponse'; +import { ProductCatalogItemResponseBundleItemsInner } from '../models/ProductCatalogItemResponseBundleItemsInner'; +import { ProductCatalogItemResponseBundleItemsInnerItem } from '../models/ProductCatalogItemResponseBundleItemsInnerItem'; +import { ProductCatalogItemResponseDefaultPriceConfiguration } from '../models/ProductCatalogItemResponseDefaultPriceConfiguration'; +import { ProductCatalogItemResponseVariantsInner } from '../models/ProductCatalogItemResponseVariantsInner'; +import { ProductCatalogPricingMethodEnum } from '../models/ProductCatalogPricingMethodEnum'; +import { ProductCatalogSearchCatalogItemResponse } from '../models/ProductCatalogSearchCatalogItemResponse'; +import { ProductCatalogSearchCatalogItemResponseCustomFieldsInner } from '../models/ProductCatalogSearchCatalogItemResponseCustomFieldsInner'; +import { ProductCatalogSearchCatalogItemResponseImagesInner } from '../models/ProductCatalogSearchCatalogItemResponseImagesInner'; +import { ProductCatalogSearchCatalogItemResponseTiersInner } from '../models/ProductCatalogSearchCatalogItemResponseTiersInner'; +import { ProductCatalogTypeEnum } from '../models/ProductCatalogTypeEnum'; import { QuoteResponse } from '../models/QuoteResponse'; -import { QuoteResponseAction } from '../models/QuoteResponseAction'; -import { QuoteResponseCondition } from '../models/QuoteResponseCondition'; -import { QuoteResponseConditionComparison } from '../models/QuoteResponseConditionComparison'; -import { QuoteResponseMergeRules } from '../models/QuoteResponseMergeRules'; -import { QuoteResponseOptions } from '../models/QuoteResponseOptions'; +import { QuoteResponseMergeRulesInner } from '../models/QuoteResponseMergeRulesInner'; +import { QuoteResponseMergeRulesInnerAction } from '../models/QuoteResponseMergeRulesInnerAction'; +import { QuoteResponseMergeRulesInnerCondition } from '../models/QuoteResponseMergeRulesInnerCondition'; +import { QuoteResponseMergeRulesInnerConditionComparisonInner } from '../models/QuoteResponseMergeRulesInnerConditionComparisonInner'; import { QuoteResponseSectionColumn } from '../models/QuoteResponseSectionColumn'; import { QuoteResponseSectionItem } from '../models/QuoteResponseSectionItem'; +import { QuoteResponseSectionItemOptions } from '../models/QuoteResponseSectionItemOptions'; import { QuoteResponseSectionSummary } from '../models/QuoteResponseSectionSummary'; -import { QuoteResponseSections } from '../models/QuoteResponseSections'; +import { QuoteResponseSectionsInner } from '../models/QuoteResponseSectionsInner'; import { QuoteResponseSettings } from '../models/QuoteResponseSettings'; import { QuoteResponseSummary } from '../models/QuoteResponseSummary'; -import { QuoteResponseSummaryDiscounts } from '../models/QuoteResponseSummaryDiscounts'; -import { QuoteResponseSummaryRecurringSubtotal } from '../models/QuoteResponseSummaryRecurringSubtotal'; +import { QuoteResponseSummaryDiscountsValue } from '../models/QuoteResponseSummaryDiscountsValue'; +import { QuoteResponseSummaryRecurringSubtotalInner } from '../models/QuoteResponseSummaryRecurringSubtotalInner'; import { QuoteSectionSettings } from '../models/QuoteSectionSettings'; import { QuoteUpdateRequest } from '../models/QuoteUpdateRequest'; -import { QuoteUpdateRequestDiscounts } from '../models/QuoteUpdateRequestDiscounts'; -import { QuoteUpdateRequestOptions } from '../models/QuoteUpdateRequestOptions'; -import { QuoteUpdateRequestPriceSettings } from '../models/QuoteUpdateRequestPriceSettings'; -import { QuoteUpdateRequestPriceSettingsTiers } from '../models/QuoteUpdateRequestPriceSettingsTiers'; +import { QuoteUpdateRequestBillingFrequencyEnum } from '../models/QuoteUpdateRequestBillingFrequencyEnum'; +import { QuoteUpdateRequestDiscountTypeEnum } from '../models/QuoteUpdateRequestDiscountTypeEnum'; import { QuoteUpdateRequestSettings } from '../models/QuoteUpdateRequestSettings'; -import { QuoteUpdateRequestSettings1 } from '../models/QuoteUpdateRequestSettings1'; +import { QuoteUpdateRequestSettingsSelectionTypeTypeEnum } from '../models/QuoteUpdateRequestSettingsSelectionTypeTypeEnum'; +import { RadioButtons } from '../models/RadioButtons'; +import { RecipientAssignedTo } from '../models/RecipientAssignedTo'; +import { RecipientAssignmentDetails } from '../models/RecipientAssignmentDetails'; +import { RecipientDeliveryMethods } from '../models/RecipientDeliveryMethods'; +import { RecipientKindEnum } from '../models/RecipientKindEnum'; +import { RecipientPersonalDetails } from '../models/RecipientPersonalDetails'; import { RecipientRedirect } from '../models/RecipientRedirect'; +import { RecipientRedirectSettings } from '../models/RecipientRedirectSettings'; +import { RecipientVerificationPlaceEnum } from '../models/RecipientVerificationPlaceEnum'; import { RecipientVerificationSettings } from '../models/RecipientVerificationSettings'; +import { RecipientVerificationSettingsIdVerification } from '../models/RecipientVerificationSettingsIdVerification'; +import { RecipientVerificationSettingsKbaVerification } from '../models/RecipientVerificationSettingsKbaVerification'; import { RecipientVerificationSettingsPasscodeVerification } from '../models/RecipientVerificationSettingsPasscodeVerification'; import { RecipientVerificationSettingsPhoneVerification } from '../models/RecipientVerificationSettingsPhoneVerification'; -import { RicipientDeliveryMethods } from '../models/RicipientDeliveryMethods'; +import { RecipientsGroupAssignedTo } from '../models/RecipientsGroupAssignedTo'; +import { RecipientsGroupAssignedToAllOfMembers } from '../models/RecipientsGroupAssignedToAllOfMembers'; +import { RemoveMember400Response } from '../models/RemoveMember400Response'; +import { RemoveMember404Response } from '../models/RemoveMember404Response'; +import { SearchCatalogItems401Response } from '../models/SearchCatalogItems401Response'; import { SectionInfoResponse } from '../models/SectionInfoResponse'; +import { Signature } from '../models/Signature'; +import { Stamp } from '../models/Stamp'; +import { StatusDocument404Response } from '../models/StatusDocument404Response'; +import { StatusDocumentAutoReminder400Response } from '../models/StatusDocumentAutoReminder400Response'; +import { TableCell } from '../models/TableCell'; +import { TableRequest } from '../models/TableRequest'; +import { TableRequestData } from '../models/TableRequestData'; +import { TableRequestDataSectionsInner } from '../models/TableRequestDataSectionsInner'; +import { TemplateCreateResponse } from '../models/TemplateCreateResponse'; import { TemplateDetailsResponse } from '../models/TemplateDetailsResponse'; -import { TemplateDetailsResponseContentPlaceholders } from '../models/TemplateDetailsResponseContentPlaceholders'; -import { TemplateDetailsResponseImages } from '../models/TemplateDetailsResponseImages'; -import { TemplateDetailsResponsePreassignedPerson } from '../models/TemplateDetailsResponsePreassignedPerson'; -import { TemplateDetailsResponseRoles } from '../models/TemplateDetailsResponseRoles'; -import { TemplateDetailsResponseTokens } from '../models/TemplateDetailsResponseTokens'; +import { TemplateDetailsResponseContentPlaceholdersInner } from '../models/TemplateDetailsResponseContentPlaceholdersInner'; +import { TemplateDetailsResponseImagesInner } from '../models/TemplateDetailsResponseImagesInner'; +import { TemplateDetailsResponseRolesInner } from '../models/TemplateDetailsResponseRolesInner'; +import { TemplateDetailsResponseRolesInnerPreassignedPerson } from '../models/TemplateDetailsResponseRolesInnerPreassignedPerson'; +import { TemplateDetailsResponseRolesInnerPreassignedPersonMembersInner } from '../models/TemplateDetailsResponseRolesInnerPreassignedPersonMembersInner'; +import { TemplateDetailsResponseTokensInner } from '../models/TemplateDetailsResponseTokensInner'; import { TemplateListResponse } from '../models/TemplateListResponse'; -import { TemplateListResponseResults } from '../models/TemplateListResponseResults'; +import { TemplateSettingsResponse } from '../models/TemplateSettingsResponse'; +import { TemplateStatusResponse } from '../models/TemplateStatusResponse'; +import { TemplateUpdateRequest } from '../models/TemplateUpdateRequest'; import { TemplatesFolderCreateRequest } from '../models/TemplatesFolderCreateRequest'; import { TemplatesFolderCreateResponse } from '../models/TemplatesFolderCreateResponse'; import { TemplatesFolderListResponse } from '../models/TemplatesFolderListResponse'; -import { TemplatesFolderListResponseResults } from '../models/TemplatesFolderListResponseResults'; +import { TemplatesFolderListResponseResultsInner } from '../models/TemplatesFolderListResponseResultsInner'; import { TemplatesFolderRenameRequest } from '../models/TemplatesFolderRenameRequest'; import { TemplatesFolderRenameResponse } from '../models/TemplatesFolderRenameResponse'; +import { Text } from '../models/Text'; +import { UpdateDocument400Response } from '../models/UpdateDocument400Response'; +import { UpdateDocumentActor } from '../models/UpdateDocumentActor'; +import { UpdateDocumentAutoRemindersRequest } from '../models/UpdateDocumentAutoRemindersRequest'; +import { UpdateDocumentAutoRemindersResponse } from '../models/UpdateDocumentAutoRemindersResponse'; +import { UpdateDocumentRecipient } from '../models/UpdateDocumentRecipient'; +import { UpdateDocumentRecipientGroup } from '../models/UpdateDocumentRecipientGroup'; +import { UpdateDocumentSettingsRequest } from '../models/UpdateDocumentSettingsRequest'; import { UpdateIntegrationQuoteSection } from '../models/UpdateIntegrationQuoteSection'; import { UpdateIntegrationQuoteSectionItem } from '../models/UpdateIntegrationQuoteSectionItem'; -import { UploadSectionByPdfRequest } from '../models/UploadSectionByPdfRequest'; +import { UpdateIntegrationQuoteSectionItemDiscountsValue } from '../models/UpdateIntegrationQuoteSectionItemDiscountsValue'; +import { UpdateIntegrationQuoteSectionItemOptions } from '../models/UpdateIntegrationQuoteSectionItemOptions'; +import { UpdateIntegrationQuoteSectionItemPriceSettings } from '../models/UpdateIntegrationQuoteSectionItemPriceSettings'; +import { UpdateIntegrationQuoteSectionItemPriceSettingsTiersInner } from '../models/UpdateIntegrationQuoteSectionItemPriceSettingsTiersInner'; +import { UpdateIntegrationQuoteSectionSettings } from '../models/UpdateIntegrationQuoteSectionSettings'; +import { UpdateTemplateSettingsRequest } from '../models/UpdateTemplateSettingsRequest'; +import { UploadSectionBase } from '../models/UploadSectionBase'; import { UploadSectionByTemplateRequest } from '../models/UploadSectionByTemplateRequest'; +import { UploadSectionByTemplateRequestAllOfContentLibraryItems } from '../models/UploadSectionByTemplateRequestAllOfContentLibraryItems'; +import { UploadSectionByTemplateRequestAllOfContentPlaceholders } from '../models/UploadSectionByTemplateRequestAllOfContentPlaceholders'; import { UploadSectionListResponse } from '../models/UploadSectionListResponse'; -import { UploadSectionListResponseResults } from '../models/UploadSectionListResponseResults'; +import { UploadSectionListResponseResultsInner } from '../models/UploadSectionListResponseResultsInner'; import { UploadSectionRequest } from '../models/UploadSectionRequest'; +import { UploadSectionRequestOneOf } from '../models/UploadSectionRequestOneOf'; import { UploadSectionResponse } from '../models/UploadSectionResponse'; import { UploadSectionStatusEnum } from '../models/UploadSectionStatusEnum'; import { UploadSectionStatusResponse } from '../models/UploadSectionStatusResponse'; +import { UserLicenseEnum } from '../models/UserLicenseEnum'; import { WebhookEventDetailsResponse } from '../models/WebhookEventDetailsResponse'; import { WebhookEventErrorEnum } from '../models/WebhookEventErrorEnum'; import { WebhookEventHttpStatusCodeGroupEnum } from '../models/WebhookEventHttpStatusCodeGroupEnum'; @@ -158,6 +368,7 @@ import { WebhookSubscriptionPayloadEnum } from '../models/WebhookSubscriptionPay import { WebhookSubscriptionSharedKeyResponse } from '../models/WebhookSubscriptionSharedKeyResponse'; import { WebhookSubscriptionStatusEnum } from '../models/WebhookSubscriptionStatusEnum'; import { WebhookSubscriptionTriggerEnum } from '../models/WebhookSubscriptionTriggerEnum'; +import { WorkspaceMemberRoleEnum } from '../models/WorkspaceMemberRoleEnum'; import { APILogsApiRequestFactory, APILogsApiResponseProcessor} from "../apis/APILogsApi"; export class ObservableAPILogsApi { @@ -177,59 +388,140 @@ export class ObservableAPILogsApi { /** * Returns details of the specific API log event. - * Details API Log + * API Log Details * @param id Log event id. */ - public detailsLog(id: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.detailsLog(id, _options); + public detailsLogWithHttpInfo(id: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.detailsLog(id, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.detailsLog(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.detailsLogWithHttpInfo(rsp))); })); } /** - * Get the list of all logs within the selected workspace. Optionally filter by date, page, and `#` of items per page. + * Returns details of the specific API log event. + * API Log Details + * @param id Log event id. + */ + public detailsLog(id: string, _options?: ConfigurationOptions): Observable { + return this.detailsLogWithHttpInfo(id, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Get the list of all logs within the selected workspace.\\ Optionally filter by date, page, and `#` of items per page. + * List API Log + * @param [since] Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \"-90d\" (for past 90 days). + * @param [to] Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \"-10d\" (for past 10 days) or a special \"now\" value. + * @param [count] The amount of items on each page. + * @param [page] Returns page of the results by number. + * @param [statuses] Returns only the predefined status codes. + * @param [methods] Returns only the predefined HTTP methods. Allows GET, POST, PUT, PATCH, and DELETE. + * @param [search] Returns the results containing a string. + * @param [environmentType] Returns logs for production/sandbox. + */ + public listLogsWithHttpInfo(since?: string, to?: string, count?: number, page?: number, statuses?: Array, methods?: Array, search?: string, environmentType?: ApiLogEnvironmentTypeEnum, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.listLogs(since, to, count, page, statuses, methods, search, environmentType, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listLogsWithHttpInfo(rsp))); + })); + } + + /** + * Get the list of all logs within the selected workspace.\\ Optionally filter by date, page, and `#` of items per page. * List API Log - * @param since Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \"-90d\" (for past 90 days). - * @param to Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \"-10d\" (for past 10 days) or a special \"now\" value. - * @param count The amount of items on each page. - * @param page Page number of the results returned. - * @param statuses Returns only the predefined status codes. Allows 1xx, 2xx, 3xx, 4xx, and 5xx. - * @param methods Returns only the predefined HTTP methods. Allows GET, POST, PUT, PATCH, and DELETE. - * @param search Returns the results containing a string. - * @param environmentType Returns logs for production/sandbox. + * @param [since] Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \"-90d\" (for past 90 days). + * @param [to] Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \"-10d\" (for past 10 days) or a special \"now\" value. + * @param [count] The amount of items on each page. + * @param [page] Returns page of the results by number. + * @param [statuses] Returns only the predefined status codes. + * @param [methods] Returns only the predefined HTTP methods. Allows GET, POST, PUT, PATCH, and DELETE. + * @param [search] Returns the results containing a string. + * @param [environmentType] Returns logs for production/sandbox. + */ + public listLogs(since?: string, to?: string, count?: number, page?: number, statuses?: Array, methods?: Array, search?: string, environmentType?: ApiLogEnvironmentTypeEnum, _options?: ConfigurationOptions): Observable { + return this.listLogsWithHttpInfo(since, to, count, page, statuses, methods, search, environmentType, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + +} + +import { CommunicationPreferencesApiRequestFactory, CommunicationPreferencesApiResponseProcessor} from "../apis/CommunicationPreferencesApi"; +export class ObservableCommunicationPreferencesApi { + private requestFactory: CommunicationPreferencesApiRequestFactory; + private responseProcessor: CommunicationPreferencesApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: CommunicationPreferencesApiRequestFactory, + responseProcessor?: CommunicationPreferencesApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = requestFactory || new CommunicationPreferencesApiRequestFactory(configuration); + this.responseProcessor = responseProcessor || new CommunicationPreferencesApiResponseProcessor(); + } + + /** + * Retrieves a list of the most recent SMS opt-out changes for each phone numbers used in your workspace. > 📘 You can filter results by time range using `timestamp_from` and `timestamp_to`. + * Recent SMS Opt-out + * @param [timestampFrom] The start of the timestamp. If no timestamp is provided, 1 hour before the current time will be used. + * @param [timestampTo] The end of the timestamp range. If no timestamp is provided the current time will be used. */ - public listLogs(since?: string, to?: string, count?: number, page?: number, statuses?: Array<100 | 200 | 300 | 400 | 500>, methods?: Array<'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'>, search?: string, environmentType?: 'PRODUCTION' | 'SANDBOX', _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.listLogs(since, to, count, page, statuses, methods, search, environmentType, _options); + public listRecentSmsOptOutsWithHttpInfo(timestampFrom?: Date, timestampTo?: Date, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.listRecentSmsOptOuts(timestampFrom, timestampTo, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listLogs(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listRecentSmsOptOutsWithHttpInfo(rsp))); })); } + /** + * Retrieves a list of the most recent SMS opt-out changes for each phone numbers used in your workspace. > 📘 You can filter results by time range using `timestamp_from` and `timestamp_to`. + * Recent SMS Opt-out + * @param [timestampFrom] The start of the timestamp. If no timestamp is provided, 1 hour before the current time will be used. + * @param [timestampTo] The end of the timestamp range. If no timestamp is provided the current time will be used. + */ + public listRecentSmsOptOuts(timestampFrom?: Date, timestampTo?: Date, _options?: ConfigurationOptions): Observable { + return this.listRecentSmsOptOutsWithHttpInfo(timestampFrom, timestampTo, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + } import { ContactsApiRequestFactory, ContactsApiResponseProcessor} from "../apis/ContactsApi"; @@ -249,121 +541,177 @@ export class ObservableContactsApi { } /** + * This method adds a contact into a contacts list. * Create contact - * @param contactCreateRequest + * @param contactCreateRequest */ - public createContact(contactCreateRequest: ContactCreateRequest, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.createContact(contactCreateRequest, _options); + public createContactWithHttpInfo(contactCreateRequest: ContactCreateRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.createContact(contactCreateRequest, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createContact(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createContactWithHttpInfo(rsp))); })); } /** - * Delete contact by id + * This method adds a contact into a contacts list. + * Create contact + * @param contactCreateRequest + */ + public createContact(contactCreateRequest: ContactCreateRequest, _options?: ConfigurationOptions): Observable { + return this.createContactWithHttpInfo(contactCreateRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * This method deletes a contact. + * Delete Contact * @param id Contact id. */ - public deleteContact(id: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.deleteContact(id, _options); + public deleteContactWithHttpInfo(id: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.deleteContact(id, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteContact(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteContactWithHttpInfo(rsp))); })); } /** - * Get contact details by id + * This method deletes a contact. + * Delete Contact + * @param id Contact id. + */ + public deleteContact(id: string, _options?: ConfigurationOptions): Observable { + return this.deleteContactWithHttpInfo(id, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Returns contact details by its ID. + * Contact Details * @param id Contact id. */ - public detailsContact(id: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.detailsContact(id, _options); + public detailsContactWithHttpInfo(id: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.detailsContact(id, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.detailsContact(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.detailsContactWithHttpInfo(rsp))); })); } /** + * Returns contact details by its ID. + * Contact Details + * @param id Contact id. + */ + public detailsContact(id: string, _options?: ConfigurationOptions): Observable { + return this.detailsContactWithHttpInfo(id, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * This method returns a list of contacts associated with a workspace. * List contacts - * @param email Optional search parameter. Filter results by exact match. + * @param [email] Optional search parameter. Filter results by exact match. */ - public listContacts(email?: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.listContacts(email, _options); + public listContactsWithHttpInfo(email?: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.listContacts(email, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listContacts(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listContactsWithHttpInfo(rsp))); })); } /** - * Update contact by id + * This method returns a list of contacts associated with a workspace. + * List contacts + * @param [email] Optional search parameter. Filter results by exact match. + */ + public listContacts(email?: string, _options?: ConfigurationOptions): Observable { + return this.listContactsWithHttpInfo(email, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * This method updates a contact details. + * Update Contact * @param id Contact id. - * @param contactUpdateRequest + * @param contactUpdateRequest */ - public updateContact(id: string, contactUpdateRequest: ContactUpdateRequest, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.updateContact(id, contactUpdateRequest, _options); + public updateContactWithHttpInfo(id: string, contactUpdateRequest: ContactUpdateRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.updateContact(id, contactUpdateRequest, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updateContact(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updateContactWithHttpInfo(rsp))); })); } + /** + * This method updates a contact details. + * Update Contact + * @param id Contact id. + * @param contactUpdateRequest + */ + public updateContact(id: string, contactUpdateRequest: ContactUpdateRequest, _options?: ConfigurationOptions): Observable { + return this.updateContactWithHttpInfo(id, contactUpdateRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + } import { ContentLibraryItemsApiRequestFactory, ContentLibraryItemsApiResponseProcessor} from "../apis/ContentLibraryItemsApi"; @@ -383,1464 +731,3883 @@ export class ObservableContentLibraryItemsApi { } /** - * Return detailed data about a content library item. - * Details Content Library Item - * @param id Content Library Item ID + * This API endpoint allows users to create an empty item in the content library. No actual content or data is required to be provided in the initial creation. + * Create Content Library Item + * @param contentLibraryItemCreateFromUrlRequest */ - public detailsContentLibraryItem(id: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.detailsContentLibraryItem(id, _options); + public createContentLibraryItemWithHttpInfo(contentLibraryItemCreateFromUrlRequest: ContentLibraryItemCreateFromUrlRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.createContentLibraryItem(contentLibraryItemCreateFromUrlRequest, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.detailsContentLibraryItem(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createContentLibraryItemWithHttpInfo(rsp))); })); } /** - * Optionally filter by a search query or tags. - * List Content Library Item - * @param q Search query. Filter by content library item name. - * @param id Specify content library item ID. - * @param deleted Returns only the deleted content library items. - * @param folderUuid The UUID of the folder where the content library items are stored. - * @param count Specify how many content library items to return. Default is 50 content library items, maximum is 100 content library items. - * @param page Specify which page of the dataset to return. - * @param tag Search tag. Filter by content library item tag. + * This API endpoint allows users to create an empty item in the content library. No actual content or data is required to be provided in the initial creation. + * Create Content Library Item + * @param contentLibraryItemCreateFromUrlRequest + */ + public createContentLibraryItem(contentLibraryItemCreateFromUrlRequest: ContentLibraryItemCreateFromUrlRequest, _options?: ConfigurationOptions): Observable { + return this.createContentLibraryItemWithHttpInfo(contentLibraryItemCreateFromUrlRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * This asynchronous endpoint allows users to create a new CLI by uploading a file. The uploaded file is processed in the background to generate the CLI. The maximum allowable file size for upload is 100 MB. Field tags and form fields are not supported yet. Once the file is uploaded, the processing will happen asynchronously, and users need to check the status of the CLI creation. + * Create Content Library Item from File Upload + * @param [file] Binary PDF File + * @param [data] JSON as a multipart/form-data request. */ - public listContentLibraryItems(q?: string, id?: string, deleted?: boolean, folderUuid?: string, count?: number, page?: number, tag?: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.listContentLibraryItems(q, id, deleted, folderUuid, count, page, tag, _options); + public createContentLibraryItemFromUploadWithHttpInfo(file?: HttpFile, data?: ContentLibraryItemCreateRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.createContentLibraryItemFromUpload(file, data, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listContentLibraryItems(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createContentLibraryItemFromUploadWithHttpInfo(rsp))); })); } -} - -import { DocumentAttachmentsApiRequestFactory, DocumentAttachmentsApiResponseProcessor} from "../apis/DocumentAttachmentsApi"; -export class ObservableDocumentAttachmentsApi { - private requestFactory: DocumentAttachmentsApiRequestFactory; - private responseProcessor: DocumentAttachmentsApiResponseProcessor; - private configuration: Configuration; - - public constructor( - configuration: Configuration, - requestFactory?: DocumentAttachmentsApiRequestFactory, - responseProcessor?: DocumentAttachmentsApiResponseProcessor - ) { - this.configuration = configuration; - this.requestFactory = requestFactory || new DocumentAttachmentsApiRequestFactory(configuration); - this.responseProcessor = responseProcessor || new DocumentAttachmentsApiResponseProcessor(); + /** + * This asynchronous endpoint allows users to create a new CLI by uploading a file. The uploaded file is processed in the background to generate the CLI. The maximum allowable file size for upload is 100 MB. Field tags and form fields are not supported yet. Once the file is uploaded, the processing will happen asynchronously, and users need to check the status of the CLI creation. + * Create Content Library Item from File Upload + * @param [file] Binary PDF File + * @param [data] JSON as a multipart/form-data request. + */ + public createContentLibraryItemFromUpload(file?: HttpFile, data?: ContentLibraryItemCreateRequest, _options?: ConfigurationOptions): Observable { + return this.createContentLibraryItemFromUploadWithHttpInfo(file, data, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** - * Creates an attachment for a particular document - * Document Attachment Create - * @param id Document UUID - * @param file Binary file to be attached to a document - * @param source URL link to the file to be attached to a document - * @param name Optional name to set for uploaded file + * Retrieve detailed information about a specific content library item using its ID. The details include: - **Roles** - **All fields with values** - **All tokens with values** - **Pricing information (pricing tables, products, etc)** - **Metadata** - **Tags** - **Modification Timestamps**: note that `date_modified` means any changes associated with the CLI, while `content_date_modified` logs any changes in CLI content. + * Content Library Item Details + * @param id Content Library Item ID */ - public createDocumentAttachment(id: string, file?: HttpFile, source?: string, name?: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.createDocumentAttachment(id, file, source, name, _options); + public detailsContentLibraryItemWithHttpInfo(id: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.detailsContentLibraryItem(id, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createDocumentAttachment(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.detailsContentLibraryItemWithHttpInfo(rsp))); })); } /** - * Deletes specific document's attachment - * Document Attachment Delete - * @param id Document UUID - * @param attachmentId Attachment UUID + * Retrieve detailed information about a specific content library item using its ID. The details include: - **Roles** - **All fields with values** - **All tokens with values** - **Pricing information (pricing tables, products, etc)** - **Metadata** - **Tags** - **Modification Timestamps**: note that `date_modified` means any changes associated with the CLI, while `content_date_modified` logs any changes in CLI content. + * Content Library Item Details + * @param id Content Library Item ID + */ + public detailsContentLibraryItem(id: string, _options?: ConfigurationOptions): Observable { + return this.detailsContentLibraryItemWithHttpInfo(id, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * The endpoint retrieves items from the content library in PandaDoc. This endpoint supports filtering options to narrow down the results, allowing users to search by query, tags, folder, and more. > ### ⚠️ Please avoid empty values for the parameters > API returns \"400\" error when any of the parameters has an empty value. Please remove such a parameter from the request or add a value. + * List Content Library Item + * @param [q] Search query. Filter by content library item name. + * @param [id] Specify content library item ID. + * @param [deleted] Returns only the deleted content library items. + * @param [folderUuid] The UUID of the folder where the content library items are stored. + * @param [count] Specify how many content library items to return. Default is 50 content library items, maximum is 100 content library items. + * @param [page] Specify which page of the dataset to return. + * @param [tag] Search tag. Filter by content library item tag. */ - public deleteDocumentAttachment(id: string, attachmentId: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.deleteDocumentAttachment(id, attachmentId, _options); + public listContentLibraryItemsWithHttpInfo(q?: string, id?: string, deleted?: boolean, folderUuid?: string, count?: number, page?: number, tag?: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.listContentLibraryItems(q, id, deleted, folderUuid, count, page, tag, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteDocumentAttachment(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listContentLibraryItemsWithHttpInfo(rsp))); })); } /** - * Returns details of the specific document's attachment - * Document Attachment Details - * @param id Document UUID - * @param attachmentId Attachment UUID + * The endpoint retrieves items from the content library in PandaDoc. This endpoint supports filtering options to narrow down the results, allowing users to search by query, tags, folder, and more. > ### ⚠️ Please avoid empty values for the parameters > API returns \"400\" error when any of the parameters has an empty value. Please remove such a parameter from the request or add a value. + * List Content Library Item + * @param [q] Search query. Filter by content library item name. + * @param [id] Specify content library item ID. + * @param [deleted] Returns only the deleted content library items. + * @param [folderUuid] The UUID of the folder where the content library items are stored. + * @param [count] Specify how many content library items to return. Default is 50 content library items, maximum is 100 content library items. + * @param [page] Specify which page of the dataset to return. + * @param [tag] Search tag. Filter by content library item tag. + */ + public listContentLibraryItems(q?: string, id?: string, deleted?: boolean, folderUuid?: string, count?: number, page?: number, tag?: string, _options?: ConfigurationOptions): Observable { + return this.listContentLibraryItemsWithHttpInfo(q, id, deleted, folderUuid, count, page, tag, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Requesting the CLI status helps verify that a CLI is in the expected state before invoking additional API methods. ## Available CLI Statuses The following is a complete list of all possible CLI statuses returned: | CLI Status | Status Description | |-----------------|--------------------| | `cli.UPLOADED` | The CLI upload process has been initiated and is currently in progress. It will soon transition to the `cli.PROCESSED` state. | | `cli.PROCESSED` | The CLI has been successfully uploaded and created. At this stage, all aspects of the CLI are editable. | | `cli.ERROR` | The CLI upload process has failed. Please refer to the error details in the response for more information. | + * Content Library Item Status + * @param id Content Library Item ID */ - public detailsDocumentAttachment(id: string, attachmentId: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.detailsDocumentAttachment(id, attachmentId, _options); + public statusContentLibraryItemWithHttpInfo(id: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.statusContentLibraryItem(id, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.detailsDocumentAttachment(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.statusContentLibraryItemWithHttpInfo(rsp))); })); } /** - * Returns document attachment file for download - * Document Attachment Download + * Requesting the CLI status helps verify that a CLI is in the expected state before invoking additional API methods. ## Available CLI Statuses The following is a complete list of all possible CLI statuses returned: | CLI Status | Status Description | |-----------------|--------------------| | `cli.UPLOADED` | The CLI upload process has been initiated and is currently in progress. It will soon transition to the `cli.PROCESSED` state. | | `cli.PROCESSED` | The CLI has been successfully uploaded and created. At this stage, all aspects of the CLI are editable. | | `cli.ERROR` | The CLI upload process has failed. Please refer to the error details in the response for more information. | + * Content Library Item Status + * @param id Content Library Item ID + */ + public statusContentLibraryItem(id: string, _options?: ConfigurationOptions): Observable { + return this.statusContentLibraryItemWithHttpInfo(id, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + +} + +import { DocumentAttachmentsApiRequestFactory, DocumentAttachmentsApiResponseProcessor} from "../apis/DocumentAttachmentsApi"; +export class ObservableDocumentAttachmentsApi { + private requestFactory: DocumentAttachmentsApiRequestFactory; + private responseProcessor: DocumentAttachmentsApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: DocumentAttachmentsApiRequestFactory, + responseProcessor?: DocumentAttachmentsApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = requestFactory || new DocumentAttachmentsApiRequestFactory(configuration); + this.responseProcessor = responseProcessor || new DocumentAttachmentsApiResponseProcessor(); + } + + /** + * Creates an attachment for a particular document + * Create Document Attachment * @param id Document UUID - * @param attachmentId Attachment UUID + * @param documentAttachmentRequest */ - public downloadDocumentAttachment(id: string, attachmentId: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.downloadDocumentAttachment(id, attachmentId, _options); + public createDocumentAttachmentWithHttpInfo(id: string, documentAttachmentRequest: DocumentAttachmentRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.createDocumentAttachment(id, documentAttachmentRequest, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.downloadDocumentAttachment(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createDocumentAttachmentWithHttpInfo(rsp))); })); } /** - * Return list of objects attached to particular document - * Document Attachment List + * Creates an attachment for a particular document + * Create Document Attachment + * @param id Document UUID + * @param documentAttachmentRequest + */ + public createDocumentAttachment(id: string, documentAttachmentRequest: DocumentAttachmentRequest, _options?: ConfigurationOptions): Observable { + return this.createDocumentAttachmentWithHttpInfo(id, documentAttachmentRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Creates an attachment for a particular document + * Create Document Attachment From Upload * @param id Document UUID + * @param [file] Binary file to be attached to a document + * @param [name] Optional name to set for uploaded file */ - public listDocumentAttachments(id: string, _options?: Configuration): Observable> { - const requestContextPromise = this.requestFactory.listDocumentAttachments(id, _options); + public createDocumentAttachmentFromFileUploadWithHttpInfo(id: string, file?: HttpFile, name?: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.createDocumentAttachmentFromFileUpload(id, file, name, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listDocumentAttachments(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createDocumentAttachmentFromFileUploadWithHttpInfo(rsp))); })); } -} - -import { DocumentRecipientsApiRequestFactory, DocumentRecipientsApiResponseProcessor} from "../apis/DocumentRecipientsApi"; -export class ObservableDocumentRecipientsApi { - private requestFactory: DocumentRecipientsApiRequestFactory; - private responseProcessor: DocumentRecipientsApiResponseProcessor; - private configuration: Configuration; - - public constructor( - configuration: Configuration, - requestFactory?: DocumentRecipientsApiRequestFactory, - responseProcessor?: DocumentRecipientsApiResponseProcessor - ) { - this.configuration = configuration; - this.requestFactory = requestFactory || new DocumentRecipientsApiRequestFactory(configuration); - this.responseProcessor = responseProcessor || new DocumentRecipientsApiResponseProcessor(); + /** + * Creates an attachment for a particular document + * Create Document Attachment From Upload + * @param id Document UUID + * @param [file] Binary file to be attached to a document + * @param [name] Optional name to set for uploaded file + */ + public createDocumentAttachmentFromFileUpload(id: string, file?: HttpFile, name?: string, _options?: ConfigurationOptions): Observable { + return this.createDocumentAttachmentFromFileUploadWithHttpInfo(id, file, name, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** - * Adds recipient as CC to document - * Add Document Recipient - * @param id Document UUID - * @param documentRecipientCreateRequest + * Deletes an attachment from the document. + * Delete Document Attachment + * @param id Document UUID. + * @param attachmentId Attachment UUID. */ - public addDocumentRecipient(id: string, documentRecipientCreateRequest: DocumentRecipientCreateRequest, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.addDocumentRecipient(id, documentRecipientCreateRequest, _options); + public deleteDocumentAttachmentWithHttpInfo(id: string, attachmentId: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.deleteDocumentAttachment(id, attachmentId, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.addDocumentRecipient(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteDocumentAttachmentWithHttpInfo(rsp))); })); } /** - * Deleted recipient from document - * Delete Document Recipient - * @param id Document UUID - * @param recipientId Recipient UUID + * Deletes an attachment from the document. + * Delete Document Attachment + * @param id Document UUID. + * @param attachmentId Attachment UUID. + */ + public deleteDocumentAttachment(id: string, attachmentId: string, _options?: ConfigurationOptions): Observable { + return this.deleteDocumentAttachmentWithHttpInfo(id, attachmentId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Returns details of the specific document\'s attachment. + * Document Attachment Details + * @param id Document UUID. + * @param attachmentId Attachment UUID. */ - public deleteDocumentRecipient(id: string, recipientId: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.deleteDocumentRecipient(id, recipientId, _options); + public detailsDocumentAttachmentWithHttpInfo(id: string, attachmentId: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.detailsDocumentAttachment(id, attachmentId, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteDocumentRecipient(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.detailsDocumentAttachmentWithHttpInfo(rsp))); })); } /** - * Edit document recipient's details - * Edit Document Recipient - * @param id Document UUID - * @param recipientId Recipient UUID - * @param documentRecipientEditRequest + * Returns details of the specific document\'s attachment. + * Document Attachment Details + * @param id Document UUID. + * @param attachmentId Attachment UUID. + */ + public detailsDocumentAttachment(id: string, attachmentId: string, _options?: ConfigurationOptions): Observable { + return this.detailsDocumentAttachmentWithHttpInfo(id, attachmentId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Download an attachment by ID. + * Download Document Attachment + * @param id Document UUID. + * @param attachmentId Attachment UUID. */ - public editDocumentRecipient(id: string, recipientId: string, documentRecipientEditRequest: DocumentRecipientEditRequest, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.editDocumentRecipient(id, recipientId, documentRecipientEditRequest, _options); + public downloadDocumentAttachmentWithHttpInfo(id: string, attachmentId: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.downloadDocumentAttachment(id, attachmentId, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.editDocumentRecipient(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.downloadDocumentAttachmentWithHttpInfo(rsp))); })); } /** - * Replace document recipient with another contact - * Reassign Document Recipient + * Download an attachment by ID. + * Download Document Attachment + * @param id Document UUID. + * @param attachmentId Attachment UUID. + */ + public downloadDocumentAttachment(id: string, attachmentId: string, _options?: ConfigurationOptions): Observable { + return this.downloadDocumentAttachmentWithHttpInfo(id, attachmentId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Returns a list of attachments associated with a specified document. + * List Document Attachments * @param id Document UUID - * @param recipientId Recipient UUID - * @param documentRecipientCreateRequest */ - public reassignDocumentRecipient(id: string, recipientId: string, documentRecipientCreateRequest: DocumentRecipientCreateRequest, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.reassignDocumentRecipient(id, recipientId, documentRecipientCreateRequest, _options); + public listDocumentAttachmentsWithHttpInfo(id: string, _options?: ConfigurationOptions): Observable>> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.listDocumentAttachments(id, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.reassignDocumentRecipient(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listDocumentAttachmentsWithHttpInfo(rsp))); })); } + /** + * Returns a list of attachments associated with a specified document. + * List Document Attachments + * @param id Document UUID + */ + public listDocumentAttachments(id: string, _options?: ConfigurationOptions): Observable> { + return this.listDocumentAttachmentsWithHttpInfo(id, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); + } + } -import { DocumentsApiRequestFactory, DocumentsApiResponseProcessor} from "../apis/DocumentsApi"; -export class ObservableDocumentsApi { - private requestFactory: DocumentsApiRequestFactory; - private responseProcessor: DocumentsApiResponseProcessor; +import { DocumentAuditTrailApiRequestFactory, DocumentAuditTrailApiResponseProcessor} from "../apis/DocumentAuditTrailApi"; +export class ObservableDocumentAuditTrailApi { + private requestFactory: DocumentAuditTrailApiRequestFactory; + private responseProcessor: DocumentAuditTrailApiResponseProcessor; private configuration: Configuration; public constructor( configuration: Configuration, - requestFactory?: DocumentsApiRequestFactory, - responseProcessor?: DocumentsApiResponseProcessor + requestFactory?: DocumentAuditTrailApiRequestFactory, + responseProcessor?: DocumentAuditTrailApiResponseProcessor ) { this.configuration = configuration; - this.requestFactory = requestFactory || new DocumentsApiRequestFactory(configuration); - this.responseProcessor = responseProcessor || new DocumentsApiResponseProcessor(); + this.requestFactory = requestFactory || new DocumentAuditTrailApiRequestFactory(configuration); + this.responseProcessor = responseProcessor || new DocumentAuditTrailApiResponseProcessor(); } /** - * Document status change - * @param id Specify document ID. - * @param documentStatusChangeRequest + * Retrieves the full audit trail for a specified document. The audit trail includes detailed user actions such as sending, viewing, signing, and editing, along with metadata like timestamps, IP addresses, and user identity. This endpoint is accessible to authorized workspace administrators only. + * List Document Audit Trail + * @param documentId Unique identifier of the document to retrieve the audit trail for. + * @param [limit] Maximum number of items to return. + * @param [offset] Number of items to skip before starting to collect the result set. */ - public changeDocumentStatus(id: string, documentStatusChangeRequest: DocumentStatusChangeRequest, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.changeDocumentStatus(id, documentStatusChangeRequest, _options); + public listDocumentAuditTrailWithHttpInfo(documentId: string, limit?: number, offset?: number, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.listDocumentAuditTrail(documentId, limit, offset, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.changeDocumentStatus(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listDocumentAuditTrailWithHttpInfo(rsp))); })); } /** - * Create document - * @param documentCreateRequest Use a PandaDoc template or an existing PDF to create a document. See the creation request examples [by template](/schemas/DocumentCreateByTemplateRequest) and [by pdf](/schemas/DocumentCreateByPdfRequest) - * @param editorVer Set this parameter as `ev1` if you want to create a document from PDF with Classic Editor when both editors are enabled for the workspace. + * Retrieves the full audit trail for a specified document. The audit trail includes detailed user actions such as sending, viewing, signing, and editing, along with metadata like timestamps, IP addresses, and user identity. This endpoint is accessible to authorized workspace administrators only. + * List Document Audit Trail + * @param documentId Unique identifier of the document to retrieve the audit trail for. + * @param [limit] Maximum number of items to return. + * @param [offset] Number of items to skip before starting to collect the result set. + */ + public listDocumentAuditTrail(documentId: string, limit?: number, offset?: number, _options?: ConfigurationOptions): Observable { + return this.listDocumentAuditTrailWithHttpInfo(documentId, limit, offset, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + +} + +import { DocumentFieldsApiRequestFactory, DocumentFieldsApiResponseProcessor} from "../apis/DocumentFieldsApi"; +export class ObservableDocumentFieldsApi { + private requestFactory: DocumentFieldsApiRequestFactory; + private responseProcessor: DocumentFieldsApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: DocumentFieldsApiRequestFactory, + responseProcessor?: DocumentFieldsApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = requestFactory || new DocumentFieldsApiRequestFactory(configuration); + this.responseProcessor = responseProcessor || new DocumentFieldsApiResponseProcessor(); + } + + /** + * Creates fields for a particular document. For CFR11-compliant workspaces (21 CFR Part 11), signature fields must have a minimum size of 108×33. + * Create Document Fields + * @param id Document UUID. + * @param createDocumentFieldsRequest */ - public createDocument(documentCreateRequest: DocumentCreateRequest, editorVer?: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.createDocument(documentCreateRequest, editorVer, _options); + public createDocumentFieldsWithHttpInfo(id: string, createDocumentFieldsRequest: CreateDocumentFieldsRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.createDocumentFields(id, createDocumentFieldsRequest, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createDocument(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createDocumentFieldsWithHttpInfo(rsp))); })); } /** - * Create a Document Link - * @param id Document ID - * @param documentCreateLinkRequest + * Creates fields for a particular document. For CFR11-compliant workspaces (21 CFR Part 11), signature fields must have a minimum size of 108×33. + * Create Document Fields + * @param id Document UUID. + * @param createDocumentFieldsRequest + */ + public createDocumentFields(id: string, createDocumentFieldsRequest: CreateDocumentFieldsRequest, _options?: ConfigurationOptions): Observable { + return this.createDocumentFieldsWithHttpInfo(id, createDocumentFieldsRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Return the list of fields for a particular document. + * List Document Fields + * @param id Document UUID. */ - public createDocumentLink(id: string, documentCreateLinkRequest: DocumentCreateLinkRequest, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.createDocumentLink(id, documentCreateLinkRequest, _options); + public listDocumentFieldsWithHttpInfo(id: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.listDocumentFields(id, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createDocumentLink(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listDocumentFieldsWithHttpInfo(rsp))); })); } /** + * Return the list of fields for a particular document. + * List Document Fields + * @param id Document UUID. + */ + public listDocumentFields(id: string, _options?: ConfigurationOptions): Observable { + return this.listDocumentFieldsWithHttpInfo(id, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + +} + +import { DocumentLinkToCRMApiRequestFactory, DocumentLinkToCRMApiResponseProcessor} from "../apis/DocumentLinkToCRMApi"; +export class ObservableDocumentLinkToCRMApi { + private requestFactory: DocumentLinkToCRMApiRequestFactory; + private responseProcessor: DocumentLinkToCRMApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: DocumentLinkToCRMApiRequestFactory, + responseProcessor?: DocumentLinkToCRMApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = requestFactory || new DocumentLinkToCRMApiRequestFactory(configuration); + this.responseProcessor = responseProcessor || new DocumentLinkToCRMApiResponseProcessor(); + } + + /** + * Create a linked object in the document. > 🚧 > > You can only link each document to each CRM once. This ensures the consistent functionality of the [two-way CRM sync](https://support.pandadoc.com/en/articles/9714877-hubspot-crm#h_3a3344e8-2a6e-4fd8-86be-0da8c121e4ac). > > You can, however, link one document to several external systems. * Create Linked Object * @param id Specify document ID. - * @param linkedObjectCreateRequest + * @param linkedObjectCreateRequest */ - public createLinkedObject(id: string, linkedObjectCreateRequest: LinkedObjectCreateRequest, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.createLinkedObject(id, linkedObjectCreateRequest, _options); + public createLinkedObjectWithHttpInfo(id: string, linkedObjectCreateRequest: LinkedObjectCreateRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.createLinkedObject(id, linkedObjectCreateRequest, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createLinkedObject(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createLinkedObjectWithHttpInfo(rsp))); })); } /** - * Delete document by id - * @param id Document ID + * Create a linked object in the document. > 🚧 > > You can only link each document to each CRM once. This ensures the consistent functionality of the [two-way CRM sync](https://support.pandadoc.com/en/articles/9714877-hubspot-crm#h_3a3344e8-2a6e-4fd8-86be-0da8c121e4ac). > > You can, however, link one document to several external systems. + * Create Linked Object + * @param id Specify document ID. + * @param linkedObjectCreateRequest + */ + public createLinkedObject(id: string, linkedObjectCreateRequest: LinkedObjectCreateRequest, _options?: ConfigurationOptions): Observable { + return this.createLinkedObjectWithHttpInfo(id, linkedObjectCreateRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Delete a linked object associated with a document. + * Delete Linked Object + * @param id Specify document ID. + * @param linkedObjectId Specify linked object ID. */ - public deleteDocument(id: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.deleteDocument(id, _options); + public deleteLinkedObjectWithHttpInfo(id: string, linkedObjectId: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.deleteLinkedObject(id, linkedObjectId, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteDocument(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteLinkedObjectWithHttpInfo(rsp))); })); } /** + * Delete a linked object associated with a document. * Delete Linked Object * @param id Specify document ID. * @param linkedObjectId Specify linked object ID. */ - public deleteLinkedObject(id: string, linkedObjectId: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.deleteLinkedObject(id, linkedObjectId, _options); + public deleteLinkedObject(id: string, linkedObjectId: string, _options?: ConfigurationOptions): Observable { + return this.deleteLinkedObjectWithHttpInfo(id, linkedObjectId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Get a list of documents connected to a linked object - an entity from an integration. + * List Documents by Linked Object + * @param entityId You can get entity id from your integration, for example, from a url of a HubSpot deal. + * @param entityType See the available entity types: https://developers.pandadoc.com/reference/link-service#examples-of-the-most-popular-crms + * @param provider See the available providers: https://developers.pandadoc.com/reference/link-service#examples-of-the-most-popular-crms + * @param [orderBy] + * @param [ownerIds] + */ + public listDocumentsByLinkedObjectWithHttpInfo(entityId: string, entityType: string, provider: string, orderBy?: string, ownerIds?: Array, _options?: ConfigurationOptions): Observable>> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.listDocumentsByLinkedObject(entityId, entityType, provider, orderBy, ownerIds, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteLinkedObject(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listDocumentsByLinkedObjectWithHttpInfo(rsp))); })); } /** - * Document details - * @param id Document ID + * Get a list of documents connected to a linked object - an entity from an integration. + * List Documents by Linked Object + * @param entityId You can get entity id from your integration, for example, from a url of a HubSpot deal. + * @param entityType See the available entity types: https://developers.pandadoc.com/reference/link-service#examples-of-the-most-popular-crms + * @param provider See the available providers: https://developers.pandadoc.com/reference/link-service#examples-of-the-most-popular-crms + * @param [orderBy] + * @param [ownerIds] + */ + public listDocumentsByLinkedObject(entityId: string, entityType: string, provider: string, orderBy?: string, ownerIds?: Array, _options?: ConfigurationOptions): Observable> { + return this.listDocumentsByLinkedObjectWithHttpInfo(entityId, entityType, provider, orderBy, ownerIds, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); + } + + /** + * Get a list of linked objects for the document. + * List Linked Objects + * @param id Specify document ID. */ - public detailsDocument(id: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.detailsDocument(id, _options); + public listLinkedObjectsWithHttpInfo(id: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.listLinkedObjects(id, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.detailsDocument(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listLinkedObjectsWithHttpInfo(rsp))); })); } /** - * Document move to folder + * Get a list of linked objects for the document. + * List Linked Objects * @param id Specify document ID. - * @param folderId Specify folder ID. */ - public documentMoveToFolder(id: string, folderId: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.documentMoveToFolder(id, folderId, _options); + public listLinkedObjects(id: string, _options?: ConfigurationOptions): Observable { + return this.listLinkedObjectsWithHttpInfo(id, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } - // build promise chain - let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { - middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); +} + +import { DocumentRecipientsApiRequestFactory, DocumentRecipientsApiResponseProcessor} from "../apis/DocumentRecipientsApi"; +export class ObservableDocumentRecipientsApi { + private requestFactory: DocumentRecipientsApiRequestFactory; + private responseProcessor: DocumentRecipientsApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: DocumentRecipientsApiRequestFactory, + responseProcessor?: DocumentRecipientsApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = requestFactory || new DocumentRecipientsApiRequestFactory(configuration); + this.responseProcessor = responseProcessor || new DocumentRecipientsApiResponseProcessor(); + } + + /** + * Add a CC recipient to a document. > 🚧 Before you start > > To add a CC recipient, please ensure that: > > - You have the \'Can Manage Recipients\' permission. > - This recipient is already created in your contacts. If not, add them using the [Create Contact](https://developers.pandadoc.com/reference/create-contact) endpoint. To add a new CC recipient to a document, two parameters must be included in the request body: - `kind`: Set this parameter to `contact` to specify an individual contact. - `id`: Input the ID of the desired contact. To retrieve the contact\'s ID, use the [List Contacts](https://developers.pandadoc.com/reference/list-contacts) endpoint to access a list of all contacts, and then locate the desired contact by searching using the name or email address within the returned list. ### Document status You can add CC recipients in any document status except for the \'Expired\' (`document.voided`) and \'Declined\' (`document.declined`). > 📘 Email notification to access the document > > **Note**: When a document is in one of the following statuses: \'Sent\' (`document.sent`), \'Viewed\' (`document.viewed`), \'Completed\' (`document.completed`), \'Waiting for Payment\' (`document.waiting_pay`), or \'Paid\' (`document.paid`), any added CC recipient will receive an instant notification at their email address, allowing them access to the document. + * Add Document Recipient + * @param id Document UUID + * @param documentRecipientCreateRequest + */ + public addDocumentRecipientWithHttpInfo(id: string, documentRecipientCreateRequest: DocumentRecipientCreateRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.addDocumentRecipient(id, documentRecipientCreateRequest, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.addDocumentRecipientWithHttpInfo(rsp))); + })); + } + + /** + * Add a CC recipient to a document. > 🚧 Before you start > > To add a CC recipient, please ensure that: > > - You have the \'Can Manage Recipients\' permission. > - This recipient is already created in your contacts. If not, add them using the [Create Contact](https://developers.pandadoc.com/reference/create-contact) endpoint. To add a new CC recipient to a document, two parameters must be included in the request body: - `kind`: Set this parameter to `contact` to specify an individual contact. - `id`: Input the ID of the desired contact. To retrieve the contact\'s ID, use the [List Contacts](https://developers.pandadoc.com/reference/list-contacts) endpoint to access a list of all contacts, and then locate the desired contact by searching using the name or email address within the returned list. ### Document status You can add CC recipients in any document status except for the \'Expired\' (`document.voided`) and \'Declined\' (`document.declined`). > 📘 Email notification to access the document > > **Note**: When a document is in one of the following statuses: \'Sent\' (`document.sent`), \'Viewed\' (`document.viewed`), \'Completed\' (`document.completed`), \'Waiting for Payment\' (`document.waiting_pay`), or \'Paid\' (`document.paid`), any added CC recipient will receive an instant notification at their email address, allowing them access to the document. + * Add Document Recipient + * @param id Document UUID + * @param documentRecipientCreateRequest + */ + public addDocumentRecipient(id: string, documentRecipientCreateRequest: DocumentRecipientCreateRequest, _options?: ConfigurationOptions): Observable { + return this.addDocumentRecipientWithHttpInfo(id, documentRecipientCreateRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Remove a recipient from a document. > 🚧 Before you start > > Please ensure that you have the \'Can Manage Recipients\' permission. To remove a recipient from a document, you must specify their ID in the path parameter (note that this is different from their contact\'s ID). The recipient\'s ID can be retrieved via the [Document Details](https://developers.pandadoc.com/reference/document-details) endpoint. ### Document status - Removing a signer is only possible when the document is in the \'Draft\' (`document.draft`) status and this action will unassign all fields associated with that signer. - Removing a CC recipient is allowed in any document status except for the \'Expired\' (`document.voided`) and \'Declined\' (`document.declined`). If a CC recipient is removed, their access will be revoked. + * Delete Document Recipient + * @param id Document UUID + * @param recipientId Recipient UUID + */ + public deleteDocumentRecipientWithHttpInfo(id: string, recipientId: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.deleteDocumentRecipient(id, recipientId, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteDocumentRecipientWithHttpInfo(rsp))); + })); + } + + /** + * Remove a recipient from a document. > 🚧 Before you start > > Please ensure that you have the \'Can Manage Recipients\' permission. To remove a recipient from a document, you must specify their ID in the path parameter (note that this is different from their contact\'s ID). The recipient\'s ID can be retrieved via the [Document Details](https://developers.pandadoc.com/reference/document-details) endpoint. ### Document status - Removing a signer is only possible when the document is in the \'Draft\' (`document.draft`) status and this action will unassign all fields associated with that signer. - Removing a CC recipient is allowed in any document status except for the \'Expired\' (`document.voided`) and \'Declined\' (`document.declined`). If a CC recipient is removed, their access will be revoked. + * Delete Document Recipient + * @param id Document UUID + * @param recipientId Recipient UUID + */ + public deleteDocumentRecipient(id: string, recipientId: string, _options?: ConfigurationOptions): Observable { + return this.deleteDocumentRecipientWithHttpInfo(id, recipientId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Modify recipient\'s personal details. > 🚧 Before you start > > To edit a recipient, please ensure that you have the \'Can Edit Document\' permission. Use this endpoint to easily fix typos in a recipient\'s name or email, or to change any other recipient information in a sent document. > 📘 Please note that changes made to a recipient within a document will also update their `Contact` information. However, these changes will not update information about this recipient in other documents where they have already been added. ### Document status - You can edit a signer in the following document statuses: - \'Draft\' (`document.draft`), - \'Waiting Approval\' (`document.waiting_approval`), - \'Approved\' (`document.approved`), - \'Rejected\' (`document.rejected`), - \'Sent\' (`document.sent`), - \'Viewed\' (`document.viewed`), but only until they have signed the document. - You can edit a CC recipient in any document status **except**: - \'Expired\' (`document.voided`), - \'Declined\' (`document.declined`). > 📘 Updating a recipient\'s email after sending a document > > **Note**: If you update a recipient\'s email address after sending a document, they will receive an instant notification at the new email address, allowing them access to the document. Access via the previous email will be revoked. ### Restrictions for updating a recipient\'s email - You cannot change emails of PandaDoc users. - You cannot use the email addresses of existing contacts. If you need to use an email from an existing contact, use the [Change Signer](https://developers.pandadoc.com/reference/change-signer) endpoint to replace a signer with this contact. + * Update Document Recipient + * @param id Document UUID. + * @param recipientId Recipient UUID. + * @param documentRecipientEditRequest + */ + public editDocumentRecipientWithHttpInfo(id: string, recipientId: string, documentRecipientEditRequest: DocumentRecipientEditRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.editDocumentRecipient(id, recipientId, documentRecipientEditRequest, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.editDocumentRecipientWithHttpInfo(rsp))); + })); + } + + /** + * Modify recipient\'s personal details. > 🚧 Before you start > > To edit a recipient, please ensure that you have the \'Can Edit Document\' permission. Use this endpoint to easily fix typos in a recipient\'s name or email, or to change any other recipient information in a sent document. > 📘 Please note that changes made to a recipient within a document will also update their `Contact` information. However, these changes will not update information about this recipient in other documents where they have already been added. ### Document status - You can edit a signer in the following document statuses: - \'Draft\' (`document.draft`), - \'Waiting Approval\' (`document.waiting_approval`), - \'Approved\' (`document.approved`), - \'Rejected\' (`document.rejected`), - \'Sent\' (`document.sent`), - \'Viewed\' (`document.viewed`), but only until they have signed the document. - You can edit a CC recipient in any document status **except**: - \'Expired\' (`document.voided`), - \'Declined\' (`document.declined`). > 📘 Updating a recipient\'s email after sending a document > > **Note**: If you update a recipient\'s email address after sending a document, they will receive an instant notification at the new email address, allowing them access to the document. Access via the previous email will be revoked. ### Restrictions for updating a recipient\'s email - You cannot change emails of PandaDoc users. - You cannot use the email addresses of existing contacts. If you need to use an email from an existing contact, use the [Change Signer](https://developers.pandadoc.com/reference/change-signer) endpoint to replace a signer with this contact. + * Update Document Recipient + * @param id Document UUID. + * @param recipientId Recipient UUID. + * @param documentRecipientEditRequest + */ + public editDocumentRecipient(id: string, recipientId: string, documentRecipientEditRequest: DocumentRecipientEditRequest, _options?: ConfigurationOptions): Observable { + return this.editDocumentRecipientWithHttpInfo(id, recipientId, documentRecipientEditRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Reassign fields to another signer. > 🚧 Before you start > > To change a signer in a document, please ensure that: > > - You have the \'Can Manage Recipients\' permission. > - New signer is already created in your contacts. If not, add them using the [Create Contact](https://developers.pandadoc.com/reference/create-contact) endpoint. You can reassign fields to another signer before the original signer has signed the document. You can choose any person except those recipients who have already signed the document. The endpoint path includes the `recipient_id` of the original signer and the request body must include the following two parameters: - `kind`: Set this parameter to `contact` to specify an individual contact. - `id`: Input the ID of the contact you want to use as a replacement for the original signer. To retrieve the contact\'s ID, use the [List Contacts](https://developers.pandadoc.com/reference/list-contacts) endpoint to access a list of all contacts, and then locate the desired contact by searching using the name or email address within the returned list. Once you execute the call to change the signer, the original signer will be entirely removed from the document. If you wish to retain the original signer as a CC recipient, you can re-add them using the [Add CC Recipient](https://developers.pandadoc.com/reference/add-new-recipient-cc) endpoint. > 🚧 Pre-filled fields > > If you change the signer in a document that has already been sent, the signer\'s pre-filled fields will be completely reset. In the \'Draft\' (`document.draft`) status, pre-filled fields will remain. + * Change Signer (Reassign Document Recipient) + * @param id Document UUID + * @param recipientId Recipient UUID + * @param documentRecipientCreateRequest + */ + public reassignDocumentRecipientWithHttpInfo(id: string, recipientId: string, documentRecipientCreateRequest: DocumentRecipientCreateRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.reassignDocumentRecipient(id, recipientId, documentRecipientCreateRequest, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.reassignDocumentRecipientWithHttpInfo(rsp))); + })); + } + + /** + * Reassign fields to another signer. > 🚧 Before you start > > To change a signer in a document, please ensure that: > > - You have the \'Can Manage Recipients\' permission. > - New signer is already created in your contacts. If not, add them using the [Create Contact](https://developers.pandadoc.com/reference/create-contact) endpoint. You can reassign fields to another signer before the original signer has signed the document. You can choose any person except those recipients who have already signed the document. The endpoint path includes the `recipient_id` of the original signer and the request body must include the following two parameters: - `kind`: Set this parameter to `contact` to specify an individual contact. - `id`: Input the ID of the contact you want to use as a replacement for the original signer. To retrieve the contact\'s ID, use the [List Contacts](https://developers.pandadoc.com/reference/list-contacts) endpoint to access a list of all contacts, and then locate the desired contact by searching using the name or email address within the returned list. Once you execute the call to change the signer, the original signer will be entirely removed from the document. If you wish to retain the original signer as a CC recipient, you can re-add them using the [Add CC Recipient](https://developers.pandadoc.com/reference/add-new-recipient-cc) endpoint. > 🚧 Pre-filled fields > > If you change the signer in a document that has already been sent, the signer\'s pre-filled fields will be completely reset. In the \'Draft\' (`document.draft`) status, pre-filled fields will remain. + * Change Signer (Reassign Document Recipient) + * @param id Document UUID + * @param recipientId Recipient UUID + * @param documentRecipientCreateRequest + */ + public reassignDocumentRecipient(id: string, recipientId: string, documentRecipientCreateRequest: DocumentRecipientCreateRequest, _options?: ConfigurationOptions): Observable { + return this.reassignDocumentRecipientWithHttpInfo(id, recipientId, documentRecipientCreateRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + +} + +import { DocumentRemindersApiRequestFactory, DocumentRemindersApiResponseProcessor} from "../apis/DocumentRemindersApi"; +export class ObservableDocumentRemindersApi { + private requestFactory: DocumentRemindersApiRequestFactory; + private responseProcessor: DocumentRemindersApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: DocumentRemindersApiRequestFactory, + responseProcessor?: DocumentRemindersApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = requestFactory || new DocumentRemindersApiRequestFactory(configuration); + this.responseProcessor = responseProcessor || new DocumentRemindersApiResponseProcessor(); + } + + /** + * Sends manual reminders to one or more recipients of a specified document. + * Send Manual Reminder + * @param documentId The UUID of the document. + * @param documentSendManualReminderRequest + */ + public createManualReminderWithHttpInfo(documentId: string, documentSendManualReminderRequest: DocumentSendManualReminderRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.createManualReminder(documentId, documentSendManualReminderRequest, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createManualReminderWithHttpInfo(rsp))); + })); + } + + /** + * Sends manual reminders to one or more recipients of a specified document. + * Send Manual Reminder + * @param documentId The UUID of the document. + * @param documentSendManualReminderRequest + */ + public createManualReminder(documentId: string, documentSendManualReminderRequest: DocumentSendManualReminderRequest, _options?: ConfigurationOptions): Observable { + return this.createManualReminderWithHttpInfo(documentId, documentSendManualReminderRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Retrieves the current auto reminder configuration for a specified document. + * Document Auto Reminder Settings + * @param documentId The UUID of the document. + */ + public getDocumentAutoReminderSettingsWithHttpInfo(documentId: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.getDocumentAutoReminderSettings(documentId, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getDocumentAutoReminderSettingsWithHttpInfo(rsp))); + })); + } + + /** + * Retrieves the current auto reminder configuration for a specified document. + * Document Auto Reminder Settings + * @param documentId The UUID of the document. + */ + public getDocumentAutoReminderSettings(documentId: string, _options?: ConfigurationOptions): Observable { + return this.getDocumentAutoReminderSettingsWithHttpInfo(documentId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Retrieves the current auto reminder status per recipient for a specified document. Recipients who could not receive reminders due to validations (recipient groups, non-signers, etc.) will be skipped and not included in the response. + * Document Auto Reminder Status + * @param documentId The UUID of the document. + */ + public statusDocumentAutoReminderWithHttpInfo(documentId: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.statusDocumentAutoReminder(documentId, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.statusDocumentAutoReminderWithHttpInfo(rsp))); + })); + } + + /** + * Retrieves the current auto reminder status per recipient for a specified document. Recipients who could not receive reminders due to validations (recipient groups, non-signers, etc.) will be skipped and not included in the response. + * Document Auto Reminder Status + * @param documentId The UUID of the document. + */ + public statusDocumentAutoReminder(documentId: string, _options?: ConfigurationOptions): Observable { + return this.statusDocumentAutoReminderWithHttpInfo(documentId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Configures automatic reminders for document recipients. These reminders are sent after the document\'s initial dispatch. Settings include enabling reminders, delivery method (email/SMS), initial delay, and recurrence frequency. + * Update Document Auto Reminder Settings + * @param documentId The UUID of the document. + * @param updateDocumentAutoRemindersRequest + */ + public updateDocumentAutoReminderSettingsWithHttpInfo(documentId: string, updateDocumentAutoRemindersRequest: UpdateDocumentAutoRemindersRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.updateDocumentAutoReminderSettings(documentId, updateDocumentAutoRemindersRequest, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updateDocumentAutoReminderSettingsWithHttpInfo(rsp))); + })); + } + + /** + * Configures automatic reminders for document recipients. These reminders are sent after the document\'s initial dispatch. Settings include enabling reminders, delivery method (email/SMS), initial delay, and recurrence frequency. + * Update Document Auto Reminder Settings + * @param documentId The UUID of the document. + * @param updateDocumentAutoRemindersRequest + */ + public updateDocumentAutoReminderSettings(documentId: string, updateDocumentAutoRemindersRequest: UpdateDocumentAutoRemindersRequest, _options?: ConfigurationOptions): Observable { + return this.updateDocumentAutoReminderSettingsWithHttpInfo(documentId, updateDocumentAutoRemindersRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + +} + +import { DocumentSectionsBundlesApiRequestFactory, DocumentSectionsBundlesApiResponseProcessor} from "../apis/DocumentSectionsBundlesApi"; +export class ObservableDocumentSectionsBundlesApi { + private requestFactory: DocumentSectionsBundlesApiRequestFactory; + private responseProcessor: DocumentSectionsBundlesApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: DocumentSectionsBundlesApiRequestFactory, + responseProcessor?: DocumentSectionsBundlesApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = requestFactory || new DocumentSectionsBundlesApiRequestFactory(configuration); + this.responseProcessor = responseProcessor || new DocumentSectionsBundlesApiResponseProcessor(); + } + + /** + * Removes selected section from the document. + * Delete Document Section + * @param documentId Specify document ID. + * @param sectionId Specify section ID. + */ + public deleteSectionWithHttpInfo(documentId: string, sectionId: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.deleteSection(documentId, sectionId, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteSectionWithHttpInfo(rsp))); + })); + } + + /** + * Removes selected section from the document. + * Delete Document Section + * @param documentId Specify document ID. + * @param sectionId Specify section ID. + */ + public deleteSection(documentId: string, sectionId: string, _options?: ConfigurationOptions): Observable { + return this.deleteSectionWithHttpInfo(documentId, sectionId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Retrieve information about the sections within a document. + * List Document Sections + * @param documentId Document ID + */ + public listSectionsWithHttpInfo(documentId: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.listSections(documentId, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listSectionsWithHttpInfo(rsp))); + })); + } + + /** + * Retrieve information about the sections within a document. + * List Document Sections + * @param documentId Document ID + */ + public listSections(documentId: string, _options?: ConfigurationOptions): Observable { + return this.listSectionsWithHttpInfo(documentId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Receive the upload status of the document and sections by their `upload_id`. Requesting document section upload status is useful to ensure a document section upload is in the expected state before calling additional API methods. In response, you receive an array with `sections_uuid`. You can receive information about each section using the [Document Section Info](https://developers.pandadoc.com/reference/document-section-info) endpoint. ```json \"section_uuids\": [ \"H8T8CJofGY6JwTsWsPuDEF\", \"8MwLaU4SaZywqLiDk26mDF\" ] ``` ## Available Document Section Upload Statuses The following is a complete list of all possible document statuses returned: | Document Status | Status Description | | :----------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `document_sections_upload.UPLOADED` | The document section upload process has just been created. It is in processing and will be in `document_sections_upload.PROCESSED` state momentarily. | | `document_sections_upload.PROCESSED` | The document sections upload is processed and the sections are already created in the document. All aspects of the document sections can be edited in this state. | | `document_sections_upload.ERROR` | Document section upload procces has been failed. For more information check error details in the response. | + * Document Section Upload Status + * @param documentId Document ID. + * @param uploadId Upload ID. + */ + public sectionDetailsWithHttpInfo(documentId: string, uploadId: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.sectionDetails(documentId, uploadId, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.sectionDetailsWithHttpInfo(rsp))); + })); + } + + /** + * Receive the upload status of the document and sections by their `upload_id`. Requesting document section upload status is useful to ensure a document section upload is in the expected state before calling additional API methods. In response, you receive an array with `sections_uuid`. You can receive information about each section using the [Document Section Info](https://developers.pandadoc.com/reference/document-section-info) endpoint. ```json \"section_uuids\": [ \"H8T8CJofGY6JwTsWsPuDEF\", \"8MwLaU4SaZywqLiDk26mDF\" ] ``` ## Available Document Section Upload Statuses The following is a complete list of all possible document statuses returned: | Document Status | Status Description | | :----------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `document_sections_upload.UPLOADED` | The document section upload process has just been created. It is in processing and will be in `document_sections_upload.PROCESSED` state momentarily. | | `document_sections_upload.PROCESSED` | The document sections upload is processed and the sections are already created in the document. All aspects of the document sections can be edited in this state. | | `document_sections_upload.ERROR` | Document section upload procces has been failed. For more information check error details in the response. | + * Document Section Upload Status + * @param documentId Document ID. + * @param uploadId Upload ID. + */ + public sectionDetails(documentId: string, uploadId: string, _options?: ConfigurationOptions): Observable { + return this.sectionDetailsWithHttpInfo(documentId, uploadId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Receive information about each section. + * Document Section Details + * @param documentId Document ID. + * @param sectionId Section ID. + */ + public sectionInfoWithHttpInfo(documentId: string, sectionId: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.sectionInfo(documentId, sectionId, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.sectionInfoWithHttpInfo(rsp))); + })); + } + + /** + * Receive information about each section. + * Document Section Details + * @param documentId Document ID. + * @param sectionId Section ID. + */ + public sectionInfo(documentId: string, sectionId: string, _options?: ConfigurationOptions): Observable { + return this.sectionInfoWithHttpInfo(documentId, sectionId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * With this endpoint, you can add a new section to an existing PandaDoc document (create a bundle). You can upload a section to the document using a PandaDoc template or a file by URL. > ⏱️ Document Section creation is a non-blocking (asynchronous) operation > > The document creation process may take some time. > > With a successful request, you receive a response with the created upload ID and status `document_sections_upload.uploaded`. After processing completes on our servers, usually a few seconds, the document moves to the `document_sections_upload.PROCESSED` status. ## Using a PandaDoc template
> 🚧 Current Version Limitations > > Images in sections are currently not supported. > 📘 Pricing tables note > > Each pricing table must have a unique name to populate it with data correctly. A PandaDoc template is a document template created and edited in the PandaDoc web application. Our [help center](https://support.pandadoc.com/en/articles/9714616-save-time-with-a-reusable-template) has further information on PandaDoc templates. If you don\'t have any PandaDoc Template yet, you can easily create one by clicking [Copy a Sample PandaDoc template](https://app.pandadoc.com/get-this-template/?pt=public_template&pub=eiC3a6qBVfEfbw7VCYgaeN). This will open the PandaDoc application in a new tab, copy the sample template into your account, and create a new document from the template.
## Using a File by URL
Using this endpoint you can add a section to the existing document. The section is created from a file you upload. The file can be a PDF, DocX, or RTF. > 📘 We\'ve prepared two samples that you can use to test the request. > Download them here: > > - [Download a Sample PDF with Form Fields](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) > - [Download a Sample PDF with Field Tags](https://5132871.fs1.hubspotusercontent-na1.net/hubfs/5132871/SamplePandaDocPdf_FieldTags_updated.pdf) > ❗️ Limitations > > * This method does not support multiple documents. > * The maximum supported file size is 50 MB. API returns \"413 Request entity too large\" in case of bigger files. > * PandaDoc does not support creating document from a PDF with encrypted files (to check whether a file is encrypted or not, try Get info -> Secure: Password Encrypted). ### PDF Form Fields PandaDoc recognizes PDF form fields. To enable this feature, pass the optional `parse_form_fields` value as `true` when making a create document section API call. We support Text fields, Dropdowns, and Signature fields. If you would like to pass additional parameters to configure PDF form fields, use the PDF field name as an optId. You can use a PDF editor such as Adobe Acrobat, Foxit to get and edit field names in your PDF. [**Download a Sample PDF with Form Fields**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) ### PDF/DocX/RTF Field Tags This parsing format allows a word processor such as [Microsoft Word](https://support.office.com/en-us/article/Save-as-PDF-d85416c5-7d77-4fd6-a216-6f4bf7c7c110?ui=en-US&rs=en-US&ad=US) or [Google Docs](https://support.google.com/drive/answer/2423534?co=GENIE.Platform%3DDesktop&hl=en) to prepare a document and save it in PDF, DocX or RTF format. Within the text, PandaDoc parses field tags. A field tag starts and ends with brackets. The field tag includes basic information on how to create a form field in the PandaDoc document. The request JSON object `optId` can also extend this information for even greater control. Here is an example of how the field tag in a PDF/DocX/RTF is converted to a text field in the PandaDoc document: ![](https://files.readme.io/38afedf-ex3.png \"ex3.png\") [**Download a Sample PDF with Field Tags**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FieldTags.pdf) #### PDF Field Tag Key ![](https://files.readme.io/a81fbf1-field-tag-structure.png \"field-tag-structure.png\") | Number | Key | Description | Example | | :----- | :---------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------- | | 1 | `fieldType` | Field type from the table documented below | `signature`, or `s` for shorthand | | 2 | `*` | Optional `*` denotes the field is not required | `*` | | 3 | `role` | Role name. Associate the field tag with a recipient role. Roles must be assigned to recipients in the request body. In this case we are using role `s1` to keep the length short and denote the concept of \"signer 1\". `s1` would be the value passed as role in a recipient JSON object. | `s1` | | 4 | `optId` | Optional field Id. Specify more information about the field tag within the post request by using this id. | `sigBox17` | | 5 | `_____` | Use underscores to widen the field if desired. The form fields in PandaDoc will scale to the length and size of your field tag. | `_____` | > 🚧 Role names restrictions > > Underscores are not supported in role names for a file with a Field Tag. #### PDF/DocX/RTF Field Tag Supported Types | Field Type | Short Notation | Is PandaDoc Field | | :---------- | :------------- | :---------------- | | `textfield` | `t` | Field | | `checkbox` | `c` | Field | | `signature` | `s` | Field | | `date` | `d` | Field | | `initials` | `i` | Field | | `dropdown` | `dd` | Field | ```json Field Tags Example \"fields\": { \"textfield\": { \"value\": \"Jane\", \"role\": \"user\" }, \"dropdown\": { \"value\": \"opt1\", \"role\": \"user\", \"options\":[ \"opt1\", \"opt2\", \"opt3\" ] }, \"checkbox\": { \"value\": true, \"role\": \"user\" }, \"date\":{ \"value\": \"2022-05-20\", \"role\": \"user\" }, \"signature\": { \"value\": \"\", \"role\": \"user\" } } ``` > 📘 Fields in PandaDoc > > The following article explains how to use Fields: [Everything you need to know about Fields](https://support.pandadoc.com/en/articles/9714583-fields) ### Signing order Set a signing order for document section sections created from a file. ```json \"recipients\": [ { \"email\": \"josh@example.com\", \"first_name\": \"Josh\", \"last_name\": \"Ron\", \"role\": \"user\", \"signing_order\": 1 } ] ``` > 📘 Signing order in PandaDoc > > The following article explains how to use signing order: [How to use signing order](https://support.pandadoc.com/en/articles/9714771-signing-order) ### Error handling | Error description | Type | Root cause | |---|---|---| | Document version 1 is not supported. | Validation errors: Form fields | The creation document section is supported only for document version 2 | | PDF content hasn\'t been processed: document is broken or locked | Processing errors: Failed to process document content | Document converter service can’t process PDF. This may be caused by locked PDF or if it’s broken. | | Error occurred while parsing PDF field tags. Please try PDF flattening or reach out to support | Processing errors: Field tag / Form field validation error | Doc converter managed to parse PDF and extract tags, but at least 1 of them is invalid (having negative position, for example). Usually we recommend PDF flattening and it helps | | No role=\'{role}\' for field tag specified in `recipients` found, roles passed were {roles} | Validation errors: Field tags | Role is invalid. When the role specified in field tag is empty or wasn’t provided in a payload for any recipient | | All field tags within PDF must be declared within `fields`  object of the JSON Payload. No field with optId=\'{optid}\' found in fields object, fields passed were {optids} | Validation errors: Field tags | Label is invalid. Occurs when **optId** specified in field tag is empty or no field with **name = optId** was provided in a payload | | One of field tags in PDF with type=\'{field}\' doesn\'t have a role | Validation errors: Field tags | Field tag in PDF has no role. One of field tags in PDF with type=% doesn\'t have a role. | | Role for form field with name=\'{role}\' is not provided in payload | Validation errors: Form fields | Role for form field with ‘name’ is not provided. Occurs when `role` for form field with name=%s  is not provided in payload | | Field for form field with name=\'{name}\' is not specified in payload, available names are {names} | Validation errors: Form fields | Field ‘name’ is not specified in payload. Occurs when no field with name = form field name was provided in a payload | | No role=\'{role}\' for form field specified in \'recipients\' found, roles passed were {roles}\" | Validation errors: Form fields | Failed to resolve field actor for `role` in form field with ‘name’.   Occurs when role from the form field is not found in recipient’s from payload | | Failed to download file from link {url}. | Source errors | Error on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload | | Failed to download file from link {url} (status code: {status code}) | Source errors | Error with HTTP status code on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload - remote server responded with the HTTP status code | | Content type=\'{type}\' is not supported, available types are {types} | Source errors | Content type is not supported.  Content type should be one of the following: PDF, ZIP, doc, docx, RTF | | The maximum file size is exceeded, limit is {limit} MB | Source errors | The file size has exceeded the allowed limits. An error occurred while trying to download a file that is too large (limit is 50M) |
+ * Create Document Section + * @param documentId Document ID + * @param uploadSectionRequest + * @param [mergeFieldScope] Determines how the fields are mapped when creating a section. * document: Default value. The fields of the entire document are updated. * upload: Only the fields from the created section are updated. The merge field is appended with the upload ID. + */ + public uploadSectionWithHttpInfo(documentId: string, uploadSectionRequest: UploadSectionRequest, mergeFieldScope?: 'document' | 'upload', _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.uploadSection(documentId, uploadSectionRequest, mergeFieldScope, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.uploadSectionWithHttpInfo(rsp))); + })); + } + + /** + * With this endpoint, you can add a new section to an existing PandaDoc document (create a bundle). You can upload a section to the document using a PandaDoc template or a file by URL. > ⏱️ Document Section creation is a non-blocking (asynchronous) operation > > The document creation process may take some time. > > With a successful request, you receive a response with the created upload ID and status `document_sections_upload.uploaded`. After processing completes on our servers, usually a few seconds, the document moves to the `document_sections_upload.PROCESSED` status. ## Using a PandaDoc template
> 🚧 Current Version Limitations > > Images in sections are currently not supported. > 📘 Pricing tables note > > Each pricing table must have a unique name to populate it with data correctly. A PandaDoc template is a document template created and edited in the PandaDoc web application. Our [help center](https://support.pandadoc.com/en/articles/9714616-save-time-with-a-reusable-template) has further information on PandaDoc templates. If you don\'t have any PandaDoc Template yet, you can easily create one by clicking [Copy a Sample PandaDoc template](https://app.pandadoc.com/get-this-template/?pt=public_template&pub=eiC3a6qBVfEfbw7VCYgaeN). This will open the PandaDoc application in a new tab, copy the sample template into your account, and create a new document from the template.
## Using a File by URL
Using this endpoint you can add a section to the existing document. The section is created from a file you upload. The file can be a PDF, DocX, or RTF. > 📘 We\'ve prepared two samples that you can use to test the request. > Download them here: > > - [Download a Sample PDF with Form Fields](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) > - [Download a Sample PDF with Field Tags](https://5132871.fs1.hubspotusercontent-na1.net/hubfs/5132871/SamplePandaDocPdf_FieldTags_updated.pdf) > ❗️ Limitations > > * This method does not support multiple documents. > * The maximum supported file size is 50 MB. API returns \"413 Request entity too large\" in case of bigger files. > * PandaDoc does not support creating document from a PDF with encrypted files (to check whether a file is encrypted or not, try Get info -> Secure: Password Encrypted). ### PDF Form Fields PandaDoc recognizes PDF form fields. To enable this feature, pass the optional `parse_form_fields` value as `true` when making a create document section API call. We support Text fields, Dropdowns, and Signature fields. If you would like to pass additional parameters to configure PDF form fields, use the PDF field name as an optId. You can use a PDF editor such as Adobe Acrobat, Foxit to get and edit field names in your PDF. [**Download a Sample PDF with Form Fields**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) ### PDF/DocX/RTF Field Tags This parsing format allows a word processor such as [Microsoft Word](https://support.office.com/en-us/article/Save-as-PDF-d85416c5-7d77-4fd6-a216-6f4bf7c7c110?ui=en-US&rs=en-US&ad=US) or [Google Docs](https://support.google.com/drive/answer/2423534?co=GENIE.Platform%3DDesktop&hl=en) to prepare a document and save it in PDF, DocX or RTF format. Within the text, PandaDoc parses field tags. A field tag starts and ends with brackets. The field tag includes basic information on how to create a form field in the PandaDoc document. The request JSON object `optId` can also extend this information for even greater control. Here is an example of how the field tag in a PDF/DocX/RTF is converted to a text field in the PandaDoc document: ![](https://files.readme.io/38afedf-ex3.png \"ex3.png\") [**Download a Sample PDF with Field Tags**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FieldTags.pdf) #### PDF Field Tag Key ![](https://files.readme.io/a81fbf1-field-tag-structure.png \"field-tag-structure.png\") | Number | Key | Description | Example | | :----- | :---------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------- | | 1 | `fieldType` | Field type from the table documented below | `signature`, or `s` for shorthand | | 2 | `*` | Optional `*` denotes the field is not required | `*` | | 3 | `role` | Role name. Associate the field tag with a recipient role. Roles must be assigned to recipients in the request body. In this case we are using role `s1` to keep the length short and denote the concept of \"signer 1\". `s1` would be the value passed as role in a recipient JSON object. | `s1` | | 4 | `optId` | Optional field Id. Specify more information about the field tag within the post request by using this id. | `sigBox17` | | 5 | `_____` | Use underscores to widen the field if desired. The form fields in PandaDoc will scale to the length and size of your field tag. | `_____` | > 🚧 Role names restrictions > > Underscores are not supported in role names for a file with a Field Tag. #### PDF/DocX/RTF Field Tag Supported Types | Field Type | Short Notation | Is PandaDoc Field | | :---------- | :------------- | :---------------- | | `textfield` | `t` | Field | | `checkbox` | `c` | Field | | `signature` | `s` | Field | | `date` | `d` | Field | | `initials` | `i` | Field | | `dropdown` | `dd` | Field | ```json Field Tags Example \"fields\": { \"textfield\": { \"value\": \"Jane\", \"role\": \"user\" }, \"dropdown\": { \"value\": \"opt1\", \"role\": \"user\", \"options\":[ \"opt1\", \"opt2\", \"opt3\" ] }, \"checkbox\": { \"value\": true, \"role\": \"user\" }, \"date\":{ \"value\": \"2022-05-20\", \"role\": \"user\" }, \"signature\": { \"value\": \"\", \"role\": \"user\" } } ``` > 📘 Fields in PandaDoc > > The following article explains how to use Fields: [Everything you need to know about Fields](https://support.pandadoc.com/en/articles/9714583-fields) ### Signing order Set a signing order for document section sections created from a file. ```json \"recipients\": [ { \"email\": \"josh@example.com\", \"first_name\": \"Josh\", \"last_name\": \"Ron\", \"role\": \"user\", \"signing_order\": 1 } ] ``` > 📘 Signing order in PandaDoc > > The following article explains how to use signing order: [How to use signing order](https://support.pandadoc.com/en/articles/9714771-signing-order) ### Error handling | Error description | Type | Root cause | |---|---|---| | Document version 1 is not supported. | Validation errors: Form fields | The creation document section is supported only for document version 2 | | PDF content hasn\'t been processed: document is broken or locked | Processing errors: Failed to process document content | Document converter service can’t process PDF. This may be caused by locked PDF or if it’s broken. | | Error occurred while parsing PDF field tags. Please try PDF flattening or reach out to support | Processing errors: Field tag / Form field validation error | Doc converter managed to parse PDF and extract tags, but at least 1 of them is invalid (having negative position, for example). Usually we recommend PDF flattening and it helps | | No role=\'{role}\' for field tag specified in `recipients` found, roles passed were {roles} | Validation errors: Field tags | Role is invalid. When the role specified in field tag is empty or wasn’t provided in a payload for any recipient | | All field tags within PDF must be declared within `fields`  object of the JSON Payload. No field with optId=\'{optid}\' found in fields object, fields passed were {optids} | Validation errors: Field tags | Label is invalid. Occurs when **optId** specified in field tag is empty or no field with **name = optId** was provided in a payload | | One of field tags in PDF with type=\'{field}\' doesn\'t have a role | Validation errors: Field tags | Field tag in PDF has no role. One of field tags in PDF with type=% doesn\'t have a role. | | Role for form field with name=\'{role}\' is not provided in payload | Validation errors: Form fields | Role for form field with ‘name’ is not provided. Occurs when `role` for form field with name=%s  is not provided in payload | | Field for form field with name=\'{name}\' is not specified in payload, available names are {names} | Validation errors: Form fields | Field ‘name’ is not specified in payload. Occurs when no field with name = form field name was provided in a payload | | No role=\'{role}\' for form field specified in \'recipients\' found, roles passed were {roles}\" | Validation errors: Form fields | Failed to resolve field actor for `role` in form field with ‘name’.   Occurs when role from the form field is not found in recipient’s from payload | | Failed to download file from link {url}. | Source errors | Error on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload | | Failed to download file from link {url} (status code: {status code}) | Source errors | Error with HTTP status code on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload - remote server responded with the HTTP status code | | Content type=\'{type}\' is not supported, available types are {types} | Source errors | Content type is not supported.  Content type should be one of the following: PDF, ZIP, doc, docx, RTF | | The maximum file size is exceeded, limit is {limit} MB | Source errors | The file size has exceeded the allowed limits. An error occurred while trying to download a file that is too large (limit is 50M) |
+ * Create Document Section + * @param documentId Document ID + * @param uploadSectionRequest + * @param [mergeFieldScope] Determines how the fields are mapped when creating a section. * document: Default value. The fields of the entire document are updated. * upload: Only the fields from the created section are updated. The merge field is appended with the upload ID. + */ + public uploadSection(documentId: string, uploadSectionRequest: UploadSectionRequest, mergeFieldScope?: 'document' | 'upload', _options?: ConfigurationOptions): Observable { + return this.uploadSectionWithHttpInfo(documentId, uploadSectionRequest, mergeFieldScope, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * With this endpoint, you can add a new section to an existing PandaDoc document (create a bundle). The section is created from a file you upload. The file can be a PDF, DocX, or RTF. > 📘 We\'ve prepared two samples that you can use to test the request. > Download them here: > > - [Download a Sample PDF with Form Fields](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) > - [Download a Sample PDF with Field Tags](https://5132871.fs1.hubspotusercontent-na1.net/hubfs/5132871/SamplePandaDocPdf_FieldTags_updated.pdf) > 🚧 Usage specifics > > 1. This method uses a `multipart/form-data` request type instead of the `application/json` typically found in the PandaDoc API. This is to accommodate the upload of the included document. > 2. You can send a URL instead of a file in the document creation request. > In this case, you need to use the `application/json` content type and add the URL parameter in the body request. As an example, see [Create from public PDF](https://developers.pandadoc.com/docs/create-and-send-a-document-from-a-publicly-available-pdf) guide for more details. > 3. A file you upload is not stored in your PandaDoc account, so you have to upload it with every request. > ❗️ Limitations > > 1. This method does not support multiple documents. > 2. The maximum supported file size is 50 MB. API returns \"413 Request entity too large\" in case of bigger files. > 3. PandaDoc does not support creating document from a PDF with encrypted files (to check whether a file is encrypted or not, try Get info -> Secure: Password Encrypted). > ⏱️ Document Section creation is a non-blocking (asynchronous) operation > > The document creation process may take some time. > > With a successful request, you receive a response with the created upload ID and status `document_sections_upload.uploaded`. After processing completes on our servers, usually a few seconds, the document moves to the `document_sections_upload.PROCESSED` status. ## PDF Form Fields PandaDoc recognizes PDF form fields. To enable this feature, pass the optional `parse_form_fields` value as `true` when making a create document section API call. We support Text fields, Dropdowns, and Signature fields. If you would like to pass additional parameters to configure PDF form fields, use the PDF field name as an optId. You can use a PDF editor such as Adobe Acrobat, Foxit to get and edit field names in your PDF. [**Download a Sample PDF with Form Fields**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) ## PDF/DocX/RTF Field Tags This parsing format allows a word processor such as [Microsoft Word](https://support.office.com/en-us/article/Save-as-PDF-d85416c5-7d77-4fd6-a216-6f4bf7c7c110?ui=en-US&rs=en-US&ad=US) or [Google Docs](https://support.google.com/drive/answer/2423534?co=GENIE.Platform%3DDesktop&hl=en) to prepare a document and save it in PDF, DocX or RTF format. Within the text, PandaDoc parses field tags. A field tag starts and ends with brackets. The field tag includes basic information on how to create a form field in the PandaDoc document. The request JSON object `optId` can also extend this information for even greater control. Here is an example of how the field tag in a PDF/DocX/RTF is converted to a text field in the PandaDoc document: ![](https://files.readme.io/38afedf-ex3.png \"ex3.png\") [**Download a Sample PDF with Field Tags**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FieldTags.pdf)
### PDF Field Tag Key ![](https://files.readme.io/a81fbf1-field-tag-structure.png \"field-tag-structure.png\") | Number | Key | Description | Example | | :----- | :---------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------- | | 1 | `fieldType` | Field type from the table documented below | `signature`, or `s` for shorthand | | 2 | `*` | Optional `*` denotes the field is not required | `*` | | 3 | `role` | Role name. Associate the field tag with a recipient role. Roles must be assigned to recipients in the request body. In this case we are using role `s1` to keep the length short and denote the concept of \"signer 1\". `s1` would be the value passed as role in a recipient JSON object. | `s1` | | 4 | `optId` | Optional field Id. Specify more information about the field tag within the post request by using this id. | `sigBox17` | | 5 | `_____` | Use underscores to widen the field if desired. The form fields in PandaDoc will scale to the length and size of your field tag. | `_____` | > 🚧 Role names restrictions > > Underscores are not supported in role names for a file with a Field Tag. ### PDF/DocX/RTF Field Tag Supported Types | Field Type | Short Notation | Is PandaDoc Field | | :---------- | :------------- | :---------------- | | `textfield` | `t` | Field | | `checkbox` | `c` | Field | | `signature` | `s` | Field | | `date` | `d` | Field | | `initials` | `i` | Field | | `dropdown` | `dd` | Field | > 📘 Fields in PandaDoc > > The following article explains how to use Fields: [Everything you need to know about Fields](https://support.pandadoc.com/en/articles/9714583-fields) ```json Field Tags Example \"fields\": { \"textfield\": { \"value\": \"Jane\", \"role\": \"user\" }, \"dropdown\": { \"value\": \"opt1\", \"role\": \"user\", \"options\":[ \"opt1\", \"opt2\", \"opt3\" ] }, \"checkbox\": { \"value\": true, \"role\": \"user\" }, \"date\":{ \"value\": \"2022-05-20\", \"role\": \"user\" }, \"signature\": { \"value\": \"\", \"role\": \"user\" } } ```
## Signing order Set a signing order for document section sections created from a file. ```json \"recipients\": [ { \"email\": \"josh@example.com\", \"first_name\": \"Josh\", \"last_name\": \"Ron\", \"role\": \"user\", \"signing_order\": 1 } ] ``` ## Error handling | Error description | Type | Root cause | |---|---|---| | Document version 1 is not supported. | Validation errors: Form fields | The creation document section is supported only for document version 2 | | PDF content hasn\'t been processed: document is broken or locked | Processing errors: Failed to process document content | Document converter service can’t process PDF. This may be caused by locked PDF or if it’s broken. | | Error occurred while parsing PDF field tags. Please try PDF flattening or reach out to support | Processing errors: Field tag / Form field validation error | Doc converter managed to parse PDF and extract tags, but at least 1 of them is invalid (having negative position, for example). Usually we recommend PDF flattening and it helps | | No role=\'{role}\' for field tag specified in `recipients` found, roles passed were {roles} | Validation errors: Field tags | Role is invalid. When the role specified in field tag is empty or wasn’t provided in a payload for any recipient | | All field tags within PDF must be declared within `fields`  object of the JSON Payload. No field with optId=\'{optid}\' found in fields object, fields passed were {optids} | Validation errors: Field tags | Label is invalid. Occurs when **optId** specified in field tag is empty or no field with **name = optId** was provided in a payload | | One of field tags in PDF with type=\'{field}\' doesn\'t have a role | Validation errors: Field tags | Field tag in PDF has no role. One of field tags in PDF with type=% doesn\'t have a role. | | Role for form field with name=\'{role}\' is not provided in payload | Validation errors: Form fields | Role for form field with ‘name’ is not provided. Occurs when `role` for form field with name=%s  is not provided in payload | | Field for form field with name=\'{name}\' is not specified in payload, available names are {names} | Validation errors: Form fields | Field ‘name’ is not specified in payload. Occurs when no field with name = form field name was provided in a payload | | No role=\'{role}\' for form field specified in \'recipients\' found, roles passed were {roles}\" | Validation errors: Form fields | Failed to resolve field actor for `role` in form field with ‘name’.   Occurs when role from the form field is not found in recipient’s from payload | | Failed to download file from link {url}. | Source errors | Error on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload | | Failed to download file from link {url} (status code: {status code}) | Source errors | Error with HTTP status code on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload - remote server responded with the HTTP status code | | Content type=\'{type}\' is not supported, available types are {types} | Source errors | Content type is not supported.  Content type should be one of the following: PDF, ZIP, doc, docx, RTF | | The maximum file size is exceeded, limit is {limit} MB | Source errors | The file size has exceeded the allowed limits. An error occurred while trying to download a file that is too large (limit is 50M) | + * Create Document Section from File Upload + * @param documentId Document ID + * @param [mergeFieldScope] Determines how the fields are mapped when creating a section. * document: Default value. The fields of the entire document are updated. * upload: Only the fields from the created section are updated. The merge field is appended with the upload ID. + * @param [file] Binary PDF/DocX/RTF File. + * @param [data] JSON as a multipart/form-data string. + */ + public uploadSectionWithUploadWithHttpInfo(documentId: string, mergeFieldScope?: 'document' | 'upload', file?: HttpFile, data?: UploadSectionRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.uploadSectionWithUpload(documentId, mergeFieldScope, file, data, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.uploadSectionWithUploadWithHttpInfo(rsp))); + })); + } + + /** + * With this endpoint, you can add a new section to an existing PandaDoc document (create a bundle). The section is created from a file you upload. The file can be a PDF, DocX, or RTF. > 📘 We\'ve prepared two samples that you can use to test the request. > Download them here: > > - [Download a Sample PDF with Form Fields](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) > - [Download a Sample PDF with Field Tags](https://5132871.fs1.hubspotusercontent-na1.net/hubfs/5132871/SamplePandaDocPdf_FieldTags_updated.pdf) > 🚧 Usage specifics > > 1. This method uses a `multipart/form-data` request type instead of the `application/json` typically found in the PandaDoc API. This is to accommodate the upload of the included document. > 2. You can send a URL instead of a file in the document creation request. > In this case, you need to use the `application/json` content type and add the URL parameter in the body request. As an example, see [Create from public PDF](https://developers.pandadoc.com/docs/create-and-send-a-document-from-a-publicly-available-pdf) guide for more details. > 3. A file you upload is not stored in your PandaDoc account, so you have to upload it with every request. > ❗️ Limitations > > 1. This method does not support multiple documents. > 2. The maximum supported file size is 50 MB. API returns \"413 Request entity too large\" in case of bigger files. > 3. PandaDoc does not support creating document from a PDF with encrypted files (to check whether a file is encrypted or not, try Get info -> Secure: Password Encrypted). > ⏱️ Document Section creation is a non-blocking (asynchronous) operation > > The document creation process may take some time. > > With a successful request, you receive a response with the created upload ID and status `document_sections_upload.uploaded`. After processing completes on our servers, usually a few seconds, the document moves to the `document_sections_upload.PROCESSED` status. ## PDF Form Fields PandaDoc recognizes PDF form fields. To enable this feature, pass the optional `parse_form_fields` value as `true` when making a create document section API call. We support Text fields, Dropdowns, and Signature fields. If you would like to pass additional parameters to configure PDF form fields, use the PDF field name as an optId. You can use a PDF editor such as Adobe Acrobat, Foxit to get and edit field names in your PDF. [**Download a Sample PDF with Form Fields**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) ## PDF/DocX/RTF Field Tags This parsing format allows a word processor such as [Microsoft Word](https://support.office.com/en-us/article/Save-as-PDF-d85416c5-7d77-4fd6-a216-6f4bf7c7c110?ui=en-US&rs=en-US&ad=US) or [Google Docs](https://support.google.com/drive/answer/2423534?co=GENIE.Platform%3DDesktop&hl=en) to prepare a document and save it in PDF, DocX or RTF format. Within the text, PandaDoc parses field tags. A field tag starts and ends with brackets. The field tag includes basic information on how to create a form field in the PandaDoc document. The request JSON object `optId` can also extend this information for even greater control. Here is an example of how the field tag in a PDF/DocX/RTF is converted to a text field in the PandaDoc document: ![](https://files.readme.io/38afedf-ex3.png \"ex3.png\") [**Download a Sample PDF with Field Tags**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FieldTags.pdf)
### PDF Field Tag Key ![](https://files.readme.io/a81fbf1-field-tag-structure.png \"field-tag-structure.png\") | Number | Key | Description | Example | | :----- | :---------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------- | | 1 | `fieldType` | Field type from the table documented below | `signature`, or `s` for shorthand | | 2 | `*` | Optional `*` denotes the field is not required | `*` | | 3 | `role` | Role name. Associate the field tag with a recipient role. Roles must be assigned to recipients in the request body. In this case we are using role `s1` to keep the length short and denote the concept of \"signer 1\". `s1` would be the value passed as role in a recipient JSON object. | `s1` | | 4 | `optId` | Optional field Id. Specify more information about the field tag within the post request by using this id. | `sigBox17` | | 5 | `_____` | Use underscores to widen the field if desired. The form fields in PandaDoc will scale to the length and size of your field tag. | `_____` | > 🚧 Role names restrictions > > Underscores are not supported in role names for a file with a Field Tag. ### PDF/DocX/RTF Field Tag Supported Types | Field Type | Short Notation | Is PandaDoc Field | | :---------- | :------------- | :---------------- | | `textfield` | `t` | Field | | `checkbox` | `c` | Field | | `signature` | `s` | Field | | `date` | `d` | Field | | `initials` | `i` | Field | | `dropdown` | `dd` | Field | > 📘 Fields in PandaDoc > > The following article explains how to use Fields: [Everything you need to know about Fields](https://support.pandadoc.com/en/articles/9714583-fields) ```json Field Tags Example \"fields\": { \"textfield\": { \"value\": \"Jane\", \"role\": \"user\" }, \"dropdown\": { \"value\": \"opt1\", \"role\": \"user\", \"options\":[ \"opt1\", \"opt2\", \"opt3\" ] }, \"checkbox\": { \"value\": true, \"role\": \"user\" }, \"date\":{ \"value\": \"2022-05-20\", \"role\": \"user\" }, \"signature\": { \"value\": \"\", \"role\": \"user\" } } ```
## Signing order Set a signing order for document section sections created from a file. ```json \"recipients\": [ { \"email\": \"josh@example.com\", \"first_name\": \"Josh\", \"last_name\": \"Ron\", \"role\": \"user\", \"signing_order\": 1 } ] ``` ## Error handling | Error description | Type | Root cause | |---|---|---| | Document version 1 is not supported. | Validation errors: Form fields | The creation document section is supported only for document version 2 | | PDF content hasn\'t been processed: document is broken or locked | Processing errors: Failed to process document content | Document converter service can’t process PDF. This may be caused by locked PDF or if it’s broken. | | Error occurred while parsing PDF field tags. Please try PDF flattening or reach out to support | Processing errors: Field tag / Form field validation error | Doc converter managed to parse PDF and extract tags, but at least 1 of them is invalid (having negative position, for example). Usually we recommend PDF flattening and it helps | | No role=\'{role}\' for field tag specified in `recipients` found, roles passed were {roles} | Validation errors: Field tags | Role is invalid. When the role specified in field tag is empty or wasn’t provided in a payload for any recipient | | All field tags within PDF must be declared within `fields`  object of the JSON Payload. No field with optId=\'{optid}\' found in fields object, fields passed were {optids} | Validation errors: Field tags | Label is invalid. Occurs when **optId** specified in field tag is empty or no field with **name = optId** was provided in a payload | | One of field tags in PDF with type=\'{field}\' doesn\'t have a role | Validation errors: Field tags | Field tag in PDF has no role. One of field tags in PDF with type=% doesn\'t have a role. | | Role for form field with name=\'{role}\' is not provided in payload | Validation errors: Form fields | Role for form field with ‘name’ is not provided. Occurs when `role` for form field with name=%s  is not provided in payload | | Field for form field with name=\'{name}\' is not specified in payload, available names are {names} | Validation errors: Form fields | Field ‘name’ is not specified in payload. Occurs when no field with name = form field name was provided in a payload | | No role=\'{role}\' for form field specified in \'recipients\' found, roles passed were {roles}\" | Validation errors: Form fields | Failed to resolve field actor for `role` in form field with ‘name’.   Occurs when role from the form field is not found in recipient’s from payload | | Failed to download file from link {url}. | Source errors | Error on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload | | Failed to download file from link {url} (status code: {status code}) | Source errors | Error with HTTP status code on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload - remote server responded with the HTTP status code | | Content type=\'{type}\' is not supported, available types are {types} | Source errors | Content type is not supported.  Content type should be one of the following: PDF, ZIP, doc, docx, RTF | | The maximum file size is exceeded, limit is {limit} MB | Source errors | The file size has exceeded the allowed limits. An error occurred while trying to download a file that is too large (limit is 50M) | + * Create Document Section from File Upload + * @param documentId Document ID + * @param [mergeFieldScope] Determines how the fields are mapped when creating a section. * document: Default value. The fields of the entire document are updated. * upload: Only the fields from the created section are updated. The merge field is appended with the upload ID. + * @param [file] Binary PDF/DocX/RTF File. + * @param [data] JSON as a multipart/form-data string. + */ + public uploadSectionWithUpload(documentId: string, mergeFieldScope?: 'document' | 'upload', file?: HttpFile, data?: UploadSectionRequest, _options?: ConfigurationOptions): Observable { + return this.uploadSectionWithUploadWithHttpInfo(documentId, mergeFieldScope, file, data, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + +} + +import { DocumentSettingsApiRequestFactory, DocumentSettingsApiResponseProcessor} from "../apis/DocumentSettingsApi"; +export class ObservableDocumentSettingsApi { + private requestFactory: DocumentSettingsApiRequestFactory; + private responseProcessor: DocumentSettingsApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: DocumentSettingsApiRequestFactory, + responseProcessor?: DocumentSettingsApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = requestFactory || new DocumentSettingsApiRequestFactory(configuration); + this.responseProcessor = responseProcessor || new DocumentSettingsApiResponseProcessor(); + } + + /** + * Retrieves the settings for a specified document. Supported fields: language, qualified_electronic_signature, expires_in (in days). + * Get document settings + * @param documentId Unique identifier of the document to retrieve settings for. + */ + public documentSettingsGetWithHttpInfo(documentId: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.documentSettingsGet(documentId, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.documentSettingsGetWithHttpInfo(rsp))); + })); + } + + /** + * Retrieves the settings for a specified document. Supported fields: language, qualified_electronic_signature, expires_in (in days). + * Get document settings + * @param documentId Unique identifier of the document to retrieve settings for. + */ + public documentSettingsGet(documentId: string, _options?: ConfigurationOptions): Observable { + return this.documentSettingsGetWithHttpInfo(documentId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Updates the settings for a specified document. Supported fields: language, qualified_electronic_signature, expires_in (in days). + * Update document settings + * @param documentId Unique identifier of the document to update settings for. + * @param updateDocumentSettingsRequest + */ + public documentSettingsUpdateWithHttpInfo(documentId: string, updateDocumentSettingsRequest: UpdateDocumentSettingsRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.documentSettingsUpdate(documentId, updateDocumentSettingsRequest, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.documentSettingsUpdateWithHttpInfo(rsp))); + })); + } + + /** + * Updates the settings for a specified document. Supported fields: language, qualified_electronic_signature, expires_in (in days). + * Update document settings + * @param documentId Unique identifier of the document to update settings for. + * @param updateDocumentSettingsRequest + */ + public documentSettingsUpdate(documentId: string, updateDocumentSettingsRequest: UpdateDocumentSettingsRequest, _options?: ConfigurationOptions): Observable { + return this.documentSettingsUpdateWithHttpInfo(documentId, updateDocumentSettingsRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + +} + +import { DocumentsApiRequestFactory, DocumentsApiResponseProcessor} from "../apis/DocumentsApi"; +export class ObservableDocumentsApi { + private requestFactory: DocumentsApiRequestFactory; + private responseProcessor: DocumentsApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: DocumentsApiRequestFactory, + responseProcessor?: DocumentsApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = requestFactory || new DocumentsApiRequestFactory(configuration); + this.responseProcessor = responseProcessor || new DocumentsApiResponseProcessor(); + } + + /** + * Appends a Content Library Item (CLI) to a document and provides a name mapping for its content blocks. + * Append Content Library Item to a document + * @param id Specify document id. + * @param appendCLIDataRequest + */ + public appendContentLibraryItemToDocumentWithHttpInfo(id: string, appendCLIDataRequest: AppendCLIDataRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.appendContentLibraryItemToDocument(id, appendCLIDataRequest, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.appendContentLibraryItemToDocumentWithHttpInfo(rsp))); + })); + } + + /** + * Appends a Content Library Item (CLI) to a document and provides a name mapping for its content blocks. + * Append Content Library Item to a document + * @param id Specify document id. + * @param appendCLIDataRequest + */ + public appendContentLibraryItemToDocument(id: string, appendCLIDataRequest: AppendCLIDataRequest, _options?: ConfigurationOptions): Observable { + return this.appendContentLibraryItemToDocumentWithHttpInfo(id, appendCLIDataRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * PandaDoc has eight document statuses, but you can manually set your document status to only four: ### Document statuses - Completed - `document.completed` - API code `2` - Expired - `document.voided` - code `11` - Paid - `document.paid` - code `10`. **Important**: You can only set it if you have a payment app connected. - Declined - `document.declined` - code `12` > 🚧 Pass a numeric code for the corresponding document status, for example, `2` for `document.completed`. Find more details in [\\[Editor 2.0\\] Manually change document status](https://support.pandadoc.com/en/articles/9714842-manually-change-document-status) topic. | Current Status | To Completed: | To Expired: | To Paid: | To Declined: | |----------------|---------------|-------------|----------|--------------| | Draft | YES | NO | YES | YES | | Approved | NO | NO | NO | NO | | Sent | YES | YES | NO | YES | | Viewed | YES | YES | NO | YES | | Completed (Auto) | NO | NO | NO | YES | | Waithing for payment | NO | NO | YES | YES | | Paid | NO | NO | NO | NO | | Expired | YES | NO | YES | YES | | Declined | YES | NO | YES | NO | > ✅ - from `document.voided` to `document.paid` > > ❌ - from `document.paid` to `document.voided` + * Document Status Change + * @param id Specify document ID. + * @param documentStatusChangeRequest + */ + public changeDocumentStatusWithHttpInfo(id: string, documentStatusChangeRequest: DocumentStatusChangeRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.changeDocumentStatus(id, documentStatusChangeRequest, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.changeDocumentStatusWithHttpInfo(rsp))); + })); + } + + /** + * PandaDoc has eight document statuses, but you can manually set your document status to only four: ### Document statuses - Completed - `document.completed` - API code `2` - Expired - `document.voided` - code `11` - Paid - `document.paid` - code `10`. **Important**: You can only set it if you have a payment app connected. - Declined - `document.declined` - code `12` > 🚧 Pass a numeric code for the corresponding document status, for example, `2` for `document.completed`. Find more details in [\\[Editor 2.0\\] Manually change document status](https://support.pandadoc.com/en/articles/9714842-manually-change-document-status) topic. | Current Status | To Completed: | To Expired: | To Paid: | To Declined: | |----------------|---------------|-------------|----------|--------------| | Draft | YES | NO | YES | YES | | Approved | NO | NO | NO | NO | | Sent | YES | YES | NO | YES | | Viewed | YES | YES | NO | YES | | Completed (Auto) | NO | NO | NO | YES | | Waithing for payment | NO | NO | YES | YES | | Paid | NO | NO | NO | NO | | Expired | YES | NO | YES | YES | | Declined | YES | NO | YES | NO | > ✅ - from `document.voided` to `document.paid` > > ❌ - from `document.paid` to `document.voided` + * Document Status Change + * @param id Specify document ID. + * @param documentStatusChangeRequest + */ + public changeDocumentStatus(id: string, documentStatusChangeRequest: DocumentStatusChangeRequest, _options?: ConfigurationOptions): Observable { + return this.changeDocumentStatusWithHttpInfo(id, documentStatusChangeRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * PandaDoc has eight document statuses, but you can manually set your document status to only four: ### Document statuses - Completed - `document.completed` - API code `2` - Expired - `document.voided` - code `11` - Paid - `document.paid` - code `10`. **Important**: You can only set it if you have a payment app connected. - Declined - `document.declined` - code `12` > 🚧 Pass a numeric code for the corresponding document status, for example, `2` for `document.completed`. Find more details in [\\[Editor 2.0\\] Manually change document status](https://support.pandadoc.com/en/articles/9714842-manually-change-document-status) topic. | Current Status | To Completed: | To Expired: | To Paid: | To Declined: | |----------------|---------------|-------------|----------|--------------| | Draft | YES | NO | YES | YES | | Approved | NO | NO | NO | NO | | Sent | YES | YES | NO | YES | | Viewed | YES | YES | NO | YES | | Completed (Auto) | NO | NO | NO | YES | | Waithing for payment | NO | NO | YES | YES | | Paid | NO | NO | NO | NO | | Expired | YES | NO | YES | YES | | Declined | YES | NO | YES | NO | > ✅ - from `document.voided` to `document.paid` > > ❌ - from `document.paid` to `document.voided` + * Document Status Change with Upload + * @param id Specify document ID. + * @param [file] Binary attachment file + * @param [data] JSON as a multipart/form-data string. + */ + public changeDocumentStatusWithUploadWithHttpInfo(id: string, file?: HttpFile, data?: DocumentStatusChangeRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.changeDocumentStatusWithUpload(id, file, data, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.changeDocumentStatusWithUploadWithHttpInfo(rsp))); + })); + } + + /** + * PandaDoc has eight document statuses, but you can manually set your document status to only four: ### Document statuses - Completed - `document.completed` - API code `2` - Expired - `document.voided` - code `11` - Paid - `document.paid` - code `10`. **Important**: You can only set it if you have a payment app connected. - Declined - `document.declined` - code `12` > 🚧 Pass a numeric code for the corresponding document status, for example, `2` for `document.completed`. Find more details in [\\[Editor 2.0\\] Manually change document status](https://support.pandadoc.com/en/articles/9714842-manually-change-document-status) topic. | Current Status | To Completed: | To Expired: | To Paid: | To Declined: | |----------------|---------------|-------------|----------|--------------| | Draft | YES | NO | YES | YES | | Approved | NO | NO | NO | NO | | Sent | YES | YES | NO | YES | | Viewed | YES | YES | NO | YES | | Completed (Auto) | NO | NO | NO | YES | | Waithing for payment | NO | NO | YES | YES | | Paid | NO | NO | NO | NO | | Expired | YES | NO | YES | YES | | Declined | YES | NO | YES | NO | > ✅ - from `document.voided` to `document.paid` > > ❌ - from `document.paid` to `document.voided` + * Document Status Change with Upload + * @param id Specify document ID. + * @param [file] Binary attachment file + * @param [data] JSON as a multipart/form-data string. + */ + public changeDocumentStatusWithUpload(id: string, file?: HttpFile, data?: DocumentStatusChangeRequest, _options?: ConfigurationOptions): Observable { + return this.changeDocumentStatusWithUploadWithHttpInfo(id, file, data, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * ## Create from a template > See the [Create document from template](https://developers.pandadoc.com/docs/create-document-from-template) tutorial for details on how to use this endpoint, as well as a sample template. ## Create from a URL > See the [Create from public PDF](https://developers.pandadoc.com/docs/create-and-send-a-document-from-a-publicly-available-pdf) guide for info about roles and fields, as well as PDF examples. + * Create Document + * @param documentCreateRequest + * @param [editorVer] Set this parameter as `ev1` if you want to create a document from PDF with Classic Editor when both editors are enabled for the workspace. + * @param [useFormFieldProperties] Set this parameter as `yes` or `1` or `true` (only when upload pdf with form fields) if you want to respect form fields properties, like `required`. + */ + public createDocumentWithHttpInfo(documentCreateRequest: DocumentCreateRequest, editorVer?: string, useFormFieldProperties?: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.createDocument(documentCreateRequest, editorVer, useFormFieldProperties, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createDocumentWithHttpInfo(rsp))); + })); + } + + /** + * ## Create from a template > See the [Create document from template](https://developers.pandadoc.com/docs/create-document-from-template) tutorial for details on how to use this endpoint, as well as a sample template. ## Create from a URL > See the [Create from public PDF](https://developers.pandadoc.com/docs/create-and-send-a-document-from-a-publicly-available-pdf) guide for info about roles and fields, as well as PDF examples. + * Create Document + * @param documentCreateRequest + * @param [editorVer] Set this parameter as `ev1` if you want to create a document from PDF with Classic Editor when both editors are enabled for the workspace. + * @param [useFormFieldProperties] Set this parameter as `yes` or `1` or `true` (only when upload pdf with form fields) if you want to respect form fields properties, like `required`. + */ + public createDocument(documentCreateRequest: DocumentCreateRequest, editorVer?: string, useFormFieldProperties?: string, _options?: ConfigurationOptions): Observable { + return this.createDocumentWithHttpInfo(documentCreateRequest, editorVer, useFormFieldProperties, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Creates a new editing session for the Embedded Editor. The response includes an E-Token, which is required to open the document. > 🚧 **Important:** The Embedded Editor can only open documents that have a `draft` status. #### Limitations - **Single Active Session per User-Document Pair** Only one editing session can be active at a time for a specific user and document. Creating a new session for the same user-document pair will automatically invalidate the previous one. - **Weekly Session Cap** A maximum of **250** editing sessions can be created for a single document per week. Any attempt to exceed this limit will result in a `403 Forbidden` error. + * Create Document Editing Session + * @param id Document ID + * @param editingSessionRequest + */ + public createDocumentEditingSessionWithHttpInfo(id: string, editingSessionRequest: EditingSessionRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.createDocumentEditingSession(id, editingSessionRequest, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createDocumentEditingSessionWithHttpInfo(rsp))); + })); + } + + /** + * Creates a new editing session for the Embedded Editor. The response includes an E-Token, which is required to open the document. > 🚧 **Important:** The Embedded Editor can only open documents that have a `draft` status. #### Limitations - **Single Active Session per User-Document Pair** Only one editing session can be active at a time for a specific user and document. Creating a new session for the same user-document pair will automatically invalidate the previous one. - **Weekly Session Cap** A maximum of **250** editing sessions can be created for a single document per week. Any attempt to exceed this limit will result in a `403 Forbidden` error. + * Create Document Editing Session + * @param id Document ID + * @param editingSessionRequest + */ + public createDocumentEditingSession(id: string, editingSessionRequest: EditingSessionRequest, _options?: ConfigurationOptions): Observable { + return this.createDocumentEditingSessionWithHttpInfo(id, editingSessionRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * ## Create from an upload > See the [Create from PDF](https://developers.pandadoc.com/docs/create-document-from-file) tutorial for the usage specifics and sample PDF files. **Note**: A file you upload is not stored in your PandaDoc account, so you have to upload it with every request. + * Create Document from File Upload + * @param [editorVer] Set this parameter as `ev1` if you want to create a document from PDF with Classic Editor when both editors are enabled for the workspace. + * @param [useFormFieldProperties] Set this parameter as `yes` or `1` or `true` (only when upload pdf with form fields) if you want to respect form fields properties, like `required`. + * @param [file] Binary PDF File + * @param [data] + */ + public createDocumentFromUploadWithHttpInfo(editorVer?: string, useFormFieldProperties?: string, file?: HttpFile, data?: DocumentCreateByPdfRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.createDocumentFromUpload(editorVer, useFormFieldProperties, file, data, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createDocumentFromUploadWithHttpInfo(rsp))); + })); + } + + /** + * ## Create from an upload > See the [Create from PDF](https://developers.pandadoc.com/docs/create-document-from-file) tutorial for the usage specifics and sample PDF files. **Note**: A file you upload is not stored in your PandaDoc account, so you have to upload it with every request. + * Create Document from File Upload + * @param [editorVer] Set this parameter as `ev1` if you want to create a document from PDF with Classic Editor when both editors are enabled for the workspace. + * @param [useFormFieldProperties] Set this parameter as `yes` or `1` or `true` (only when upload pdf with form fields) if you want to respect form fields properties, like `required`. + * @param [file] Binary PDF File + * @param [data] + */ + public createDocumentFromUpload(editorVer?: string, useFormFieldProperties?: string, file?: HttpFile, data?: DocumentCreateByPdfRequest, _options?: ConfigurationOptions): Observable { + return this.createDocumentFromUploadWithHttpInfo(editorVer, useFormFieldProperties, file, data, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Creates a document session for a recipient to view and sign a document. > 📘 How to create an Embedded Sign session > For more information on how to create an Embedded Sign session, see the [Embedded Signing](https://developers.pandadoc.com/docs/embedded-signing) documentation. + * Create Document Session for Embedded Sign + * @param id Document ID + * @param documentCreateLinkRequest + */ + public createDocumentLinkWithHttpInfo(id: string, documentCreateLinkRequest: DocumentCreateLinkRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.createDocumentLink(id, documentCreateLinkRequest, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createDocumentLinkWithHttpInfo(rsp))); + })); + } + + /** + * Creates a document session for a recipient to view and sign a document. > 📘 How to create an Embedded Sign session > For more information on how to create an Embedded Sign session, see the [Embedded Signing](https://developers.pandadoc.com/docs/embedded-signing) documentation. + * Create Document Session for Embedded Sign + * @param id Document ID + * @param documentCreateLinkRequest + */ + public createDocumentLink(id: string, documentCreateLinkRequest: DocumentCreateLinkRequest, _options?: ConfigurationOptions): Observable { + return this.createDocumentLinkWithHttpInfo(id, documentCreateLinkRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * > ⏱️ Export as DOCX is a non-blocking (asynchronous) operation > The document generation process may take some time. > With a successful request, you receive a response with task ID, status **created** and document id. After process completes, usually in a few minutes, the task status moves to the **done** state. > You can download documents up to 300 pages. For documents of 301+ pages, you will receive an error “400: The number of pages more then limit 300” + * [Beta] Create DOCX Export Task + * @param documentId Specify document id. + */ + public createExportDocxTaskWithHttpInfo(documentId: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.createExportDocxTask(documentId, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createExportDocxTaskWithHttpInfo(rsp))); + })); + } + + /** + * > ⏱️ Export as DOCX is a non-blocking (asynchronous) operation > The document generation process may take some time. > With a successful request, you receive a response with task ID, status **created** and document id. After process completes, usually in a few minutes, the task status moves to the **done** state. > You can download documents up to 300 pages. For documents of 301+ pages, you will receive an error “400: The number of pages more then limit 300” + * [Beta] Create DOCX Export Task + * @param documentId Specify document id. + */ + public createExportDocxTask(documentId: string, _options?: ConfigurationOptions): Observable { + return this.createExportDocxTaskWithHttpInfo(documentId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Delete a document by ID. + * Delete Document + * @param id Document ID + */ + public deleteDocumentWithHttpInfo(id: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.deleteDocument(id, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteDocumentWithHttpInfo(rsp))); + })); + } + + /** + * Delete a document by ID. + * Delete Document + * @param id Document ID + */ + public deleteDocument(id: string, _options?: ConfigurationOptions): Observable { + return this.deleteDocumentWithHttpInfo(id, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Return detailed data about a document. Use Document Status for getting just a basic info and status. Get details about a document by its `id`. Details include: - Basic document information (name, document state, owner, sender, grand total, etc.) - Recipients (completion status, signing order, etc.) - Fields with values (incl. Collect Files field) - Tokens (variables) with values - Pricing information (pricing tables, products, quotes, etc.) - Content block names for table, image, and text blocks (tables, images, texts) - Metadata - Tags - Linked objects - [Approval flow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) (if present) - Timestamps associated with a document. Note that `date_modified` means any changes associated with the recipients and document status, while `content_date_modified` reflects any changes in the document content. + * Document Details + * @param id Document ID + */ + public detailsDocumentWithHttpInfo(id: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.detailsDocument(id, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.detailsDocumentWithHttpInfo(rsp))); + })); + } + + /** + * Return detailed data about a document. Use Document Status for getting just a basic info and status. Get details about a document by its `id`. Details include: - Basic document information (name, document state, owner, sender, grand total, etc.) - Recipients (completion status, signing order, etc.) - Fields with values (incl. Collect Files field) - Tokens (variables) with values - Pricing information (pricing tables, products, quotes, etc.) - Content block names for table, image, and text blocks (tables, images, texts) - Metadata - Tags - Linked objects - [Approval flow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) (if present) - Timestamps associated with a document. Note that `date_modified` means any changes associated with the recipients and document status, while `content_date_modified` reflects any changes in the document content. + * Document Details + * @param id Document ID + */ + public detailsDocument(id: string, _options?: ConfigurationOptions): Observable { + return this.detailsDocumentWithHttpInfo(id, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Retrieves the current version of eSign disclosure text for a specified document. + * Document eSign disclosure + * @param documentId The UUID of the document. + */ + public documentESignDisclosureWithHttpInfo(documentId: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.documentESignDisclosure(documentId, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.documentESignDisclosureWithHttpInfo(rsp))); + })); + } + + /** + * Retrieves the current version of eSign disclosure text for a specified document. + * Document eSign disclosure + * @param documentId The UUID of the document. + */ + public documentESignDisclosure(documentId: string, _options?: ConfigurationOptions): Observable { + return this.documentESignDisclosureWithHttpInfo(documentId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * This operation allows you to move a document to a folder by specifying the document ID and folder ID. + * Document move to folder + * @param id Specify document ID. + * @param folderId Specify folder ID. + */ + public documentMoveToFolderWithHttpInfo(id: string, folderId: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.documentMoveToFolder(id, folderId, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.documentMoveToFolderWithHttpInfo(rsp))); + })); + } + + /** + * This operation allows you to move a document to a folder by specifying the document ID and folder ID. + * Document move to folder + * @param id Specify document ID. + * @param folderId Specify folder ID. + */ + public documentMoveToFolder(id: string, folderId: string, _options?: ConfigurationOptions): Observable { + return this.documentMoveToFolderWithHttpInfo(id, folderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Revert your document back to draft to continue editing it. > 📘 Returning to Draft works for any document status except Removed. ## After you move your document to the Draft status - `Signature` and `Initials` fields are cleared. All other fields stay filled in. - Recipients are **not** notified that the document is back in Draft. - You\'ll need to resend the document so that recipients can sign the updated version. + * Move Document to Draft + * @param id Specify document ID. + */ + public documentRevertToDraftWithHttpInfo(id: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.documentRevertToDraft(id, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.documentRevertToDraftWithHttpInfo(rsp))); + })); + } + + /** + * Revert your document back to draft to continue editing it. > 📘 Returning to Draft works for any document status except Removed. ## After you move your document to the Draft status - `Signature` and `Initials` fields are cleared. All other fields stay filled in. - Recipients are **not** notified that the document is back in Draft. - You\'ll need to resend the document so that recipients can sign the updated version. + * Move Document to Draft + * @param id Specify document ID. + */ + public documentRevertToDraft(id: string, _options?: ConfigurationOptions): Observable { + return this.documentRevertToDraftWithHttpInfo(id, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Download documents as a PDF. + * Document Download + * @param id Specify document ID. + * @param [watermarkColor] HEX code (for example `#FF5733`). + * @param [watermarkFontSize] Font size of the watermark. + * @param [watermarkOpacity] In range 0.0-1.0 + * @param [watermarkText] Specify watermark text. + * @param [separateFiles] Download document bundle as a zip-archive of separate PDFs (1 file per section). + */ + public downloadDocumentWithHttpInfo(id: string, watermarkColor?: string, watermarkFontSize?: number, watermarkOpacity?: number, watermarkText?: string, separateFiles?: boolean, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.downloadDocument(id, watermarkColor, watermarkFontSize, watermarkOpacity, watermarkText, separateFiles, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.downloadDocumentWithHttpInfo(rsp))); + })); + } + + /** + * Download documents as a PDF. + * Document Download + * @param id Specify document ID. + * @param [watermarkColor] HEX code (for example `#FF5733`). + * @param [watermarkFontSize] Font size of the watermark. + * @param [watermarkOpacity] In range 0.0-1.0 + * @param [watermarkText] Specify watermark text. + * @param [separateFiles] Download document bundle as a zip-archive of separate PDFs (1 file per section). + */ + public downloadDocument(id: string, watermarkColor?: string, watermarkFontSize?: number, watermarkOpacity?: number, watermarkText?: string, separateFiles?: boolean, _options?: ConfigurationOptions): Observable { + return this.downloadDocumentWithHttpInfo(id, watermarkColor, watermarkFontSize, watermarkOpacity, watermarkText, separateFiles, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Download a completed document as a verifiable PDF (Download Protected Document) > 🚧 Production key only > > This endpoint only works with a Production key. You\'ll get a 401 Unauthorized error when trying to use a Sandbox key. Download a signed PDF of a completed document + * Download Completed Document + * @param id Specify document ID. + * @param [separateFiles] Download document bundle as a zip-archive of separate PDFs (1 file per section). + */ + public downloadProtectedDocumentWithHttpInfo(id: string, separateFiles?: boolean, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.downloadProtectedDocument(id, separateFiles, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.downloadProtectedDocumentWithHttpInfo(rsp))); + })); + } + + /** + * Download a completed document as a verifiable PDF (Download Protected Document) > 🚧 Production key only > > This endpoint only works with a Production key. You\'ll get a 401 Unauthorized error when trying to use a Sandbox key. Download a signed PDF of a completed document + * Download Completed Document + * @param id Specify document ID. + * @param [separateFiles] Download document bundle as a zip-archive of separate PDFs (1 file per section). + */ + public downloadProtectedDocument(id: string, separateFiles?: boolean, _options?: ConfigurationOptions): Observable { + return this.downloadProtectedDocumentWithHttpInfo(id, separateFiles, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * > 📘 This endpoint returns the current state of a DOCX export task for a document. > The endpoint supports downloading only multiple files if the document contains several sections. Downloading as a single file in this case is not possible. + * [Beta] DOCX Export Task + * @param documentId Specify document id. + * @param taskId Specify Task id. + */ + public getDocxExportTaskWithHttpInfo(documentId: string, taskId: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.getDocxExportTask(documentId, taskId, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getDocxExportTaskWithHttpInfo(rsp))); + })); + } + + /** + * > 📘 This endpoint returns the current state of a DOCX export task for a document. > The endpoint supports downloading only multiple files if the document contains several sections. Downloading as a single file in this case is not possible. + * [Beta] DOCX Export Task + * @param documentId Specify document id. + * @param taskId Specify Task id. + */ + public getDocxExportTask(documentId: string, taskId: string, _options?: ConfigurationOptions): Observable { + return this.getDocxExportTaskWithHttpInfo(documentId, taskId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * This endpoint will let you list and search for the documents. ### [Here](https://developers.pandadoc.com/docs/list-search-documents-api) you can find how to filter, search and order documents. + * List Documents + * @param [templateId] Filters by parent template. This Parameter can\'t be used with form_id. + * @param [formId] Filters by parent form. This parameter can\'t be used with template_id. + * @param [folderUuid] Filters by the folder where the documents are stored. + * @param [contactId] Filters by recipient or approver with this \'contact_id\'. + * @param [count] Limits the size of the response. Default is 50 documents, maximum is 100 documents. + * @param [page] Paginates the search result. Increase value to get the next page of results. + * @param [orderBy] Defines the sorting of the result. Use `date_created` for ASC and `-date_created` for DESC sorting. + * @param [createdFrom] Limits results to the documents with the `date_created` greater than or equal to this value. + * @param [createdTo] Limits results to the documents with the `date_created` less than this value. + * @param [deleted] Returns only the deleted documents. + * @param [id] + * @param [completedFrom] Limits results to the documents with the `date_completed` greater than or equal to this value. + * @param [completedTo] Limits results to the documents with the `date_completed` less than this value. + * @param [membershipId] Filter documents by the owner\'s \'membership_id\'. + * @param [metadata] Filters documents by metadata. Pass metadata in the format of `metadata_{metadata-key}={metadata-value}` such as `metadata_opportunity_id=2181432`. The `metadata_` prefix is always required. + * @param [modifiedFrom] Limits results to the documents with the `date_modified` greater than or equal to this value. + * @param [modifiedTo] Limits results to the documents with the `date_modified` less than this value. + * @param [q] Filters documents by name or reference number (stored on the template level). + * @param [status] Filters documents by the status. * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review + * @param [statusNe] Exludes documents with this status. * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review + * @param [tag] Filters documents by tag. + */ + public listDocumentsWithHttpInfo(templateId?: string, formId?: string, folderUuid?: string, contactId?: string, count?: number, page?: number, orderBy?: DocumentOrderingFieldsEnum, createdFrom?: string, createdTo?: string, deleted?: boolean, id?: string, completedFrom?: string, completedTo?: string, membershipId?: string, metadata?: Array, modifiedFrom?: string, modifiedTo?: string, q?: string, status?: DocumentStatusRequestEnum, statusNe?: DocumentStatusRequestEnum, tag?: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.listDocuments(templateId, formId, folderUuid, contactId, count, page, orderBy, createdFrom, createdTo, deleted, id, completedFrom, completedTo, membershipId, metadata, modifiedFrom, modifiedTo, q, status, statusNe, tag, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listDocumentsWithHttpInfo(rsp))); + })); + } + + /** + * This endpoint will let you list and search for the documents. ### [Here](https://developers.pandadoc.com/docs/list-search-documents-api) you can find how to filter, search and order documents. + * List Documents + * @param [templateId] Filters by parent template. This Parameter can\'t be used with form_id. + * @param [formId] Filters by parent form. This parameter can\'t be used with template_id. + * @param [folderUuid] Filters by the folder where the documents are stored. + * @param [contactId] Filters by recipient or approver with this \'contact_id\'. + * @param [count] Limits the size of the response. Default is 50 documents, maximum is 100 documents. + * @param [page] Paginates the search result. Increase value to get the next page of results. + * @param [orderBy] Defines the sorting of the result. Use `date_created` for ASC and `-date_created` for DESC sorting. + * @param [createdFrom] Limits results to the documents with the `date_created` greater than or equal to this value. + * @param [createdTo] Limits results to the documents with the `date_created` less than this value. + * @param [deleted] Returns only the deleted documents. + * @param [id] + * @param [completedFrom] Limits results to the documents with the `date_completed` greater than or equal to this value. + * @param [completedTo] Limits results to the documents with the `date_completed` less than this value. + * @param [membershipId] Filter documents by the owner\'s \'membership_id\'. + * @param [metadata] Filters documents by metadata. Pass metadata in the format of `metadata_{metadata-key}={metadata-value}` such as `metadata_opportunity_id=2181432`. The `metadata_` prefix is always required. + * @param [modifiedFrom] Limits results to the documents with the `date_modified` greater than or equal to this value. + * @param [modifiedTo] Limits results to the documents with the `date_modified` less than this value. + * @param [q] Filters documents by name or reference number (stored on the template level). + * @param [status] Filters documents by the status. * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review + * @param [statusNe] Exludes documents with this status. * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review + * @param [tag] Filters documents by tag. + */ + public listDocuments(templateId?: string, formId?: string, folderUuid?: string, contactId?: string, count?: number, page?: number, orderBy?: DocumentOrderingFieldsEnum, createdFrom?: string, createdTo?: string, deleted?: boolean, id?: string, completedFrom?: string, completedTo?: string, membershipId?: string, metadata?: Array, modifiedFrom?: string, modifiedTo?: string, q?: string, status?: DocumentStatusRequestEnum, statusNe?: DocumentStatusRequestEnum, tag?: string, _options?: ConfigurationOptions): Observable { + return this.listDocumentsWithHttpInfo(templateId, formId, folderUuid, contactId, count, page, orderBy, createdFrom, createdTo, deleted, id, completedFrom, completedTo, membershipId, metadata, modifiedFrom, modifiedTo, q, status, statusNe, tag, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * > 🚧 Using the Sandbox Key > > When you use a [sandbox API key](https://developers.pandadoc.com/reference/sandbox-key) during the free trial period, the sender and recipient email addresses must be from the same organisation (email domain). ## Document State - You can only send a document in the `document.draft` status. - After creating a new document, it usually retains a `document.uploaded` status for 3-5 seconds while the document syncs across PandaDoc servers. When the document is available for further API calls, it moves to the `document.draft` state. Use [Document Status](/reference/document-status) or [Webhooks](/reference/on-document-status-change) to check document status. - Moving a document to the `document.sent` status finalizes the document structure, before recipients can complete it. - If a template used for the document creation has an approval workflow turned on, the sent document moves to the `document.waiting_approval` status. Once the document is approved, you need to make the call again to move the document to `document.sent` status. ## Send and Silence Notifications - By default, PandaDoc sends a notification email to the recipient, as well as notifications the sender has configured. You may disable all notifications for recipients by passing `silent: true`. This is useful when you are using alternative delivery methods such as linking to the document or embedding the document. - The `silent: true` parameter disables sent, viewed, comment and completed document email notifications. \"Document Approval\" notification won\'t be affected by this parameter. - If you pass `silent: false`, the document is going to be delivered by email and/or SMS. ![Example email. Branding can be changed in workspace settings](https://files.readme.io/cc5a03e-email2.png) ## Select Approver from Group If you have previously set up an approval workflow with selectable groups on the UI, you can select a particular approver from this group. Learn more about [selectable groups](https://support.pandadoc.com/en/articles/9714799-approval-workflow#h_01H4GNY5GSGG38BPYY46XV7GB4). To set an approver, we recommend to follow these steps: 1. Run the [Document Details](https://developers.pandadoc.com/reference/document-details) request. 2. Copy the `steps` part from the `approval_execution` section of the response into the `selected_approvers` field of the Send Document payload. 3. Modify your payload according to business needs: set `is_selected` to true for one approver. > 📘 **Note**: You can change the selected approver only if you revert your document back to the `document.draft` status. + * Send Document + * @param id Document ID + * @param documentSendRequest + */ + public sendDocumentWithHttpInfo(id: string, documentSendRequest: DocumentSendRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.sendDocument(id, documentSendRequest, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.sendDocumentWithHttpInfo(rsp))); + })); + } + + /** + * > 🚧 Using the Sandbox Key > > When you use a [sandbox API key](https://developers.pandadoc.com/reference/sandbox-key) during the free trial period, the sender and recipient email addresses must be from the same organisation (email domain). ## Document State - You can only send a document in the `document.draft` status. - After creating a new document, it usually retains a `document.uploaded` status for 3-5 seconds while the document syncs across PandaDoc servers. When the document is available for further API calls, it moves to the `document.draft` state. Use [Document Status](/reference/document-status) or [Webhooks](/reference/on-document-status-change) to check document status. - Moving a document to the `document.sent` status finalizes the document structure, before recipients can complete it. - If a template used for the document creation has an approval workflow turned on, the sent document moves to the `document.waiting_approval` status. Once the document is approved, you need to make the call again to move the document to `document.sent` status. ## Send and Silence Notifications - By default, PandaDoc sends a notification email to the recipient, as well as notifications the sender has configured. You may disable all notifications for recipients by passing `silent: true`. This is useful when you are using alternative delivery methods such as linking to the document or embedding the document. - The `silent: true` parameter disables sent, viewed, comment and completed document email notifications. \"Document Approval\" notification won\'t be affected by this parameter. - If you pass `silent: false`, the document is going to be delivered by email and/or SMS. ![Example email. Branding can be changed in workspace settings](https://files.readme.io/cc5a03e-email2.png) ## Select Approver from Group If you have previously set up an approval workflow with selectable groups on the UI, you can select a particular approver from this group. Learn more about [selectable groups](https://support.pandadoc.com/en/articles/9714799-approval-workflow#h_01H4GNY5GSGG38BPYY46XV7GB4). To set an approver, we recommend to follow these steps: 1. Run the [Document Details](https://developers.pandadoc.com/reference/document-details) request. 2. Copy the `steps` part from the `approval_execution` section of the response into the `selected_approvers` field of the Send Document payload. 3. Modify your payload according to business needs: set `is_selected` to true for one approver. > 📘 **Note**: You can change the selected approver only if you revert your document back to the `document.draft` status. + * Send Document + * @param id Document ID + * @param documentSendRequest + */ + public sendDocument(id: string, documentSendRequest: DocumentSendRequest, _options?: ConfigurationOptions): Observable { + return this.sendDocumentWithHttpInfo(id, documentSendRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * It is useful to request document status to ensure a document is in the expected state before calling additional API methods. ### Required Document Statuses Here are some common methods and the `document.status` required to proceed: | API Method | Required Document State | | :------------------- | :---------------------- | | Send A Document | `document.draft` | | Get Document Details | `document.draft` | | Embed A Document | `document.sent` | | Download A Document | `document.completed` | > 📘 Polling vs Webhooks > > If you are using the `GET` document status endpoint for [**polling**](https://en.wikipedia.org/wiki/Polling_(computer_science)), we also support and recommend using **webhooks** for event-driven needs: ### Available Document Statuses The following is a complete list of all possible document statuses returned: | Document Status | Status Description | | :-------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `document.uploaded` | The document has just been created or uploaded. It is in processing and will be in `document.draft` state soon. | | `document.error` | The document creation has failed. This status is terminal, you should stop polling after getting it. | `document.draft` | The document is in a draft state. All aspects of the document can be edited in this state. Our API does not support edits after the document has been created, but it can still be edited manually on | | `document.sent` | The document has been \"sealed\" and optionally sent. No further document edits can occur except for document recipient(s) filling out or signing the document. | | `document.viewed` | Document recipient(s) have viewed the sent document. | | `document.waiting_approval` | The document has an [automatic approval workflow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) and has not yet been approved. | | `document.rejected` | The document has an [automatic approval workflow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) and was rejected. | | `document.approved` | The document has an [automatic approval workflow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) and was approved. | | `document.waiting_pay` | The document has a [Stripe payment](https://support.pandadoc.com/en/articles/9714942-stripe-checkout-payments) option and is awaiting payment. | | `document.paid` | The document has a [Stripe payment](https://support.pandadoc.com/en/articles/9714942-stripe-checkout-payments) option and was paid. | | `document.completed` | The document has been completed by all recipients. | | `document.voided` | The document expired and is no longer available for completion or signature. | | `document.declined` | The document was [manually marked](https://support.pandadoc.com/en/articles/9714842-manually-change-document-status) as \"Declined\" | | `document.external_review` | The document is reviewed by it\'s recipient using Suggest Edit feature | + * Document Status + * @param id Specify document ID. + */ + public statusDocumentWithHttpInfo(id: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.statusDocument(id, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.statusDocumentWithHttpInfo(rsp))); + })); + } + + /** + * It is useful to request document status to ensure a document is in the expected state before calling additional API methods. ### Required Document Statuses Here are some common methods and the `document.status` required to proceed: | API Method | Required Document State | | :------------------- | :---------------------- | | Send A Document | `document.draft` | | Get Document Details | `document.draft` | | Embed A Document | `document.sent` | | Download A Document | `document.completed` | > 📘 Polling vs Webhooks > > If you are using the `GET` document status endpoint for [**polling**](https://en.wikipedia.org/wiki/Polling_(computer_science)), we also support and recommend using **webhooks** for event-driven needs: ### Available Document Statuses The following is a complete list of all possible document statuses returned: | Document Status | Status Description | | :-------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `document.uploaded` | The document has just been created or uploaded. It is in processing and will be in `document.draft` state soon. | | `document.error` | The document creation has failed. This status is terminal, you should stop polling after getting it. | `document.draft` | The document is in a draft state. All aspects of the document can be edited in this state. Our API does not support edits after the document has been created, but it can still be edited manually on | | `document.sent` | The document has been \"sealed\" and optionally sent. No further document edits can occur except for document recipient(s) filling out or signing the document. | | `document.viewed` | Document recipient(s) have viewed the sent document. | | `document.waiting_approval` | The document has an [automatic approval workflow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) and has not yet been approved. | | `document.rejected` | The document has an [automatic approval workflow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) and was rejected. | | `document.approved` | The document has an [automatic approval workflow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) and was approved. | | `document.waiting_pay` | The document has a [Stripe payment](https://support.pandadoc.com/en/articles/9714942-stripe-checkout-payments) option and is awaiting payment. | | `document.paid` | The document has a [Stripe payment](https://support.pandadoc.com/en/articles/9714942-stripe-checkout-payments) option and was paid. | | `document.completed` | The document has been completed by all recipients. | | `document.voided` | The document expired and is no longer available for completion or signature. | | `document.declined` | The document was [manually marked](https://support.pandadoc.com/en/articles/9714842-manually-change-document-status) as \"Declined\" | | `document.external_review` | The document is reviewed by it\'s recipient using Suggest Edit feature | + * Document Status + * @param id Specify document ID. + */ + public statusDocument(id: string, _options?: ConfigurationOptions): Observable { + return this.statusDocumentWithHttpInfo(id, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * This method transfers ownership of all documents from one member to another. + * Transfer all documents ownership + * @param documentTransferAllOwnershipRequest + */ + public transferAllDocumentsOwnershipWithHttpInfo(documentTransferAllOwnershipRequest: DocumentTransferAllOwnershipRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.transferAllDocumentsOwnership(documentTransferAllOwnershipRequest, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.transferAllDocumentsOwnershipWithHttpInfo(rsp))); + })); + } + + /** + * This method transfers ownership of all documents from one member to another. + * Transfer all documents ownership + * @param documentTransferAllOwnershipRequest + */ + public transferAllDocumentsOwnership(documentTransferAllOwnershipRequest: DocumentTransferAllOwnershipRequest, _options?: ConfigurationOptions): Observable { + return this.transferAllDocumentsOwnershipWithHttpInfo(documentTransferAllOwnershipRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * This operation allows transferring the ownership of a document to another user by specifying the document ID and membership ID. + * Update document ownership + * @param id Specify document ID. + * @param documentTransferOwnershipRequest + */ + public transferDocumentOwnershipWithHttpInfo(id: string, documentTransferOwnershipRequest: DocumentTransferOwnershipRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.transferDocumentOwnership(id, documentTransferOwnershipRequest, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.transferDocumentOwnershipWithHttpInfo(rsp))); + })); + } + + /** + * This operation allows transferring the ownership of a document to another user by specifying the document ID and membership ID. + * Update document ownership + * @param id Specify document ID. + * @param documentTransferOwnershipRequest + */ + public transferDocumentOwnership(id: string, documentTransferOwnershipRequest: DocumentTransferOwnershipRequest, _options?: ConfigurationOptions): Observable { + return this.transferDocumentOwnershipWithHttpInfo(id, documentTransferOwnershipRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Use the PATCH method to update a PandaDoc document. > 🚧 Document status > > You can only update a document in the Draft status (`document.draft`). > > After creating a new document, it usually retains a `document.uploaded` status for 3-5 seconds while the document syncs across PandaDoc servers. When the document is available for further API calls, the document moves to the `document.draft` state. Use [Document Status](https://developers.pandadoc.com/reference/document-status) or Webhooks to check document status. + * Update Document + * @param id Document ID + * @param documentUpdateRequest + */ + public updateDocumentWithHttpInfo(id: string, documentUpdateRequest: DocumentUpdateRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.updateDocument(id, documentUpdateRequest, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updateDocumentWithHttpInfo(rsp))); + })); + } + + /** + * Use the PATCH method to update a PandaDoc document. > 🚧 Document status > > You can only update a document in the Draft status (`document.draft`). > > After creating a new document, it usually retains a `document.uploaded` status for 3-5 seconds while the document syncs across PandaDoc servers. When the document is available for further API calls, the document moves to the `document.draft` state. Use [Document Status](https://developers.pandadoc.com/reference/document-status) or Webhooks to check document status. + * Update Document + * @param id Document ID + * @param documentUpdateRequest + */ + public updateDocument(id: string, documentUpdateRequest: DocumentUpdateRequest, _options?: ConfigurationOptions): Observable { + return this.updateDocumentWithHttpInfo(id, documentUpdateRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + +} + +import { FoldersApiRequestFactory, FoldersApiResponseProcessor} from "../apis/FoldersApi"; +export class ObservableFoldersApi { + private requestFactory: FoldersApiRequestFactory; + private responseProcessor: FoldersApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: FoldersApiRequestFactory, + responseProcessor?: FoldersApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = requestFactory || new FoldersApiRequestFactory(configuration); + this.responseProcessor = responseProcessor || new FoldersApiResponseProcessor(); + } + + /** + * Create a new folder to store your documents. For the full list of folder operations and their limitations, see [Organize Documents and Folders](https://developers.pandadoc.com/docs/organize-folders). + * Create Documents Folder + * @param documentsFolderCreateRequest + */ + public createDocumentFolderWithHttpInfo(documentsFolderCreateRequest: DocumentsFolderCreateRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.createDocumentFolder(documentsFolderCreateRequest, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createDocumentFolderWithHttpInfo(rsp))); + })); + } + + /** + * Create a new folder to store your documents. For the full list of folder operations and their limitations, see [Organize Documents and Folders](https://developers.pandadoc.com/docs/organize-folders). + * Create Documents Folder + * @param documentsFolderCreateRequest + */ + public createDocumentFolder(documentsFolderCreateRequest: DocumentsFolderCreateRequest, _options?: ConfigurationOptions): Observable { + return this.createDocumentFolderWithHttpInfo(documentsFolderCreateRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Create a new folder to store your templates. For the full list of folder operations and their limitations, see [Organize Templates and Folders](https://developers.pandadoc.com/docs/organize-folders). + * Create Templates Folder + * @param templatesFolderCreateRequest + */ + public createTemplateFolderWithHttpInfo(templatesFolderCreateRequest: TemplatesFolderCreateRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.createTemplateFolder(templatesFolderCreateRequest, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createTemplateFolderWithHttpInfo(rsp))); + })); + } + + /** + * Create a new folder to store your templates. For the full list of folder operations and their limitations, see [Organize Templates and Folders](https://developers.pandadoc.com/docs/organize-folders). + * Create Templates Folder + * @param templatesFolderCreateRequest + */ + public createTemplateFolder(templatesFolderCreateRequest: TemplatesFolderCreateRequest, _options?: ConfigurationOptions): Observable { + return this.createTemplateFolderWithHttpInfo(templatesFolderCreateRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Get the list of folders which contain Documents in your account. > 📘 > > The root folder is not listed in the response. For the full list of folder operations and their limitations, see [Organize Documents and Folders](https://developers.pandadoc.com/docs/organize-folders). + * List Documents Folders + * @param [parentUuid] The UUID of the folder containing folders. To list the folders located in the root folder, remove this parameter in the request. + * @param [count] Optionally, specify how many folders to return. + * @param [page] Optionally, specify which page of the dataset to return. + */ + public listDocumentFoldersWithHttpInfo(parentUuid?: string, count?: number, page?: number, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.listDocumentFolders(parentUuid, count, page, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listDocumentFoldersWithHttpInfo(rsp))); + })); + } + + /** + * Get the list of folders which contain Documents in your account. > 📘 > > The root folder is not listed in the response. For the full list of folder operations and their limitations, see [Organize Documents and Folders](https://developers.pandadoc.com/docs/organize-folders). + * List Documents Folders + * @param [parentUuid] The UUID of the folder containing folders. To list the folders located in the root folder, remove this parameter in the request. + * @param [count] Optionally, specify how many folders to return. + * @param [page] Optionally, specify which page of the dataset to return. + */ + public listDocumentFolders(parentUuid?: string, count?: number, page?: number, _options?: ConfigurationOptions): Observable { + return this.listDocumentFoldersWithHttpInfo(parentUuid, count, page, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Get the list of folders that contain Templates in your account. > 📘 > > The root folder is not listed in the response. For the full list of folder operations and their limitations, see [Organize Templates and Folders](https://developers.pandadoc.com/docs/organize-folders). + * List Templates Folders + * @param [parentUuid] The UUID of the folder containing folders. To list the folders located in the root folder, remove this parameter in the request. + * @param [count] Optionally, specify how many folders to return. + * @param [page] Optionally, specify which page of the dataset to return. + */ + public listTemplateFoldersWithHttpInfo(parentUuid?: string, count?: number, page?: number, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.listTemplateFolders(parentUuid, count, page, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listTemplateFoldersWithHttpInfo(rsp))); + })); + } + + /** + * Get the list of folders that contain Templates in your account. > 📘 > > The root folder is not listed in the response. For the full list of folder operations and their limitations, see [Organize Templates and Folders](https://developers.pandadoc.com/docs/organize-folders). + * List Templates Folders + * @param [parentUuid] The UUID of the folder containing folders. To list the folders located in the root folder, remove this parameter in the request. + * @param [count] Optionally, specify how many folders to return. + * @param [page] Optionally, specify which page of the dataset to return. + */ + public listTemplateFolders(parentUuid?: string, count?: number, page?: number, _options?: ConfigurationOptions): Observable { + return this.listTemplateFoldersWithHttpInfo(parentUuid, count, page, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Rename Documents Folder. For the full list of folder operations and their limitations, see [Organize Documents and Folders](https://developers.pandadoc.com/docs/organize-folders). + * Rename Documents Folder + * @param id The UUID of the folder that you are renaming. + * @param documentsFolderRenameRequest + */ + public renameDocumentFolderWithHttpInfo(id: string, documentsFolderRenameRequest: DocumentsFolderRenameRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.renameDocumentFolder(id, documentsFolderRenameRequest, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.renameDocumentFolderWithHttpInfo(rsp))); + })); + } + + /** + * Rename Documents Folder. For the full list of folder operations and their limitations, see [Organize Documents and Folders](https://developers.pandadoc.com/docs/organize-folders). + * Rename Documents Folder + * @param id The UUID of the folder that you are renaming. + * @param documentsFolderRenameRequest + */ + public renameDocumentFolder(id: string, documentsFolderRenameRequest: DocumentsFolderRenameRequest, _options?: ConfigurationOptions): Observable { + return this.renameDocumentFolderWithHttpInfo(id, documentsFolderRenameRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Rename a templates folder. For the full list of folder operations and their limitations, see [Organize Templates and Folders](https://developers.pandadoc.com/docs/organize-folders). + * Rename Templates Folder + * @param id The UUID of the folder which you are renaming. + * @param templatesFolderRenameRequest + */ + public renameTemplateFolderWithHttpInfo(id: string, templatesFolderRenameRequest: TemplatesFolderRenameRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.renameTemplateFolder(id, templatesFolderRenameRequest, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.documentMoveToFolder(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.renameTemplateFolderWithHttpInfo(rsp))); })); } /** - * Document download - * @param id Specify document ID. - * @param watermarkColor HEX code (for example `#FF5733`). - * @param watermarkFontSize Font size of the watermark. - * @param watermarkOpacity In range 0.0-1.0 - * @param watermarkText Specify watermark text. - * @param separateFiles Set as `true` if you want to receive a zip file with all documents in separate when document transaction contains more than 1. + * Rename a templates folder. For the full list of folder operations and their limitations, see [Organize Templates and Folders](https://developers.pandadoc.com/docs/organize-folders). + * Rename Templates Folder + * @param id The UUID of the folder which you are renaming. + * @param templatesFolderRenameRequest + */ + public renameTemplateFolder(id: string, templatesFolderRenameRequest: TemplatesFolderRenameRequest, _options?: ConfigurationOptions): Observable { + return this.renameTemplateFolderWithHttpInfo(id, templatesFolderRenameRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + +} + +import { FormsApiRequestFactory, FormsApiResponseProcessor} from "../apis/FormsApi"; +export class ObservableFormsApi { + private requestFactory: FormsApiRequestFactory; + private responseProcessor: FormsApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: FormsApiRequestFactory, + responseProcessor?: FormsApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = requestFactory || new FormsApiRequestFactory(configuration); + this.responseProcessor = responseProcessor || new FormsApiResponseProcessor(); + } + + /** + * Retrieve a paginated list of forms with optional filtering and sorting options. + * List Forms + * @param [count] Specify how many forms to return. Default is 50 forms, maximum is 100 forms. + * @param [page] Specify which page of the dataset to return. + * @param [status] Specify which status of the forms dataset to return. + * @param [orderBy] Specify the form dataset order to return. + * @param [asc] Specify sorting the result-set in ascending or descending order. + * @param [name] Specify the form name. */ - public downloadDocument(id: string, watermarkColor?: string, watermarkFontSize?: number, watermarkOpacity?: number, watermarkText?: string, separateFiles?: boolean, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.downloadDocument(id, watermarkColor, watermarkFontSize, watermarkOpacity, watermarkText, separateFiles, _options); + public listFormWithHttpInfo(count?: number, page?: number, status?: Array<'draft' | 'active' | 'disabled'>, orderBy?: 'name' | 'responses' | 'status' | 'created_date' | 'modified_date', asc?: boolean, name?: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.listForm(count, page, status, orderBy, asc, name, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.downloadDocument(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listFormWithHttpInfo(rsp))); })); } /** - * Download a signed PDF of a completed document - * Download document protected - * @param id Specify document ID. - * @param separateFiles Set as `true` if you want to receive a zip file with all documents in separate when document transaction contains more than 1. + * Retrieve a paginated list of forms with optional filtering and sorting options. + * List Forms + * @param [count] Specify how many forms to return. Default is 50 forms, maximum is 100 forms. + * @param [page] Specify which page of the dataset to return. + * @param [status] Specify which status of the forms dataset to return. + * @param [orderBy] Specify the form dataset order to return. + * @param [asc] Specify sorting the result-set in ascending or descending order. + * @param [name] Specify the form name. + */ + public listForm(count?: number, page?: number, status?: Array<'draft' | 'active' | 'disabled'>, orderBy?: 'name' | 'responses' | 'status' | 'created_date' | 'modified_date', asc?: boolean, name?: string, _options?: ConfigurationOptions): Observable { + return this.listFormWithHttpInfo(count, page, status, orderBy, asc, name, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + +} + +import { MembersApiRequestFactory, MembersApiResponseProcessor} from "../apis/MembersApi"; +export class ObservableMembersApi { + private requestFactory: MembersApiRequestFactory; + private responseProcessor: MembersApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: MembersApiRequestFactory, + responseProcessor?: MembersApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = requestFactory || new MembersApiRequestFactory(configuration); + this.responseProcessor = responseProcessor || new MembersApiResponseProcessor(); + } + + /** + * > 🚧 > > This endpoint is only exposed upon request. Please reach out to your Account Manager to get access. > 📘 > > Make sure you\'re using Public API keys generated by Org Admin, otherwise you\'ll receive a 403 response. + * Create Member Token + * @param memberId Member id. + * @param [createMemberTokenRequest] */ - public downloadProtectedDocument(id: string, separateFiles?: boolean, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.downloadProtectedDocument(id, separateFiles, _options); + public createMemberTokenWithHttpInfo(memberId: string, createMemberTokenRequest?: CreateMemberTokenRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.createMemberToken(memberId, createMemberTokenRequest, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.downloadProtectedDocument(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createMemberTokenWithHttpInfo(rsp))); })); } /** - * List documents - * @param completedFrom Return results where the `date_completed` field (ISO 8601) is greater than or equal to this value. - * @param completedTo Return results where the `date_completed` field (ISO 8601) is less than or equal to this value. - * @param contactId Returns results where 'contact_id' is present in document as recipient or approver - * @param count Specify how many document results to return. Default is 50 documents, maximum is 100 documents. - * @param createdFrom Return results where the `date_created` field (ISO 8601) is greater than or equal to this value. - * @param createdTo Return results where the `date_created` field (ISO 8601) is less than this value. - * @param deleted Returns only the deleted documents. - * @param id - * @param folderUuid The UUID of the folder where the documents are stored. - * @param formId Specify the form used for documents creation. This parameter can't be used with template_id. - * @param membershipId Returns results where 'membership_id' is present in document as owner (should be member uuid) - * @param metadata Specify metadata to filter by in the format of `metadata_{metadata-key}={metadata-value}` such as `metadata_opportunity_id=2181432`. The `metadata_` prefix is always required. - * @param modifiedFrom Return results where the `date_modified` field (iso-8601) is greater than or equal to this value. - * @param modifiedTo Return results where the `date_modified` field (iso-8601) is less than this value. - * @param orderBy Specify the order of documents to return. Use `value` (for example, `date_created`) for ASC and `-value` (for example, `-date_created`) for DESC. - * @param page Specify which page of the dataset to return. - * @param q Search query. Filter by document reference number (this token is stored on the template level) or name. - * @param status Specify the status of documents to return. * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review - * @param statusNe Specify the status of documents to return (exclude). * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review - * @param tag Search tag. Filter by document tag. - * @param templateId Specify the template used for documents creation. Parameter can't be used with form_id. + * > 🚧 > > This endpoint is only exposed upon request. Please reach out to your Account Manager to get access. > 📘 > > Make sure you\'re using Public API keys generated by Org Admin, otherwise you\'ll receive a 403 response. + * Create Member Token + * @param memberId Member id. + * @param [createMemberTokenRequest] + */ + public createMemberToken(memberId: string, createMemberTokenRequest?: CreateMemberTokenRequest, _options?: ConfigurationOptions): Observable { + return this.createMemberTokenWithHttpInfo(memberId, createMemberTokenRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Returns the member details of the current user (the owner of the API key). **User** - is an account with a license in the Organization. **Member** - is a User with a predefined Role in the Workspace. | Parameter | Description | |---|---| | `user_id` | A unique identifier of the `user` in the **organization** | | `membership_id` | A unique identifier of the `user` in the **workspace** | | `email` | A user email address | | `first_name` | A user\'s first name | | `last_name` | A user\'s last name | | `is_active` | A boolean value that identifies if a member is active and not blocked | | `workspace` | A unique identifier of the user\'s current active workspace | | `workspace_name` | A name of the user\'s current active workspace | | `email_verified` | A boolean value that identifies if the email is verified | | `role` | A member\'s role in the workspace | | `user_license` | A user license in the organization: 
`Full (Standard)`; 
`Read-only`; 
`eSignature`; 
`Guest`; 
`Creator` | | `date_created` | A date when a member was added to the workspace | | `date_modified` | Last modified date of a member | + * Current Member Details */ - public listDocuments(completedFrom?: string, completedTo?: string, contactId?: string, count?: number, createdFrom?: string, createdTo?: string, deleted?: boolean, id?: string, folderUuid?: string, formId?: string, membershipId?: string, metadata?: Array, modifiedFrom?: string, modifiedTo?: string, orderBy?: DocumentOrderingFieldsEnum, page?: number, q?: string, status?: DocumentStatusRequestEnum, statusNe?: DocumentStatusRequestEnum, tag?: string, templateId?: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.listDocuments(completedFrom, completedTo, contactId, count, createdFrom, createdTo, deleted, id, folderUuid, formId, membershipId, metadata, modifiedFrom, modifiedTo, orderBy, page, q, status, statusNe, tag, templateId, _options); + public detailsCurrentMemberWithHttpInfo(_options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.detailsCurrentMember(_config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listDocuments(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.detailsCurrentMemberWithHttpInfo(rsp))); })); } /** - * List Linked Objects - * @param id Specify document ID. + * Returns the member details of the current user (the owner of the API key). **User** - is an account with a license in the Organization. **Member** - is a User with a predefined Role in the Workspace. | Parameter | Description | |---|---| | `user_id` | A unique identifier of the `user` in the **organization** | | `membership_id` | A unique identifier of the `user` in the **workspace** | | `email` | A user email address | | `first_name` | A user\'s first name | | `last_name` | A user\'s last name | | `is_active` | A boolean value that identifies if a member is active and not blocked | | `workspace` | A unique identifier of the user\'s current active workspace | | `workspace_name` | A name of the user\'s current active workspace | | `email_verified` | A boolean value that identifies if the email is verified | | `role` | A member\'s role in the workspace | | `user_license` | A user license in the organization: 
`Full (Standard)`; 
`Read-only`; 
`eSignature`; 
`Guest`; 
`Creator` | | `date_created` | A date when a member was added to the workspace | | `date_modified` | Last modified date of a member | + * Current Member Details + */ + public detailsCurrentMember(_options?: ConfigurationOptions): Observable { + return this.detailsCurrentMemberWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * A method to retrieve a member\'s details by ID. **User** - is an account with a license in the Organization. **Member** - is a User with a predefined Role in the Workspace. | Parameter | Description | |---|---| | `user_id` | A unique identifier of the `user` in the **organization** | | `membership_id` | A unique identifier of the `user` in the **workspace** | | `email` | A user email address | | `first_name` | A user\'s first name | | `last_name` | A user\'s last name | | `is_active` | A boolean value that identifies if a member is active and not blocked | | `workspace` | A unique identifier of the user\'s current active workspace | | `workspace_name` | A name of the user\'s current active workspace | | `email_verified` | A boolean value that identifies if the email is verified | | `role` | A member\'s role in the workspace | | `user_license` | A user license in the organization: 
`Full (Standard)`; 
`Read-only`; 
`eSignature`; 
`Guest`; 
`Creator` | | `date_created` | A date when a member was added to the workspace | | `date_modified` | Last modified date of a member | + * Member Details + * @param id Membership id. */ - public listLinkedObjects(id: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.listLinkedObjects(id, _options); + public detailsMemberWithHttpInfo(id: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.detailsMember(id, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listLinkedObjects(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.detailsMemberWithHttpInfo(rsp))); })); } /** - * Send Document - * @param id Document ID - * @param documentSendRequest + * A method to retrieve a member\'s details by ID. **User** - is an account with a license in the Organization. **Member** - is a User with a predefined Role in the Workspace. | Parameter | Description | |---|---| | `user_id` | A unique identifier of the `user` in the **organization** | | `membership_id` | A unique identifier of the `user` in the **workspace** | | `email` | A user email address | | `first_name` | A user\'s first name | | `last_name` | A user\'s last name | | `is_active` | A boolean value that identifies if a member is active and not blocked | | `workspace` | A unique identifier of the user\'s current active workspace | | `workspace_name` | A name of the user\'s current active workspace | | `email_verified` | A boolean value that identifies if the email is verified | | `role` | A member\'s role in the workspace | | `user_license` | A user license in the organization: 
`Full (Standard)`; 
`Read-only`; 
`eSignature`; 
`Guest`; 
`Creator` | | `date_created` | A date when a member was added to the workspace | | `date_modified` | Last modified date of a member | + * Member Details + * @param id Membership id. + */ + public detailsMember(id: string, _options?: ConfigurationOptions): Observable { + return this.detailsMemberWithHttpInfo(id, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Retrieve all members details of the workspace implied by the OAuth token or API key.\\ For each member, the `workspace` parameter shows their active workspace, that is the workspace they are currently working in.\\ This means the `workspace` value can differ from the workspace implied by your API key. + * List Members */ - public sendDocument(id: string, documentSendRequest: DocumentSendRequest, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.sendDocument(id, documentSendRequest, _options); + public listMembersWithHttpInfo(_options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.listMembers(_config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.sendDocument(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listMembersWithHttpInfo(rsp))); })); } /** - * Document status - * @param id Specify document ID. + * Retrieve all members details of the workspace implied by the OAuth token or API key.\\ For each member, the `workspace` parameter shows their active workspace, that is the workspace they are currently working in.\\ This means the `workspace` value can differ from the workspace implied by your API key. + * List Members + */ + public listMembers(_options?: ConfigurationOptions): Observable { + return this.listMembersWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + +} + +import { NotaryApiRequestFactory, NotaryApiResponseProcessor} from "../apis/NotaryApi"; +export class ObservableNotaryApi { + private requestFactory: NotaryApiRequestFactory; + private responseProcessor: NotaryApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: NotaryApiRequestFactory, + responseProcessor?: NotaryApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = requestFactory || new NotaryApiRequestFactory(configuration); + this.responseProcessor = responseProcessor || new NotaryApiResponseProcessor(); + } + + /** + * Create a notarization request to connect with a notary and complete online notarizations for your signers within minutes. > 🚧 **Important:** This endpoint supports only documents in draft status. ## Prerequisites > 🚧 Before you start > > Ensure the following before creating a notarization request: > > - Install the Notary On-Demand or Notary add-on > - Create a document for notarization and get its `document_id`. To create a document, use the [Create Document from Template](https://developers.pandadoc.com/reference/create-document-from-pandadoc-template) or [Create Document from File Upload](https://developers.pandadoc.com/reference/create-document-from-pdf) endpoint. ## Request Details For the notarization request, include in the request body: - `document_id` - At least one `invitees`, specifying their `email`, `first_name`, and `last_name` - Optionally, include a `message` for your signers - Optionally, using `disable_invitees_notifications` you can disable all notifications for invitees including email with invitation for notarization. This is useful when you are using alternative delivery methods. - If in-house notary must be assigned to this request, include the `notary` object with the notary\'s `id`, `scheduled_at` timestamp, and an optional `message` for the notary After the API call is executed, your signers will receive an email invitation for notarization. Alternatively, you can directly share the `notarization_link` with your signers, which is available in the 201 response body. Upon successful notarization, you will receive an email with a link to the notarized document. ## Usage Tips > 📘 Best Practices > > - Ensure that signers are added as both invitees in the request body and recipients in the document to avoid inconveniences during notary sessions > - Signers will receive an email with a notary link upon a successful API call; this link is also in the 201 response > - In case if notary is not specified in the request, signers will use the link to connect with commissioned online notaries, available Mon-Fri, 9 AM - 9 PM Central Time, typically responding within 2 minutes > - If notary is specified, signers will use the link to connect with your in-house notary at the scheduled time ## Limits A maximum of 100 API calls per minute is permitted. Exceeding this limit triggers a 429 Too Many Requests error. ## Troubleshooting **Solutions for 4xx Response Codes:** - **403 Forbidden (Inactive Add-on)**: Ensure the Notary On-Demand or Notary add-on is installed - **403 Forbidden (Transactions Limit)**: Purchase additional transactions either through the Notary UI or by contacting the Sales team - **429 Too Many Requests**: If you hit the limit, hold your API calls, then send them after waiting for the retry time > 📘 To learn more about PandaDoc Notary On-Demand, visit our [website](https://notary.pandadoc.com/notary-on-demand/). + * Create Notarization Request + * @param createNotarizationRequest */ - public statusDocument(id: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.statusDocument(id, _options); + public createNotarizationRequestWithHttpInfo(createNotarizationRequest: CreateNotarizationRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.createNotarizationRequest(createNotarizationRequest, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.statusDocument(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createNotarizationRequestWithHttpInfo(rsp))); })); } /** - * Transfer all documents ownership - * @param documentTransferAllOwnershipRequest + * Create a notarization request to connect with a notary and complete online notarizations for your signers within minutes. > 🚧 **Important:** This endpoint supports only documents in draft status. ## Prerequisites > 🚧 Before you start > > Ensure the following before creating a notarization request: > > - Install the Notary On-Demand or Notary add-on > - Create a document for notarization and get its `document_id`. To create a document, use the [Create Document from Template](https://developers.pandadoc.com/reference/create-document-from-pandadoc-template) or [Create Document from File Upload](https://developers.pandadoc.com/reference/create-document-from-pdf) endpoint. ## Request Details For the notarization request, include in the request body: - `document_id` - At least one `invitees`, specifying their `email`, `first_name`, and `last_name` - Optionally, include a `message` for your signers - Optionally, using `disable_invitees_notifications` you can disable all notifications for invitees including email with invitation for notarization. This is useful when you are using alternative delivery methods. - If in-house notary must be assigned to this request, include the `notary` object with the notary\'s `id`, `scheduled_at` timestamp, and an optional `message` for the notary After the API call is executed, your signers will receive an email invitation for notarization. Alternatively, you can directly share the `notarization_link` with your signers, which is available in the 201 response body. Upon successful notarization, you will receive an email with a link to the notarized document. ## Usage Tips > 📘 Best Practices > > - Ensure that signers are added as both invitees in the request body and recipients in the document to avoid inconveniences during notary sessions > - Signers will receive an email with a notary link upon a successful API call; this link is also in the 201 response > - In case if notary is not specified in the request, signers will use the link to connect with commissioned online notaries, available Mon-Fri, 9 AM - 9 PM Central Time, typically responding within 2 minutes > - If notary is specified, signers will use the link to connect with your in-house notary at the scheduled time ## Limits A maximum of 100 API calls per minute is permitted. Exceeding this limit triggers a 429 Too Many Requests error. ## Troubleshooting **Solutions for 4xx Response Codes:** - **403 Forbidden (Inactive Add-on)**: Ensure the Notary On-Demand or Notary add-on is installed - **403 Forbidden (Transactions Limit)**: Purchase additional transactions either through the Notary UI or by contacting the Sales team - **429 Too Many Requests**: If you hit the limit, hold your API calls, then send them after waiting for the retry time > 📘 To learn more about PandaDoc Notary On-Demand, visit our [website](https://notary.pandadoc.com/notary-on-demand/). + * Create Notarization Request + * @param createNotarizationRequest + */ + public createNotarizationRequest(createNotarizationRequest: CreateNotarizationRequest, _options?: ConfigurationOptions): Observable { + return this.createNotarizationRequestWithHttpInfo(createNotarizationRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Use this method to delete a notarization request. Once notarization request is deleted it cannot be restored. > 🚧 Notarization Request status > > You can only delete a notarization request in status \'SENT\', \'WAITING_FOR_NOTARY\' or \'INCOMPLETE\'. > If the notarization request is in any other status, the request will return a 400 Bad Request error. By default all invitees will receive email notification about deletion of the notarization request. If you want to disable this notification, you can use the `disable_invitees_notifications` parameter when creating request (see [Create Notarization Request](https://developers.pandadoc.com/reference/create-notarization-request)). + * Delete Notarization Request + * @param sessionRequestId Notarization Request ID. */ - public transferAllDocumentsOwnership(documentTransferAllOwnershipRequest: DocumentTransferAllOwnershipRequest, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.transferAllDocumentsOwnership(documentTransferAllOwnershipRequest, _options); + public deleteNotarizationRequestWithHttpInfo(sessionRequestId: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.deleteNotarizationRequest(sessionRequestId, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.transferAllDocumentsOwnership(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteNotarizationRequestWithHttpInfo(rsp))); })); } /** - * Update document ownership - * @param id Specify document ID. - * @param documentTransferOwnershipRequest + * Use this method to delete a notarization request. Once notarization request is deleted it cannot be restored. > 🚧 Notarization Request status > > You can only delete a notarization request in status \'SENT\', \'WAITING_FOR_NOTARY\' or \'INCOMPLETE\'. > If the notarization request is in any other status, the request will return a 400 Bad Request error. By default all invitees will receive email notification about deletion of the notarization request. If you want to disable this notification, you can use the `disable_invitees_notifications` parameter when creating request (see [Create Notarization Request](https://developers.pandadoc.com/reference/create-notarization-request)). + * Delete Notarization Request + * @param sessionRequestId Notarization Request ID. + */ + public deleteNotarizationRequest(sessionRequestId: string, _options?: ConfigurationOptions): Observable { + return this.deleteNotarizationRequestWithHttpInfo(sessionRequestId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Retrieve a list of notaries associated with your organization. ## Important Notes - At the moment, notaries can be added to organization only manually through the PandaDoc Notary UI. - Organization must have Notary addon enabled to use this endpoint + * List Notaries + * @param [status] Filter by status (comma-separated values supported). Valid values are INVITED, UNDER_REVIEW, ACTIVE, REJECTED, INACTIVE + * @param [commissionState] Filter by commission state (comma-separated values supported) + * @param [offset] Number of results to skip + * @param [limit] Maximum number of results to return + * @param [orderBy] Sort by name, email, or status (default is email). Use a - prefix for descending order (e.g., -email) */ - public transferDocumentOwnership(id: string, documentTransferOwnershipRequest: DocumentTransferOwnershipRequest, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.transferDocumentOwnership(id, documentTransferOwnershipRequest, _options); + public listNotariesWithHttpInfo(status?: Array<'INVITED' | 'UNDER_REVIEW' | 'ACTIVE' | 'REJECTED' | 'INACTIVE'>, commissionState?: Array, offset?: number, limit?: number, orderBy?: 'email' | '-email' | 'status' | '-status' | 'name' | '-name', _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.listNotaries(status, commissionState, offset, limit, orderBy, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.transferDocumentOwnership(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listNotariesWithHttpInfo(rsp))); })); } /** - * Update Document only in the draft status - * @param id Document ID - * @param documentUpdateRequest + * Retrieve a list of notaries associated with your organization. ## Important Notes - At the moment, notaries can be added to organization only manually through the PandaDoc Notary UI. - Organization must have Notary addon enabled to use this endpoint + * List Notaries + * @param [status] Filter by status (comma-separated values supported). Valid values are INVITED, UNDER_REVIEW, ACTIVE, REJECTED, INACTIVE + * @param [commissionState] Filter by commission state (comma-separated values supported) + * @param [offset] Number of results to skip + * @param [limit] Maximum number of results to return + * @param [orderBy] Sort by name, email, or status (default is email). Use a - prefix for descending order (e.g., -email) + */ + public listNotaries(status?: Array<'INVITED' | 'UNDER_REVIEW' | 'ACTIVE' | 'REJECTED' | 'INACTIVE'>, commissionState?: Array, offset?: number, limit?: number, orderBy?: 'email' | '-email' | 'status' | '-status' | 'name' | '-name', _options?: ConfigurationOptions): Observable { + return this.listNotariesWithHttpInfo(status, commissionState, offset, limit, orderBy, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Get details about a notarization request by its `id`. Details include: - Basic notarization request information (status, creator, invitees). - Signed documents information with links for downloading. - Notarization session recording information with link for downloading. - Timestamps associated with a notarization request. ## Available Notarization Request Statuses The following is a complete list of all possible notarization request statuses returned: | Notarization Request Status | Status Description | | :-------------------------- | :----------------------------------------------------------------------------------------------------------------- | | SENT | Notarization request has been created. Invitees are notified and can start the process of finding a notary. | | WAITING_FOR_NOTARY | One of the invitees initialised the process of finding a notary. | | ACCEPTED | Notarization request has been accepted by the notary. At this time nobody has joined the notarization session yet. | | LIVE | Notarization session has started. | | COMPLETED | Notarization session is finished. Documents have been successfully signed and ready for downloading. | | INCOMPLETE | Notarization session has started but was not completed successfully. | ## Signed documents Signed documents are the documents that were successfully signed during the notarization session. The signed document\'s info is available only if the notarization request has `COMPLETED` status, otherwise the returned list will be empty. In case you uploaded several documents for notarization then the `signed_documents` list will contain links for downloading for each document separately (with `SINGLE` document type) and link for the combined document (with `COMBINED` document type accordingly). ## Recording Recording is the video of the notarization session. The recording info is available only if the notarization request has `COMPLETED` status and recording is available, otherwise the returned object will be empty. > 📘 Links expire in 1 hour > > **Note**: The signed document and recording links expire in 1 hour. After this time it will be not possible to download files using the returned urls. In this case you need to call endpoint again since each request generates a new link. ## Limits A maximum of 100 API calls per minute is permitted. Exceeding this limit triggers a 429 Too Many Requests error. + * Notarization Request Details + * @param sessionRequestId Notarization Request ID. + */ + public notarizationRequestDetailsWithHttpInfo(sessionRequestId: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.notarizationRequestDetails(sessionRequestId, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.notarizationRequestDetailsWithHttpInfo(rsp))); + })); + } + + /** + * Get details about a notarization request by its `id`. Details include: - Basic notarization request information (status, creator, invitees). - Signed documents information with links for downloading. - Notarization session recording information with link for downloading. - Timestamps associated with a notarization request. ## Available Notarization Request Statuses The following is a complete list of all possible notarization request statuses returned: | Notarization Request Status | Status Description | | :-------------------------- | :----------------------------------------------------------------------------------------------------------------- | | SENT | Notarization request has been created. Invitees are notified and can start the process of finding a notary. | | WAITING_FOR_NOTARY | One of the invitees initialised the process of finding a notary. | | ACCEPTED | Notarization request has been accepted by the notary. At this time nobody has joined the notarization session yet. | | LIVE | Notarization session has started. | | COMPLETED | Notarization session is finished. Documents have been successfully signed and ready for downloading. | | INCOMPLETE | Notarization session has started but was not completed successfully. | ## Signed documents Signed documents are the documents that were successfully signed during the notarization session. The signed document\'s info is available only if the notarization request has `COMPLETED` status, otherwise the returned list will be empty. In case you uploaded several documents for notarization then the `signed_documents` list will contain links for downloading for each document separately (with `SINGLE` document type) and link for the combined document (with `COMBINED` document type accordingly). ## Recording Recording is the video of the notarization session. The recording info is available only if the notarization request has `COMPLETED` status and recording is available, otherwise the returned object will be empty. > 📘 Links expire in 1 hour > > **Note**: The signed document and recording links expire in 1 hour. After this time it will be not possible to download files using the returned urls. In this case you need to call endpoint again since each request generates a new link. ## Limits A maximum of 100 API calls per minute is permitted. Exceeding this limit triggers a 429 Too Many Requests error. + * Notarization Request Details + * @param sessionRequestId Notarization Request ID. + */ + public notarizationRequestDetails(sessionRequestId: string, _options?: ConfigurationOptions): Observable { + return this.notarizationRequestDetailsWithHttpInfo(sessionRequestId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + +} + +import { OAuth20AuthenticationApiRequestFactory, OAuth20AuthenticationApiResponseProcessor} from "../apis/OAuth20AuthenticationApi"; +export class ObservableOAuth20AuthenticationApi { + private requestFactory: OAuth20AuthenticationApiRequestFactory; + private responseProcessor: OAuth20AuthenticationApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: OAuth20AuthenticationApiRequestFactory, + responseProcessor?: OAuth20AuthenticationApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = requestFactory || new OAuth20AuthenticationApiRequestFactory(configuration); + this.responseProcessor = responseProcessor || new OAuth20AuthenticationApiResponseProcessor(); + } + + /** + * Create or refresh an access token to make requests on behalf of a user. This endpoint is used to obtain an `access_token` and `refresh_token` for the first time, and to refresh the `access_token` when it expires. This endpoint is part of OAuth 2.0 implementation. You need to configure OAuth App to obtain `client_id` and `client_secret`. Read more about [OAuth 2.0 implementation](https://developers.pandadoc.com/reference/authentication-process). Make sure you\'re sending the header `Content-Type: application/x-www-form-urlencoded`. ## Create Access Token As a result of the OAuth 2.0 user authentication process, you should get a `code` that can be exchanged for an `access_token`. Use this endpoint to do this exchange, and to refresh the token later. > 🚧 Invalid Grant? > > If you receive an `invalid grant` response it is likely because you used the same `code` more than once from the [Authorize a PandaDoc User](ref:authorize-a-user) step above. The `code` parameter is generated for one-time use. A new `code` value must be generated if you wish to change API users, permissions, or simply generate a new `code` value for the same PandaDoc user. > 📘 expires_in > > `expires_in` is based in seconds. Currently, a token expires in 31535999 seconds = 1 year. ## Refresh Access Token Eventually, `access_token` expires and accessing an API method returns **401 unauthorized**. Your application needs to refresh the OAuth2 token with the stored `refresh_token` returned when initially creating an access token. Once refreshed, calls on behalf of the originally authorized user can resume immediately. Use the newly returned `access_token` for all future API requests. > 🚧 Invalid Grant? > > If you receive an `invalid grant` response, it is likely because your `refresh_token` is invalid. + * Create/Refresh Access Token + * @param [grantType] This value must be set to `refresh_token`. + * @param [clientId] Client ID that is automatically generated after application creation in the Developer Dashboard. + * @param [clientSecret] Client secret that is automatically generated after application creation in the Developer Dashboard. + * @param [code] `auth_code` from the server on the previous step (Authorize a PandaDoc User). + * @param [scope] Requested permissions. Use `read+write` as our default value to send documents. + * @param [refreshToken] `refresh_token` you received and stored from the server when initially creating an `access_token`. */ - public updateDocument(id: string, documentUpdateRequest: DocumentUpdateRequest, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.updateDocument(id, documentUpdateRequest, _options); + public accessTokenWithHttpInfo(grantType?: string, clientId?: string, clientSecret?: string, code?: string, scope?: string, refreshToken?: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.accessToken(grantType, clientId, clientSecret, code, scope, refreshToken, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updateDocument(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.accessTokenWithHttpInfo(rsp))); })); } + /** + * Create or refresh an access token to make requests on behalf of a user. This endpoint is used to obtain an `access_token` and `refresh_token` for the first time, and to refresh the `access_token` when it expires. This endpoint is part of OAuth 2.0 implementation. You need to configure OAuth App to obtain `client_id` and `client_secret`. Read more about [OAuth 2.0 implementation](https://developers.pandadoc.com/reference/authentication-process). Make sure you\'re sending the header `Content-Type: application/x-www-form-urlencoded`. ## Create Access Token As a result of the OAuth 2.0 user authentication process, you should get a `code` that can be exchanged for an `access_token`. Use this endpoint to do this exchange, and to refresh the token later. > 🚧 Invalid Grant? > > If you receive an `invalid grant` response it is likely because you used the same `code` more than once from the [Authorize a PandaDoc User](ref:authorize-a-user) step above. The `code` parameter is generated for one-time use. A new `code` value must be generated if you wish to change API users, permissions, or simply generate a new `code` value for the same PandaDoc user. > 📘 expires_in > > `expires_in` is based in seconds. Currently, a token expires in 31535999 seconds = 1 year. ## Refresh Access Token Eventually, `access_token` expires and accessing an API method returns **401 unauthorized**. Your application needs to refresh the OAuth2 token with the stored `refresh_token` returned when initially creating an access token. Once refreshed, calls on behalf of the originally authorized user can resume immediately. Use the newly returned `access_token` for all future API requests. > 🚧 Invalid Grant? > > If you receive an `invalid grant` response, it is likely because your `refresh_token` is invalid. + * Create/Refresh Access Token + * @param [grantType] This value must be set to `refresh_token`. + * @param [clientId] Client ID that is automatically generated after application creation in the Developer Dashboard. + * @param [clientSecret] Client secret that is automatically generated after application creation in the Developer Dashboard. + * @param [code] `auth_code` from the server on the previous step (Authorize a PandaDoc User). + * @param [scope] Requested permissions. Use `read+write` as our default value to send documents. + * @param [refreshToken] `refresh_token` you received and stored from the server when initially creating an `access_token`. + */ + public accessToken(grantType?: string, clientId?: string, clientSecret?: string, code?: string, scope?: string, refreshToken?: string, _options?: ConfigurationOptions): Observable { + return this.accessTokenWithHttpInfo(grantType, clientId, clientSecret, code, scope, refreshToken, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + } -import { FoldersAPIApiRequestFactory, FoldersAPIApiResponseProcessor} from "../apis/FoldersAPIApi"; -export class ObservableFoldersAPIApi { - private requestFactory: FoldersAPIApiRequestFactory; - private responseProcessor: FoldersAPIApiResponseProcessor; +import { ProductCatalogApiRequestFactory, ProductCatalogApiResponseProcessor} from "../apis/ProductCatalogApi"; +export class ObservableProductCatalogApi { + private requestFactory: ProductCatalogApiRequestFactory; + private responseProcessor: ProductCatalogApiResponseProcessor; private configuration: Configuration; public constructor( configuration: Configuration, - requestFactory?: FoldersAPIApiRequestFactory, - responseProcessor?: FoldersAPIApiResponseProcessor + requestFactory?: ProductCatalogApiRequestFactory, + responseProcessor?: ProductCatalogApiResponseProcessor ) { this.configuration = configuration; - this.requestFactory = requestFactory || new FoldersAPIApiRequestFactory(configuration); - this.responseProcessor = responseProcessor || new FoldersAPIApiResponseProcessor(); + this.requestFactory = requestFactory || new ProductCatalogApiRequestFactory(configuration); + this.responseProcessor = responseProcessor || new ProductCatalogApiResponseProcessor(); } /** - * Create a new folder to store your documents. - * Create Documents Folder - * @param documentsFolderCreateRequest + * Create a new catalog item. + * Create Catalog Item + * @param productCatalogItemRequest */ - public createDocumentFolder(documentsFolderCreateRequest: DocumentsFolderCreateRequest, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.createDocumentFolder(documentsFolderCreateRequest, _options); + public createCatalogItemWithHttpInfo(productCatalogItemRequest: ProductCatalogItemRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.createCatalogItem(productCatalogItemRequest, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createDocumentFolder(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createCatalogItemWithHttpInfo(rsp))); })); } /** - * Create a new folder to store your templates. - * Create Templates Folder - * @param templatesFolderCreateRequest + * Create a new catalog item. + * Create Catalog Item + * @param productCatalogItemRequest + */ + public createCatalogItem(productCatalogItemRequest: ProductCatalogItemRequest, _options?: ConfigurationOptions): Observable { + return this.createCatalogItemWithHttpInfo(productCatalogItemRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Delete catalog item. + * Delete Catalog Item + * @param itemUuid Catalog item UUID */ - public createTemplateFolder(templatesFolderCreateRequest: TemplatesFolderCreateRequest, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.createTemplateFolder(templatesFolderCreateRequest, _options); + public deleteCatalogItemWithHttpInfo(itemUuid: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.deleteCatalogItem(itemUuid, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createTemplateFolder(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteCatalogItemWithHttpInfo(rsp))); })); } /** - * Get the list of folders that contain Documents in your account. - * List Documents Folders - * @param parentUuid The UUID of the folder containing folders. To list the folders located in the root folder, remove this parameter in the request. - * @param count Optionally, specify how many folders to return. Default is 50 folders, maximum is 100 folders. - * @param page Optionally, specify which page of the dataset to return. + * Delete catalog item. + * Delete Catalog Item + * @param itemUuid Catalog item UUID */ - public listDocumentFolders(parentUuid?: string, count?: number, page?: number, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.listDocumentFolders(parentUuid, count, page, _options); + public deleteCatalogItem(itemUuid: string, _options?: ConfigurationOptions): Observable { + return this.deleteCatalogItemWithHttpInfo(itemUuid, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Get catalog item. + * Catalog Item Details + * @param itemUuid Catalog item UUID + */ + public getCatalogItemWithHttpInfo(itemUuid: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.getCatalogItem(itemUuid, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listDocumentFolders(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getCatalogItemWithHttpInfo(rsp))); })); } /** - * Get the list of folders that contain Templates in your account. - * List Templates Folders - * @param parentUuid The UUID of the folder containing folders. To list the folders located in the root folder, remove this parameter in the request. - * @param count Optionally, specify how many folders to return. Default is 50 folders, maximum is 100 folders. - * @param page Optionally, specify which page of the dataset to return. + * Get catalog item. + * Catalog Item Details + * @param itemUuid Catalog item UUID + */ + public getCatalogItem(itemUuid: string, _options?: ConfigurationOptions): Observable { + return this.getCatalogItemWithHttpInfo(itemUuid, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * This method searches for items in your [product catalog](https://support.pandadoc.com/en/articles/9714691-product-catalog). Use the `query` parameter to search in title, SKU, description, category name, custom fields name and value. You can also search for items by their type, billing type, and category id. Order search results, in both ascending and descending order, by these item properties: - SKU - Name - Price - Modification date Use the `exclude_uuids` parameter to exclude particular uuids from the search request. + * List Catalog Items Search + * @param [page] Page number. + * @param [perPage] Items per page. + * @param [query] Search query. Searches the following fields: Title, SKU, description, category name, custom fields name and value. + * @param [orderBy] Ordering principle for displaying search results. + * @param [types] Filter by catalog item types. + * @param [billingTypes] Filter by billing types. + * @param [excludeUuids] A list of item uuids to be excluded from search. + * @param [categoryId] Category id. + * @param [noCategory] */ - public listTemplateFolders(parentUuid?: string, count?: number, page?: number, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.listTemplateFolders(parentUuid, count, page, _options); + public searchCatalogItemsWithHttpInfo(page?: number, perPage?: number, query?: string, orderBy?: 'sku' | '-sku' | 'title' | '-title' | 'price' | '-price' | 'date_modified' | '-date_modified', types?: Array, billingTypes?: Array<'one_time' | 'recurring'>, excludeUuids?: Array, categoryId?: string, noCategory?: boolean, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.searchCatalogItems(page, perPage, query, orderBy, types, billingTypes, excludeUuids, categoryId, noCategory, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listTemplateFolders(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.searchCatalogItemsWithHttpInfo(rsp))); })); } /** - * Rename Documents Folder. - * Rename Documents Folder - * @param id The UUID of the folder that you are renaming. - * @param documentsFolderRenameRequest + * This method searches for items in your [product catalog](https://support.pandadoc.com/en/articles/9714691-product-catalog). Use the `query` parameter to search in title, SKU, description, category name, custom fields name and value. You can also search for items by their type, billing type, and category id. Order search results, in both ascending and descending order, by these item properties: - SKU - Name - Price - Modification date Use the `exclude_uuids` parameter to exclude particular uuids from the search request. + * List Catalog Items Search + * @param [page] Page number. + * @param [perPage] Items per page. + * @param [query] Search query. Searches the following fields: Title, SKU, description, category name, custom fields name and value. + * @param [orderBy] Ordering principle for displaying search results. + * @param [types] Filter by catalog item types. + * @param [billingTypes] Filter by billing types. + * @param [excludeUuids] A list of item uuids to be excluded from search. + * @param [categoryId] Category id. + * @param [noCategory] + */ + public searchCatalogItems(page?: number, perPage?: number, query?: string, orderBy?: 'sku' | '-sku' | 'title' | '-title' | 'price' | '-price' | 'date_modified' | '-date_modified', types?: Array, billingTypes?: Array<'one_time' | 'recurring'>, excludeUuids?: Array, categoryId?: string, noCategory?: boolean, _options?: ConfigurationOptions): Observable { + return this.searchCatalogItemsWithHttpInfo(page, perPage, query, orderBy, types, billingTypes, excludeUuids, categoryId, noCategory, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Update catalog item. + * Update Catalog Item + * @param itemUuid Catalog item UUID + * @param productCatalogItemPatchRequest + */ + public updateCatalogItemWithHttpInfo(itemUuid: string, productCatalogItemPatchRequest: ProductCatalogItemPatchRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.updateCatalogItem(itemUuid, productCatalogItemPatchRequest, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updateCatalogItemWithHttpInfo(rsp))); + })); + } + + /** + * Update catalog item. + * Update Catalog Item + * @param itemUuid Catalog item UUID + * @param productCatalogItemPatchRequest + */ + public updateCatalogItem(itemUuid: string, productCatalogItemPatchRequest: ProductCatalogItemPatchRequest, _options?: ConfigurationOptions): Observable { + return this.updateCatalogItemWithHttpInfo(itemUuid, productCatalogItemPatchRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + +} + +import { QuotesApiRequestFactory, QuotesApiResponseProcessor} from "../apis/QuotesApi"; +export class ObservableQuotesApi { + private requestFactory: QuotesApiRequestFactory; + private responseProcessor: QuotesApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: QuotesApiRequestFactory, + responseProcessor?: QuotesApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = requestFactory || new QuotesApiRequestFactory(configuration); + this.responseProcessor = responseProcessor || new QuotesApiResponseProcessor(); + } + + /** + * This operation updates the details of a specific quote within a document by specifying the document ID and quote ID. + * Quote update + * @param documentId Document ID + * @param quoteId Quote ID + * @param quoteUpdateRequest + */ + public quoteUpdateWithHttpInfo(documentId: string, quoteId: string, quoteUpdateRequest: QuoteUpdateRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + + const requestContextPromise = this.requestFactory.quoteUpdate(documentId, quoteId, quoteUpdateRequest, _config); + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of _config.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of _config.middleware.reverse()) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.quoteUpdateWithHttpInfo(rsp))); + })); + } + + /** + * This operation updates the details of a specific quote within a document by specifying the document ID and quote ID. + * Quote update + * @param documentId Document ID + * @param quoteId Quote ID + * @param quoteUpdateRequest + */ + public quoteUpdate(documentId: string, quoteId: string, quoteUpdateRequest: QuoteUpdateRequest, _options?: ConfigurationOptions): Observable { + return this.quoteUpdateWithHttpInfo(documentId, quoteId, quoteUpdateRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + +} + +import { TemplateSettingsApiRequestFactory, TemplateSettingsApiResponseProcessor} from "../apis/TemplateSettingsApi"; +export class ObservableTemplateSettingsApi { + private requestFactory: TemplateSettingsApiRequestFactory; + private responseProcessor: TemplateSettingsApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: TemplateSettingsApiRequestFactory, + responseProcessor?: TemplateSettingsApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = requestFactory || new TemplateSettingsApiRequestFactory(configuration); + this.responseProcessor = responseProcessor || new TemplateSettingsApiResponseProcessor(); + } + + /** + * Retrieves the settings for a specified template. Only the language field is currently supported. + * Get template settings + * @param templateId Unique identifier of the template to retrieve settings for. */ - public renameDocumentFolder(id: string, documentsFolderRenameRequest: DocumentsFolderRenameRequest, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.renameDocumentFolder(id, documentsFolderRenameRequest, _options); + public templateSettingsGetWithHttpInfo(templateId: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.templateSettingsGet(templateId, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.renameDocumentFolder(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.templateSettingsGetWithHttpInfo(rsp))); })); } /** - * Rename a templates folder. - * Rename Templates Folder - * @param id The UUID of the folder which you are renaming. - * @param templatesFolderRenameRequest + * Retrieves the settings for a specified template. Only the language field is currently supported. + * Get template settings + * @param templateId Unique identifier of the template to retrieve settings for. + */ + public templateSettingsGet(templateId: string, _options?: ConfigurationOptions): Observable { + return this.templateSettingsGetWithHttpInfo(templateId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Updates the settings for a specified template. Only the language field is currently supported. + * Update template settings + * @param templateId Unique identifier of the template to update settings for. + * @param updateTemplateSettingsRequest */ - public renameTemplateFolder(id: string, templatesFolderRenameRequest: TemplatesFolderRenameRequest, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.renameTemplateFolder(id, templatesFolderRenameRequest, _options); + public templateSettingsUpdateWithHttpInfo(templateId: string, updateTemplateSettingsRequest: UpdateTemplateSettingsRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.templateSettingsUpdate(templateId, updateTemplateSettingsRequest, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.renameTemplateFolder(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.templateSettingsUpdateWithHttpInfo(rsp))); })); } + /** + * Updates the settings for a specified template. Only the language field is currently supported. + * Update template settings + * @param templateId Unique identifier of the template to update settings for. + * @param updateTemplateSettingsRequest + */ + public templateSettingsUpdate(templateId: string, updateTemplateSettingsRequest: UpdateTemplateSettingsRequest, _options?: ConfigurationOptions): Observable { + return this.templateSettingsUpdateWithHttpInfo(templateId, updateTemplateSettingsRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + } -import { FormsApiRequestFactory, FormsApiResponseProcessor} from "../apis/FormsApi"; -export class ObservableFormsApi { - private requestFactory: FormsApiRequestFactory; - private responseProcessor: FormsApiResponseProcessor; +import { TemplatesApiRequestFactory, TemplatesApiResponseProcessor} from "../apis/TemplatesApi"; +export class ObservableTemplatesApi { + private requestFactory: TemplatesApiRequestFactory; + private responseProcessor: TemplatesApiResponseProcessor; private configuration: Configuration; public constructor( configuration: Configuration, - requestFactory?: FormsApiRequestFactory, - responseProcessor?: FormsApiResponseProcessor + requestFactory?: TemplatesApiRequestFactory, + responseProcessor?: TemplatesApiResponseProcessor ) { this.configuration = configuration; - this.requestFactory = requestFactory || new FormsApiRequestFactory(configuration); - this.responseProcessor = responseProcessor || new FormsApiResponseProcessor(); + this.requestFactory = requestFactory || new TemplatesApiRequestFactory(configuration); + this.responseProcessor = responseProcessor || new TemplatesApiResponseProcessor(); } /** - * List forms. - * Forms - * @param count Optionally, specify how many forms to return. Default is 50 forms, maximum is 100 forms. - * @param page Optionally, specify which page of the dataset to return. - * @param status Optionally, specify which status of the forms dataset to return. - * @param orderBy Optionally, specify the form dataset order to return. - * @param asc Optionally, specify sorting the result-set in ascending or descending order. - * @param name Specify the form name. + * This operation allows you to create a new template by providing the necessary template details. + * Create Template + * @param createTemplateFromUrlRequest + * @param [fields] A comma-separated list of additional fields to include in the response. */ - public listForm(count?: number, page?: number, status?: Array<'draft' | 'active' | 'disabled'>, orderBy?: 'name' | 'responses' | 'status' | 'created_date' | 'modified_date', asc?: boolean, name?: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.listForm(count, page, status, orderBy, asc, name, _options); + public createTemplateWithHttpInfo(createTemplateFromUrlRequest: CreateTemplateFromUrlRequest, fields?: Array<'content_date_modified'>, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.createTemplate(createTemplateFromUrlRequest, fields, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listForm(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createTemplateWithHttpInfo(rsp))); })); } -} - -import { MembersApiRequestFactory, MembersApiResponseProcessor} from "../apis/MembersApi"; -export class ObservableMembersApi { - private requestFactory: MembersApiRequestFactory; - private responseProcessor: MembersApiResponseProcessor; - private configuration: Configuration; - - public constructor( - configuration: Configuration, - requestFactory?: MembersApiRequestFactory, - responseProcessor?: MembersApiResponseProcessor - ) { - this.configuration = configuration; - this.requestFactory = requestFactory || new MembersApiRequestFactory(configuration); - this.responseProcessor = responseProcessor || new MembersApiResponseProcessor(); + /** + * This operation allows you to create a new template by providing the necessary template details. + * Create Template + * @param createTemplateFromUrlRequest + * @param [fields] A comma-separated list of additional fields to include in the response. + */ + public createTemplate(createTemplateFromUrlRequest: CreateTemplateFromUrlRequest, fields?: Array<'content_date_modified'>, _options?: ConfigurationOptions): Observable { + return this.createTemplateWithHttpInfo(createTemplateFromUrlRequest, fields, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** - * A method to define to whom credentials belong - * Current member details + * Creates a new editing session for the Embedded Editor. The response includes an E-Token, which is required to open the template. #### Limitations - **Single Active Session per User-Template Pair** Only one editing session can be active at a time for a specific user and template. Creating a new session for the same user-template pair will automatically invalidate the previous one. - **Weekly Session Cap** A maximum of **250** editing sessions can be created for a single template per week. Any attempt to exceed this limit will result in a `403 Forbidden` error. + * Create Template Editing Session + * @param id Template ID + * @param editingSessionRequest */ - public detailsCurrentMember(_options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.detailsCurrentMember(_options); + public createTemplateEditingSessionWithHttpInfo(id: string, editingSessionRequest: EditingSessionRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.createTemplateEditingSession(id, editingSessionRequest, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.detailsCurrentMember(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createTemplateEditingSessionWithHttpInfo(rsp))); })); } /** - * A method to retrieve a member's details by id - * Member details - * @param id Membership id + * Creates a new editing session for the Embedded Editor. The response includes an E-Token, which is required to open the template. #### Limitations - **Single Active Session per User-Template Pair** Only one editing session can be active at a time for a specific user and template. Creating a new session for the same user-template pair will automatically invalidate the previous one. - **Weekly Session Cap** A maximum of **250** editing sessions can be created for a single template per week. Any attempt to exceed this limit will result in a `403 Forbidden` error. + * Create Template Editing Session + * @param id Template ID + * @param editingSessionRequest + */ + public createTemplateEditingSession(id: string, editingSessionRequest: EditingSessionRequest, _options?: ConfigurationOptions): Observable { + return this.createTemplateEditingSessionWithHttpInfo(id, editingSessionRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * This asynchronous endpoint allows users to create a new template by uploading a file. The uploaded file is processed in the background to generate the template. The maximum allowable file size for upload is 100 MB. Field tags and form fields are not supported yet. Once the file is uploaded, the processing will happen asynchronously, and users need to check [the status of the template](https://developers.pandadoc.com/reference/template-status) creation. + * Create Template from File Upload + * @param [fields] A comma-separated list of additional fields to include in the response. + * @param [file] Binary PDF/DocX/RTF File. + * @param [data] JSON as a multipart/form-data string. */ - public detailsMember(id: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.detailsMember(id, _options); + public createTemplateWithUploadWithHttpInfo(fields?: Array<'content_date_modified'>, file?: HttpFile, data?: CreateTemplateRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.createTemplateWithUpload(fields, file, data, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.detailsMember(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createTemplateWithUploadWithHttpInfo(rsp))); })); } /** - * Retrieve all members details of the workspace - * List members + * This asynchronous endpoint allows users to create a new template by uploading a file. The uploaded file is processed in the background to generate the template. The maximum allowable file size for upload is 100 MB. Field tags and form fields are not supported yet. Once the file is uploaded, the processing will happen asynchronously, and users need to check [the status of the template](https://developers.pandadoc.com/reference/template-status) creation. + * Create Template from File Upload + * @param [fields] A comma-separated list of additional fields to include in the response. + * @param [file] Binary PDF/DocX/RTF File. + * @param [data] JSON as a multipart/form-data string. + */ + public createTemplateWithUpload(fields?: Array<'content_date_modified'>, file?: HttpFile, data?: CreateTemplateRequest, _options?: ConfigurationOptions): Observable { + return this.createTemplateWithUploadWithHttpInfo(fields, file, data, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Delete a template + * Delete Template + * @param id Template ID */ - public listMembers(_options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.listMembers(_options); + public deleteTemplateWithHttpInfo(id: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.deleteTemplate(id, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listMembers(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteTemplateWithHttpInfo(rsp))); })); } -} - -import { OAuth20AuthenticationApiRequestFactory, OAuth20AuthenticationApiResponseProcessor} from "../apis/OAuth20AuthenticationApi"; -export class ObservableOAuth20AuthenticationApi { - private requestFactory: OAuth20AuthenticationApiRequestFactory; - private responseProcessor: OAuth20AuthenticationApiResponseProcessor; - private configuration: Configuration; - - public constructor( - configuration: Configuration, - requestFactory?: OAuth20AuthenticationApiRequestFactory, - responseProcessor?: OAuth20AuthenticationApiResponseProcessor - ) { - this.configuration = configuration; - this.requestFactory = requestFactory || new OAuth20AuthenticationApiRequestFactory(configuration); - this.responseProcessor = responseProcessor || new OAuth20AuthenticationApiResponseProcessor(); + /** + * Delete a template + * Delete Template + * @param id Template ID + */ + public deleteTemplate(id: string, _options?: ConfigurationOptions): Observable { + return this.deleteTemplateWithHttpInfo(id, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** - * Create/Refresh Access Token - * @param grantType This value must be set to `refresh_token`. - * @param clientId Client ID that is automatically generated after application creation in the Developer Dashboard. - * @param clientSecret Client secret that is automatically generated after application creation in the Developer Dashboard. - * @param code `auth_code` from the server on the previous step (Authorize a PandaDoc User). - * @param scope Requested permissions. Use `read+write` as our default value to send documents. - * @param refreshToken `refresh_token` you received and stored from the server when initially creating an `access_token`. + * Get details about a template by `id`. Details include: - Basic template information (name, author, etc) - Roles - All fields with values - All tokens with values - Pricing information (pricing tables, products, quotes) - Template metadata - Template tags - Content placeholders - Modification timestamps. Note that `date_modified` means any changes associated with the template roles, while `content_date_modified` logs any changes in the template content. + * Template Details + * @param id Template ID */ - public accessToken(grantType?: string, clientId?: string, clientSecret?: string, code?: string, scope?: string, refreshToken?: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.accessToken(grantType, clientId, clientSecret, code, scope, refreshToken, _options); + public detailsTemplateWithHttpInfo(id: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.detailsTemplate(id, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.accessToken(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.detailsTemplateWithHttpInfo(rsp))); })); } -} - -import { QuotesApiRequestFactory, QuotesApiResponseProcessor} from "../apis/QuotesApi"; -export class ObservableQuotesApi { - private requestFactory: QuotesApiRequestFactory; - private responseProcessor: QuotesApiResponseProcessor; - private configuration: Configuration; - - public constructor( - configuration: Configuration, - requestFactory?: QuotesApiRequestFactory, - responseProcessor?: QuotesApiResponseProcessor - ) { - this.configuration = configuration; - this.requestFactory = requestFactory || new QuotesApiRequestFactory(configuration); - this.responseProcessor = responseProcessor || new QuotesApiResponseProcessor(); + /** + * Get details about a template by `id`. Details include: - Basic template information (name, author, etc) - Roles - All fields with values - All tokens with values - Pricing information (pricing tables, products, quotes) - Template metadata - Template tags - Content placeholders - Modification timestamps. Note that `date_modified` means any changes associated with the template roles, while `content_date_modified` logs any changes in the template content. + * Template Details + * @param id Template ID + */ + public detailsTemplate(id: string, _options?: ConfigurationOptions): Observable { + return this.detailsTemplateWithHttpInfo(id, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** - * Quote update - * @param documentId Document ID - * @param quoteId Quote ID - * @param quoteUpdateRequest + * Retrieves a list of templates. You can filter results by a search query, tags, or fields. + * List Templates + * @param [q] Search query. Filter by template name. + * @param [shared] Returns only the shared templates. + * @param [deleted] Returns only the deleted templates. + * @param [count] Specify how many templates to return. + * @param [page] Specify which page of the dataset to return. + * @param [id] Specify template ID. + * @param [folderUuid] UUID of the folder where the templates are stored. + * @param [tag] Search tag. Filter by template tag. + * @param [fields] A comma-separated list of additional fields to include in the response. */ - public quoteUpdate(documentId: string, quoteId: string, quoteUpdateRequest: QuoteUpdateRequest, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.quoteUpdate(documentId, quoteId, quoteUpdateRequest, _options); + public listTemplatesWithHttpInfo(q?: string, shared?: boolean, deleted?: boolean, count?: number, page?: number, id?: string, folderUuid?: string, tag?: Array, fields?: Array<'content_date_modified'>, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.listTemplates(q, shared, deleted, count, page, id, folderUuid, tag, fields, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.quoteUpdate(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listTemplatesWithHttpInfo(rsp))); })); } -} - -import { SectionsApiRequestFactory, SectionsApiResponseProcessor} from "../apis/SectionsApi"; -export class ObservableSectionsApi { - private requestFactory: SectionsApiRequestFactory; - private responseProcessor: SectionsApiResponseProcessor; - private configuration: Configuration; - - public constructor( - configuration: Configuration, - requestFactory?: SectionsApiRequestFactory, - responseProcessor?: SectionsApiResponseProcessor - ) { - this.configuration = configuration; - this.requestFactory = requestFactory || new SectionsApiRequestFactory(configuration); - this.responseProcessor = responseProcessor || new SectionsApiResponseProcessor(); + /** + * Retrieves a list of templates. You can filter results by a search query, tags, or fields. + * List Templates + * @param [q] Search query. Filter by template name. + * @param [shared] Returns only the shared templates. + * @param [deleted] Returns only the deleted templates. + * @param [count] Specify how many templates to return. + * @param [page] Specify which page of the dataset to return. + * @param [id] Specify template ID. + * @param [folderUuid] UUID of the folder where the templates are stored. + * @param [tag] Search tag. Filter by template tag. + * @param [fields] A comma-separated list of additional fields to include in the response. + */ + public listTemplates(q?: string, shared?: boolean, deleted?: boolean, count?: number, page?: number, id?: string, folderUuid?: string, tag?: Array, fields?: Array<'content_date_modified'>, _options?: ConfigurationOptions): Observable { + return this.listTemplatesWithHttpInfo(q, shared, deleted, count, page, id, folderUuid, tag, fields, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** - * List sections - * @param documentId Document ID + * ## Available Template Statuses The following is a complete list of all possible template statuses returned: | Template Status | Status Description | | :------------------- | :-------------------------------------------------------------------------------------------------------------------------------------- | | `template.UPLOADED` | The template upload process has been initiated and is currently in progress. It will soon transition to the `template.PROCESSED` state. | | `template.PROCESSED` | The template has been successfully uploaded and created. At this stage, all aspects of the template are editable. | | `template.ERROR` | The template upload process has failed. Please refer to the error details in the response for more information. | + * Template Status + * @param id Template ID */ - public listSections(documentId: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.listSections(documentId, _options); + public statusTemplateWithHttpInfo(id: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.statusTemplate(id, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listSections(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.statusTemplateWithHttpInfo(rsp))); })); } /** - * Section details - * @param documentId Document ID - * @param uploadId Upload ID + * ## Available Template Statuses The following is a complete list of all possible template statuses returned: | Template Status | Status Description | | :------------------- | :-------------------------------------------------------------------------------------------------------------------------------------- | | `template.UPLOADED` | The template upload process has been initiated and is currently in progress. It will soon transition to the `template.PROCESSED` state. | | `template.PROCESSED` | The template has been successfully uploaded and created. At this stage, all aspects of the template are editable. | | `template.ERROR` | The template upload process has failed. Please refer to the error details in the response for more information. | + * Template Status + * @param id Template ID + */ + public statusTemplate(id: string, _options?: ConfigurationOptions): Observable { + return this.statusTemplateWithHttpInfo(id, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * > 🚧 Template status > > You can only update a template in the PROCESSED status (`template.PROCESSED`). > > After creating a new template, it usually retains a `template.uploaded` status for 3-5 seconds while the template syncs across PandaDoc servers. When the template is available for further API calls, the template moves to the `template.PROCESSED` state. Use [Template Status](https://developers.pandadoc.com/reference/template-status) or Webhooks to check template status. + * Template Update + * @param id Template ID + * @param templateUpdateRequest */ - public sectionDetails(documentId: string, uploadId: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.sectionDetails(documentId, uploadId, _options); + public updateTemplateWithHttpInfo(id: string, templateUpdateRequest: TemplateUpdateRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.updateTemplate(id, templateUpdateRequest, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.sectionDetails(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updateTemplateWithHttpInfo(rsp))); })); } /** - * Section Info - * @param documentId Document ID - * @param sectionId Section ID + * > 🚧 Template status > > You can only update a template in the PROCESSED status (`template.PROCESSED`). > > After creating a new template, it usually retains a `template.uploaded` status for 3-5 seconds while the template syncs across PandaDoc servers. When the template is available for further API calls, the template moves to the `template.PROCESSED` state. Use [Template Status](https://developers.pandadoc.com/reference/template-status) or Webhooks to check template status. + * Template Update + * @param id Template ID + * @param templateUpdateRequest + */ + public updateTemplate(id: string, templateUpdateRequest: TemplateUpdateRequest, _options?: ConfigurationOptions): Observable { + return this.updateTemplateWithHttpInfo(id, templateUpdateRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + +} + +import { UserAndWorkspaceManagementApiRequestFactory, UserAndWorkspaceManagementApiResponseProcessor} from "../apis/UserAndWorkspaceManagementApi"; +export class ObservableUserAndWorkspaceManagementApi { + private requestFactory: UserAndWorkspaceManagementApiRequestFactory; + private responseProcessor: UserAndWorkspaceManagementApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: UserAndWorkspaceManagementApiRequestFactory, + responseProcessor?: UserAndWorkspaceManagementApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = requestFactory || new UserAndWorkspaceManagementApiRequestFactory(configuration); + this.responseProcessor = responseProcessor || new UserAndWorkspaceManagementApiResponseProcessor(); + } + + /** + * Add an existing user to a workspace. - You must be an organization admin or a workspace admin to add members. + * Add Member to Workspace + * @param workspaceId + * @param addMemberRequest + * @param [notifyUser] Send a confirmation email to the user that was added to workspace(s). + * @param [notifyWsAdmins] Send a confirmation email to all workspace admins indicating that the user has been added to the workspace. */ - public sectionInfo(documentId: string, sectionId: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.sectionInfo(documentId, sectionId, _options); + public addMemberWithHttpInfo(workspaceId: string, addMemberRequest: AddMemberRequest, notifyUser?: boolean, notifyWsAdmins?: boolean, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.addMember(workspaceId, addMemberRequest, notifyUser, notifyWsAdmins, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.sectionInfo(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.addMemberWithHttpInfo(rsp))); })); } /** - * Upload section - * @param documentId Document ID - * @param uploadSectionRequest Use a PandaDoc template or an existing PDF to upload a section. See the creation request examples [by template](/schemas/UploadSectionByTemplateRequest) and [by pdf](/schemas/UploadSectionByPdfRequest) - * @param mergeFieldScope Determines how the fields are mapped when creating a section. * document: Default value. The fields of the entire document are updated. * upload: Only the fields from the created section are updated. The merge field is appended with the upload ID. + * Add an existing user to a workspace. - You must be an organization admin or a workspace admin to add members. + * Add Member to Workspace + * @param workspaceId + * @param addMemberRequest + * @param [notifyUser] Send a confirmation email to the user that was added to workspace(s). + * @param [notifyWsAdmins] Send a confirmation email to all workspace admins indicating that the user has been added to the workspace. + */ + public addMember(workspaceId: string, addMemberRequest: AddMemberRequest, notifyUser?: boolean, notifyWsAdmins?: boolean, _options?: ConfigurationOptions): Observable { + return this.addMemberWithHttpInfo(workspaceId, addMemberRequest, notifyUser, notifyWsAdmins, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Generate a new API key for the workspace. Check out [API Key Authentication article](https://developers.pandadoc.com/reference/api-key-authentication-process) for detailed API Keys description. > 📘 > - Only an **Org Admin** can generate an API keys. > - To make another user a key\'s owner, pass `user_id` of this user. The user should has an **Admin** role in the workspace. > - Generating a new key invalidates existing key with the same type. Using this request, you can deactivate the key you\'re using for the request. + * Create API Key + * @param workspaceId Workspace id. + * @param createApiKeyRequest */ - public uploadSection(documentId: string, uploadSectionRequest: UploadSectionRequest, mergeFieldScope?: 'document' | 'upload', _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.uploadSection(documentId, uploadSectionRequest, mergeFieldScope, _options); + public createApiKeyWithHttpInfo(workspaceId: string, createApiKeyRequest: CreateApiKeyRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.createApiKey(workspaceId, createApiKeyRequest, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.uploadSection(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createApiKeyWithHttpInfo(rsp))); })); } -} - -import { TemplatesApiRequestFactory, TemplatesApiResponseProcessor} from "../apis/TemplatesApi"; -export class ObservableTemplatesApi { - private requestFactory: TemplatesApiRequestFactory; - private responseProcessor: TemplatesApiResponseProcessor; - private configuration: Configuration; - - public constructor( - configuration: Configuration, - requestFactory?: TemplatesApiRequestFactory, - responseProcessor?: TemplatesApiResponseProcessor - ) { - this.configuration = configuration; - this.requestFactory = requestFactory || new TemplatesApiRequestFactory(configuration); - this.responseProcessor = responseProcessor || new TemplatesApiResponseProcessor(); + /** + * Generate a new API key for the workspace. Check out [API Key Authentication article](https://developers.pandadoc.com/reference/api-key-authentication-process) for detailed API Keys description. > 📘 > - Only an **Org Admin** can generate an API keys. > - To make another user a key\'s owner, pass `user_id` of this user. The user should has an **Admin** role in the workspace. > - Generating a new key invalidates existing key with the same type. Using this request, you can deactivate the key you\'re using for the request. + * Create API Key + * @param workspaceId Workspace id. + * @param createApiKeyRequest + */ + public createApiKey(workspaceId: string, createApiKeyRequest: CreateApiKeyRequest, _options?: ConfigurationOptions): Observable { + return this.createApiKeyWithHttpInfo(workspaceId, createApiKeyRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** - * Delete a template - * Delete Template - * @param id Template ID + * Create users, and assign them roles, licenses, and workspaces. - You must be an organization admin to create users. - We check that the user email domain matches your organization domain. - We check that the user email and phone number have a valid format. + * Create User + * @param createUserRequest + * @param [notifyUser] Send a confirmation email to the user that was added to workspace(s). + * @param [notifyWsAdmins] Send a confirmation email to all workspace admins indicating that the user has been added to the workspace. */ - public deleteTemplate(id: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.deleteTemplate(id, _options); + public createUserWithHttpInfo(createUserRequest: CreateUserRequest, notifyUser?: boolean, notifyWsAdmins?: boolean, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.createUser(createUserRequest, notifyUser, notifyWsAdmins, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteTemplate(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createUserWithHttpInfo(rsp))); })); } /** - * Return detailed data about a template. - * Details Template - * @param id Template ID + * Create users, and assign them roles, licenses, and workspaces. - You must be an organization admin to create users. - We check that the user email domain matches your organization domain. - We check that the user email and phone number have a valid format. + * Create User + * @param createUserRequest + * @param [notifyUser] Send a confirmation email to the user that was added to workspace(s). + * @param [notifyWsAdmins] Send a confirmation email to all workspace admins indicating that the user has been added to the workspace. + */ + public createUser(createUserRequest: CreateUserRequest, notifyUser?: boolean, notifyWsAdmins?: boolean, _options?: ConfigurationOptions): Observable { + return this.createUserWithHttpInfo(createUserRequest, notifyUser, notifyWsAdmins, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Create a workspace in your organization. - You need to be an Org Admin to create a workspace. - You will be added to the new workspace with an Admin role. + * Create Workspace + * @param createWorkspaceRequest */ - public detailsTemplate(id: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.detailsTemplate(id, _options); + public createWorkspaceWithHttpInfo(createWorkspaceRequest: CreateWorkspaceRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.createWorkspace(createWorkspaceRequest, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.detailsTemplate(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createWorkspaceWithHttpInfo(rsp))); })); } /** - * Optionally, filter by a search query or tags. - * List Templates - * @param q Optional search query. Filter by template name. - * @param shared Returns only the shared templates. - * @param deleted Optional. Returns only the deleted templates. - * @param count Optionally, specify how many templates to return. Default is 50 templates, maximum is 100 templates. - * @param page Optionally, specify which page of the dataset to return. - * @param id Optionally, specify template ID. - * @param folderUuid UUID of the folder where the templates are stored. - * @param tag Optional search tag. Filter by template tag. - * @param fields A comma-separated list of additional fields to include in the response. Each field must be a valid template property. Currently, only one additional field, `content_date_modified`, is supported. For example, `GET /templates?fields=content_date_modified`. + * Create a workspace in your organization. - You need to be an Org Admin to create a workspace. - You will be added to the new workspace with an Admin role. + * Create Workspace + * @param createWorkspaceRequest + */ + public createWorkspace(createWorkspaceRequest: CreateWorkspaceRequest, _options?: ConfigurationOptions): Observable { + return this.createWorkspaceWithHttpInfo(createWorkspaceRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Deactivate the workspace, remove all the members from it and make it unavailable. + * Deactivate Workspace + * @param workspaceId + * @param [body] */ - public listTemplates(q?: string, shared?: boolean, deleted?: boolean, count?: number, page?: number, id?: string, folderUuid?: string, tag?: Array, fields?: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.listTemplates(q, shared, deleted, count, page, id, folderUuid, tag, fields, _options); + public deactivateWorkspaceWithHttpInfo(workspaceId: string, body?: any, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.deactivateWorkspace(workspaceId, body, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listTemplates(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deactivateWorkspaceWithHttpInfo(rsp))); })); } -} - -import { UserAndWorkspaceManagementApiRequestFactory, UserAndWorkspaceManagementApiResponseProcessor} from "../apis/UserAndWorkspaceManagementApi"; -export class ObservableUserAndWorkspaceManagementApi { - private requestFactory: UserAndWorkspaceManagementApiRequestFactory; - private responseProcessor: UserAndWorkspaceManagementApiResponseProcessor; - private configuration: Configuration; - - public constructor( - configuration: Configuration, - requestFactory?: UserAndWorkspaceManagementApiRequestFactory, - responseProcessor?: UserAndWorkspaceManagementApiResponseProcessor - ) { - this.configuration = configuration; - this.requestFactory = requestFactory || new UserAndWorkspaceManagementApiRequestFactory(configuration); - this.responseProcessor = responseProcessor || new UserAndWorkspaceManagementApiResponseProcessor(); + /** + * Deactivate the workspace, remove all the members from it and make it unavailable. + * Deactivate Workspace + * @param workspaceId + * @param [body] + */ + public deactivateWorkspace(workspaceId: string, body?: any, _options?: ConfigurationOptions): Observable { + return this.deactivateWorkspaceWithHttpInfo(workspaceId, body, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** - * Add member - * @param workspaceId - * @param addMemberRequest - * @param notifyUser Send a confirmation email to the user that was added to workspace(s). - * @param notifyWsAdmins Send a confirmation email to all workspace admins indicating that the user has been added to the workspace. + * Get a list of all the active workspaces in the organization. + * List Workspaces + * @param [count] Number of elements in page. + * @param [page] Page number. */ - public addMember(workspaceId: string, addMemberRequest: AddMemberRequest, notifyUser?: boolean, notifyWsAdmins?: boolean, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.addMember(workspaceId, addMemberRequest, notifyUser, notifyWsAdmins, _options); + public getWorkspacesListWithHttpInfo(count?: number, page?: number, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.getWorkspacesList(count, page, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.addMember(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getWorkspacesListWithHttpInfo(rsp))); })); } /** - * Create User - * @param createUserRequest - * @param notifyUser Send a confirmation email to the user that was added to workspace(s). - * @param notifyWsAdmins Send a confirmation email to all workspace admins indicating that the user has been added to the workspace. + * Get a list of all the active workspaces in the organization. + * List Workspaces + * @param [count] Number of elements in page. + * @param [page] Page number. + */ + public getWorkspacesList(count?: number, page?: number, _options?: ConfigurationOptions): Observable { + return this.getWorkspacesListWithHttpInfo(count, page, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Get a list of all users with membership in your organization, with their contact information, license type, and workspace roles. You must be an organization admin to list users. + * List Users + * @param [count] Number of elements in page. + * @param [page] Page number. + * @param [showRemoved] Filter option - show users with removed memberships. */ - public createUser(createUserRequest: CreateUserRequest, notifyUser?: boolean, notifyWsAdmins?: boolean, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.createUser(createUserRequest, notifyUser, notifyWsAdmins, _options); + public listUsersWithHttpInfo(count?: number, page?: number, showRemoved?: boolean, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.listUsers(count, page, showRemoved, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createUser(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listUsersWithHttpInfo(rsp))); })); } /** - * Create Workspace - * @param createWorkspaceRequest + * Get a list of all users with membership in your organization, with their contact information, license type, and workspace roles. You must be an organization admin to list users. + * List Users + * @param [count] Number of elements in page. + * @param [page] Page number. + * @param [showRemoved] Filter option - show users with removed memberships. + */ + public listUsers(count?: number, page?: number, showRemoved?: boolean, _options?: ConfigurationOptions): Observable { + return this.listUsersWithHttpInfo(count, page, showRemoved, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * This operation removes a specified member from a workspace by providing the workspace ID and member ID. + * Remove Member from Workspace + * @param workspaceId Workspace id + * @param memberId Member id */ - public createWorkspace(createWorkspaceRequest: CreateWorkspaceRequest, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.createWorkspace(createWorkspaceRequest, _options); + public removeMemberWithHttpInfo(workspaceId: string, memberId: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.removeMember(workspaceId, memberId, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createWorkspace(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.removeMemberWithHttpInfo(rsp))); })); } + /** + * This operation removes a specified member from a workspace by providing the workspace ID and member ID. + * Remove Member from Workspace + * @param workspaceId Workspace id + * @param memberId Member id + */ + public removeMember(workspaceId: string, memberId: string, _options?: ConfigurationOptions): Observable { + return this.removeMemberWithHttpInfo(workspaceId, memberId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + } import { WebhookEventsApiRequestFactory, WebhookEventsApiResponseProcessor} from "../apis/WebhookEventsApi"; @@ -1860,57 +4627,85 @@ export class ObservableWebhookEventsApi { } /** - * Get webhook event by uuid - * @param id Webhook event uuid + * This operation fetches detailed information about a specific webhook event using its unique identifier. + * Webhook Event Details + * @param id Webhook event uuid. */ - public detailsWebhookEvent(id: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.detailsWebhookEvent(id, _options); + public detailsWebhookEventWithHttpInfo(id: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.detailsWebhookEvent(id, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.detailsWebhookEvent(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.detailsWebhookEventWithHttpInfo(rsp))); })); } /** - * Get webhook event page - * @param count Number of element in page - * @param page Page number - * @param since Filter option: all events from specified timestamp - * @param to Filter option: all events up to specified timestamp - * @param type Filter option: all events of type - * @param httpStatusCode Filter option: all events of http status code - * @param error Filter option: all events with following error + * This operation fetches detailed information about a specific webhook event using its unique identifier. + * Webhook Event Details + * @param id Webhook event uuid. + */ + public detailsWebhookEvent(id: string, _options?: ConfigurationOptions): Observable { + return this.detailsWebhookEventWithHttpInfo(id, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * This operation retrieves a paginated list of all webhook events. + * List Webhook Events + * @param count Specify how many event results to return. + * @param page Specify which page of the dataset to return. + * @param [since] Return results where the event creation time is greater than or equal to this value. + * @param [to] Return results where the event creation time is less than this value. + * @param [type] Returns results by the specified event types. + * @param [httpStatusCode] Returns results with the specified HTTP status codes. + * @param [error] Returns results with the following errors. */ - public listWebhookEvent(count: number, page: number, since?: Date, to?: Date, type?: Array, httpStatusCode?: Array, error?: Array, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.listWebhookEvent(count, page, since, to, type, httpStatusCode, error, _options); + public listWebhookEventWithHttpInfo(count: number, page: number, since?: Date, to?: Date, type?: Array, httpStatusCode?: Array, error?: Array, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.listWebhookEvent(count, page, since, to, type, httpStatusCode, error, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listWebhookEvent(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listWebhookEventWithHttpInfo(rsp))); })); } + /** + * This operation retrieves a paginated list of all webhook events. + * List Webhook Events + * @param count Specify how many event results to return. + * @param page Specify which page of the dataset to return. + * @param [since] Return results where the event creation time is greater than or equal to this value. + * @param [to] Return results where the event creation time is less than this value. + * @param [type] Returns results by the specified event types. + * @param [httpStatusCode] Returns results with the specified HTTP status codes. + * @param [error] Returns results with the following errors. + */ + public listWebhookEvent(count: number, page: number, since?: Date, to?: Date, type?: Array, httpStatusCode?: Array, error?: Array, _options?: ConfigurationOptions): Observable { + return this.listWebhookEventWithHttpInfo(count, page, since, to, type, httpStatusCode, error, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + } import { WebhookSubscriptionsApiRequestFactory, WebhookSubscriptionsApiResponseProcessor} from "../apis/WebhookSubscriptionsApi"; @@ -1930,141 +4725,207 @@ export class ObservableWebhookSubscriptionsApi { } /** - * Create webhook subscription - * @param webhookSubscriptionCreateRequest + * This operation creates a new webhook subscription by specifying its details. + * Create Webhook Subscription + * @param webhookSubscriptionCreateRequest */ - public createWebhookSubscription(webhookSubscriptionCreateRequest: WebhookSubscriptionCreateRequest, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.createWebhookSubscription(webhookSubscriptionCreateRequest, _options); + public createWebhookSubscriptionWithHttpInfo(webhookSubscriptionCreateRequest: WebhookSubscriptionCreateRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.createWebhookSubscription(webhookSubscriptionCreateRequest, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createWebhookSubscription(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createWebhookSubscriptionWithHttpInfo(rsp))); })); } /** - * Delete webhook subscription - * @param id Webhook subscription uuid + * This operation creates a new webhook subscription by specifying its details. + * Create Webhook Subscription + * @param webhookSubscriptionCreateRequest + */ + public createWebhookSubscription(webhookSubscriptionCreateRequest: WebhookSubscriptionCreateRequest, _options?: ConfigurationOptions): Observable { + return this.createWebhookSubscriptionWithHttpInfo(webhookSubscriptionCreateRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * This operation deletes a specific webhook subscription identified by its UUID. + * Delete Webhook Subscription + * @param id Webhook subscription uuid. */ - public deleteWebhookSubscription(id: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.deleteWebhookSubscription(id, _options); + public deleteWebhookSubscriptionWithHttpInfo(id: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.deleteWebhookSubscription(id, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteWebhookSubscription(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteWebhookSubscriptionWithHttpInfo(rsp))); })); } /** - * Get webhook subscription by uuid + * This operation deletes a specific webhook subscription identified by its UUID. + * Delete Webhook Subscription + * @param id Webhook subscription uuid. + */ + public deleteWebhookSubscription(id: string, _options?: ConfigurationOptions): Observable { + return this.deleteWebhookSubscriptionWithHttpInfo(id, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * Get webhook subscription by uuid + * Webhook Subscription Details * @param id Webhook subscription uuid */ - public detailsWebhookSubscription(id: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.detailsWebhookSubscription(id, _options); + public detailsWebhookSubscriptionWithHttpInfo(id: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.detailsWebhookSubscription(id, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.detailsWebhookSubscription(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.detailsWebhookSubscriptionWithHttpInfo(rsp))); })); } /** - * Get all webhook subscriptions + * Get webhook subscription by uuid + * Webhook Subscription Details + * @param id Webhook subscription uuid + */ + public detailsWebhookSubscription(id: string, _options?: ConfigurationOptions): Observable { + return this.detailsWebhookSubscriptionWithHttpInfo(id, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * This operation fetches a paginated list of webhook subscriptions. + * List Webhook Subscriptions */ - public listWebhookSubscriptions(_options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.listWebhookSubscriptions(_options); + public listWebhookSubscriptionsWithHttpInfo(_options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.listWebhookSubscriptions(_config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listWebhookSubscriptions(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.listWebhookSubscriptionsWithHttpInfo(rsp))); })); } /** - * Update webhook subscription + * This operation fetches a paginated list of webhook subscriptions. + * List Webhook Subscriptions + */ + public listWebhookSubscriptions(_options?: ConfigurationOptions): Observable { + return this.listWebhookSubscriptionsWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * This operation updates the details of a webhook subscription. + * Update Webhook Subscription * @param id Webhook subscription uuid - * @param webhookSubscriptionPatchRequest + * @param webhookSubscriptionPatchRequest */ - public updateWebhookSubscription(id: string, webhookSubscriptionPatchRequest: WebhookSubscriptionPatchRequest, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.updateWebhookSubscription(id, webhookSubscriptionPatchRequest, _options); + public updateWebhookSubscriptionWithHttpInfo(id: string, webhookSubscriptionPatchRequest: WebhookSubscriptionPatchRequest, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.updateWebhookSubscription(id, webhookSubscriptionPatchRequest, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updateWebhookSubscription(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updateWebhookSubscriptionWithHttpInfo(rsp))); })); } /** - * Regenerate webhook subscription shared key + * This operation updates the details of a webhook subscription. + * Update Webhook Subscription + * @param id Webhook subscription uuid + * @param webhookSubscriptionPatchRequest + */ + public updateWebhookSubscription(id: string, webhookSubscriptionPatchRequest: WebhookSubscriptionPatchRequest, _options?: ConfigurationOptions): Observable { + return this.updateWebhookSubscriptionWithHttpInfo(id, webhookSubscriptionPatchRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + + /** + * This operation regenerates the shared key for a specific webhook subscription identified by its UUID. + * Update Webhook Subscription Shared Key * @param id Webhook subscription uuid */ - public updateWebhookSubscriptionSharedKey(id: string, _options?: Configuration): Observable { - const requestContextPromise = this.requestFactory.updateWebhookSubscriptionSharedKey(id, _options); + public updateWebhookSubscriptionSharedKeyWithHttpInfo(id: string, _options?: ConfigurationOptions): Observable> { + const _config = mergeConfiguration(this.configuration, _options); + const requestContextPromise = this.requestFactory.updateWebhookSubscriptionSharedKey(id, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } - return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => _config.httpApi.send(ctx))). pipe(mergeMap((response: ResponseContext) => { let middlewarePostObservable = of(response); - for (let middleware of this.configuration.middleware) { + for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); } - return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updateWebhookSubscriptionSharedKey(rsp))); + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updateWebhookSubscriptionSharedKeyWithHttpInfo(rsp))); })); } + /** + * This operation regenerates the shared key for a specific webhook subscription identified by its UUID. + * Update Webhook Subscription Shared Key + * @param id Webhook subscription uuid + */ + public updateWebhookSubscriptionSharedKey(id: string, _options?: ConfigurationOptions): Observable { + return this.updateWebhookSubscriptionSharedKeyWithHttpInfo(id, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + } diff --git a/src/types/PromiseAPI.ts b/src/types/PromiseAPI.ts index c247376..6d925c1 100644 --- a/src/types/PromiseAPI.ts +++ b/src/types/PromiseAPI.ts @@ -1,148 +1,358 @@ -import { ResponseContext, RequestContext, HttpFile } from '../http/http'; -import * as models from '../models/all'; -import { Configuration} from '../configuration' +import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; +import { Configuration, PromiseConfigurationOptions, wrapOptions } from '../configuration' +import { PromiseMiddleware, Middleware, PromiseMiddlewareWrapper } from '../middleware'; import { APILogDetailsResponse } from '../models/APILogDetailsResponse'; import { APILogListResponse } from '../models/APILogListResponse'; -import { APILogListResponseResults } from '../models/APILogListResponseResults'; +import { APILogListResponseResultsInner } from '../models/APILogListResponseResultsInner'; +import { AccessToken400Response } from '../models/AccessToken400Response'; +import { AddDsvNamedItemsRequest } from '../models/AddDsvNamedItemsRequest'; +import { AddDsvNamedItemsRequestItemsInner } from '../models/AddDsvNamedItemsRequestItemsInner'; +import { AddDsvNamedItemsResponse } from '../models/AddDsvNamedItemsResponse'; +import { AddDsvNamedItemsResponseResultsInner } from '../models/AddDsvNamedItemsResponseResultsInner'; +import { AddMember400Response } from '../models/AddMember400Response'; import { AddMemberRequest } from '../models/AddMemberRequest'; import { AddMemberResponse } from '../models/AddMemberResponse'; +import { ApiKeyTypeEnum } from '../models/ApiKeyTypeEnum'; +import { ApiLogEnvironmentTypeEnum } from '../models/ApiLogEnvironmentTypeEnum'; +import { ApiLogMethodEnum } from '../models/ApiLogMethodEnum'; +import { ApiLogStatusEnum } from '../models/ApiLogStatusEnum'; +import { AppendCLIDataRequest } from '../models/AppendCLIDataRequest'; +import { AppendCLIDataRequestCli } from '../models/AppendCLIDataRequestCli'; +import { AppendCLIDataRequestCliPagesInner } from '../models/AppendCLIDataRequestCliPagesInner'; +import { AppendCLIDataResponse } from '../models/AppendCLIDataResponse'; +import { AppendCLIDataResponseBlockMapping } from '../models/AppendCLIDataResponseBlockMapping'; +import { AppendCLIDataResponseBlockMappingImagesInner } from '../models/AppendCLIDataResponseBlockMappingImagesInner'; +import { AppendCLIDataResponseBlockMappingPricingTablesInner } from '../models/AppendCLIDataResponseBlockMappingPricingTablesInner'; +import { AppendCLIDataResponseBlockMappingTablesInner } from '../models/AppendCLIDataResponseBlockMappingTablesInner'; +import { AppendCLIDataResponseBlockMappingTextsInner } from '../models/AppendCLIDataResponseBlockMappingTextsInner'; +import { AppendCLIDataResponseCli } from '../models/AppendCLIDataResponseCli'; +import { AppendCLIDataResponseCliPagesInner } from '../models/AppendCLIDataResponseCliPagesInner'; +import { AssignedToRecipientDeliveryMethods } from '../models/AssignedToRecipientDeliveryMethods'; +import { AutoReminders } from '../models/AutoReminders'; +import { BaseActor } from '../models/BaseActor'; +import { BaseEditingSessionResponse } from '../models/BaseEditingSessionResponse'; +import { BaseField } from '../models/BaseField'; +import { BaseFieldAssignedTo } from '../models/BaseFieldAssignedTo'; +import { BaseIdentity } from '../models/BaseIdentity'; +import { ChangeDocumentStatus409Response } from '../models/ChangeDocumentStatus409Response'; +import { Checkbox } from '../models/Checkbox'; +import { CollectFile } from '../models/CollectFile'; +import { CollectFileAllOfValue } from '../models/CollectFileAllOfValue'; import { ContactCreateRequest } from '../models/ContactCreateRequest'; import { ContactDetailsResponse } from '../models/ContactDetailsResponse'; import { ContactListResponse } from '../models/ContactListResponse'; import { ContactUpdateRequest } from '../models/ContactUpdateRequest'; +import { ContentLibraryItemCreateFromUrlRequest } from '../models/ContentLibraryItemCreateFromUrlRequest'; +import { ContentLibraryItemCreateRequest } from '../models/ContentLibraryItemCreateRequest'; import { ContentLibraryItemListResponse } from '../models/ContentLibraryItemListResponse'; -import { ContentLibraryItemListResponseResults } from '../models/ContentLibraryItemListResponseResults'; +import { ContentLibraryItemListResponseResultsInner } from '../models/ContentLibraryItemListResponseResultsInner'; import { ContentLibraryItemResponse } from '../models/ContentLibraryItemResponse'; import { ContentLibraryItemResponseCreatedBy } from '../models/ContentLibraryItemResponseCreatedBy'; +import { ContentLibraryResponse } from '../models/ContentLibraryResponse'; +import { CreateApiKeyRequest } from '../models/CreateApiKeyRequest'; +import { CreateApiKeyResponse } from '../models/CreateApiKeyResponse'; +import { CreateDocument400Response } from '../models/CreateDocument400Response'; +import { CreateDocumentActor } from '../models/CreateDocumentActor'; +import { CreateDocumentEditingSession201Response } from '../models/CreateDocumentEditingSession201Response'; +import { CreateDocumentFieldsRequest } from '../models/CreateDocumentFieldsRequest'; +import { CreateDocumentFieldsResponse } from '../models/CreateDocumentFieldsResponse'; +import { CreateDocumentRecipient } from '../models/CreateDocumentRecipient'; +import { CreateDocumentRecipientGroup } from '../models/CreateDocumentRecipientGroup'; +import { CreateMemberTokenRequest } from '../models/CreateMemberTokenRequest'; +import { CreateMemberTokenResponse } from '../models/CreateMemberTokenResponse'; +import { CreateNotarizationRequest } from '../models/CreateNotarizationRequest'; +import { CreateNotarizationRequestInvitation } from '../models/CreateNotarizationRequestInvitation'; +import { CreateNotarizationRequestInvitationInviteesInner } from '../models/CreateNotarizationRequestInvitationInviteesInner'; +import { CreateNotarizationRequestNotary } from '../models/CreateNotarizationRequestNotary'; +import { CreateNotarizationResponse } from '../models/CreateNotarizationResponse'; +import { CreateNotarizationResponseCreatedBy } from '../models/CreateNotarizationResponseCreatedBy'; +import { CreateNotarizationResponseInviteesInner } from '../models/CreateNotarizationResponseInviteesInner'; +import { CreateTemplateEditingSession201Response } from '../models/CreateTemplateEditingSession201Response'; +import { CreateTemplateFromUrlRequest } from '../models/CreateTemplateFromUrlRequest'; +import { CreateTemplateRequest } from '../models/CreateTemplateRequest'; +import { CreateTemplateRequestOwner } from '../models/CreateTemplateRequestOwner'; +import { CreateUser400Response } from '../models/CreateUser400Response'; import { CreateUserRequest } from '../models/CreateUserRequest'; import { CreateUserRequestUser } from '../models/CreateUserRequestUser'; -import { CreateUserRequestWorkspaces } from '../models/CreateUserRequestWorkspaces'; +import { CreateUserRequestWorkspacesInner } from '../models/CreateUserRequestWorkspacesInner'; import { CreateUserResponse } from '../models/CreateUserResponse'; +import { CreateUserResponseWorkspacesInner } from '../models/CreateUserResponseWorkspacesInner'; import { CreateWorkspaceRequest } from '../models/CreateWorkspaceRequest'; import { CreateWorkspaceResponse } from '../models/CreateWorkspaceResponse'; +import { DeleteNotarizationRequest404Response } from '../models/DeleteNotarizationRequest404Response'; +import { DocumentAttachmentMetadata } from '../models/DocumentAttachmentMetadata'; +import { DocumentAttachmentRequest } from '../models/DocumentAttachmentRequest'; import { DocumentAttachmentResponse } from '../models/DocumentAttachmentResponse'; import { DocumentAttachmentResponseCreatedBy } from '../models/DocumentAttachmentResponseCreatedBy'; +import { DocumentAuditTrailResponse } from '../models/DocumentAuditTrailResponse'; +import { DocumentAuditTrailResponseResultsInner } from '../models/DocumentAuditTrailResponseResultsInner'; +import { DocumentAuditTrailResponseResultsInnerUser } from '../models/DocumentAuditTrailResponseResultsInnerUser'; +import { DocumentAutoRemindersResponse } from '../models/DocumentAutoRemindersResponse'; +import { DocumentAutoRemindersResponse400 } from '../models/DocumentAutoRemindersResponse400'; +import { DocumentAutoRemindersResponseResultInner } from '../models/DocumentAutoRemindersResponseResultInner'; import { DocumentCreateByPdfRequest } from '../models/DocumentCreateByPdfRequest'; import { DocumentCreateByTemplateRequest } from '../models/DocumentCreateByTemplateRequest'; -import { DocumentCreateByTemplateRequestContentLibraryItems } from '../models/DocumentCreateByTemplateRequestContentLibraryItems'; -import { DocumentCreateByTemplateRequestContentPlaceholders } from '../models/DocumentCreateByTemplateRequestContentPlaceholders'; -import { DocumentCreateByTemplateRequestImages } from '../models/DocumentCreateByTemplateRequestImages'; -import { DocumentCreateByTemplateRequestRecipients } from '../models/DocumentCreateByTemplateRequestRecipients'; -import { DocumentCreateByTemplateRequestTokens } from '../models/DocumentCreateByTemplateRequestTokens'; +import { DocumentCreateByTemplateRequestContentPlaceholdersInner } from '../models/DocumentCreateByTemplateRequestContentPlaceholdersInner'; +import { DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInner } from '../models/DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInner'; +import { DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInnerRecipientsInner } from '../models/DocumentCreateByTemplateRequestContentPlaceholdersInnerContentLibraryItemsInnerRecipientsInner'; +import { DocumentCreateByTemplateRequestFieldsValue } from '../models/DocumentCreateByTemplateRequestFieldsValue'; +import { DocumentCreateByTemplateRequestFieldsValueValue } from '../models/DocumentCreateByTemplateRequestFieldsValueValue'; +import { DocumentCreateByTemplateRequestImagesInner } from '../models/DocumentCreateByTemplateRequestImagesInner'; +import { DocumentCreateByTemplateRequestOwner } from '../models/DocumentCreateByTemplateRequestOwner'; +import { DocumentCreateByTemplateRequestTextsInner } from '../models/DocumentCreateByTemplateRequestTextsInner'; +import { DocumentCreateByTemplateRequestTokensInner } from '../models/DocumentCreateByTemplateRequestTokensInner'; import { DocumentCreateLinkRequest } from '../models/DocumentCreateLinkRequest'; import { DocumentCreateLinkResponse } from '../models/DocumentCreateLinkResponse'; import { DocumentCreateRequest } from '../models/DocumentCreateRequest'; -import { DocumentCreateRequestContentLibraryItems } from '../models/DocumentCreateRequestContentLibraryItems'; -import { DocumentCreateRequestContentPlaceholders } from '../models/DocumentCreateRequestContentPlaceholders'; -import { DocumentCreateRequestImages } from '../models/DocumentCreateRequestImages'; -import { DocumentCreateRequestRecipients } from '../models/DocumentCreateRequestRecipients'; +import { DocumentCreateRequestOneOf } from '../models/DocumentCreateRequestOneOf'; +import { DocumentCreateRequestOneOf1 } from '../models/DocumentCreateRequestOneOf1'; import { DocumentCreateResponse } from '../models/DocumentCreateResponse'; -import { DocumentCreateResponseLinks } from '../models/DocumentCreateResponseLinks'; +import { DocumentCreateResponseLinksInner } from '../models/DocumentCreateResponseLinksInner'; +import { DocumentDeliveryMethodEnum } from '../models/DocumentDeliveryMethodEnum'; +import { DocumentDetailsRecipient } from '../models/DocumentDetailsRecipient'; +import { DocumentDetailsRecipientGroup } from '../models/DocumentDetailsRecipientGroup'; +import { DocumentDetailsRecipientGroupMember } from '../models/DocumentDetailsRecipientGroupMember'; import { DocumentDetailsResponse } from '../models/DocumentDetailsResponse'; import { DocumentDetailsResponseCreatedBy } from '../models/DocumentDetailsResponseCreatedBy'; import { DocumentDetailsResponseGrandTotal } from '../models/DocumentDetailsResponseGrandTotal'; -import { DocumentDetailsResponseLinkedObjects } from '../models/DocumentDetailsResponseLinkedObjects'; -import { DocumentDetailsResponseRecipients } from '../models/DocumentDetailsResponseRecipients'; +import { DocumentDetailsResponseImagesInner } from '../models/DocumentDetailsResponseImagesInner'; +import { DocumentDetailsResponseLinkedObjectsInner } from '../models/DocumentDetailsResponseLinkedObjectsInner'; +import { DocumentDetailsResponseLinkedObjectsInnerChildrenInner } from '../models/DocumentDetailsResponseLinkedObjectsInnerChildrenInner'; +import { DocumentDetailsResponseRecipientsInner } from '../models/DocumentDetailsResponseRecipientsInner'; +import { DocumentDetailsResponseTablesInner } from '../models/DocumentDetailsResponseTablesInner'; import { DocumentDetailsResponseTemplate } from '../models/DocumentDetailsResponseTemplate'; +import { DocumentDetailsResponseTextsInner } from '../models/DocumentDetailsResponseTextsInner'; +import { DocumentDocxExport } from '../models/DocumentDocxExport'; +import { DocumentDocxExportStatusEnum } from '../models/DocumentDocxExportStatusEnum'; +import { DocumentESignDisclosure } from '../models/DocumentESignDisclosure'; +import { DocumentESignDisclosureResult } from '../models/DocumentESignDisclosureResult'; +import { DocumentFieldAnchorPointEnum } from '../models/DocumentFieldAnchorPointEnum'; +import { DocumentFieldTypeEnum } from '../models/DocumentFieldTypeEnum'; +import { DocumentFieldsField } from '../models/DocumentFieldsField'; +import { DocumentFieldsFieldAssignedTo } from '../models/DocumentFieldsFieldAssignedTo'; +import { DocumentFieldsFieldCreate } from '../models/DocumentFieldsFieldCreate'; +import { DocumentFieldsLayout } from '../models/DocumentFieldsLayout'; +import { DocumentFieldsLayoutPosition } from '../models/DocumentFieldsLayoutPosition'; +import { DocumentFieldsLayoutStyle } from '../models/DocumentFieldsLayoutStyle'; +import { DocumentLanguageEnum } from '../models/DocumentLanguageEnum'; import { DocumentListResponse } from '../models/DocumentListResponse'; -import { DocumentListResponseResults } from '../models/DocumentListResponseResults'; +import { DocumentListResponseResultsInner } from '../models/DocumentListResponseResultsInner'; import { DocumentOrderingFieldsEnum } from '../models/DocumentOrderingFieldsEnum'; import { DocumentRecipientCreateRequest } from '../models/DocumentRecipientCreateRequest'; import { DocumentRecipientEditRequest } from '../models/DocumentRecipientEditRequest'; import { DocumentRecipientResponse } from '../models/DocumentRecipientResponse'; +import { DocumentRevertToDraftResponse } from '../models/DocumentRevertToDraftResponse'; +import { DocumentSendManualReminder200Response } from '../models/DocumentSendManualReminder200Response'; +import { DocumentSendManualReminder200ResponseResultInner } from '../models/DocumentSendManualReminder200ResponseResultInner'; +import { DocumentSendManualReminder200ResponseResultInnerEmail } from '../models/DocumentSendManualReminder200ResponseResultInnerEmail'; +import { DocumentSendManualReminder200ResponseResultInnerEmailCustomization } from '../models/DocumentSendManualReminder200ResponseResultInnerEmailCustomization'; +import { DocumentSendManualReminder200ResponseResultInnerSms } from '../models/DocumentSendManualReminder200ResponseResultInnerSms'; +import { DocumentSendManualReminder409Response } from '../models/DocumentSendManualReminder409Response'; +import { DocumentSendManualReminderRequest } from '../models/DocumentSendManualReminderRequest'; +import { DocumentSendManualReminderRequestRemindersInner } from '../models/DocumentSendManualReminderRequestRemindersInner'; +import { DocumentSendManualReminderRequestRemindersInnerEmailCustomization } from '../models/DocumentSendManualReminderRequestRemindersInnerEmailCustomization'; import { DocumentSendRequest } from '../models/DocumentSendRequest'; import { DocumentSendRequestForwardingSettings } from '../models/DocumentSendRequestForwardingSettings'; import { DocumentSendRequestSelectedApprovers } from '../models/DocumentSendRequestSelectedApprovers'; -import { DocumentSendRequestSelectedApproversGroup } from '../models/DocumentSendRequestSelectedApproversGroup'; -import { DocumentSendRequestSelectedApproversGroupAssignees } from '../models/DocumentSendRequestSelectedApproversGroupAssignees'; -import { DocumentSendRequestSelectedApproversSteps } from '../models/DocumentSendRequestSelectedApproversSteps'; +import { DocumentSendRequestSelectedApproversStepsInner } from '../models/DocumentSendRequestSelectedApproversStepsInner'; +import { DocumentSendRequestSelectedApproversStepsInnerGroup } from '../models/DocumentSendRequestSelectedApproversStepsInnerGroup'; +import { DocumentSendRequestSelectedApproversStepsInnerGroupAssigneesInner } from '../models/DocumentSendRequestSelectedApproversStepsInnerGroupAssigneesInner'; +import { DocumentSendRequestSender } from '../models/DocumentSendRequestSender'; import { DocumentSendResponse } from '../models/DocumentSendResponse'; -import { DocumentSendResponseRecipients } from '../models/DocumentSendResponseRecipients'; +import { DocumentSendResponseRecipientsInner } from '../models/DocumentSendResponseRecipientsInner'; +import { DocumentSettingsResponse } from '../models/DocumentSettingsResponse'; import { DocumentStatusChangeRequest } from '../models/DocumentStatusChangeRequest'; +import { DocumentStatusChangeRequestStatusEnum } from '../models/DocumentStatusChangeRequestStatusEnum'; import { DocumentStatusEnum } from '../models/DocumentStatusEnum'; import { DocumentStatusRequestEnum } from '../models/DocumentStatusRequestEnum'; import { DocumentStatusResponse } from '../models/DocumentStatusResponse'; import { DocumentTransferAllOwnershipRequest } from '../models/DocumentTransferAllOwnershipRequest'; import { DocumentTransferOwnershipRequest } from '../models/DocumentTransferOwnershipRequest'; import { DocumentUpdateRequest } from '../models/DocumentUpdateRequest'; -import { DocumentUpdateRequestRecipients } from '../models/DocumentUpdateRequestRecipients'; +import { DocumentUpdateRequestFieldValue } from '../models/DocumentUpdateRequestFieldValue'; +import { DocumentUpdateRequestImagesInner } from '../models/DocumentUpdateRequestImagesInner'; +import { DocumentUpdateRequestTextsInner } from '../models/DocumentUpdateRequestTextsInner'; +import { DocumentUpdateRequestTokensInner } from '../models/DocumentUpdateRequestTokensInner'; import { DocumentsFolderCreateRequest } from '../models/DocumentsFolderCreateRequest'; import { DocumentsFolderCreateResponse } from '../models/DocumentsFolderCreateResponse'; import { DocumentsFolderListResponse } from '../models/DocumentsFolderListResponse'; -import { DocumentsFolderListResponseResults } from '../models/DocumentsFolderListResponseResults'; +import { DocumentsFolderListResponseResultsInner } from '../models/DocumentsFolderListResponseResultsInner'; import { DocumentsFolderRenameRequest } from '../models/DocumentsFolderRenameRequest'; import { DocumentsFolderRenameResponse } from '../models/DocumentsFolderRenameResponse'; +import { DocxExportTaskResponse } from '../models/DocxExportTaskResponse'; +import { DocxExportTaskResponseAllOfDocxItems } from '../models/DocxExportTaskResponseAllOfDocxItems'; +import { Dropdown } from '../models/Dropdown'; +import { EditingSessionRequest } from '../models/EditingSessionRequest'; +import { Field } from '../models/Field'; import { FormListResponse } from '../models/FormListResponse'; -import { FormListResponseResults } from '../models/FormListResponseResults'; +import { FormListResponseResultsInner } from '../models/FormListResponseResultsInner'; +import { Initials } from '../models/Initials'; +import { LinkedObjectChild } from '../models/LinkedObjectChild'; import { LinkedObjectCreateRequest } from '../models/LinkedObjectCreateRequest'; import { LinkedObjectCreateResponse } from '../models/LinkedObjectCreateResponse'; import { LinkedObjectListResponse } from '../models/LinkedObjectListResponse'; +import { ListCatalogItemsSearchResponse } from '../models/ListCatalogItemsSearchResponse'; +import { ListDocumentFieldsResponse } from '../models/ListDocumentFieldsResponse'; +import { ListDocuments400Response } from '../models/ListDocuments400Response'; +import { ListDocuments401Response } from '../models/ListDocuments401Response'; +import { ListDocuments403Response } from '../models/ListDocuments403Response'; +import { ListDocuments403ResponseLinksInner } from '../models/ListDocuments403ResponseLinksInner'; +import { ListDocuments429Response } from '../models/ListDocuments429Response'; +import { ListDocumentsByLinkedObjectsResponseInner } from '../models/ListDocumentsByLinkedObjectsResponseInner'; +import { ListNotaries400Response } from '../models/ListNotaries400Response'; +import { ListNotaries400ResponseDetailsInner } from '../models/ListNotaries400ResponseDetailsInner'; +import { ListNotaries403Response } from '../models/ListNotaries403Response'; +import { ListNotaries429Response } from '../models/ListNotaries429Response'; +import { ListNotariesResponse } from '../models/ListNotariesResponse'; +import { ListNotariesResponseResultsInner } from '../models/ListNotariesResponseResultsInner'; +import { ListSmsOptOutChangelogResponse } from '../models/ListSmsOptOutChangelogResponse'; +import { ListSmsOptOutChangelogResponseResultsInner } from '../models/ListSmsOptOutChangelogResponseResultsInner'; +import { ListUsersResponse } from '../models/ListUsersResponse'; +import { ListUsersResponseResultsInner } from '../models/ListUsersResponseResultsInner'; +import { ListUsersResponseResultsInnerWorkspacesInner } from '../models/ListUsersResponseResultsInnerWorkspacesInner'; +import { ListWorkspacesResponse } from '../models/ListWorkspacesResponse'; +import { ListWorkspacesResponseResultsInner } from '../models/ListWorkspacesResponseResultsInner'; import { MemberDetailsResponse } from '../models/MemberDetailsResponse'; import { MemberListResponse } from '../models/MemberListResponse'; +import { ModelDate } from '../models/ModelDate'; +import { NotarizationRequestDetailsResponse } from '../models/NotarizationRequestDetailsResponse'; +import { NotarizationRequestDetailsResponseCreatedBy } from '../models/NotarizationRequestDetailsResponseCreatedBy'; +import { NotarizationRequestDetailsResponseInviteesInner } from '../models/NotarizationRequestDetailsResponseInviteesInner'; +import { NotarizationRequestDetailsResponseRecording } from '../models/NotarizationRequestDetailsResponseRecording'; +import { NotarizationRequestDetailsResponseSignedDocumentsInner } from '../models/NotarizationRequestDetailsResponseSignedDocumentsInner'; import { OAuth2AccessTokenResponse } from '../models/OAuth2AccessTokenResponse'; +import { Payment } from '../models/Payment'; import { PricingResponse } from '../models/PricingResponse'; import { PricingTableRequest } from '../models/PricingTableRequest'; import { PricingTableRequestRowOptions } from '../models/PricingTableRequestRowOptions'; -import { PricingTableRequestRows } from '../models/PricingTableRequestRows'; -import { PricingTableRequestSections } from '../models/PricingTableRequestSections'; +import { PricingTableRequestSectionsInner } from '../models/PricingTableRequestSectionsInner'; +import { PricingTableRequestSectionsInnerRowsInner } from '../models/PricingTableRequestSectionsInnerRowsInner'; import { PricingTableResponse } from '../models/PricingTableResponse'; -import { PricingTableResponseDiscount } from '../models/PricingTableResponseDiscount'; -import { PricingTableResponseItems } from '../models/PricingTableResponseItems'; -import { PricingTableResponseOptions } from '../models/PricingTableResponseOptions'; +import { PricingTableResponseItemsInner } from '../models/PricingTableResponseItemsInner'; +import { PricingTableResponseItemsInnerDiscount } from '../models/PricingTableResponseItemsInnerDiscount'; +import { PricingTableResponseItemsInnerOptions } from '../models/PricingTableResponseItemsInnerOptions'; import { PricingTableResponseSummary } from '../models/PricingTableResponseSummary'; +import { ProductCatalogCatalogCustomBundleItem } from '../models/ProductCatalogCatalogCustomBundleItem'; +import { ProductCatalogCatalogItemInBundle } from '../models/ProductCatalogCatalogItemInBundle'; +import { ProductCatalogCustomBundleItemNoId } from '../models/ProductCatalogCustomBundleItemNoId'; +import { ProductCatalogCustomCatalogItemInBundle } from '../models/ProductCatalogCustomCatalogItemInBundle'; +import { ProductCatalogItemPatchRequest } from '../models/ProductCatalogItemPatchRequest'; +import { ProductCatalogItemPatchRequestBundleItemsInner } from '../models/ProductCatalogItemPatchRequestBundleItemsInner'; +import { ProductCatalogItemPatchRequestBundleItemsInnerItemOrUuid } from '../models/ProductCatalogItemPatchRequestBundleItemsInnerItemOrUuid'; +import { ProductCatalogItemPatchRequestProductVariant } from '../models/ProductCatalogItemPatchRequestProductVariant'; +import { ProductCatalogItemPriceConfiguration } from '../models/ProductCatalogItemPriceConfiguration'; +import { ProductCatalogItemPriceTier } from '../models/ProductCatalogItemPriceTier'; +import { ProductCatalogItemRequest } from '../models/ProductCatalogItemRequest'; +import { ProductCatalogItemRequestBundleItemsInner } from '../models/ProductCatalogItemRequestBundleItemsInner'; +import { ProductCatalogItemRequestBundleItemsInnerItemOrUuid } from '../models/ProductCatalogItemRequestBundleItemsInnerItemOrUuid'; +import { ProductCatalogItemRequestCustomFieldsInner } from '../models/ProductCatalogItemRequestCustomFieldsInner'; +import { ProductCatalogItemRequestImagesInner } from '../models/ProductCatalogItemRequestImagesInner'; +import { ProductCatalogItemResponse } from '../models/ProductCatalogItemResponse'; +import { ProductCatalogItemResponseBundleItemsInner } from '../models/ProductCatalogItemResponseBundleItemsInner'; +import { ProductCatalogItemResponseBundleItemsInnerItem } from '../models/ProductCatalogItemResponseBundleItemsInnerItem'; +import { ProductCatalogItemResponseDefaultPriceConfiguration } from '../models/ProductCatalogItemResponseDefaultPriceConfiguration'; +import { ProductCatalogItemResponseVariantsInner } from '../models/ProductCatalogItemResponseVariantsInner'; +import { ProductCatalogPricingMethodEnum } from '../models/ProductCatalogPricingMethodEnum'; +import { ProductCatalogSearchCatalogItemResponse } from '../models/ProductCatalogSearchCatalogItemResponse'; +import { ProductCatalogSearchCatalogItemResponseCustomFieldsInner } from '../models/ProductCatalogSearchCatalogItemResponseCustomFieldsInner'; +import { ProductCatalogSearchCatalogItemResponseImagesInner } from '../models/ProductCatalogSearchCatalogItemResponseImagesInner'; +import { ProductCatalogSearchCatalogItemResponseTiersInner } from '../models/ProductCatalogSearchCatalogItemResponseTiersInner'; +import { ProductCatalogTypeEnum } from '../models/ProductCatalogTypeEnum'; import { QuoteResponse } from '../models/QuoteResponse'; -import { QuoteResponseAction } from '../models/QuoteResponseAction'; -import { QuoteResponseCondition } from '../models/QuoteResponseCondition'; -import { QuoteResponseConditionComparison } from '../models/QuoteResponseConditionComparison'; -import { QuoteResponseMergeRules } from '../models/QuoteResponseMergeRules'; -import { QuoteResponseOptions } from '../models/QuoteResponseOptions'; +import { QuoteResponseMergeRulesInner } from '../models/QuoteResponseMergeRulesInner'; +import { QuoteResponseMergeRulesInnerAction } from '../models/QuoteResponseMergeRulesInnerAction'; +import { QuoteResponseMergeRulesInnerCondition } from '../models/QuoteResponseMergeRulesInnerCondition'; +import { QuoteResponseMergeRulesInnerConditionComparisonInner } from '../models/QuoteResponseMergeRulesInnerConditionComparisonInner'; import { QuoteResponseSectionColumn } from '../models/QuoteResponseSectionColumn'; import { QuoteResponseSectionItem } from '../models/QuoteResponseSectionItem'; +import { QuoteResponseSectionItemOptions } from '../models/QuoteResponseSectionItemOptions'; import { QuoteResponseSectionSummary } from '../models/QuoteResponseSectionSummary'; -import { QuoteResponseSections } from '../models/QuoteResponseSections'; +import { QuoteResponseSectionsInner } from '../models/QuoteResponseSectionsInner'; import { QuoteResponseSettings } from '../models/QuoteResponseSettings'; import { QuoteResponseSummary } from '../models/QuoteResponseSummary'; -import { QuoteResponseSummaryDiscounts } from '../models/QuoteResponseSummaryDiscounts'; -import { QuoteResponseSummaryRecurringSubtotal } from '../models/QuoteResponseSummaryRecurringSubtotal'; +import { QuoteResponseSummaryDiscountsValue } from '../models/QuoteResponseSummaryDiscountsValue'; +import { QuoteResponseSummaryRecurringSubtotalInner } from '../models/QuoteResponseSummaryRecurringSubtotalInner'; import { QuoteSectionSettings } from '../models/QuoteSectionSettings'; import { QuoteUpdateRequest } from '../models/QuoteUpdateRequest'; -import { QuoteUpdateRequestDiscounts } from '../models/QuoteUpdateRequestDiscounts'; -import { QuoteUpdateRequestOptions } from '../models/QuoteUpdateRequestOptions'; -import { QuoteUpdateRequestPriceSettings } from '../models/QuoteUpdateRequestPriceSettings'; -import { QuoteUpdateRequestPriceSettingsTiers } from '../models/QuoteUpdateRequestPriceSettingsTiers'; +import { QuoteUpdateRequestBillingFrequencyEnum } from '../models/QuoteUpdateRequestBillingFrequencyEnum'; +import { QuoteUpdateRequestDiscountTypeEnum } from '../models/QuoteUpdateRequestDiscountTypeEnum'; import { QuoteUpdateRequestSettings } from '../models/QuoteUpdateRequestSettings'; -import { QuoteUpdateRequestSettings1 } from '../models/QuoteUpdateRequestSettings1'; +import { QuoteUpdateRequestSettingsSelectionTypeTypeEnum } from '../models/QuoteUpdateRequestSettingsSelectionTypeTypeEnum'; +import { RadioButtons } from '../models/RadioButtons'; +import { RecipientAssignedTo } from '../models/RecipientAssignedTo'; +import { RecipientAssignmentDetails } from '../models/RecipientAssignmentDetails'; +import { RecipientDeliveryMethods } from '../models/RecipientDeliveryMethods'; +import { RecipientKindEnum } from '../models/RecipientKindEnum'; +import { RecipientPersonalDetails } from '../models/RecipientPersonalDetails'; import { RecipientRedirect } from '../models/RecipientRedirect'; +import { RecipientRedirectSettings } from '../models/RecipientRedirectSettings'; +import { RecipientVerificationPlaceEnum } from '../models/RecipientVerificationPlaceEnum'; import { RecipientVerificationSettings } from '../models/RecipientVerificationSettings'; +import { RecipientVerificationSettingsIdVerification } from '../models/RecipientVerificationSettingsIdVerification'; +import { RecipientVerificationSettingsKbaVerification } from '../models/RecipientVerificationSettingsKbaVerification'; import { RecipientVerificationSettingsPasscodeVerification } from '../models/RecipientVerificationSettingsPasscodeVerification'; import { RecipientVerificationSettingsPhoneVerification } from '../models/RecipientVerificationSettingsPhoneVerification'; -import { RicipientDeliveryMethods } from '../models/RicipientDeliveryMethods'; +import { RecipientsGroupAssignedTo } from '../models/RecipientsGroupAssignedTo'; +import { RecipientsGroupAssignedToAllOfMembers } from '../models/RecipientsGroupAssignedToAllOfMembers'; +import { RemoveMember400Response } from '../models/RemoveMember400Response'; +import { RemoveMember404Response } from '../models/RemoveMember404Response'; +import { SearchCatalogItems401Response } from '../models/SearchCatalogItems401Response'; import { SectionInfoResponse } from '../models/SectionInfoResponse'; +import { Signature } from '../models/Signature'; +import { Stamp } from '../models/Stamp'; +import { StatusDocument404Response } from '../models/StatusDocument404Response'; +import { StatusDocumentAutoReminder400Response } from '../models/StatusDocumentAutoReminder400Response'; +import { TableCell } from '../models/TableCell'; +import { TableRequest } from '../models/TableRequest'; +import { TableRequestData } from '../models/TableRequestData'; +import { TableRequestDataSectionsInner } from '../models/TableRequestDataSectionsInner'; +import { TemplateCreateResponse } from '../models/TemplateCreateResponse'; import { TemplateDetailsResponse } from '../models/TemplateDetailsResponse'; -import { TemplateDetailsResponseContentPlaceholders } from '../models/TemplateDetailsResponseContentPlaceholders'; -import { TemplateDetailsResponseImages } from '../models/TemplateDetailsResponseImages'; -import { TemplateDetailsResponsePreassignedPerson } from '../models/TemplateDetailsResponsePreassignedPerson'; -import { TemplateDetailsResponseRoles } from '../models/TemplateDetailsResponseRoles'; -import { TemplateDetailsResponseTokens } from '../models/TemplateDetailsResponseTokens'; +import { TemplateDetailsResponseContentPlaceholdersInner } from '../models/TemplateDetailsResponseContentPlaceholdersInner'; +import { TemplateDetailsResponseImagesInner } from '../models/TemplateDetailsResponseImagesInner'; +import { TemplateDetailsResponseRolesInner } from '../models/TemplateDetailsResponseRolesInner'; +import { TemplateDetailsResponseRolesInnerPreassignedPerson } from '../models/TemplateDetailsResponseRolesInnerPreassignedPerson'; +import { TemplateDetailsResponseRolesInnerPreassignedPersonMembersInner } from '../models/TemplateDetailsResponseRolesInnerPreassignedPersonMembersInner'; +import { TemplateDetailsResponseTokensInner } from '../models/TemplateDetailsResponseTokensInner'; import { TemplateListResponse } from '../models/TemplateListResponse'; -import { TemplateListResponseResults } from '../models/TemplateListResponseResults'; +import { TemplateSettingsResponse } from '../models/TemplateSettingsResponse'; +import { TemplateStatusResponse } from '../models/TemplateStatusResponse'; +import { TemplateUpdateRequest } from '../models/TemplateUpdateRequest'; import { TemplatesFolderCreateRequest } from '../models/TemplatesFolderCreateRequest'; import { TemplatesFolderCreateResponse } from '../models/TemplatesFolderCreateResponse'; import { TemplatesFolderListResponse } from '../models/TemplatesFolderListResponse'; -import { TemplatesFolderListResponseResults } from '../models/TemplatesFolderListResponseResults'; +import { TemplatesFolderListResponseResultsInner } from '../models/TemplatesFolderListResponseResultsInner'; import { TemplatesFolderRenameRequest } from '../models/TemplatesFolderRenameRequest'; import { TemplatesFolderRenameResponse } from '../models/TemplatesFolderRenameResponse'; +import { Text } from '../models/Text'; +import { UpdateDocument400Response } from '../models/UpdateDocument400Response'; +import { UpdateDocumentActor } from '../models/UpdateDocumentActor'; +import { UpdateDocumentAutoRemindersRequest } from '../models/UpdateDocumentAutoRemindersRequest'; +import { UpdateDocumentAutoRemindersResponse } from '../models/UpdateDocumentAutoRemindersResponse'; +import { UpdateDocumentRecipient } from '../models/UpdateDocumentRecipient'; +import { UpdateDocumentRecipientGroup } from '../models/UpdateDocumentRecipientGroup'; +import { UpdateDocumentSettingsRequest } from '../models/UpdateDocumentSettingsRequest'; import { UpdateIntegrationQuoteSection } from '../models/UpdateIntegrationQuoteSection'; import { UpdateIntegrationQuoteSectionItem } from '../models/UpdateIntegrationQuoteSectionItem'; -import { UploadSectionByPdfRequest } from '../models/UploadSectionByPdfRequest'; +import { UpdateIntegrationQuoteSectionItemDiscountsValue } from '../models/UpdateIntegrationQuoteSectionItemDiscountsValue'; +import { UpdateIntegrationQuoteSectionItemOptions } from '../models/UpdateIntegrationQuoteSectionItemOptions'; +import { UpdateIntegrationQuoteSectionItemPriceSettings } from '../models/UpdateIntegrationQuoteSectionItemPriceSettings'; +import { UpdateIntegrationQuoteSectionItemPriceSettingsTiersInner } from '../models/UpdateIntegrationQuoteSectionItemPriceSettingsTiersInner'; +import { UpdateIntegrationQuoteSectionSettings } from '../models/UpdateIntegrationQuoteSectionSettings'; +import { UpdateTemplateSettingsRequest } from '../models/UpdateTemplateSettingsRequest'; +import { UploadSectionBase } from '../models/UploadSectionBase'; import { UploadSectionByTemplateRequest } from '../models/UploadSectionByTemplateRequest'; +import { UploadSectionByTemplateRequestAllOfContentLibraryItems } from '../models/UploadSectionByTemplateRequestAllOfContentLibraryItems'; +import { UploadSectionByTemplateRequestAllOfContentPlaceholders } from '../models/UploadSectionByTemplateRequestAllOfContentPlaceholders'; import { UploadSectionListResponse } from '../models/UploadSectionListResponse'; -import { UploadSectionListResponseResults } from '../models/UploadSectionListResponseResults'; +import { UploadSectionListResponseResultsInner } from '../models/UploadSectionListResponseResultsInner'; import { UploadSectionRequest } from '../models/UploadSectionRequest'; +import { UploadSectionRequestOneOf } from '../models/UploadSectionRequestOneOf'; import { UploadSectionResponse } from '../models/UploadSectionResponse'; import { UploadSectionStatusEnum } from '../models/UploadSectionStatusEnum'; import { UploadSectionStatusResponse } from '../models/UploadSectionStatusResponse'; +import { UserLicenseEnum } from '../models/UserLicenseEnum'; import { WebhookEventDetailsResponse } from '../models/WebhookEventDetailsResponse'; import { WebhookEventErrorEnum } from '../models/WebhookEventErrorEnum'; import { WebhookEventHttpStatusCodeGroupEnum } from '../models/WebhookEventHttpStatusCodeGroupEnum'; @@ -157,6 +367,7 @@ import { WebhookSubscriptionPayloadEnum } from '../models/WebhookSubscriptionPay import { WebhookSubscriptionSharedKeyResponse } from '../models/WebhookSubscriptionSharedKeyResponse'; import { WebhookSubscriptionStatusEnum } from '../models/WebhookSubscriptionStatusEnum'; import { WebhookSubscriptionTriggerEnum } from '../models/WebhookSubscriptionTriggerEnum'; +import { WorkspaceMemberRoleEnum } from '../models/WorkspaceMemberRoleEnum'; import { ObservableAPILogsApi } from './ObservableAPI'; import { APILogsApiRequestFactory, APILogsApiResponseProcessor} from "../apis/APILogsApi"; @@ -173,28 +384,102 @@ export class PromiseAPILogsApi { /** * Returns details of the specific API log event. - * Details API Log + * API Log Details * @param id Log event id. */ - public detailsLog(id: string, _options?: Configuration): Promise { - const result = this.api.detailsLog(id, _options); + public detailsLogWithHttpInfo(id: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.detailsLogWithHttpInfo(id, observableOptions); return result.toPromise(); } /** - * Get the list of all logs within the selected workspace. Optionally filter by date, page, and `#` of items per page. + * Returns details of the specific API log event. + * API Log Details + * @param id Log event id. + */ + public detailsLog(id: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.detailsLog(id, observableOptions); + return result.toPromise(); + } + + /** + * Get the list of all logs within the selected workspace.\\ Optionally filter by date, page, and `#` of items per page. + * List API Log + * @param [since] Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \"-90d\" (for past 90 days). + * @param [to] Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \"-10d\" (for past 10 days) or a special \"now\" value. + * @param [count] The amount of items on each page. + * @param [page] Returns page of the results by number. + * @param [statuses] Returns only the predefined status codes. + * @param [methods] Returns only the predefined HTTP methods. Allows GET, POST, PUT, PATCH, and DELETE. + * @param [search] Returns the results containing a string. + * @param [environmentType] Returns logs for production/sandbox. + */ + public listLogsWithHttpInfo(since?: string, to?: string, count?: number, page?: number, statuses?: Array, methods?: Array, search?: string, environmentType?: ApiLogEnvironmentTypeEnum, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.listLogsWithHttpInfo(since, to, count, page, statuses, methods, search, environmentType, observableOptions); + return result.toPromise(); + } + + /** + * Get the list of all logs within the selected workspace.\\ Optionally filter by date, page, and `#` of items per page. * List API Log - * @param since Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \"-90d\" (for past 90 days). - * @param to Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \"-10d\" (for past 10 days) or a special \"now\" value. - * @param count The amount of items on each page. - * @param page Page number of the results returned. - * @param statuses Returns only the predefined status codes. Allows 1xx, 2xx, 3xx, 4xx, and 5xx. - * @param methods Returns only the predefined HTTP methods. Allows GET, POST, PUT, PATCH, and DELETE. - * @param search Returns the results containing a string. - * @param environmentType Returns logs for production/sandbox. + * @param [since] Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \"-90d\" (for past 90 days). + * @param [to] Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \"-10d\" (for past 10 days) or a special \"now\" value. + * @param [count] The amount of items on each page. + * @param [page] Returns page of the results by number. + * @param [statuses] Returns only the predefined status codes. + * @param [methods] Returns only the predefined HTTP methods. Allows GET, POST, PUT, PATCH, and DELETE. + * @param [search] Returns the results containing a string. + * @param [environmentType] Returns logs for production/sandbox. + */ + public listLogs(since?: string, to?: string, count?: number, page?: number, statuses?: Array, methods?: Array, search?: string, environmentType?: ApiLogEnvironmentTypeEnum, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.listLogs(since, to, count, page, statuses, methods, search, environmentType, observableOptions); + return result.toPromise(); + } + + +} + + + +import { ObservableCommunicationPreferencesApi } from './ObservableAPI'; + +import { CommunicationPreferencesApiRequestFactory, CommunicationPreferencesApiResponseProcessor} from "../apis/CommunicationPreferencesApi"; +export class PromiseCommunicationPreferencesApi { + private api: ObservableCommunicationPreferencesApi + + public constructor( + configuration: Configuration, + requestFactory?: CommunicationPreferencesApiRequestFactory, + responseProcessor?: CommunicationPreferencesApiResponseProcessor + ) { + this.api = new ObservableCommunicationPreferencesApi(configuration, requestFactory, responseProcessor); + } + + /** + * Retrieves a list of the most recent SMS opt-out changes for each phone numbers used in your workspace. > 📘 You can filter results by time range using `timestamp_from` and `timestamp_to`. + * Recent SMS Opt-out + * @param [timestampFrom] The start of the timestamp. If no timestamp is provided, 1 hour before the current time will be used. + * @param [timestampTo] The end of the timestamp range. If no timestamp is provided the current time will be used. + */ + public listRecentSmsOptOutsWithHttpInfo(timestampFrom?: Date, timestampTo?: Date, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.listRecentSmsOptOutsWithHttpInfo(timestampFrom, timestampTo, observableOptions); + return result.toPromise(); + } + + /** + * Retrieves a list of the most recent SMS opt-out changes for each phone numbers used in your workspace. > 📘 You can filter results by time range using `timestamp_from` and `timestamp_to`. + * Recent SMS Opt-out + * @param [timestampFrom] The start of the timestamp. If no timestamp is provided, 1 hour before the current time will be used. + * @param [timestampTo] The end of the timestamp range. If no timestamp is provided the current time will be used. */ - public listLogs(since?: string, to?: string, count?: number, page?: number, statuses?: Array<100 | 200 | 300 | 400 | 500>, methods?: Array<'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'>, search?: string, environmentType?: 'PRODUCTION' | 'SANDBOX', _options?: Configuration): Promise { - const result = this.api.listLogs(since, to, count, page, statuses, methods, search, environmentType, _options); + public listRecentSmsOptOuts(timestampFrom?: Date, timestampTo?: Date, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.listRecentSmsOptOuts(timestampFrom, timestampTo, observableOptions); return result.toPromise(); } @@ -218,48 +503,114 @@ export class PromiseContactsApi { } /** + * This method adds a contact into a contacts list. + * Create contact + * @param contactCreateRequest + */ + public createContactWithHttpInfo(contactCreateRequest: ContactCreateRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.createContactWithHttpInfo(contactCreateRequest, observableOptions); + return result.toPromise(); + } + + /** + * This method adds a contact into a contacts list. * Create contact - * @param contactCreateRequest + * @param contactCreateRequest + */ + public createContact(contactCreateRequest: ContactCreateRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.createContact(contactCreateRequest, observableOptions); + return result.toPromise(); + } + + /** + * This method deletes a contact. + * Delete Contact + * @param id Contact id. + */ + public deleteContactWithHttpInfo(id: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.deleteContactWithHttpInfo(id, observableOptions); + return result.toPromise(); + } + + /** + * This method deletes a contact. + * Delete Contact + * @param id Contact id. */ - public createContact(contactCreateRequest: ContactCreateRequest, _options?: Configuration): Promise { - const result = this.api.createContact(contactCreateRequest, _options); + public deleteContact(id: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.deleteContact(id, observableOptions); return result.toPromise(); } /** - * Delete contact by id + * Returns contact details by its ID. + * Contact Details * @param id Contact id. */ - public deleteContact(id: string, _options?: Configuration): Promise { - const result = this.api.deleteContact(id, _options); + public detailsContactWithHttpInfo(id: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.detailsContactWithHttpInfo(id, observableOptions); return result.toPromise(); } /** - * Get contact details by id + * Returns contact details by its ID. + * Contact Details * @param id Contact id. */ - public detailsContact(id: string, _options?: Configuration): Promise { - const result = this.api.detailsContact(id, _options); + public detailsContact(id: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.detailsContact(id, observableOptions); + return result.toPromise(); + } + + /** + * This method returns a list of contacts associated with a workspace. + * List contacts + * @param [email] Optional search parameter. Filter results by exact match. + */ + public listContactsWithHttpInfo(email?: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.listContactsWithHttpInfo(email, observableOptions); return result.toPromise(); } /** + * This method returns a list of contacts associated with a workspace. * List contacts - * @param email Optional search parameter. Filter results by exact match. + * @param [email] Optional search parameter. Filter results by exact match. + */ + public listContacts(email?: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.listContacts(email, observableOptions); + return result.toPromise(); + } + + /** + * This method updates a contact details. + * Update Contact + * @param id Contact id. + * @param contactUpdateRequest */ - public listContacts(email?: string, _options?: Configuration): Promise { - const result = this.api.listContacts(email, _options); + public updateContactWithHttpInfo(id: string, contactUpdateRequest: ContactUpdateRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.updateContactWithHttpInfo(id, contactUpdateRequest, observableOptions); return result.toPromise(); } /** - * Update contact by id + * This method updates a contact details. + * Update Contact * @param id Contact id. - * @param contactUpdateRequest + * @param contactUpdateRequest */ - public updateContact(id: string, contactUpdateRequest: ContactUpdateRequest, _options?: Configuration): Promise { - const result = this.api.updateContact(id, contactUpdateRequest, _options); + public updateContact(id: string, contactUpdateRequest: ContactUpdateRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.updateContact(id, contactUpdateRequest, observableOptions); return result.toPromise(); } @@ -283,28 +634,126 @@ export class PromiseContentLibraryItemsApi { } /** - * Return detailed data about a content library item. - * Details Content Library Item + * This API endpoint allows users to create an empty item in the content library. No actual content or data is required to be provided in the initial creation. + * Create Content Library Item + * @param contentLibraryItemCreateFromUrlRequest + */ + public createContentLibraryItemWithHttpInfo(contentLibraryItemCreateFromUrlRequest: ContentLibraryItemCreateFromUrlRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.createContentLibraryItemWithHttpInfo(contentLibraryItemCreateFromUrlRequest, observableOptions); + return result.toPromise(); + } + + /** + * This API endpoint allows users to create an empty item in the content library. No actual content or data is required to be provided in the initial creation. + * Create Content Library Item + * @param contentLibraryItemCreateFromUrlRequest + */ + public createContentLibraryItem(contentLibraryItemCreateFromUrlRequest: ContentLibraryItemCreateFromUrlRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.createContentLibraryItem(contentLibraryItemCreateFromUrlRequest, observableOptions); + return result.toPromise(); + } + + /** + * This asynchronous endpoint allows users to create a new CLI by uploading a file. The uploaded file is processed in the background to generate the CLI. The maximum allowable file size for upload is 100 MB. Field tags and form fields are not supported yet. Once the file is uploaded, the processing will happen asynchronously, and users need to check the status of the CLI creation. + * Create Content Library Item from File Upload + * @param [file] Binary PDF File + * @param [data] JSON as a multipart/form-data request. + */ + public createContentLibraryItemFromUploadWithHttpInfo(file?: HttpFile, data?: ContentLibraryItemCreateRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.createContentLibraryItemFromUploadWithHttpInfo(file, data, observableOptions); + return result.toPromise(); + } + + /** + * This asynchronous endpoint allows users to create a new CLI by uploading a file. The uploaded file is processed in the background to generate the CLI. The maximum allowable file size for upload is 100 MB. Field tags and form fields are not supported yet. Once the file is uploaded, the processing will happen asynchronously, and users need to check the status of the CLI creation. + * Create Content Library Item from File Upload + * @param [file] Binary PDF File + * @param [data] JSON as a multipart/form-data request. + */ + public createContentLibraryItemFromUpload(file?: HttpFile, data?: ContentLibraryItemCreateRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.createContentLibraryItemFromUpload(file, data, observableOptions); + return result.toPromise(); + } + + /** + * Retrieve detailed information about a specific content library item using its ID. The details include: - **Roles** - **All fields with values** - **All tokens with values** - **Pricing information (pricing tables, products, etc)** - **Metadata** - **Tags** - **Modification Timestamps**: note that `date_modified` means any changes associated with the CLI, while `content_date_modified` logs any changes in CLI content. + * Content Library Item Details + * @param id Content Library Item ID + */ + public detailsContentLibraryItemWithHttpInfo(id: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.detailsContentLibraryItemWithHttpInfo(id, observableOptions); + return result.toPromise(); + } + + /** + * Retrieve detailed information about a specific content library item using its ID. The details include: - **Roles** - **All fields with values** - **All tokens with values** - **Pricing information (pricing tables, products, etc)** - **Metadata** - **Tags** - **Modification Timestamps**: note that `date_modified` means any changes associated with the CLI, while `content_date_modified` logs any changes in CLI content. + * Content Library Item Details * @param id Content Library Item ID */ - public detailsContentLibraryItem(id: string, _options?: Configuration): Promise { - const result = this.api.detailsContentLibraryItem(id, _options); + public detailsContentLibraryItem(id: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.detailsContentLibraryItem(id, observableOptions); return result.toPromise(); } /** - * Optionally filter by a search query or tags. + * The endpoint retrieves items from the content library in PandaDoc. This endpoint supports filtering options to narrow down the results, allowing users to search by query, tags, folder, and more. > ### ⚠️ Please avoid empty values for the parameters > API returns \"400\" error when any of the parameters has an empty value. Please remove such a parameter from the request or add a value. * List Content Library Item - * @param q Search query. Filter by content library item name. - * @param id Specify content library item ID. - * @param deleted Returns only the deleted content library items. - * @param folderUuid The UUID of the folder where the content library items are stored. - * @param count Specify how many content library items to return. Default is 50 content library items, maximum is 100 content library items. - * @param page Specify which page of the dataset to return. - * @param tag Search tag. Filter by content library item tag. + * @param [q] Search query. Filter by content library item name. + * @param [id] Specify content library item ID. + * @param [deleted] Returns only the deleted content library items. + * @param [folderUuid] The UUID of the folder where the content library items are stored. + * @param [count] Specify how many content library items to return. Default is 50 content library items, maximum is 100 content library items. + * @param [page] Specify which page of the dataset to return. + * @param [tag] Search tag. Filter by content library item tag. + */ + public listContentLibraryItemsWithHttpInfo(q?: string, id?: string, deleted?: boolean, folderUuid?: string, count?: number, page?: number, tag?: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.listContentLibraryItemsWithHttpInfo(q, id, deleted, folderUuid, count, page, tag, observableOptions); + return result.toPromise(); + } + + /** + * The endpoint retrieves items from the content library in PandaDoc. This endpoint supports filtering options to narrow down the results, allowing users to search by query, tags, folder, and more. > ### ⚠️ Please avoid empty values for the parameters > API returns \"400\" error when any of the parameters has an empty value. Please remove such a parameter from the request or add a value. + * List Content Library Item + * @param [q] Search query. Filter by content library item name. + * @param [id] Specify content library item ID. + * @param [deleted] Returns only the deleted content library items. + * @param [folderUuid] The UUID of the folder where the content library items are stored. + * @param [count] Specify how many content library items to return. Default is 50 content library items, maximum is 100 content library items. + * @param [page] Specify which page of the dataset to return. + * @param [tag] Search tag. Filter by content library item tag. + */ + public listContentLibraryItems(q?: string, id?: string, deleted?: boolean, folderUuid?: string, count?: number, page?: number, tag?: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.listContentLibraryItems(q, id, deleted, folderUuid, count, page, tag, observableOptions); + return result.toPromise(); + } + + /** + * Requesting the CLI status helps verify that a CLI is in the expected state before invoking additional API methods. ## Available CLI Statuses The following is a complete list of all possible CLI statuses returned: | CLI Status | Status Description | |-----------------|--------------------| | `cli.UPLOADED` | The CLI upload process has been initiated and is currently in progress. It will soon transition to the `cli.PROCESSED` state. | | `cli.PROCESSED` | The CLI has been successfully uploaded and created. At this stage, all aspects of the CLI are editable. | | `cli.ERROR` | The CLI upload process has failed. Please refer to the error details in the response for more information. | + * Content Library Item Status + * @param id Content Library Item ID */ - public listContentLibraryItems(q?: string, id?: string, deleted?: boolean, folderUuid?: string, count?: number, page?: number, tag?: string, _options?: Configuration): Promise { - const result = this.api.listContentLibraryItems(q, id, deleted, folderUuid, count, page, tag, _options); + public statusContentLibraryItemWithHttpInfo(id: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.statusContentLibraryItemWithHttpInfo(id, observableOptions); + return result.toPromise(); + } + + /** + * Requesting the CLI status helps verify that a CLI is in the expected state before invoking additional API methods. ## Available CLI Statuses The following is a complete list of all possible CLI statuses returned: | CLI Status | Status Description | |-----------------|--------------------| | `cli.UPLOADED` | The CLI upload process has been initiated and is currently in progress. It will soon transition to the `cli.PROCESSED` state. | | `cli.PROCESSED` | The CLI has been successfully uploaded and created. At this stage, all aspects of the CLI are editable. | | `cli.ERROR` | The CLI upload process has failed. Please refer to the error details in the response for more information. | + * Content Library Item Status + * @param id Content Library Item ID + */ + public statusContentLibraryItem(id: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.statusContentLibraryItem(id, observableOptions); return result.toPromise(); } @@ -329,122 +778,145 @@ export class PromiseDocumentAttachmentsApi { /** * Creates an attachment for a particular document - * Document Attachment Create + * Create Document Attachment * @param id Document UUID - * @param file Binary file to be attached to a document - * @param source URL link to the file to be attached to a document - * @param name Optional name to set for uploaded file + * @param documentAttachmentRequest */ - public createDocumentAttachment(id: string, file?: HttpFile, source?: string, name?: string, _options?: Configuration): Promise { - const result = this.api.createDocumentAttachment(id, file, source, name, _options); + public createDocumentAttachmentWithHttpInfo(id: string, documentAttachmentRequest: DocumentAttachmentRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.createDocumentAttachmentWithHttpInfo(id, documentAttachmentRequest, observableOptions); return result.toPromise(); } /** - * Deletes specific document's attachment - * Document Attachment Delete + * Creates an attachment for a particular document + * Create Document Attachment * @param id Document UUID - * @param attachmentId Attachment UUID + * @param documentAttachmentRequest */ - public deleteDocumentAttachment(id: string, attachmentId: string, _options?: Configuration): Promise { - const result = this.api.deleteDocumentAttachment(id, attachmentId, _options); + public createDocumentAttachment(id: string, documentAttachmentRequest: DocumentAttachmentRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.createDocumentAttachment(id, documentAttachmentRequest, observableOptions); return result.toPromise(); } /** - * Returns details of the specific document's attachment - * Document Attachment Details + * Creates an attachment for a particular document + * Create Document Attachment From Upload * @param id Document UUID - * @param attachmentId Attachment UUID + * @param [file] Binary file to be attached to a document + * @param [name] Optional name to set for uploaded file */ - public detailsDocumentAttachment(id: string, attachmentId: string, _options?: Configuration): Promise { - const result = this.api.detailsDocumentAttachment(id, attachmentId, _options); + public createDocumentAttachmentFromFileUploadWithHttpInfo(id: string, file?: HttpFile, name?: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.createDocumentAttachmentFromFileUploadWithHttpInfo(id, file, name, observableOptions); return result.toPromise(); } /** - * Returns document attachment file for download - * Document Attachment Download + * Creates an attachment for a particular document + * Create Document Attachment From Upload * @param id Document UUID - * @param attachmentId Attachment UUID + * @param [file] Binary file to be attached to a document + * @param [name] Optional name to set for uploaded file */ - public downloadDocumentAttachment(id: string, attachmentId: string, _options?: Configuration): Promise { - const result = this.api.downloadDocumentAttachment(id, attachmentId, _options); + public createDocumentAttachmentFromFileUpload(id: string, file?: HttpFile, name?: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.createDocumentAttachmentFromFileUpload(id, file, name, observableOptions); return result.toPromise(); } /** - * Return list of objects attached to particular document - * Document Attachment List - * @param id Document UUID + * Deletes an attachment from the document. + * Delete Document Attachment + * @param id Document UUID. + * @param attachmentId Attachment UUID. */ - public listDocumentAttachments(id: string, _options?: Configuration): Promise> { - const result = this.api.listDocumentAttachments(id, _options); + public deleteDocumentAttachmentWithHttpInfo(id: string, attachmentId: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.deleteDocumentAttachmentWithHttpInfo(id, attachmentId, observableOptions); return result.toPromise(); } + /** + * Deletes an attachment from the document. + * Delete Document Attachment + * @param id Document UUID. + * @param attachmentId Attachment UUID. + */ + public deleteDocumentAttachment(id: string, attachmentId: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.deleteDocumentAttachment(id, attachmentId, observableOptions); + return result.toPromise(); + } -} - - - -import { ObservableDocumentRecipientsApi } from './ObservableAPI'; - -import { DocumentRecipientsApiRequestFactory, DocumentRecipientsApiResponseProcessor} from "../apis/DocumentRecipientsApi"; -export class PromiseDocumentRecipientsApi { - private api: ObservableDocumentRecipientsApi + /** + * Returns details of the specific document\'s attachment. + * Document Attachment Details + * @param id Document UUID. + * @param attachmentId Attachment UUID. + */ + public detailsDocumentAttachmentWithHttpInfo(id: string, attachmentId: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.detailsDocumentAttachmentWithHttpInfo(id, attachmentId, observableOptions); + return result.toPromise(); + } - public constructor( - configuration: Configuration, - requestFactory?: DocumentRecipientsApiRequestFactory, - responseProcessor?: DocumentRecipientsApiResponseProcessor - ) { - this.api = new ObservableDocumentRecipientsApi(configuration, requestFactory, responseProcessor); + /** + * Returns details of the specific document\'s attachment. + * Document Attachment Details + * @param id Document UUID. + * @param attachmentId Attachment UUID. + */ + public detailsDocumentAttachment(id: string, attachmentId: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.detailsDocumentAttachment(id, attachmentId, observableOptions); + return result.toPromise(); } /** - * Adds recipient as CC to document - * Add Document Recipient - * @param id Document UUID - * @param documentRecipientCreateRequest + * Download an attachment by ID. + * Download Document Attachment + * @param id Document UUID. + * @param attachmentId Attachment UUID. */ - public addDocumentRecipient(id: string, documentRecipientCreateRequest: DocumentRecipientCreateRequest, _options?: Configuration): Promise { - const result = this.api.addDocumentRecipient(id, documentRecipientCreateRequest, _options); + public downloadDocumentAttachmentWithHttpInfo(id: string, attachmentId: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.downloadDocumentAttachmentWithHttpInfo(id, attachmentId, observableOptions); return result.toPromise(); } /** - * Deleted recipient from document - * Delete Document Recipient - * @param id Document UUID - * @param recipientId Recipient UUID + * Download an attachment by ID. + * Download Document Attachment + * @param id Document UUID. + * @param attachmentId Attachment UUID. */ - public deleteDocumentRecipient(id: string, recipientId: string, _options?: Configuration): Promise { - const result = this.api.deleteDocumentRecipient(id, recipientId, _options); + public downloadDocumentAttachment(id: string, attachmentId: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.downloadDocumentAttachment(id, attachmentId, observableOptions); return result.toPromise(); } /** - * Edit document recipient's details - * Edit Document Recipient + * Returns a list of attachments associated with a specified document. + * List Document Attachments * @param id Document UUID - * @param recipientId Recipient UUID - * @param documentRecipientEditRequest */ - public editDocumentRecipient(id: string, recipientId: string, documentRecipientEditRequest: DocumentRecipientEditRequest, _options?: Configuration): Promise { - const result = this.api.editDocumentRecipient(id, recipientId, documentRecipientEditRequest, _options); + public listDocumentAttachmentsWithHttpInfo(id: string, _options?: PromiseConfigurationOptions): Promise>> { + const observableOptions = wrapOptions(_options); + const result = this.api.listDocumentAttachmentsWithHttpInfo(id, observableOptions); return result.toPromise(); } /** - * Replace document recipient with another contact - * Reassign Document Recipient + * Returns a list of attachments associated with a specified document. + * List Document Attachments * @param id Document UUID - * @param recipientId Recipient UUID - * @param documentRecipientCreateRequest */ - public reassignDocumentRecipient(id: string, recipientId: string, documentRecipientCreateRequest: DocumentRecipientCreateRequest, _options?: Configuration): Promise { - const result = this.api.reassignDocumentRecipient(id, recipientId, documentRecipientCreateRequest, _options); + public listDocumentAttachments(id: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.listDocumentAttachments(id, observableOptions); return result.toPromise(); } @@ -453,206 +925,227 @@ export class PromiseDocumentRecipientsApi { -import { ObservableDocumentsApi } from './ObservableAPI'; +import { ObservableDocumentAuditTrailApi } from './ObservableAPI'; -import { DocumentsApiRequestFactory, DocumentsApiResponseProcessor} from "../apis/DocumentsApi"; -export class PromiseDocumentsApi { - private api: ObservableDocumentsApi +import { DocumentAuditTrailApiRequestFactory, DocumentAuditTrailApiResponseProcessor} from "../apis/DocumentAuditTrailApi"; +export class PromiseDocumentAuditTrailApi { + private api: ObservableDocumentAuditTrailApi public constructor( configuration: Configuration, - requestFactory?: DocumentsApiRequestFactory, - responseProcessor?: DocumentsApiResponseProcessor + requestFactory?: DocumentAuditTrailApiRequestFactory, + responseProcessor?: DocumentAuditTrailApiResponseProcessor ) { - this.api = new ObservableDocumentsApi(configuration, requestFactory, responseProcessor); + this.api = new ObservableDocumentAuditTrailApi(configuration, requestFactory, responseProcessor); } /** - * Document status change - * @param id Specify document ID. - * @param documentStatusChangeRequest + * Retrieves the full audit trail for a specified document. The audit trail includes detailed user actions such as sending, viewing, signing, and editing, along with metadata like timestamps, IP addresses, and user identity. This endpoint is accessible to authorized workspace administrators only. + * List Document Audit Trail + * @param documentId Unique identifier of the document to retrieve the audit trail for. + * @param [limit] Maximum number of items to return. + * @param [offset] Number of items to skip before starting to collect the result set. */ - public changeDocumentStatus(id: string, documentStatusChangeRequest: DocumentStatusChangeRequest, _options?: Configuration): Promise { - const result = this.api.changeDocumentStatus(id, documentStatusChangeRequest, _options); + public listDocumentAuditTrailWithHttpInfo(documentId: string, limit?: number, offset?: number, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.listDocumentAuditTrailWithHttpInfo(documentId, limit, offset, observableOptions); return result.toPromise(); } /** - * Create document - * @param documentCreateRequest Use a PandaDoc template or an existing PDF to create a document. See the creation request examples [by template](/schemas/DocumentCreateByTemplateRequest) and [by pdf](/schemas/DocumentCreateByPdfRequest) - * @param editorVer Set this parameter as `ev1` if you want to create a document from PDF with Classic Editor when both editors are enabled for the workspace. + * Retrieves the full audit trail for a specified document. The audit trail includes detailed user actions such as sending, viewing, signing, and editing, along with metadata like timestamps, IP addresses, and user identity. This endpoint is accessible to authorized workspace administrators only. + * List Document Audit Trail + * @param documentId Unique identifier of the document to retrieve the audit trail for. + * @param [limit] Maximum number of items to return. + * @param [offset] Number of items to skip before starting to collect the result set. */ - public createDocument(documentCreateRequest: DocumentCreateRequest, editorVer?: string, _options?: Configuration): Promise { - const result = this.api.createDocument(documentCreateRequest, editorVer, _options); + public listDocumentAuditTrail(documentId: string, limit?: number, offset?: number, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.listDocumentAuditTrail(documentId, limit, offset, observableOptions); return result.toPromise(); } - /** - * Create a Document Link - * @param id Document ID - * @param documentCreateLinkRequest - */ - public createDocumentLink(id: string, documentCreateLinkRequest: DocumentCreateLinkRequest, _options?: Configuration): Promise { - const result = this.api.createDocumentLink(id, documentCreateLinkRequest, _options); - return result.toPromise(); + +} + + + +import { ObservableDocumentFieldsApi } from './ObservableAPI'; + +import { DocumentFieldsApiRequestFactory, DocumentFieldsApiResponseProcessor} from "../apis/DocumentFieldsApi"; +export class PromiseDocumentFieldsApi { + private api: ObservableDocumentFieldsApi + + public constructor( + configuration: Configuration, + requestFactory?: DocumentFieldsApiRequestFactory, + responseProcessor?: DocumentFieldsApiResponseProcessor + ) { + this.api = new ObservableDocumentFieldsApi(configuration, requestFactory, responseProcessor); } /** - * Create Linked Object - * @param id Specify document ID. - * @param linkedObjectCreateRequest + * Creates fields for a particular document. For CFR11-compliant workspaces (21 CFR Part 11), signature fields must have a minimum size of 108×33. + * Create Document Fields + * @param id Document UUID. + * @param createDocumentFieldsRequest */ - public createLinkedObject(id: string, linkedObjectCreateRequest: LinkedObjectCreateRequest, _options?: Configuration): Promise { - const result = this.api.createLinkedObject(id, linkedObjectCreateRequest, _options); + public createDocumentFieldsWithHttpInfo(id: string, createDocumentFieldsRequest: CreateDocumentFieldsRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.createDocumentFieldsWithHttpInfo(id, createDocumentFieldsRequest, observableOptions); return result.toPromise(); } /** - * Delete document by id - * @param id Document ID + * Creates fields for a particular document. For CFR11-compliant workspaces (21 CFR Part 11), signature fields must have a minimum size of 108×33. + * Create Document Fields + * @param id Document UUID. + * @param createDocumentFieldsRequest */ - public deleteDocument(id: string, _options?: Configuration): Promise { - const result = this.api.deleteDocument(id, _options); + public createDocumentFields(id: string, createDocumentFieldsRequest: CreateDocumentFieldsRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.createDocumentFields(id, createDocumentFieldsRequest, observableOptions); return result.toPromise(); } /** - * Delete Linked Object - * @param id Specify document ID. - * @param linkedObjectId Specify linked object ID. + * Return the list of fields for a particular document. + * List Document Fields + * @param id Document UUID. */ - public deleteLinkedObject(id: string, linkedObjectId: string, _options?: Configuration): Promise { - const result = this.api.deleteLinkedObject(id, linkedObjectId, _options); + public listDocumentFieldsWithHttpInfo(id: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.listDocumentFieldsWithHttpInfo(id, observableOptions); return result.toPromise(); } /** - * Document details - * @param id Document ID + * Return the list of fields for a particular document. + * List Document Fields + * @param id Document UUID. */ - public detailsDocument(id: string, _options?: Configuration): Promise { - const result = this.api.detailsDocument(id, _options); + public listDocumentFields(id: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.listDocumentFields(id, observableOptions); return result.toPromise(); } - /** - * Document move to folder - * @param id Specify document ID. - * @param folderId Specify folder ID. - */ - public documentMoveToFolder(id: string, folderId: string, _options?: Configuration): Promise { - const result = this.api.documentMoveToFolder(id, folderId, _options); - return result.toPromise(); + +} + + + +import { ObservableDocumentLinkToCRMApi } from './ObservableAPI'; + +import { DocumentLinkToCRMApiRequestFactory, DocumentLinkToCRMApiResponseProcessor} from "../apis/DocumentLinkToCRMApi"; +export class PromiseDocumentLinkToCRMApi { + private api: ObservableDocumentLinkToCRMApi + + public constructor( + configuration: Configuration, + requestFactory?: DocumentLinkToCRMApiRequestFactory, + responseProcessor?: DocumentLinkToCRMApiResponseProcessor + ) { + this.api = new ObservableDocumentLinkToCRMApi(configuration, requestFactory, responseProcessor); } /** - * Document download + * Create a linked object in the document. > 🚧 > > You can only link each document to each CRM once. This ensures the consistent functionality of the [two-way CRM sync](https://support.pandadoc.com/en/articles/9714877-hubspot-crm#h_3a3344e8-2a6e-4fd8-86be-0da8c121e4ac). > > You can, however, link one document to several external systems. + * Create Linked Object * @param id Specify document ID. - * @param watermarkColor HEX code (for example `#FF5733`). - * @param watermarkFontSize Font size of the watermark. - * @param watermarkOpacity In range 0.0-1.0 - * @param watermarkText Specify watermark text. - * @param separateFiles Set as `true` if you want to receive a zip file with all documents in separate when document transaction contains more than 1. + * @param linkedObjectCreateRequest */ - public downloadDocument(id: string, watermarkColor?: string, watermarkFontSize?: number, watermarkOpacity?: number, watermarkText?: string, separateFiles?: boolean, _options?: Configuration): Promise { - const result = this.api.downloadDocument(id, watermarkColor, watermarkFontSize, watermarkOpacity, watermarkText, separateFiles, _options); + public createLinkedObjectWithHttpInfo(id: string, linkedObjectCreateRequest: LinkedObjectCreateRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.createLinkedObjectWithHttpInfo(id, linkedObjectCreateRequest, observableOptions); return result.toPromise(); } /** - * Download a signed PDF of a completed document - * Download document protected + * Create a linked object in the document. > 🚧 > > You can only link each document to each CRM once. This ensures the consistent functionality of the [two-way CRM sync](https://support.pandadoc.com/en/articles/9714877-hubspot-crm#h_3a3344e8-2a6e-4fd8-86be-0da8c121e4ac). > > You can, however, link one document to several external systems. + * Create Linked Object * @param id Specify document ID. - * @param separateFiles Set as `true` if you want to receive a zip file with all documents in separate when document transaction contains more than 1. - */ - public downloadProtectedDocument(id: string, separateFiles?: boolean, _options?: Configuration): Promise { - const result = this.api.downloadProtectedDocument(id, separateFiles, _options); - return result.toPromise(); - } - - /** - * List documents - * @param completedFrom Return results where the `date_completed` field (ISO 8601) is greater than or equal to this value. - * @param completedTo Return results where the `date_completed` field (ISO 8601) is less than or equal to this value. - * @param contactId Returns results where 'contact_id' is present in document as recipient or approver - * @param count Specify how many document results to return. Default is 50 documents, maximum is 100 documents. - * @param createdFrom Return results where the `date_created` field (ISO 8601) is greater than or equal to this value. - * @param createdTo Return results where the `date_created` field (ISO 8601) is less than this value. - * @param deleted Returns only the deleted documents. - * @param id - * @param folderUuid The UUID of the folder where the documents are stored. - * @param formId Specify the form used for documents creation. This parameter can't be used with template_id. - * @param membershipId Returns results where 'membership_id' is present in document as owner (should be member uuid) - * @param metadata Specify metadata to filter by in the format of `metadata_{metadata-key}={metadata-value}` such as `metadata_opportunity_id=2181432`. The `metadata_` prefix is always required. - * @param modifiedFrom Return results where the `date_modified` field (iso-8601) is greater than or equal to this value. - * @param modifiedTo Return results where the `date_modified` field (iso-8601) is less than this value. - * @param orderBy Specify the order of documents to return. Use `value` (for example, `date_created`) for ASC and `-value` (for example, `-date_created`) for DESC. - * @param page Specify which page of the dataset to return. - * @param q Search query. Filter by document reference number (this token is stored on the template level) or name. - * @param status Specify the status of documents to return. * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review - * @param statusNe Specify the status of documents to return (exclude). * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review - * @param tag Search tag. Filter by document tag. - * @param templateId Specify the template used for documents creation. Parameter can't be used with form_id. + * @param linkedObjectCreateRequest */ - public listDocuments(completedFrom?: string, completedTo?: string, contactId?: string, count?: number, createdFrom?: string, createdTo?: string, deleted?: boolean, id?: string, folderUuid?: string, formId?: string, membershipId?: string, metadata?: Array, modifiedFrom?: string, modifiedTo?: string, orderBy?: DocumentOrderingFieldsEnum, page?: number, q?: string, status?: DocumentStatusRequestEnum, statusNe?: DocumentStatusRequestEnum, tag?: string, templateId?: string, _options?: Configuration): Promise { - const result = this.api.listDocuments(completedFrom, completedTo, contactId, count, createdFrom, createdTo, deleted, id, folderUuid, formId, membershipId, metadata, modifiedFrom, modifiedTo, orderBy, page, q, status, statusNe, tag, templateId, _options); + public createLinkedObject(id: string, linkedObjectCreateRequest: LinkedObjectCreateRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.createLinkedObject(id, linkedObjectCreateRequest, observableOptions); return result.toPromise(); } /** - * List Linked Objects + * Delete a linked object associated with a document. + * Delete Linked Object * @param id Specify document ID. + * @param linkedObjectId Specify linked object ID. */ - public listLinkedObjects(id: string, _options?: Configuration): Promise { - const result = this.api.listLinkedObjects(id, _options); + public deleteLinkedObjectWithHttpInfo(id: string, linkedObjectId: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.deleteLinkedObjectWithHttpInfo(id, linkedObjectId, observableOptions); return result.toPromise(); } /** - * Send Document - * @param id Document ID - * @param documentSendRequest + * Delete a linked object associated with a document. + * Delete Linked Object + * @param id Specify document ID. + * @param linkedObjectId Specify linked object ID. */ - public sendDocument(id: string, documentSendRequest: DocumentSendRequest, _options?: Configuration): Promise { - const result = this.api.sendDocument(id, documentSendRequest, _options); + public deleteLinkedObject(id: string, linkedObjectId: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.deleteLinkedObject(id, linkedObjectId, observableOptions); return result.toPromise(); } /** - * Document status - * @param id Specify document ID. + * Get a list of documents connected to a linked object - an entity from an integration. + * List Documents by Linked Object + * @param entityId You can get entity id from your integration, for example, from a url of a HubSpot deal. + * @param entityType See the available entity types: https://developers.pandadoc.com/reference/link-service#examples-of-the-most-popular-crms + * @param provider See the available providers: https://developers.pandadoc.com/reference/link-service#examples-of-the-most-popular-crms + * @param [orderBy] + * @param [ownerIds] */ - public statusDocument(id: string, _options?: Configuration): Promise { - const result = this.api.statusDocument(id, _options); + public listDocumentsByLinkedObjectWithHttpInfo(entityId: string, entityType: string, provider: string, orderBy?: string, ownerIds?: Array, _options?: PromiseConfigurationOptions): Promise>> { + const observableOptions = wrapOptions(_options); + const result = this.api.listDocumentsByLinkedObjectWithHttpInfo(entityId, entityType, provider, orderBy, ownerIds, observableOptions); return result.toPromise(); } /** - * Transfer all documents ownership - * @param documentTransferAllOwnershipRequest + * Get a list of documents connected to a linked object - an entity from an integration. + * List Documents by Linked Object + * @param entityId You can get entity id from your integration, for example, from a url of a HubSpot deal. + * @param entityType See the available entity types: https://developers.pandadoc.com/reference/link-service#examples-of-the-most-popular-crms + * @param provider See the available providers: https://developers.pandadoc.com/reference/link-service#examples-of-the-most-popular-crms + * @param [orderBy] + * @param [ownerIds] */ - public transferAllDocumentsOwnership(documentTransferAllOwnershipRequest: DocumentTransferAllOwnershipRequest, _options?: Configuration): Promise { - const result = this.api.transferAllDocumentsOwnership(documentTransferAllOwnershipRequest, _options); + public listDocumentsByLinkedObject(entityId: string, entityType: string, provider: string, orderBy?: string, ownerIds?: Array, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.listDocumentsByLinkedObject(entityId, entityType, provider, orderBy, ownerIds, observableOptions); return result.toPromise(); } /** - * Update document ownership + * Get a list of linked objects for the document. + * List Linked Objects * @param id Specify document ID. - * @param documentTransferOwnershipRequest */ - public transferDocumentOwnership(id: string, documentTransferOwnershipRequest: DocumentTransferOwnershipRequest, _options?: Configuration): Promise { - const result = this.api.transferDocumentOwnership(id, documentTransferOwnershipRequest, _options); + public listLinkedObjectsWithHttpInfo(id: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.listLinkedObjectsWithHttpInfo(id, observableOptions); return result.toPromise(); } /** - * Update Document only in the draft status - * @param id Document ID - * @param documentUpdateRequest + * Get a list of linked objects for the document. + * List Linked Objects + * @param id Specify document ID. */ - public updateDocument(id: string, documentUpdateRequest: DocumentUpdateRequest, _options?: Configuration): Promise { - const result = this.api.updateDocument(id, documentUpdateRequest, _options); + public listLinkedObjects(id: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.listLinkedObjects(id, observableOptions); return result.toPromise(); } @@ -661,83 +1154,117 @@ export class PromiseDocumentsApi { -import { ObservableFoldersAPIApi } from './ObservableAPI'; +import { ObservableDocumentRecipientsApi } from './ObservableAPI'; -import { FoldersAPIApiRequestFactory, FoldersAPIApiResponseProcessor} from "../apis/FoldersAPIApi"; -export class PromiseFoldersAPIApi { - private api: ObservableFoldersAPIApi +import { DocumentRecipientsApiRequestFactory, DocumentRecipientsApiResponseProcessor} from "../apis/DocumentRecipientsApi"; +export class PromiseDocumentRecipientsApi { + private api: ObservableDocumentRecipientsApi public constructor( configuration: Configuration, - requestFactory?: FoldersAPIApiRequestFactory, - responseProcessor?: FoldersAPIApiResponseProcessor + requestFactory?: DocumentRecipientsApiRequestFactory, + responseProcessor?: DocumentRecipientsApiResponseProcessor ) { - this.api = new ObservableFoldersAPIApi(configuration, requestFactory, responseProcessor); + this.api = new ObservableDocumentRecipientsApi(configuration, requestFactory, responseProcessor); } /** - * Create a new folder to store your documents. - * Create Documents Folder - * @param documentsFolderCreateRequest + * Add a CC recipient to a document. > 🚧 Before you start > > To add a CC recipient, please ensure that: > > - You have the \'Can Manage Recipients\' permission. > - This recipient is already created in your contacts. If not, add them using the [Create Contact](https://developers.pandadoc.com/reference/create-contact) endpoint. To add a new CC recipient to a document, two parameters must be included in the request body: - `kind`: Set this parameter to `contact` to specify an individual contact. - `id`: Input the ID of the desired contact. To retrieve the contact\'s ID, use the [List Contacts](https://developers.pandadoc.com/reference/list-contacts) endpoint to access a list of all contacts, and then locate the desired contact by searching using the name or email address within the returned list. ### Document status You can add CC recipients in any document status except for the \'Expired\' (`document.voided`) and \'Declined\' (`document.declined`). > 📘 Email notification to access the document > > **Note**: When a document is in one of the following statuses: \'Sent\' (`document.sent`), \'Viewed\' (`document.viewed`), \'Completed\' (`document.completed`), \'Waiting for Payment\' (`document.waiting_pay`), or \'Paid\' (`document.paid`), any added CC recipient will receive an instant notification at their email address, allowing them access to the document. + * Add Document Recipient + * @param id Document UUID + * @param documentRecipientCreateRequest */ - public createDocumentFolder(documentsFolderCreateRequest: DocumentsFolderCreateRequest, _options?: Configuration): Promise { - const result = this.api.createDocumentFolder(documentsFolderCreateRequest, _options); + public addDocumentRecipientWithHttpInfo(id: string, documentRecipientCreateRequest: DocumentRecipientCreateRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.addDocumentRecipientWithHttpInfo(id, documentRecipientCreateRequest, observableOptions); return result.toPromise(); } /** - * Create a new folder to store your templates. - * Create Templates Folder - * @param templatesFolderCreateRequest + * Add a CC recipient to a document. > 🚧 Before you start > > To add a CC recipient, please ensure that: > > - You have the \'Can Manage Recipients\' permission. > - This recipient is already created in your contacts. If not, add them using the [Create Contact](https://developers.pandadoc.com/reference/create-contact) endpoint. To add a new CC recipient to a document, two parameters must be included in the request body: - `kind`: Set this parameter to `contact` to specify an individual contact. - `id`: Input the ID of the desired contact. To retrieve the contact\'s ID, use the [List Contacts](https://developers.pandadoc.com/reference/list-contacts) endpoint to access a list of all contacts, and then locate the desired contact by searching using the name or email address within the returned list. ### Document status You can add CC recipients in any document status except for the \'Expired\' (`document.voided`) and \'Declined\' (`document.declined`). > 📘 Email notification to access the document > > **Note**: When a document is in one of the following statuses: \'Sent\' (`document.sent`), \'Viewed\' (`document.viewed`), \'Completed\' (`document.completed`), \'Waiting for Payment\' (`document.waiting_pay`), or \'Paid\' (`document.paid`), any added CC recipient will receive an instant notification at their email address, allowing them access to the document. + * Add Document Recipient + * @param id Document UUID + * @param documentRecipientCreateRequest */ - public createTemplateFolder(templatesFolderCreateRequest: TemplatesFolderCreateRequest, _options?: Configuration): Promise { - const result = this.api.createTemplateFolder(templatesFolderCreateRequest, _options); + public addDocumentRecipient(id: string, documentRecipientCreateRequest: DocumentRecipientCreateRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.addDocumentRecipient(id, documentRecipientCreateRequest, observableOptions); return result.toPromise(); } /** - * Get the list of folders that contain Documents in your account. - * List Documents Folders - * @param parentUuid The UUID of the folder containing folders. To list the folders located in the root folder, remove this parameter in the request. - * @param count Optionally, specify how many folders to return. Default is 50 folders, maximum is 100 folders. - * @param page Optionally, specify which page of the dataset to return. + * Remove a recipient from a document. > 🚧 Before you start > > Please ensure that you have the \'Can Manage Recipients\' permission. To remove a recipient from a document, you must specify their ID in the path parameter (note that this is different from their contact\'s ID). The recipient\'s ID can be retrieved via the [Document Details](https://developers.pandadoc.com/reference/document-details) endpoint. ### Document status - Removing a signer is only possible when the document is in the \'Draft\' (`document.draft`) status and this action will unassign all fields associated with that signer. - Removing a CC recipient is allowed in any document status except for the \'Expired\' (`document.voided`) and \'Declined\' (`document.declined`). If a CC recipient is removed, their access will be revoked. + * Delete Document Recipient + * @param id Document UUID + * @param recipientId Recipient UUID */ - public listDocumentFolders(parentUuid?: string, count?: number, page?: number, _options?: Configuration): Promise { - const result = this.api.listDocumentFolders(parentUuid, count, page, _options); + public deleteDocumentRecipientWithHttpInfo(id: string, recipientId: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.deleteDocumentRecipientWithHttpInfo(id, recipientId, observableOptions); return result.toPromise(); } /** - * Get the list of folders that contain Templates in your account. - * List Templates Folders - * @param parentUuid The UUID of the folder containing folders. To list the folders located in the root folder, remove this parameter in the request. - * @param count Optionally, specify how many folders to return. Default is 50 folders, maximum is 100 folders. - * @param page Optionally, specify which page of the dataset to return. + * Remove a recipient from a document. > 🚧 Before you start > > Please ensure that you have the \'Can Manage Recipients\' permission. To remove a recipient from a document, you must specify their ID in the path parameter (note that this is different from their contact\'s ID). The recipient\'s ID can be retrieved via the [Document Details](https://developers.pandadoc.com/reference/document-details) endpoint. ### Document status - Removing a signer is only possible when the document is in the \'Draft\' (`document.draft`) status and this action will unassign all fields associated with that signer. - Removing a CC recipient is allowed in any document status except for the \'Expired\' (`document.voided`) and \'Declined\' (`document.declined`). If a CC recipient is removed, their access will be revoked. + * Delete Document Recipient + * @param id Document UUID + * @param recipientId Recipient UUID */ - public listTemplateFolders(parentUuid?: string, count?: number, page?: number, _options?: Configuration): Promise { - const result = this.api.listTemplateFolders(parentUuid, count, page, _options); + public deleteDocumentRecipient(id: string, recipientId: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.deleteDocumentRecipient(id, recipientId, observableOptions); return result.toPromise(); } /** - * Rename Documents Folder. - * Rename Documents Folder - * @param id The UUID of the folder that you are renaming. - * @param documentsFolderRenameRequest + * Modify recipient\'s personal details. > 🚧 Before you start > > To edit a recipient, please ensure that you have the \'Can Edit Document\' permission. Use this endpoint to easily fix typos in a recipient\'s name or email, or to change any other recipient information in a sent document. > 📘 Please note that changes made to a recipient within a document will also update their `Contact` information. However, these changes will not update information about this recipient in other documents where they have already been added. ### Document status - You can edit a signer in the following document statuses: - \'Draft\' (`document.draft`), - \'Waiting Approval\' (`document.waiting_approval`), - \'Approved\' (`document.approved`), - \'Rejected\' (`document.rejected`), - \'Sent\' (`document.sent`), - \'Viewed\' (`document.viewed`), but only until they have signed the document. - You can edit a CC recipient in any document status **except**: - \'Expired\' (`document.voided`), - \'Declined\' (`document.declined`). > 📘 Updating a recipient\'s email after sending a document > > **Note**: If you update a recipient\'s email address after sending a document, they will receive an instant notification at the new email address, allowing them access to the document. Access via the previous email will be revoked. ### Restrictions for updating a recipient\'s email - You cannot change emails of PandaDoc users. - You cannot use the email addresses of existing contacts. If you need to use an email from an existing contact, use the [Change Signer](https://developers.pandadoc.com/reference/change-signer) endpoint to replace a signer with this contact. + * Update Document Recipient + * @param id Document UUID. + * @param recipientId Recipient UUID. + * @param documentRecipientEditRequest */ - public renameDocumentFolder(id: string, documentsFolderRenameRequest: DocumentsFolderRenameRequest, _options?: Configuration): Promise { - const result = this.api.renameDocumentFolder(id, documentsFolderRenameRequest, _options); + public editDocumentRecipientWithHttpInfo(id: string, recipientId: string, documentRecipientEditRequest: DocumentRecipientEditRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.editDocumentRecipientWithHttpInfo(id, recipientId, documentRecipientEditRequest, observableOptions); return result.toPromise(); } /** - * Rename a templates folder. - * Rename Templates Folder - * @param id The UUID of the folder which you are renaming. - * @param templatesFolderRenameRequest + * Modify recipient\'s personal details. > 🚧 Before you start > > To edit a recipient, please ensure that you have the \'Can Edit Document\' permission. Use this endpoint to easily fix typos in a recipient\'s name or email, or to change any other recipient information in a sent document. > 📘 Please note that changes made to a recipient within a document will also update their `Contact` information. However, these changes will not update information about this recipient in other documents where they have already been added. ### Document status - You can edit a signer in the following document statuses: - \'Draft\' (`document.draft`), - \'Waiting Approval\' (`document.waiting_approval`), - \'Approved\' (`document.approved`), - \'Rejected\' (`document.rejected`), - \'Sent\' (`document.sent`), - \'Viewed\' (`document.viewed`), but only until they have signed the document. - You can edit a CC recipient in any document status **except**: - \'Expired\' (`document.voided`), - \'Declined\' (`document.declined`). > 📘 Updating a recipient\'s email after sending a document > > **Note**: If you update a recipient\'s email address after sending a document, they will receive an instant notification at the new email address, allowing them access to the document. Access via the previous email will be revoked. ### Restrictions for updating a recipient\'s email - You cannot change emails of PandaDoc users. - You cannot use the email addresses of existing contacts. If you need to use an email from an existing contact, use the [Change Signer](https://developers.pandadoc.com/reference/change-signer) endpoint to replace a signer with this contact. + * Update Document Recipient + * @param id Document UUID. + * @param recipientId Recipient UUID. + * @param documentRecipientEditRequest + */ + public editDocumentRecipient(id: string, recipientId: string, documentRecipientEditRequest: DocumentRecipientEditRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.editDocumentRecipient(id, recipientId, documentRecipientEditRequest, observableOptions); + return result.toPromise(); + } + + /** + * Reassign fields to another signer. > 🚧 Before you start > > To change a signer in a document, please ensure that: > > - You have the \'Can Manage Recipients\' permission. > - New signer is already created in your contacts. If not, add them using the [Create Contact](https://developers.pandadoc.com/reference/create-contact) endpoint. You can reassign fields to another signer before the original signer has signed the document. You can choose any person except those recipients who have already signed the document. The endpoint path includes the `recipient_id` of the original signer and the request body must include the following two parameters: - `kind`: Set this parameter to `contact` to specify an individual contact. - `id`: Input the ID of the contact you want to use as a replacement for the original signer. To retrieve the contact\'s ID, use the [List Contacts](https://developers.pandadoc.com/reference/list-contacts) endpoint to access a list of all contacts, and then locate the desired contact by searching using the name or email address within the returned list. Once you execute the call to change the signer, the original signer will be entirely removed from the document. If you wish to retain the original signer as a CC recipient, you can re-add them using the [Add CC Recipient](https://developers.pandadoc.com/reference/add-new-recipient-cc) endpoint. > 🚧 Pre-filled fields > > If you change the signer in a document that has already been sent, the signer\'s pre-filled fields will be completely reset. In the \'Draft\' (`document.draft`) status, pre-filled fields will remain. + * Change Signer (Reassign Document Recipient) + * @param id Document UUID + * @param recipientId Recipient UUID + * @param documentRecipientCreateRequest + */ + public reassignDocumentRecipientWithHttpInfo(id: string, recipientId: string, documentRecipientCreateRequest: DocumentRecipientCreateRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.reassignDocumentRecipientWithHttpInfo(id, recipientId, documentRecipientCreateRequest, observableOptions); + return result.toPromise(); + } + + /** + * Reassign fields to another signer. > 🚧 Before you start > > To change a signer in a document, please ensure that: > > - You have the \'Can Manage Recipients\' permission. > - New signer is already created in your contacts. If not, add them using the [Create Contact](https://developers.pandadoc.com/reference/create-contact) endpoint. You can reassign fields to another signer before the original signer has signed the document. You can choose any person except those recipients who have already signed the document. The endpoint path includes the `recipient_id` of the original signer and the request body must include the following two parameters: - `kind`: Set this parameter to `contact` to specify an individual contact. - `id`: Input the ID of the contact you want to use as a replacement for the original signer. To retrieve the contact\'s ID, use the [List Contacts](https://developers.pandadoc.com/reference/list-contacts) endpoint to access a list of all contacts, and then locate the desired contact by searching using the name or email address within the returned list. Once you execute the call to change the signer, the original signer will be entirely removed from the document. If you wish to retain the original signer as a CC recipient, you can re-add them using the [Add CC Recipient](https://developers.pandadoc.com/reference/add-new-recipient-cc) endpoint. > 🚧 Pre-filled fields > > If you change the signer in a document that has already been sent, the signer\'s pre-filled fields will be completely reset. In the \'Draft\' (`document.draft`) status, pre-filled fields will remain. + * Change Signer (Reassign Document Recipient) + * @param id Document UUID + * @param recipientId Recipient UUID + * @param documentRecipientCreateRequest */ - public renameTemplateFolder(id: string, templatesFolderRenameRequest: TemplatesFolderRenameRequest, _options?: Configuration): Promise { - const result = this.api.renameTemplateFolder(id, templatesFolderRenameRequest, _options); + public reassignDocumentRecipient(id: string, recipientId: string, documentRecipientCreateRequest: DocumentRecipientCreateRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.reassignDocumentRecipient(id, recipientId, documentRecipientCreateRequest, observableOptions); return result.toPromise(); } @@ -746,32 +1273,1413 @@ export class PromiseFoldersAPIApi { -import { ObservableFormsApi } from './ObservableAPI'; +import { ObservableDocumentRemindersApi } from './ObservableAPI'; -import { FormsApiRequestFactory, FormsApiResponseProcessor} from "../apis/FormsApi"; -export class PromiseFormsApi { - private api: ObservableFormsApi +import { DocumentRemindersApiRequestFactory, DocumentRemindersApiResponseProcessor} from "../apis/DocumentRemindersApi"; +export class PromiseDocumentRemindersApi { + private api: ObservableDocumentRemindersApi + + public constructor( + configuration: Configuration, + requestFactory?: DocumentRemindersApiRequestFactory, + responseProcessor?: DocumentRemindersApiResponseProcessor + ) { + this.api = new ObservableDocumentRemindersApi(configuration, requestFactory, responseProcessor); + } + + /** + * Sends manual reminders to one or more recipients of a specified document. + * Send Manual Reminder + * @param documentId The UUID of the document. + * @param documentSendManualReminderRequest + */ + public createManualReminderWithHttpInfo(documentId: string, documentSendManualReminderRequest: DocumentSendManualReminderRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.createManualReminderWithHttpInfo(documentId, documentSendManualReminderRequest, observableOptions); + return result.toPromise(); + } + + /** + * Sends manual reminders to one or more recipients of a specified document. + * Send Manual Reminder + * @param documentId The UUID of the document. + * @param documentSendManualReminderRequest + */ + public createManualReminder(documentId: string, documentSendManualReminderRequest: DocumentSendManualReminderRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.createManualReminder(documentId, documentSendManualReminderRequest, observableOptions); + return result.toPromise(); + } + + /** + * Retrieves the current auto reminder configuration for a specified document. + * Document Auto Reminder Settings + * @param documentId The UUID of the document. + */ + public getDocumentAutoReminderSettingsWithHttpInfo(documentId: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.getDocumentAutoReminderSettingsWithHttpInfo(documentId, observableOptions); + return result.toPromise(); + } + + /** + * Retrieves the current auto reminder configuration for a specified document. + * Document Auto Reminder Settings + * @param documentId The UUID of the document. + */ + public getDocumentAutoReminderSettings(documentId: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.getDocumentAutoReminderSettings(documentId, observableOptions); + return result.toPromise(); + } + + /** + * Retrieves the current auto reminder status per recipient for a specified document. Recipients who could not receive reminders due to validations (recipient groups, non-signers, etc.) will be skipped and not included in the response. + * Document Auto Reminder Status + * @param documentId The UUID of the document. + */ + public statusDocumentAutoReminderWithHttpInfo(documentId: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.statusDocumentAutoReminderWithHttpInfo(documentId, observableOptions); + return result.toPromise(); + } + + /** + * Retrieves the current auto reminder status per recipient for a specified document. Recipients who could not receive reminders due to validations (recipient groups, non-signers, etc.) will be skipped and not included in the response. + * Document Auto Reminder Status + * @param documentId The UUID of the document. + */ + public statusDocumentAutoReminder(documentId: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.statusDocumentAutoReminder(documentId, observableOptions); + return result.toPromise(); + } + + /** + * Configures automatic reminders for document recipients. These reminders are sent after the document\'s initial dispatch. Settings include enabling reminders, delivery method (email/SMS), initial delay, and recurrence frequency. + * Update Document Auto Reminder Settings + * @param documentId The UUID of the document. + * @param updateDocumentAutoRemindersRequest + */ + public updateDocumentAutoReminderSettingsWithHttpInfo(documentId: string, updateDocumentAutoRemindersRequest: UpdateDocumentAutoRemindersRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.updateDocumentAutoReminderSettingsWithHttpInfo(documentId, updateDocumentAutoRemindersRequest, observableOptions); + return result.toPromise(); + } + + /** + * Configures automatic reminders for document recipients. These reminders are sent after the document\'s initial dispatch. Settings include enabling reminders, delivery method (email/SMS), initial delay, and recurrence frequency. + * Update Document Auto Reminder Settings + * @param documentId The UUID of the document. + * @param updateDocumentAutoRemindersRequest + */ + public updateDocumentAutoReminderSettings(documentId: string, updateDocumentAutoRemindersRequest: UpdateDocumentAutoRemindersRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.updateDocumentAutoReminderSettings(documentId, updateDocumentAutoRemindersRequest, observableOptions); + return result.toPromise(); + } + + +} + + + +import { ObservableDocumentSectionsBundlesApi } from './ObservableAPI'; + +import { DocumentSectionsBundlesApiRequestFactory, DocumentSectionsBundlesApiResponseProcessor} from "../apis/DocumentSectionsBundlesApi"; +export class PromiseDocumentSectionsBundlesApi { + private api: ObservableDocumentSectionsBundlesApi + + public constructor( + configuration: Configuration, + requestFactory?: DocumentSectionsBundlesApiRequestFactory, + responseProcessor?: DocumentSectionsBundlesApiResponseProcessor + ) { + this.api = new ObservableDocumentSectionsBundlesApi(configuration, requestFactory, responseProcessor); + } + + /** + * Removes selected section from the document. + * Delete Document Section + * @param documentId Specify document ID. + * @param sectionId Specify section ID. + */ + public deleteSectionWithHttpInfo(documentId: string, sectionId: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.deleteSectionWithHttpInfo(documentId, sectionId, observableOptions); + return result.toPromise(); + } + + /** + * Removes selected section from the document. + * Delete Document Section + * @param documentId Specify document ID. + * @param sectionId Specify section ID. + */ + public deleteSection(documentId: string, sectionId: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.deleteSection(documentId, sectionId, observableOptions); + return result.toPromise(); + } + + /** + * Retrieve information about the sections within a document. + * List Document Sections + * @param documentId Document ID + */ + public listSectionsWithHttpInfo(documentId: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.listSectionsWithHttpInfo(documentId, observableOptions); + return result.toPromise(); + } + + /** + * Retrieve information about the sections within a document. + * List Document Sections + * @param documentId Document ID + */ + public listSections(documentId: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.listSections(documentId, observableOptions); + return result.toPromise(); + } + + /** + * Receive the upload status of the document and sections by their `upload_id`. Requesting document section upload status is useful to ensure a document section upload is in the expected state before calling additional API methods. In response, you receive an array with `sections_uuid`. You can receive information about each section using the [Document Section Info](https://developers.pandadoc.com/reference/document-section-info) endpoint. ```json \"section_uuids\": [ \"H8T8CJofGY6JwTsWsPuDEF\", \"8MwLaU4SaZywqLiDk26mDF\" ] ``` ## Available Document Section Upload Statuses The following is a complete list of all possible document statuses returned: | Document Status | Status Description | | :----------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `document_sections_upload.UPLOADED` | The document section upload process has just been created. It is in processing and will be in `document_sections_upload.PROCESSED` state momentarily. | | `document_sections_upload.PROCESSED` | The document sections upload is processed and the sections are already created in the document. All aspects of the document sections can be edited in this state. | | `document_sections_upload.ERROR` | Document section upload procces has been failed. For more information check error details in the response. | + * Document Section Upload Status + * @param documentId Document ID. + * @param uploadId Upload ID. + */ + public sectionDetailsWithHttpInfo(documentId: string, uploadId: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.sectionDetailsWithHttpInfo(documentId, uploadId, observableOptions); + return result.toPromise(); + } + + /** + * Receive the upload status of the document and sections by their `upload_id`. Requesting document section upload status is useful to ensure a document section upload is in the expected state before calling additional API methods. In response, you receive an array with `sections_uuid`. You can receive information about each section using the [Document Section Info](https://developers.pandadoc.com/reference/document-section-info) endpoint. ```json \"section_uuids\": [ \"H8T8CJofGY6JwTsWsPuDEF\", \"8MwLaU4SaZywqLiDk26mDF\" ] ``` ## Available Document Section Upload Statuses The following is a complete list of all possible document statuses returned: | Document Status | Status Description | | :----------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `document_sections_upload.UPLOADED` | The document section upload process has just been created. It is in processing and will be in `document_sections_upload.PROCESSED` state momentarily. | | `document_sections_upload.PROCESSED` | The document sections upload is processed and the sections are already created in the document. All aspects of the document sections can be edited in this state. | | `document_sections_upload.ERROR` | Document section upload procces has been failed. For more information check error details in the response. | + * Document Section Upload Status + * @param documentId Document ID. + * @param uploadId Upload ID. + */ + public sectionDetails(documentId: string, uploadId: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.sectionDetails(documentId, uploadId, observableOptions); + return result.toPromise(); + } + + /** + * Receive information about each section. + * Document Section Details + * @param documentId Document ID. + * @param sectionId Section ID. + */ + public sectionInfoWithHttpInfo(documentId: string, sectionId: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.sectionInfoWithHttpInfo(documentId, sectionId, observableOptions); + return result.toPromise(); + } + + /** + * Receive information about each section. + * Document Section Details + * @param documentId Document ID. + * @param sectionId Section ID. + */ + public sectionInfo(documentId: string, sectionId: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.sectionInfo(documentId, sectionId, observableOptions); + return result.toPromise(); + } + + /** + * With this endpoint, you can add a new section to an existing PandaDoc document (create a bundle). You can upload a section to the document using a PandaDoc template or a file by URL. > ⏱️ Document Section creation is a non-blocking (asynchronous) operation > > The document creation process may take some time. > > With a successful request, you receive a response with the created upload ID and status `document_sections_upload.uploaded`. After processing completes on our servers, usually a few seconds, the document moves to the `document_sections_upload.PROCESSED` status. ## Using a PandaDoc template
> 🚧 Current Version Limitations > > Images in sections are currently not supported. > 📘 Pricing tables note > > Each pricing table must have a unique name to populate it with data correctly. A PandaDoc template is a document template created and edited in the PandaDoc web application. Our [help center](https://support.pandadoc.com/en/articles/9714616-save-time-with-a-reusable-template) has further information on PandaDoc templates. If you don\'t have any PandaDoc Template yet, you can easily create one by clicking [Copy a Sample PandaDoc template](https://app.pandadoc.com/get-this-template/?pt=public_template&pub=eiC3a6qBVfEfbw7VCYgaeN). This will open the PandaDoc application in a new tab, copy the sample template into your account, and create a new document from the template.
## Using a File by URL
Using this endpoint you can add a section to the existing document. The section is created from a file you upload. The file can be a PDF, DocX, or RTF. > 📘 We\'ve prepared two samples that you can use to test the request. > Download them here: > > - [Download a Sample PDF with Form Fields](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) > - [Download a Sample PDF with Field Tags](https://5132871.fs1.hubspotusercontent-na1.net/hubfs/5132871/SamplePandaDocPdf_FieldTags_updated.pdf) > ❗️ Limitations > > * This method does not support multiple documents. > * The maximum supported file size is 50 MB. API returns \"413 Request entity too large\" in case of bigger files. > * PandaDoc does not support creating document from a PDF with encrypted files (to check whether a file is encrypted or not, try Get info -> Secure: Password Encrypted). ### PDF Form Fields PandaDoc recognizes PDF form fields. To enable this feature, pass the optional `parse_form_fields` value as `true` when making a create document section API call. We support Text fields, Dropdowns, and Signature fields. If you would like to pass additional parameters to configure PDF form fields, use the PDF field name as an optId. You can use a PDF editor such as Adobe Acrobat, Foxit to get and edit field names in your PDF. [**Download a Sample PDF with Form Fields**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) ### PDF/DocX/RTF Field Tags This parsing format allows a word processor such as [Microsoft Word](https://support.office.com/en-us/article/Save-as-PDF-d85416c5-7d77-4fd6-a216-6f4bf7c7c110?ui=en-US&rs=en-US&ad=US) or [Google Docs](https://support.google.com/drive/answer/2423534?co=GENIE.Platform%3DDesktop&hl=en) to prepare a document and save it in PDF, DocX or RTF format. Within the text, PandaDoc parses field tags. A field tag starts and ends with brackets. The field tag includes basic information on how to create a form field in the PandaDoc document. The request JSON object `optId` can also extend this information for even greater control. Here is an example of how the field tag in a PDF/DocX/RTF is converted to a text field in the PandaDoc document: ![](https://files.readme.io/38afedf-ex3.png \"ex3.png\") [**Download a Sample PDF with Field Tags**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FieldTags.pdf) #### PDF Field Tag Key ![](https://files.readme.io/a81fbf1-field-tag-structure.png \"field-tag-structure.png\") | Number | Key | Description | Example | | :----- | :---------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------- | | 1 | `fieldType` | Field type from the table documented below | `signature`, or `s` for shorthand | | 2 | `*` | Optional `*` denotes the field is not required | `*` | | 3 | `role` | Role name. Associate the field tag with a recipient role. Roles must be assigned to recipients in the request body. In this case we are using role `s1` to keep the length short and denote the concept of \"signer 1\". `s1` would be the value passed as role in a recipient JSON object. | `s1` | | 4 | `optId` | Optional field Id. Specify more information about the field tag within the post request by using this id. | `sigBox17` | | 5 | `_____` | Use underscores to widen the field if desired. The form fields in PandaDoc will scale to the length and size of your field tag. | `_____` | > 🚧 Role names restrictions > > Underscores are not supported in role names for a file with a Field Tag. #### PDF/DocX/RTF Field Tag Supported Types | Field Type | Short Notation | Is PandaDoc Field | | :---------- | :------------- | :---------------- | | `textfield` | `t` | Field | | `checkbox` | `c` | Field | | `signature` | `s` | Field | | `date` | `d` | Field | | `initials` | `i` | Field | | `dropdown` | `dd` | Field | ```json Field Tags Example \"fields\": { \"textfield\": { \"value\": \"Jane\", \"role\": \"user\" }, \"dropdown\": { \"value\": \"opt1\", \"role\": \"user\", \"options\":[ \"opt1\", \"opt2\", \"opt3\" ] }, \"checkbox\": { \"value\": true, \"role\": \"user\" }, \"date\":{ \"value\": \"2022-05-20\", \"role\": \"user\" }, \"signature\": { \"value\": \"\", \"role\": \"user\" } } ``` > 📘 Fields in PandaDoc > > The following article explains how to use Fields: [Everything you need to know about Fields](https://support.pandadoc.com/en/articles/9714583-fields) ### Signing order Set a signing order for document section sections created from a file. ```json \"recipients\": [ { \"email\": \"josh@example.com\", \"first_name\": \"Josh\", \"last_name\": \"Ron\", \"role\": \"user\", \"signing_order\": 1 } ] ``` > 📘 Signing order in PandaDoc > > The following article explains how to use signing order: [How to use signing order](https://support.pandadoc.com/en/articles/9714771-signing-order) ### Error handling | Error description | Type | Root cause | |---|---|---| | Document version 1 is not supported. | Validation errors: Form fields | The creation document section is supported only for document version 2 | | PDF content hasn\'t been processed: document is broken or locked | Processing errors: Failed to process document content | Document converter service can’t process PDF. This may be caused by locked PDF or if it’s broken. | | Error occurred while parsing PDF field tags. Please try PDF flattening or reach out to support | Processing errors: Field tag / Form field validation error | Doc converter managed to parse PDF and extract tags, but at least 1 of them is invalid (having negative position, for example). Usually we recommend PDF flattening and it helps | | No role=\'{role}\' for field tag specified in `recipients` found, roles passed were {roles} | Validation errors: Field tags | Role is invalid. When the role specified in field tag is empty or wasn’t provided in a payload for any recipient | | All field tags within PDF must be declared within `fields`  object of the JSON Payload. No field with optId=\'{optid}\' found in fields object, fields passed were {optids} | Validation errors: Field tags | Label is invalid. Occurs when **optId** specified in field tag is empty or no field with **name = optId** was provided in a payload | | One of field tags in PDF with type=\'{field}\' doesn\'t have a role | Validation errors: Field tags | Field tag in PDF has no role. One of field tags in PDF with type=% doesn\'t have a role. | | Role for form field with name=\'{role}\' is not provided in payload | Validation errors: Form fields | Role for form field with ‘name’ is not provided. Occurs when `role` for form field with name=%s  is not provided in payload | | Field for form field with name=\'{name}\' is not specified in payload, available names are {names} | Validation errors: Form fields | Field ‘name’ is not specified in payload. Occurs when no field with name = form field name was provided in a payload | | No role=\'{role}\' for form field specified in \'recipients\' found, roles passed were {roles}\" | Validation errors: Form fields | Failed to resolve field actor for `role` in form field with ‘name’.   Occurs when role from the form field is not found in recipient’s from payload | | Failed to download file from link {url}. | Source errors | Error on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload | | Failed to download file from link {url} (status code: {status code}) | Source errors | Error with HTTP status code on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload - remote server responded with the HTTP status code | | Content type=\'{type}\' is not supported, available types are {types} | Source errors | Content type is not supported.  Content type should be one of the following: PDF, ZIP, doc, docx, RTF | | The maximum file size is exceeded, limit is {limit} MB | Source errors | The file size has exceeded the allowed limits. An error occurred while trying to download a file that is too large (limit is 50M) |
+ * Create Document Section + * @param documentId Document ID + * @param uploadSectionRequest + * @param [mergeFieldScope] Determines how the fields are mapped when creating a section. * document: Default value. The fields of the entire document are updated. * upload: Only the fields from the created section are updated. The merge field is appended with the upload ID. + */ + public uploadSectionWithHttpInfo(documentId: string, uploadSectionRequest: UploadSectionRequest, mergeFieldScope?: 'document' | 'upload', _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.uploadSectionWithHttpInfo(documentId, uploadSectionRequest, mergeFieldScope, observableOptions); + return result.toPromise(); + } + + /** + * With this endpoint, you can add a new section to an existing PandaDoc document (create a bundle). You can upload a section to the document using a PandaDoc template or a file by URL. > ⏱️ Document Section creation is a non-blocking (asynchronous) operation > > The document creation process may take some time. > > With a successful request, you receive a response with the created upload ID and status `document_sections_upload.uploaded`. After processing completes on our servers, usually a few seconds, the document moves to the `document_sections_upload.PROCESSED` status. ## Using a PandaDoc template
> 🚧 Current Version Limitations > > Images in sections are currently not supported. > 📘 Pricing tables note > > Each pricing table must have a unique name to populate it with data correctly. A PandaDoc template is a document template created and edited in the PandaDoc web application. Our [help center](https://support.pandadoc.com/en/articles/9714616-save-time-with-a-reusable-template) has further information on PandaDoc templates. If you don\'t have any PandaDoc Template yet, you can easily create one by clicking [Copy a Sample PandaDoc template](https://app.pandadoc.com/get-this-template/?pt=public_template&pub=eiC3a6qBVfEfbw7VCYgaeN). This will open the PandaDoc application in a new tab, copy the sample template into your account, and create a new document from the template.
## Using a File by URL
Using this endpoint you can add a section to the existing document. The section is created from a file you upload. The file can be a PDF, DocX, or RTF. > 📘 We\'ve prepared two samples that you can use to test the request. > Download them here: > > - [Download a Sample PDF with Form Fields](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) > - [Download a Sample PDF with Field Tags](https://5132871.fs1.hubspotusercontent-na1.net/hubfs/5132871/SamplePandaDocPdf_FieldTags_updated.pdf) > ❗️ Limitations > > * This method does not support multiple documents. > * The maximum supported file size is 50 MB. API returns \"413 Request entity too large\" in case of bigger files. > * PandaDoc does not support creating document from a PDF with encrypted files (to check whether a file is encrypted or not, try Get info -> Secure: Password Encrypted). ### PDF Form Fields PandaDoc recognizes PDF form fields. To enable this feature, pass the optional `parse_form_fields` value as `true` when making a create document section API call. We support Text fields, Dropdowns, and Signature fields. If you would like to pass additional parameters to configure PDF form fields, use the PDF field name as an optId. You can use a PDF editor such as Adobe Acrobat, Foxit to get and edit field names in your PDF. [**Download a Sample PDF with Form Fields**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) ### PDF/DocX/RTF Field Tags This parsing format allows a word processor such as [Microsoft Word](https://support.office.com/en-us/article/Save-as-PDF-d85416c5-7d77-4fd6-a216-6f4bf7c7c110?ui=en-US&rs=en-US&ad=US) or [Google Docs](https://support.google.com/drive/answer/2423534?co=GENIE.Platform%3DDesktop&hl=en) to prepare a document and save it in PDF, DocX or RTF format. Within the text, PandaDoc parses field tags. A field tag starts and ends with brackets. The field tag includes basic information on how to create a form field in the PandaDoc document. The request JSON object `optId` can also extend this information for even greater control. Here is an example of how the field tag in a PDF/DocX/RTF is converted to a text field in the PandaDoc document: ![](https://files.readme.io/38afedf-ex3.png \"ex3.png\") [**Download a Sample PDF with Field Tags**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FieldTags.pdf) #### PDF Field Tag Key ![](https://files.readme.io/a81fbf1-field-tag-structure.png \"field-tag-structure.png\") | Number | Key | Description | Example | | :----- | :---------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------- | | 1 | `fieldType` | Field type from the table documented below | `signature`, or `s` for shorthand | | 2 | `*` | Optional `*` denotes the field is not required | `*` | | 3 | `role` | Role name. Associate the field tag with a recipient role. Roles must be assigned to recipients in the request body. In this case we are using role `s1` to keep the length short and denote the concept of \"signer 1\". `s1` would be the value passed as role in a recipient JSON object. | `s1` | | 4 | `optId` | Optional field Id. Specify more information about the field tag within the post request by using this id. | `sigBox17` | | 5 | `_____` | Use underscores to widen the field if desired. The form fields in PandaDoc will scale to the length and size of your field tag. | `_____` | > 🚧 Role names restrictions > > Underscores are not supported in role names for a file with a Field Tag. #### PDF/DocX/RTF Field Tag Supported Types | Field Type | Short Notation | Is PandaDoc Field | | :---------- | :------------- | :---------------- | | `textfield` | `t` | Field | | `checkbox` | `c` | Field | | `signature` | `s` | Field | | `date` | `d` | Field | | `initials` | `i` | Field | | `dropdown` | `dd` | Field | ```json Field Tags Example \"fields\": { \"textfield\": { \"value\": \"Jane\", \"role\": \"user\" }, \"dropdown\": { \"value\": \"opt1\", \"role\": \"user\", \"options\":[ \"opt1\", \"opt2\", \"opt3\" ] }, \"checkbox\": { \"value\": true, \"role\": \"user\" }, \"date\":{ \"value\": \"2022-05-20\", \"role\": \"user\" }, \"signature\": { \"value\": \"\", \"role\": \"user\" } } ``` > 📘 Fields in PandaDoc > > The following article explains how to use Fields: [Everything you need to know about Fields](https://support.pandadoc.com/en/articles/9714583-fields) ### Signing order Set a signing order for document section sections created from a file. ```json \"recipients\": [ { \"email\": \"josh@example.com\", \"first_name\": \"Josh\", \"last_name\": \"Ron\", \"role\": \"user\", \"signing_order\": 1 } ] ``` > 📘 Signing order in PandaDoc > > The following article explains how to use signing order: [How to use signing order](https://support.pandadoc.com/en/articles/9714771-signing-order) ### Error handling | Error description | Type | Root cause | |---|---|---| | Document version 1 is not supported. | Validation errors: Form fields | The creation document section is supported only for document version 2 | | PDF content hasn\'t been processed: document is broken or locked | Processing errors: Failed to process document content | Document converter service can’t process PDF. This may be caused by locked PDF or if it’s broken. | | Error occurred while parsing PDF field tags. Please try PDF flattening or reach out to support | Processing errors: Field tag / Form field validation error | Doc converter managed to parse PDF and extract tags, but at least 1 of them is invalid (having negative position, for example). Usually we recommend PDF flattening and it helps | | No role=\'{role}\' for field tag specified in `recipients` found, roles passed were {roles} | Validation errors: Field tags | Role is invalid. When the role specified in field tag is empty or wasn’t provided in a payload for any recipient | | All field tags within PDF must be declared within `fields`  object of the JSON Payload. No field with optId=\'{optid}\' found in fields object, fields passed were {optids} | Validation errors: Field tags | Label is invalid. Occurs when **optId** specified in field tag is empty or no field with **name = optId** was provided in a payload | | One of field tags in PDF with type=\'{field}\' doesn\'t have a role | Validation errors: Field tags | Field tag in PDF has no role. One of field tags in PDF with type=% doesn\'t have a role. | | Role for form field with name=\'{role}\' is not provided in payload | Validation errors: Form fields | Role for form field with ‘name’ is not provided. Occurs when `role` for form field with name=%s  is not provided in payload | | Field for form field with name=\'{name}\' is not specified in payload, available names are {names} | Validation errors: Form fields | Field ‘name’ is not specified in payload. Occurs when no field with name = form field name was provided in a payload | | No role=\'{role}\' for form field specified in \'recipients\' found, roles passed were {roles}\" | Validation errors: Form fields | Failed to resolve field actor for `role` in form field with ‘name’.   Occurs when role from the form field is not found in recipient’s from payload | | Failed to download file from link {url}. | Source errors | Error on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload | | Failed to download file from link {url} (status code: {status code}) | Source errors | Error with HTTP status code on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload - remote server responded with the HTTP status code | | Content type=\'{type}\' is not supported, available types are {types} | Source errors | Content type is not supported.  Content type should be one of the following: PDF, ZIP, doc, docx, RTF | | The maximum file size is exceeded, limit is {limit} MB | Source errors | The file size has exceeded the allowed limits. An error occurred while trying to download a file that is too large (limit is 50M) |
+ * Create Document Section + * @param documentId Document ID + * @param uploadSectionRequest + * @param [mergeFieldScope] Determines how the fields are mapped when creating a section. * document: Default value. The fields of the entire document are updated. * upload: Only the fields from the created section are updated. The merge field is appended with the upload ID. + */ + public uploadSection(documentId: string, uploadSectionRequest: UploadSectionRequest, mergeFieldScope?: 'document' | 'upload', _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.uploadSection(documentId, uploadSectionRequest, mergeFieldScope, observableOptions); + return result.toPromise(); + } + + /** + * With this endpoint, you can add a new section to an existing PandaDoc document (create a bundle). The section is created from a file you upload. The file can be a PDF, DocX, or RTF. > 📘 We\'ve prepared two samples that you can use to test the request. > Download them here: > > - [Download a Sample PDF with Form Fields](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) > - [Download a Sample PDF with Field Tags](https://5132871.fs1.hubspotusercontent-na1.net/hubfs/5132871/SamplePandaDocPdf_FieldTags_updated.pdf) > 🚧 Usage specifics > > 1. This method uses a `multipart/form-data` request type instead of the `application/json` typically found in the PandaDoc API. This is to accommodate the upload of the included document. > 2. You can send a URL instead of a file in the document creation request. > In this case, you need to use the `application/json` content type and add the URL parameter in the body request. As an example, see [Create from public PDF](https://developers.pandadoc.com/docs/create-and-send-a-document-from-a-publicly-available-pdf) guide for more details. > 3. A file you upload is not stored in your PandaDoc account, so you have to upload it with every request. > ❗️ Limitations > > 1. This method does not support multiple documents. > 2. The maximum supported file size is 50 MB. API returns \"413 Request entity too large\" in case of bigger files. > 3. PandaDoc does not support creating document from a PDF with encrypted files (to check whether a file is encrypted or not, try Get info -> Secure: Password Encrypted). > ⏱️ Document Section creation is a non-blocking (asynchronous) operation > > The document creation process may take some time. > > With a successful request, you receive a response with the created upload ID and status `document_sections_upload.uploaded`. After processing completes on our servers, usually a few seconds, the document moves to the `document_sections_upload.PROCESSED` status. ## PDF Form Fields PandaDoc recognizes PDF form fields. To enable this feature, pass the optional `parse_form_fields` value as `true` when making a create document section API call. We support Text fields, Dropdowns, and Signature fields. If you would like to pass additional parameters to configure PDF form fields, use the PDF field name as an optId. You can use a PDF editor such as Adobe Acrobat, Foxit to get and edit field names in your PDF. [**Download a Sample PDF with Form Fields**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) ## PDF/DocX/RTF Field Tags This parsing format allows a word processor such as [Microsoft Word](https://support.office.com/en-us/article/Save-as-PDF-d85416c5-7d77-4fd6-a216-6f4bf7c7c110?ui=en-US&rs=en-US&ad=US) or [Google Docs](https://support.google.com/drive/answer/2423534?co=GENIE.Platform%3DDesktop&hl=en) to prepare a document and save it in PDF, DocX or RTF format. Within the text, PandaDoc parses field tags. A field tag starts and ends with brackets. The field tag includes basic information on how to create a form field in the PandaDoc document. The request JSON object `optId` can also extend this information for even greater control. Here is an example of how the field tag in a PDF/DocX/RTF is converted to a text field in the PandaDoc document: ![](https://files.readme.io/38afedf-ex3.png \"ex3.png\") [**Download a Sample PDF with Field Tags**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FieldTags.pdf)
### PDF Field Tag Key ![](https://files.readme.io/a81fbf1-field-tag-structure.png \"field-tag-structure.png\") | Number | Key | Description | Example | | :----- | :---------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------- | | 1 | `fieldType` | Field type from the table documented below | `signature`, or `s` for shorthand | | 2 | `*` | Optional `*` denotes the field is not required | `*` | | 3 | `role` | Role name. Associate the field tag with a recipient role. Roles must be assigned to recipients in the request body. In this case we are using role `s1` to keep the length short and denote the concept of \"signer 1\". `s1` would be the value passed as role in a recipient JSON object. | `s1` | | 4 | `optId` | Optional field Id. Specify more information about the field tag within the post request by using this id. | `sigBox17` | | 5 | `_____` | Use underscores to widen the field if desired. The form fields in PandaDoc will scale to the length and size of your field tag. | `_____` | > 🚧 Role names restrictions > > Underscores are not supported in role names for a file with a Field Tag. ### PDF/DocX/RTF Field Tag Supported Types | Field Type | Short Notation | Is PandaDoc Field | | :---------- | :------------- | :---------------- | | `textfield` | `t` | Field | | `checkbox` | `c` | Field | | `signature` | `s` | Field | | `date` | `d` | Field | | `initials` | `i` | Field | | `dropdown` | `dd` | Field | > 📘 Fields in PandaDoc > > The following article explains how to use Fields: [Everything you need to know about Fields](https://support.pandadoc.com/en/articles/9714583-fields) ```json Field Tags Example \"fields\": { \"textfield\": { \"value\": \"Jane\", \"role\": \"user\" }, \"dropdown\": { \"value\": \"opt1\", \"role\": \"user\", \"options\":[ \"opt1\", \"opt2\", \"opt3\" ] }, \"checkbox\": { \"value\": true, \"role\": \"user\" }, \"date\":{ \"value\": \"2022-05-20\", \"role\": \"user\" }, \"signature\": { \"value\": \"\", \"role\": \"user\" } } ```
## Signing order Set a signing order for document section sections created from a file. ```json \"recipients\": [ { \"email\": \"josh@example.com\", \"first_name\": \"Josh\", \"last_name\": \"Ron\", \"role\": \"user\", \"signing_order\": 1 } ] ``` ## Error handling | Error description | Type | Root cause | |---|---|---| | Document version 1 is not supported. | Validation errors: Form fields | The creation document section is supported only for document version 2 | | PDF content hasn\'t been processed: document is broken or locked | Processing errors: Failed to process document content | Document converter service can’t process PDF. This may be caused by locked PDF or if it’s broken. | | Error occurred while parsing PDF field tags. Please try PDF flattening or reach out to support | Processing errors: Field tag / Form field validation error | Doc converter managed to parse PDF and extract tags, but at least 1 of them is invalid (having negative position, for example). Usually we recommend PDF flattening and it helps | | No role=\'{role}\' for field tag specified in `recipients` found, roles passed were {roles} | Validation errors: Field tags | Role is invalid. When the role specified in field tag is empty or wasn’t provided in a payload for any recipient | | All field tags within PDF must be declared within `fields`  object of the JSON Payload. No field with optId=\'{optid}\' found in fields object, fields passed were {optids} | Validation errors: Field tags | Label is invalid. Occurs when **optId** specified in field tag is empty or no field with **name = optId** was provided in a payload | | One of field tags in PDF with type=\'{field}\' doesn\'t have a role | Validation errors: Field tags | Field tag in PDF has no role. One of field tags in PDF with type=% doesn\'t have a role. | | Role for form field with name=\'{role}\' is not provided in payload | Validation errors: Form fields | Role for form field with ‘name’ is not provided. Occurs when `role` for form field with name=%s  is not provided in payload | | Field for form field with name=\'{name}\' is not specified in payload, available names are {names} | Validation errors: Form fields | Field ‘name’ is not specified in payload. Occurs when no field with name = form field name was provided in a payload | | No role=\'{role}\' for form field specified in \'recipients\' found, roles passed were {roles}\" | Validation errors: Form fields | Failed to resolve field actor for `role` in form field with ‘name’.   Occurs when role from the form field is not found in recipient’s from payload | | Failed to download file from link {url}. | Source errors | Error on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload | | Failed to download file from link {url} (status code: {status code}) | Source errors | Error with HTTP status code on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload - remote server responded with the HTTP status code | | Content type=\'{type}\' is not supported, available types are {types} | Source errors | Content type is not supported.  Content type should be one of the following: PDF, ZIP, doc, docx, RTF | | The maximum file size is exceeded, limit is {limit} MB | Source errors | The file size has exceeded the allowed limits. An error occurred while trying to download a file that is too large (limit is 50M) | + * Create Document Section from File Upload + * @param documentId Document ID + * @param [mergeFieldScope] Determines how the fields are mapped when creating a section. * document: Default value. The fields of the entire document are updated. * upload: Only the fields from the created section are updated. The merge field is appended with the upload ID. + * @param [file] Binary PDF/DocX/RTF File. + * @param [data] JSON as a multipart/form-data string. + */ + public uploadSectionWithUploadWithHttpInfo(documentId: string, mergeFieldScope?: 'document' | 'upload', file?: HttpFile, data?: UploadSectionRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.uploadSectionWithUploadWithHttpInfo(documentId, mergeFieldScope, file, data, observableOptions); + return result.toPromise(); + } + + /** + * With this endpoint, you can add a new section to an existing PandaDoc document (create a bundle). The section is created from a file you upload. The file can be a PDF, DocX, or RTF. > 📘 We\'ve prepared two samples that you can use to test the request. > Download them here: > > - [Download a Sample PDF with Form Fields](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) > - [Download a Sample PDF with Field Tags](https://5132871.fs1.hubspotusercontent-na1.net/hubfs/5132871/SamplePandaDocPdf_FieldTags_updated.pdf) > 🚧 Usage specifics > > 1. This method uses a `multipart/form-data` request type instead of the `application/json` typically found in the PandaDoc API. This is to accommodate the upload of the included document. > 2. You can send a URL instead of a file in the document creation request. > In this case, you need to use the `application/json` content type and add the URL parameter in the body request. As an example, see [Create from public PDF](https://developers.pandadoc.com/docs/create-and-send-a-document-from-a-publicly-available-pdf) guide for more details. > 3. A file you upload is not stored in your PandaDoc account, so you have to upload it with every request. > ❗️ Limitations > > 1. This method does not support multiple documents. > 2. The maximum supported file size is 50 MB. API returns \"413 Request entity too large\" in case of bigger files. > 3. PandaDoc does not support creating document from a PDF with encrypted files (to check whether a file is encrypted or not, try Get info -> Secure: Password Encrypted). > ⏱️ Document Section creation is a non-blocking (asynchronous) operation > > The document creation process may take some time. > > With a successful request, you receive a response with the created upload ID and status `document_sections_upload.uploaded`. After processing completes on our servers, usually a few seconds, the document moves to the `document_sections_upload.PROCESSED` status. ## PDF Form Fields PandaDoc recognizes PDF form fields. To enable this feature, pass the optional `parse_form_fields` value as `true` when making a create document section API call. We support Text fields, Dropdowns, and Signature fields. If you would like to pass additional parameters to configure PDF form fields, use the PDF field name as an optId. You can use a PDF editor such as Adobe Acrobat, Foxit to get and edit field names in your PDF. [**Download a Sample PDF with Form Fields**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FormFields.pdf) ## PDF/DocX/RTF Field Tags This parsing format allows a word processor such as [Microsoft Word](https://support.office.com/en-us/article/Save-as-PDF-d85416c5-7d77-4fd6-a216-6f4bf7c7c110?ui=en-US&rs=en-US&ad=US) or [Google Docs](https://support.google.com/drive/answer/2423534?co=GENIE.Platform%3DDesktop&hl=en) to prepare a document and save it in PDF, DocX or RTF format. Within the text, PandaDoc parses field tags. A field tag starts and ends with brackets. The field tag includes basic information on how to create a form field in the PandaDoc document. The request JSON object `optId` can also extend this information for even greater control. Here is an example of how the field tag in a PDF/DocX/RTF is converted to a text field in the PandaDoc document: ![](https://files.readme.io/38afedf-ex3.png \"ex3.png\") [**Download a Sample PDF with Field Tags**](https://cdn2.hubspot.net/hubfs/2127247/public-templates/SamplePandaDocPdf_FieldTags.pdf)
### PDF Field Tag Key ![](https://files.readme.io/a81fbf1-field-tag-structure.png \"field-tag-structure.png\") | Number | Key | Description | Example | | :----- | :---------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------- | | 1 | `fieldType` | Field type from the table documented below | `signature`, or `s` for shorthand | | 2 | `*` | Optional `*` denotes the field is not required | `*` | | 3 | `role` | Role name. Associate the field tag with a recipient role. Roles must be assigned to recipients in the request body. In this case we are using role `s1` to keep the length short and denote the concept of \"signer 1\". `s1` would be the value passed as role in a recipient JSON object. | `s1` | | 4 | `optId` | Optional field Id. Specify more information about the field tag within the post request by using this id. | `sigBox17` | | 5 | `_____` | Use underscores to widen the field if desired. The form fields in PandaDoc will scale to the length and size of your field tag. | `_____` | > 🚧 Role names restrictions > > Underscores are not supported in role names for a file with a Field Tag. ### PDF/DocX/RTF Field Tag Supported Types | Field Type | Short Notation | Is PandaDoc Field | | :---------- | :------------- | :---------------- | | `textfield` | `t` | Field | | `checkbox` | `c` | Field | | `signature` | `s` | Field | | `date` | `d` | Field | | `initials` | `i` | Field | | `dropdown` | `dd` | Field | > 📘 Fields in PandaDoc > > The following article explains how to use Fields: [Everything you need to know about Fields](https://support.pandadoc.com/en/articles/9714583-fields) ```json Field Tags Example \"fields\": { \"textfield\": { \"value\": \"Jane\", \"role\": \"user\" }, \"dropdown\": { \"value\": \"opt1\", \"role\": \"user\", \"options\":[ \"opt1\", \"opt2\", \"opt3\" ] }, \"checkbox\": { \"value\": true, \"role\": \"user\" }, \"date\":{ \"value\": \"2022-05-20\", \"role\": \"user\" }, \"signature\": { \"value\": \"\", \"role\": \"user\" } } ```
## Signing order Set a signing order for document section sections created from a file. ```json \"recipients\": [ { \"email\": \"josh@example.com\", \"first_name\": \"Josh\", \"last_name\": \"Ron\", \"role\": \"user\", \"signing_order\": 1 } ] ``` ## Error handling | Error description | Type | Root cause | |---|---|---| | Document version 1 is not supported. | Validation errors: Form fields | The creation document section is supported only for document version 2 | | PDF content hasn\'t been processed: document is broken or locked | Processing errors: Failed to process document content | Document converter service can’t process PDF. This may be caused by locked PDF or if it’s broken. | | Error occurred while parsing PDF field tags. Please try PDF flattening or reach out to support | Processing errors: Field tag / Form field validation error | Doc converter managed to parse PDF and extract tags, but at least 1 of them is invalid (having negative position, for example). Usually we recommend PDF flattening and it helps | | No role=\'{role}\' for field tag specified in `recipients` found, roles passed were {roles} | Validation errors: Field tags | Role is invalid. When the role specified in field tag is empty or wasn’t provided in a payload for any recipient | | All field tags within PDF must be declared within `fields`  object of the JSON Payload. No field with optId=\'{optid}\' found in fields object, fields passed were {optids} | Validation errors: Field tags | Label is invalid. Occurs when **optId** specified in field tag is empty or no field with **name = optId** was provided in a payload | | One of field tags in PDF with type=\'{field}\' doesn\'t have a role | Validation errors: Field tags | Field tag in PDF has no role. One of field tags in PDF with type=% doesn\'t have a role. | | Role for form field with name=\'{role}\' is not provided in payload | Validation errors: Form fields | Role for form field with ‘name’ is not provided. Occurs when `role` for form field with name=%s  is not provided in payload | | Field for form field with name=\'{name}\' is not specified in payload, available names are {names} | Validation errors: Form fields | Field ‘name’ is not specified in payload. Occurs when no field with name = form field name was provided in a payload | | No role=\'{role}\' for form field specified in \'recipients\' found, roles passed were {roles}\" | Validation errors: Form fields | Failed to resolve field actor for `role` in form field with ‘name’.   Occurs when role from the form field is not found in recipient’s from payload | | Failed to download file from link {url}. | Source errors | Error on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload | | Failed to download file from link {url} (status code: {status code}) | Source errors | Error with HTTP status code on attempt to download file.  An error has occurred on an attempt to download file using the provided ‘url’ in payload - remote server responded with the HTTP status code | | Content type=\'{type}\' is not supported, available types are {types} | Source errors | Content type is not supported.  Content type should be one of the following: PDF, ZIP, doc, docx, RTF | | The maximum file size is exceeded, limit is {limit} MB | Source errors | The file size has exceeded the allowed limits. An error occurred while trying to download a file that is too large (limit is 50M) | + * Create Document Section from File Upload + * @param documentId Document ID + * @param [mergeFieldScope] Determines how the fields are mapped when creating a section. * document: Default value. The fields of the entire document are updated. * upload: Only the fields from the created section are updated. The merge field is appended with the upload ID. + * @param [file] Binary PDF/DocX/RTF File. + * @param [data] JSON as a multipart/form-data string. + */ + public uploadSectionWithUpload(documentId: string, mergeFieldScope?: 'document' | 'upload', file?: HttpFile, data?: UploadSectionRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.uploadSectionWithUpload(documentId, mergeFieldScope, file, data, observableOptions); + return result.toPromise(); + } + + +} + + + +import { ObservableDocumentSettingsApi } from './ObservableAPI'; + +import { DocumentSettingsApiRequestFactory, DocumentSettingsApiResponseProcessor} from "../apis/DocumentSettingsApi"; +export class PromiseDocumentSettingsApi { + private api: ObservableDocumentSettingsApi + + public constructor( + configuration: Configuration, + requestFactory?: DocumentSettingsApiRequestFactory, + responseProcessor?: DocumentSettingsApiResponseProcessor + ) { + this.api = new ObservableDocumentSettingsApi(configuration, requestFactory, responseProcessor); + } + + /** + * Retrieves the settings for a specified document. Supported fields: language, qualified_electronic_signature, expires_in (in days). + * Get document settings + * @param documentId Unique identifier of the document to retrieve settings for. + */ + public documentSettingsGetWithHttpInfo(documentId: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.documentSettingsGetWithHttpInfo(documentId, observableOptions); + return result.toPromise(); + } + + /** + * Retrieves the settings for a specified document. Supported fields: language, qualified_electronic_signature, expires_in (in days). + * Get document settings + * @param documentId Unique identifier of the document to retrieve settings for. + */ + public documentSettingsGet(documentId: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.documentSettingsGet(documentId, observableOptions); + return result.toPromise(); + } + + /** + * Updates the settings for a specified document. Supported fields: language, qualified_electronic_signature, expires_in (in days). + * Update document settings + * @param documentId Unique identifier of the document to update settings for. + * @param updateDocumentSettingsRequest + */ + public documentSettingsUpdateWithHttpInfo(documentId: string, updateDocumentSettingsRequest: UpdateDocumentSettingsRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.documentSettingsUpdateWithHttpInfo(documentId, updateDocumentSettingsRequest, observableOptions); + return result.toPromise(); + } + + /** + * Updates the settings for a specified document. Supported fields: language, qualified_electronic_signature, expires_in (in days). + * Update document settings + * @param documentId Unique identifier of the document to update settings for. + * @param updateDocumentSettingsRequest + */ + public documentSettingsUpdate(documentId: string, updateDocumentSettingsRequest: UpdateDocumentSettingsRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.documentSettingsUpdate(documentId, updateDocumentSettingsRequest, observableOptions); + return result.toPromise(); + } + + +} + + + +import { ObservableDocumentsApi } from './ObservableAPI'; + +import { DocumentsApiRequestFactory, DocumentsApiResponseProcessor} from "../apis/DocumentsApi"; +export class PromiseDocumentsApi { + private api: ObservableDocumentsApi + + public constructor( + configuration: Configuration, + requestFactory?: DocumentsApiRequestFactory, + responseProcessor?: DocumentsApiResponseProcessor + ) { + this.api = new ObservableDocumentsApi(configuration, requestFactory, responseProcessor); + } + + /** + * Appends a Content Library Item (CLI) to a document and provides a name mapping for its content blocks. + * Append Content Library Item to a document + * @param id Specify document id. + * @param appendCLIDataRequest + */ + public appendContentLibraryItemToDocumentWithHttpInfo(id: string, appendCLIDataRequest: AppendCLIDataRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.appendContentLibraryItemToDocumentWithHttpInfo(id, appendCLIDataRequest, observableOptions); + return result.toPromise(); + } + + /** + * Appends a Content Library Item (CLI) to a document and provides a name mapping for its content blocks. + * Append Content Library Item to a document + * @param id Specify document id. + * @param appendCLIDataRequest + */ + public appendContentLibraryItemToDocument(id: string, appendCLIDataRequest: AppendCLIDataRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.appendContentLibraryItemToDocument(id, appendCLIDataRequest, observableOptions); + return result.toPromise(); + } + + /** + * PandaDoc has eight document statuses, but you can manually set your document status to only four: ### Document statuses - Completed - `document.completed` - API code `2` - Expired - `document.voided` - code `11` - Paid - `document.paid` - code `10`. **Important**: You can only set it if you have a payment app connected. - Declined - `document.declined` - code `12` > 🚧 Pass a numeric code for the corresponding document status, for example, `2` for `document.completed`. Find more details in [\\[Editor 2.0\\] Manually change document status](https://support.pandadoc.com/en/articles/9714842-manually-change-document-status) topic. | Current Status | To Completed: | To Expired: | To Paid: | To Declined: | |----------------|---------------|-------------|----------|--------------| | Draft | YES | NO | YES | YES | | Approved | NO | NO | NO | NO | | Sent | YES | YES | NO | YES | | Viewed | YES | YES | NO | YES | | Completed (Auto) | NO | NO | NO | YES | | Waithing for payment | NO | NO | YES | YES | | Paid | NO | NO | NO | NO | | Expired | YES | NO | YES | YES | | Declined | YES | NO | YES | NO | > ✅ - from `document.voided` to `document.paid` > > ❌ - from `document.paid` to `document.voided` + * Document Status Change + * @param id Specify document ID. + * @param documentStatusChangeRequest + */ + public changeDocumentStatusWithHttpInfo(id: string, documentStatusChangeRequest: DocumentStatusChangeRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.changeDocumentStatusWithHttpInfo(id, documentStatusChangeRequest, observableOptions); + return result.toPromise(); + } + + /** + * PandaDoc has eight document statuses, but you can manually set your document status to only four: ### Document statuses - Completed - `document.completed` - API code `2` - Expired - `document.voided` - code `11` - Paid - `document.paid` - code `10`. **Important**: You can only set it if you have a payment app connected. - Declined - `document.declined` - code `12` > 🚧 Pass a numeric code for the corresponding document status, for example, `2` for `document.completed`. Find more details in [\\[Editor 2.0\\] Manually change document status](https://support.pandadoc.com/en/articles/9714842-manually-change-document-status) topic. | Current Status | To Completed: | To Expired: | To Paid: | To Declined: | |----------------|---------------|-------------|----------|--------------| | Draft | YES | NO | YES | YES | | Approved | NO | NO | NO | NO | | Sent | YES | YES | NO | YES | | Viewed | YES | YES | NO | YES | | Completed (Auto) | NO | NO | NO | YES | | Waithing for payment | NO | NO | YES | YES | | Paid | NO | NO | NO | NO | | Expired | YES | NO | YES | YES | | Declined | YES | NO | YES | NO | > ✅ - from `document.voided` to `document.paid` > > ❌ - from `document.paid` to `document.voided` + * Document Status Change + * @param id Specify document ID. + * @param documentStatusChangeRequest + */ + public changeDocumentStatus(id: string, documentStatusChangeRequest: DocumentStatusChangeRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.changeDocumentStatus(id, documentStatusChangeRequest, observableOptions); + return result.toPromise(); + } + + /** + * PandaDoc has eight document statuses, but you can manually set your document status to only four: ### Document statuses - Completed - `document.completed` - API code `2` - Expired - `document.voided` - code `11` - Paid - `document.paid` - code `10`. **Important**: You can only set it if you have a payment app connected. - Declined - `document.declined` - code `12` > 🚧 Pass a numeric code for the corresponding document status, for example, `2` for `document.completed`. Find more details in [\\[Editor 2.0\\] Manually change document status](https://support.pandadoc.com/en/articles/9714842-manually-change-document-status) topic. | Current Status | To Completed: | To Expired: | To Paid: | To Declined: | |----------------|---------------|-------------|----------|--------------| | Draft | YES | NO | YES | YES | | Approved | NO | NO | NO | NO | | Sent | YES | YES | NO | YES | | Viewed | YES | YES | NO | YES | | Completed (Auto) | NO | NO | NO | YES | | Waithing for payment | NO | NO | YES | YES | | Paid | NO | NO | NO | NO | | Expired | YES | NO | YES | YES | | Declined | YES | NO | YES | NO | > ✅ - from `document.voided` to `document.paid` > > ❌ - from `document.paid` to `document.voided` + * Document Status Change with Upload + * @param id Specify document ID. + * @param [file] Binary attachment file + * @param [data] JSON as a multipart/form-data string. + */ + public changeDocumentStatusWithUploadWithHttpInfo(id: string, file?: HttpFile, data?: DocumentStatusChangeRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.changeDocumentStatusWithUploadWithHttpInfo(id, file, data, observableOptions); + return result.toPromise(); + } + + /** + * PandaDoc has eight document statuses, but you can manually set your document status to only four: ### Document statuses - Completed - `document.completed` - API code `2` - Expired - `document.voided` - code `11` - Paid - `document.paid` - code `10`. **Important**: You can only set it if you have a payment app connected. - Declined - `document.declined` - code `12` > 🚧 Pass a numeric code for the corresponding document status, for example, `2` for `document.completed`. Find more details in [\\[Editor 2.0\\] Manually change document status](https://support.pandadoc.com/en/articles/9714842-manually-change-document-status) topic. | Current Status | To Completed: | To Expired: | To Paid: | To Declined: | |----------------|---------------|-------------|----------|--------------| | Draft | YES | NO | YES | YES | | Approved | NO | NO | NO | NO | | Sent | YES | YES | NO | YES | | Viewed | YES | YES | NO | YES | | Completed (Auto) | NO | NO | NO | YES | | Waithing for payment | NO | NO | YES | YES | | Paid | NO | NO | NO | NO | | Expired | YES | NO | YES | YES | | Declined | YES | NO | YES | NO | > ✅ - from `document.voided` to `document.paid` > > ❌ - from `document.paid` to `document.voided` + * Document Status Change with Upload + * @param id Specify document ID. + * @param [file] Binary attachment file + * @param [data] JSON as a multipart/form-data string. + */ + public changeDocumentStatusWithUpload(id: string, file?: HttpFile, data?: DocumentStatusChangeRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.changeDocumentStatusWithUpload(id, file, data, observableOptions); + return result.toPromise(); + } + + /** + * ## Create from a template > See the [Create document from template](https://developers.pandadoc.com/docs/create-document-from-template) tutorial for details on how to use this endpoint, as well as a sample template. ## Create from a URL > See the [Create from public PDF](https://developers.pandadoc.com/docs/create-and-send-a-document-from-a-publicly-available-pdf) guide for info about roles and fields, as well as PDF examples. + * Create Document + * @param documentCreateRequest + * @param [editorVer] Set this parameter as `ev1` if you want to create a document from PDF with Classic Editor when both editors are enabled for the workspace. + * @param [useFormFieldProperties] Set this parameter as `yes` or `1` or `true` (only when upload pdf with form fields) if you want to respect form fields properties, like `required`. + */ + public createDocumentWithHttpInfo(documentCreateRequest: DocumentCreateRequest, editorVer?: string, useFormFieldProperties?: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.createDocumentWithHttpInfo(documentCreateRequest, editorVer, useFormFieldProperties, observableOptions); + return result.toPromise(); + } + + /** + * ## Create from a template > See the [Create document from template](https://developers.pandadoc.com/docs/create-document-from-template) tutorial for details on how to use this endpoint, as well as a sample template. ## Create from a URL > See the [Create from public PDF](https://developers.pandadoc.com/docs/create-and-send-a-document-from-a-publicly-available-pdf) guide for info about roles and fields, as well as PDF examples. + * Create Document + * @param documentCreateRequest + * @param [editorVer] Set this parameter as `ev1` if you want to create a document from PDF with Classic Editor when both editors are enabled for the workspace. + * @param [useFormFieldProperties] Set this parameter as `yes` or `1` or `true` (only when upload pdf with form fields) if you want to respect form fields properties, like `required`. + */ + public createDocument(documentCreateRequest: DocumentCreateRequest, editorVer?: string, useFormFieldProperties?: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.createDocument(documentCreateRequest, editorVer, useFormFieldProperties, observableOptions); + return result.toPromise(); + } + + /** + * Creates a new editing session for the Embedded Editor. The response includes an E-Token, which is required to open the document. > 🚧 **Important:** The Embedded Editor can only open documents that have a `draft` status. #### Limitations - **Single Active Session per User-Document Pair** Only one editing session can be active at a time for a specific user and document. Creating a new session for the same user-document pair will automatically invalidate the previous one. - **Weekly Session Cap** A maximum of **250** editing sessions can be created for a single document per week. Any attempt to exceed this limit will result in a `403 Forbidden` error. + * Create Document Editing Session + * @param id Document ID + * @param editingSessionRequest + */ + public createDocumentEditingSessionWithHttpInfo(id: string, editingSessionRequest: EditingSessionRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.createDocumentEditingSessionWithHttpInfo(id, editingSessionRequest, observableOptions); + return result.toPromise(); + } + + /** + * Creates a new editing session for the Embedded Editor. The response includes an E-Token, which is required to open the document. > 🚧 **Important:** The Embedded Editor can only open documents that have a `draft` status. #### Limitations - **Single Active Session per User-Document Pair** Only one editing session can be active at a time for a specific user and document. Creating a new session for the same user-document pair will automatically invalidate the previous one. - **Weekly Session Cap** A maximum of **250** editing sessions can be created for a single document per week. Any attempt to exceed this limit will result in a `403 Forbidden` error. + * Create Document Editing Session + * @param id Document ID + * @param editingSessionRequest + */ + public createDocumentEditingSession(id: string, editingSessionRequest: EditingSessionRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.createDocumentEditingSession(id, editingSessionRequest, observableOptions); + return result.toPromise(); + } + + /** + * ## Create from an upload > See the [Create from PDF](https://developers.pandadoc.com/docs/create-document-from-file) tutorial for the usage specifics and sample PDF files. **Note**: A file you upload is not stored in your PandaDoc account, so you have to upload it with every request. + * Create Document from File Upload + * @param [editorVer] Set this parameter as `ev1` if you want to create a document from PDF with Classic Editor when both editors are enabled for the workspace. + * @param [useFormFieldProperties] Set this parameter as `yes` or `1` or `true` (only when upload pdf with form fields) if you want to respect form fields properties, like `required`. + * @param [file] Binary PDF File + * @param [data] + */ + public createDocumentFromUploadWithHttpInfo(editorVer?: string, useFormFieldProperties?: string, file?: HttpFile, data?: DocumentCreateByPdfRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.createDocumentFromUploadWithHttpInfo(editorVer, useFormFieldProperties, file, data, observableOptions); + return result.toPromise(); + } + + /** + * ## Create from an upload > See the [Create from PDF](https://developers.pandadoc.com/docs/create-document-from-file) tutorial for the usage specifics and sample PDF files. **Note**: A file you upload is not stored in your PandaDoc account, so you have to upload it with every request. + * Create Document from File Upload + * @param [editorVer] Set this parameter as `ev1` if you want to create a document from PDF with Classic Editor when both editors are enabled for the workspace. + * @param [useFormFieldProperties] Set this parameter as `yes` or `1` or `true` (only when upload pdf with form fields) if you want to respect form fields properties, like `required`. + * @param [file] Binary PDF File + * @param [data] + */ + public createDocumentFromUpload(editorVer?: string, useFormFieldProperties?: string, file?: HttpFile, data?: DocumentCreateByPdfRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.createDocumentFromUpload(editorVer, useFormFieldProperties, file, data, observableOptions); + return result.toPromise(); + } + + /** + * Creates a document session for a recipient to view and sign a document. > 📘 How to create an Embedded Sign session > For more information on how to create an Embedded Sign session, see the [Embedded Signing](https://developers.pandadoc.com/docs/embedded-signing) documentation. + * Create Document Session for Embedded Sign + * @param id Document ID + * @param documentCreateLinkRequest + */ + public createDocumentLinkWithHttpInfo(id: string, documentCreateLinkRequest: DocumentCreateLinkRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.createDocumentLinkWithHttpInfo(id, documentCreateLinkRequest, observableOptions); + return result.toPromise(); + } + + /** + * Creates a document session for a recipient to view and sign a document. > 📘 How to create an Embedded Sign session > For more information on how to create an Embedded Sign session, see the [Embedded Signing](https://developers.pandadoc.com/docs/embedded-signing) documentation. + * Create Document Session for Embedded Sign + * @param id Document ID + * @param documentCreateLinkRequest + */ + public createDocumentLink(id: string, documentCreateLinkRequest: DocumentCreateLinkRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.createDocumentLink(id, documentCreateLinkRequest, observableOptions); + return result.toPromise(); + } + + /** + * > ⏱️ Export as DOCX is a non-blocking (asynchronous) operation > The document generation process may take some time. > With a successful request, you receive a response with task ID, status **created** and document id. After process completes, usually in a few minutes, the task status moves to the **done** state. > You can download documents up to 300 pages. For documents of 301+ pages, you will receive an error “400: The number of pages more then limit 300” + * [Beta] Create DOCX Export Task + * @param documentId Specify document id. + */ + public createExportDocxTaskWithHttpInfo(documentId: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.createExportDocxTaskWithHttpInfo(documentId, observableOptions); + return result.toPromise(); + } + + /** + * > ⏱️ Export as DOCX is a non-blocking (asynchronous) operation > The document generation process may take some time. > With a successful request, you receive a response with task ID, status **created** and document id. After process completes, usually in a few minutes, the task status moves to the **done** state. > You can download documents up to 300 pages. For documents of 301+ pages, you will receive an error “400: The number of pages more then limit 300” + * [Beta] Create DOCX Export Task + * @param documentId Specify document id. + */ + public createExportDocxTask(documentId: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.createExportDocxTask(documentId, observableOptions); + return result.toPromise(); + } + + /** + * Delete a document by ID. + * Delete Document + * @param id Document ID + */ + public deleteDocumentWithHttpInfo(id: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.deleteDocumentWithHttpInfo(id, observableOptions); + return result.toPromise(); + } + + /** + * Delete a document by ID. + * Delete Document + * @param id Document ID + */ + public deleteDocument(id: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.deleteDocument(id, observableOptions); + return result.toPromise(); + } + + /** + * Return detailed data about a document. Use Document Status for getting just a basic info and status. Get details about a document by its `id`. Details include: - Basic document information (name, document state, owner, sender, grand total, etc.) - Recipients (completion status, signing order, etc.) - Fields with values (incl. Collect Files field) - Tokens (variables) with values - Pricing information (pricing tables, products, quotes, etc.) - Content block names for table, image, and text blocks (tables, images, texts) - Metadata - Tags - Linked objects - [Approval flow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) (if present) - Timestamps associated with a document. Note that `date_modified` means any changes associated with the recipients and document status, while `content_date_modified` reflects any changes in the document content. + * Document Details + * @param id Document ID + */ + public detailsDocumentWithHttpInfo(id: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.detailsDocumentWithHttpInfo(id, observableOptions); + return result.toPromise(); + } + + /** + * Return detailed data about a document. Use Document Status for getting just a basic info and status. Get details about a document by its `id`. Details include: - Basic document information (name, document state, owner, sender, grand total, etc.) - Recipients (completion status, signing order, etc.) - Fields with values (incl. Collect Files field) - Tokens (variables) with values - Pricing information (pricing tables, products, quotes, etc.) - Content block names for table, image, and text blocks (tables, images, texts) - Metadata - Tags - Linked objects - [Approval flow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) (if present) - Timestamps associated with a document. Note that `date_modified` means any changes associated with the recipients and document status, while `content_date_modified` reflects any changes in the document content. + * Document Details + * @param id Document ID + */ + public detailsDocument(id: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.detailsDocument(id, observableOptions); + return result.toPromise(); + } + + /** + * Retrieves the current version of eSign disclosure text for a specified document. + * Document eSign disclosure + * @param documentId The UUID of the document. + */ + public documentESignDisclosureWithHttpInfo(documentId: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.documentESignDisclosureWithHttpInfo(documentId, observableOptions); + return result.toPromise(); + } + + /** + * Retrieves the current version of eSign disclosure text for a specified document. + * Document eSign disclosure + * @param documentId The UUID of the document. + */ + public documentESignDisclosure(documentId: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.documentESignDisclosure(documentId, observableOptions); + return result.toPromise(); + } + + /** + * This operation allows you to move a document to a folder by specifying the document ID and folder ID. + * Document move to folder + * @param id Specify document ID. + * @param folderId Specify folder ID. + */ + public documentMoveToFolderWithHttpInfo(id: string, folderId: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.documentMoveToFolderWithHttpInfo(id, folderId, observableOptions); + return result.toPromise(); + } + + /** + * This operation allows you to move a document to a folder by specifying the document ID and folder ID. + * Document move to folder + * @param id Specify document ID. + * @param folderId Specify folder ID. + */ + public documentMoveToFolder(id: string, folderId: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.documentMoveToFolder(id, folderId, observableOptions); + return result.toPromise(); + } + + /** + * Revert your document back to draft to continue editing it. > 📘 Returning to Draft works for any document status except Removed. ## After you move your document to the Draft status - `Signature` and `Initials` fields are cleared. All other fields stay filled in. - Recipients are **not** notified that the document is back in Draft. - You\'ll need to resend the document so that recipients can sign the updated version. + * Move Document to Draft + * @param id Specify document ID. + */ + public documentRevertToDraftWithHttpInfo(id: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.documentRevertToDraftWithHttpInfo(id, observableOptions); + return result.toPromise(); + } + + /** + * Revert your document back to draft to continue editing it. > 📘 Returning to Draft works for any document status except Removed. ## After you move your document to the Draft status - `Signature` and `Initials` fields are cleared. All other fields stay filled in. - Recipients are **not** notified that the document is back in Draft. - You\'ll need to resend the document so that recipients can sign the updated version. + * Move Document to Draft + * @param id Specify document ID. + */ + public documentRevertToDraft(id: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.documentRevertToDraft(id, observableOptions); + return result.toPromise(); + } + + /** + * Download documents as a PDF. + * Document Download + * @param id Specify document ID. + * @param [watermarkColor] HEX code (for example `#FF5733`). + * @param [watermarkFontSize] Font size of the watermark. + * @param [watermarkOpacity] In range 0.0-1.0 + * @param [watermarkText] Specify watermark text. + * @param [separateFiles] Download document bundle as a zip-archive of separate PDFs (1 file per section). + */ + public downloadDocumentWithHttpInfo(id: string, watermarkColor?: string, watermarkFontSize?: number, watermarkOpacity?: number, watermarkText?: string, separateFiles?: boolean, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.downloadDocumentWithHttpInfo(id, watermarkColor, watermarkFontSize, watermarkOpacity, watermarkText, separateFiles, observableOptions); + return result.toPromise(); + } + + /** + * Download documents as a PDF. + * Document Download + * @param id Specify document ID. + * @param [watermarkColor] HEX code (for example `#FF5733`). + * @param [watermarkFontSize] Font size of the watermark. + * @param [watermarkOpacity] In range 0.0-1.0 + * @param [watermarkText] Specify watermark text. + * @param [separateFiles] Download document bundle as a zip-archive of separate PDFs (1 file per section). + */ + public downloadDocument(id: string, watermarkColor?: string, watermarkFontSize?: number, watermarkOpacity?: number, watermarkText?: string, separateFiles?: boolean, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.downloadDocument(id, watermarkColor, watermarkFontSize, watermarkOpacity, watermarkText, separateFiles, observableOptions); + return result.toPromise(); + } + + /** + * Download a completed document as a verifiable PDF (Download Protected Document) > 🚧 Production key only > > This endpoint only works with a Production key. You\'ll get a 401 Unauthorized error when trying to use a Sandbox key. Download a signed PDF of a completed document + * Download Completed Document + * @param id Specify document ID. + * @param [separateFiles] Download document bundle as a zip-archive of separate PDFs (1 file per section). + */ + public downloadProtectedDocumentWithHttpInfo(id: string, separateFiles?: boolean, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.downloadProtectedDocumentWithHttpInfo(id, separateFiles, observableOptions); + return result.toPromise(); + } + + /** + * Download a completed document as a verifiable PDF (Download Protected Document) > 🚧 Production key only > > This endpoint only works with a Production key. You\'ll get a 401 Unauthorized error when trying to use a Sandbox key. Download a signed PDF of a completed document + * Download Completed Document + * @param id Specify document ID. + * @param [separateFiles] Download document bundle as a zip-archive of separate PDFs (1 file per section). + */ + public downloadProtectedDocument(id: string, separateFiles?: boolean, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.downloadProtectedDocument(id, separateFiles, observableOptions); + return result.toPromise(); + } + + /** + * > 📘 This endpoint returns the current state of a DOCX export task for a document. > The endpoint supports downloading only multiple files if the document contains several sections. Downloading as a single file in this case is not possible. + * [Beta] DOCX Export Task + * @param documentId Specify document id. + * @param taskId Specify Task id. + */ + public getDocxExportTaskWithHttpInfo(documentId: string, taskId: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.getDocxExportTaskWithHttpInfo(documentId, taskId, observableOptions); + return result.toPromise(); + } + + /** + * > 📘 This endpoint returns the current state of a DOCX export task for a document. > The endpoint supports downloading only multiple files if the document contains several sections. Downloading as a single file in this case is not possible. + * [Beta] DOCX Export Task + * @param documentId Specify document id. + * @param taskId Specify Task id. + */ + public getDocxExportTask(documentId: string, taskId: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.getDocxExportTask(documentId, taskId, observableOptions); + return result.toPromise(); + } + + /** + * This endpoint will let you list and search for the documents. ### [Here](https://developers.pandadoc.com/docs/list-search-documents-api) you can find how to filter, search and order documents. + * List Documents + * @param [templateId] Filters by parent template. This Parameter can\'t be used with form_id. + * @param [formId] Filters by parent form. This parameter can\'t be used with template_id. + * @param [folderUuid] Filters by the folder where the documents are stored. + * @param [contactId] Filters by recipient or approver with this \'contact_id\'. + * @param [count] Limits the size of the response. Default is 50 documents, maximum is 100 documents. + * @param [page] Paginates the search result. Increase value to get the next page of results. + * @param [orderBy] Defines the sorting of the result. Use `date_created` for ASC and `-date_created` for DESC sorting. + * @param [createdFrom] Limits results to the documents with the `date_created` greater than or equal to this value. + * @param [createdTo] Limits results to the documents with the `date_created` less than this value. + * @param [deleted] Returns only the deleted documents. + * @param [id] + * @param [completedFrom] Limits results to the documents with the `date_completed` greater than or equal to this value. + * @param [completedTo] Limits results to the documents with the `date_completed` less than this value. + * @param [membershipId] Filter documents by the owner\'s \'membership_id\'. + * @param [metadata] Filters documents by metadata. Pass metadata in the format of `metadata_{metadata-key}={metadata-value}` such as `metadata_opportunity_id=2181432`. The `metadata_` prefix is always required. + * @param [modifiedFrom] Limits results to the documents with the `date_modified` greater than or equal to this value. + * @param [modifiedTo] Limits results to the documents with the `date_modified` less than this value. + * @param [q] Filters documents by name or reference number (stored on the template level). + * @param [status] Filters documents by the status. * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review + * @param [statusNe] Exludes documents with this status. * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review + * @param [tag] Filters documents by tag. + */ + public listDocumentsWithHttpInfo(templateId?: string, formId?: string, folderUuid?: string, contactId?: string, count?: number, page?: number, orderBy?: DocumentOrderingFieldsEnum, createdFrom?: string, createdTo?: string, deleted?: boolean, id?: string, completedFrom?: string, completedTo?: string, membershipId?: string, metadata?: Array, modifiedFrom?: string, modifiedTo?: string, q?: string, status?: DocumentStatusRequestEnum, statusNe?: DocumentStatusRequestEnum, tag?: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.listDocumentsWithHttpInfo(templateId, formId, folderUuid, contactId, count, page, orderBy, createdFrom, createdTo, deleted, id, completedFrom, completedTo, membershipId, metadata, modifiedFrom, modifiedTo, q, status, statusNe, tag, observableOptions); + return result.toPromise(); + } + + /** + * This endpoint will let you list and search for the documents. ### [Here](https://developers.pandadoc.com/docs/list-search-documents-api) you can find how to filter, search and order documents. + * List Documents + * @param [templateId] Filters by parent template. This Parameter can\'t be used with form_id. + * @param [formId] Filters by parent form. This parameter can\'t be used with template_id. + * @param [folderUuid] Filters by the folder where the documents are stored. + * @param [contactId] Filters by recipient or approver with this \'contact_id\'. + * @param [count] Limits the size of the response. Default is 50 documents, maximum is 100 documents. + * @param [page] Paginates the search result. Increase value to get the next page of results. + * @param [orderBy] Defines the sorting of the result. Use `date_created` for ASC and `-date_created` for DESC sorting. + * @param [createdFrom] Limits results to the documents with the `date_created` greater than or equal to this value. + * @param [createdTo] Limits results to the documents with the `date_created` less than this value. + * @param [deleted] Returns only the deleted documents. + * @param [id] + * @param [completedFrom] Limits results to the documents with the `date_completed` greater than or equal to this value. + * @param [completedTo] Limits results to the documents with the `date_completed` less than this value. + * @param [membershipId] Filter documents by the owner\'s \'membership_id\'. + * @param [metadata] Filters documents by metadata. Pass metadata in the format of `metadata_{metadata-key}={metadata-value}` such as `metadata_opportunity_id=2181432`. The `metadata_` prefix is always required. + * @param [modifiedFrom] Limits results to the documents with the `date_modified` greater than or equal to this value. + * @param [modifiedTo] Limits results to the documents with the `date_modified` less than this value. + * @param [q] Filters documents by name or reference number (stored on the template level). + * @param [status] Filters documents by the status. * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review + * @param [statusNe] Exludes documents with this status. * 0: document.draft * 1: document.sent * 2: document.completed * 3: document.uploaded * 4: document.error * 5: document.viewed * 6: document.waiting_approval * 7: document.approved * 8: document.rejected * 9: document.waiting_pay * 10: document.paid * 11: document.voided * 12: document.declined * 13: document.external_review + * @param [tag] Filters documents by tag. + */ + public listDocuments(templateId?: string, formId?: string, folderUuid?: string, contactId?: string, count?: number, page?: number, orderBy?: DocumentOrderingFieldsEnum, createdFrom?: string, createdTo?: string, deleted?: boolean, id?: string, completedFrom?: string, completedTo?: string, membershipId?: string, metadata?: Array, modifiedFrom?: string, modifiedTo?: string, q?: string, status?: DocumentStatusRequestEnum, statusNe?: DocumentStatusRequestEnum, tag?: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.listDocuments(templateId, formId, folderUuid, contactId, count, page, orderBy, createdFrom, createdTo, deleted, id, completedFrom, completedTo, membershipId, metadata, modifiedFrom, modifiedTo, q, status, statusNe, tag, observableOptions); + return result.toPromise(); + } + + /** + * > 🚧 Using the Sandbox Key > > When you use a [sandbox API key](https://developers.pandadoc.com/reference/sandbox-key) during the free trial period, the sender and recipient email addresses must be from the same organisation (email domain). ## Document State - You can only send a document in the `document.draft` status. - After creating a new document, it usually retains a `document.uploaded` status for 3-5 seconds while the document syncs across PandaDoc servers. When the document is available for further API calls, it moves to the `document.draft` state. Use [Document Status](/reference/document-status) or [Webhooks](/reference/on-document-status-change) to check document status. - Moving a document to the `document.sent` status finalizes the document structure, before recipients can complete it. - If a template used for the document creation has an approval workflow turned on, the sent document moves to the `document.waiting_approval` status. Once the document is approved, you need to make the call again to move the document to `document.sent` status. ## Send and Silence Notifications - By default, PandaDoc sends a notification email to the recipient, as well as notifications the sender has configured. You may disable all notifications for recipients by passing `silent: true`. This is useful when you are using alternative delivery methods such as linking to the document or embedding the document. - The `silent: true` parameter disables sent, viewed, comment and completed document email notifications. \"Document Approval\" notification won\'t be affected by this parameter. - If you pass `silent: false`, the document is going to be delivered by email and/or SMS. ![Example email. Branding can be changed in workspace settings](https://files.readme.io/cc5a03e-email2.png) ## Select Approver from Group If you have previously set up an approval workflow with selectable groups on the UI, you can select a particular approver from this group. Learn more about [selectable groups](https://support.pandadoc.com/en/articles/9714799-approval-workflow#h_01H4GNY5GSGG38BPYY46XV7GB4). To set an approver, we recommend to follow these steps: 1. Run the [Document Details](https://developers.pandadoc.com/reference/document-details) request. 2. Copy the `steps` part from the `approval_execution` section of the response into the `selected_approvers` field of the Send Document payload. 3. Modify your payload according to business needs: set `is_selected` to true for one approver. > 📘 **Note**: You can change the selected approver only if you revert your document back to the `document.draft` status. + * Send Document + * @param id Document ID + * @param documentSendRequest + */ + public sendDocumentWithHttpInfo(id: string, documentSendRequest: DocumentSendRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.sendDocumentWithHttpInfo(id, documentSendRequest, observableOptions); + return result.toPromise(); + } + + /** + * > 🚧 Using the Sandbox Key > > When you use a [sandbox API key](https://developers.pandadoc.com/reference/sandbox-key) during the free trial period, the sender and recipient email addresses must be from the same organisation (email domain). ## Document State - You can only send a document in the `document.draft` status. - After creating a new document, it usually retains a `document.uploaded` status for 3-5 seconds while the document syncs across PandaDoc servers. When the document is available for further API calls, it moves to the `document.draft` state. Use [Document Status](/reference/document-status) or [Webhooks](/reference/on-document-status-change) to check document status. - Moving a document to the `document.sent` status finalizes the document structure, before recipients can complete it. - If a template used for the document creation has an approval workflow turned on, the sent document moves to the `document.waiting_approval` status. Once the document is approved, you need to make the call again to move the document to `document.sent` status. ## Send and Silence Notifications - By default, PandaDoc sends a notification email to the recipient, as well as notifications the sender has configured. You may disable all notifications for recipients by passing `silent: true`. This is useful when you are using alternative delivery methods such as linking to the document or embedding the document. - The `silent: true` parameter disables sent, viewed, comment and completed document email notifications. \"Document Approval\" notification won\'t be affected by this parameter. - If you pass `silent: false`, the document is going to be delivered by email and/or SMS. ![Example email. Branding can be changed in workspace settings](https://files.readme.io/cc5a03e-email2.png) ## Select Approver from Group If you have previously set up an approval workflow with selectable groups on the UI, you can select a particular approver from this group. Learn more about [selectable groups](https://support.pandadoc.com/en/articles/9714799-approval-workflow#h_01H4GNY5GSGG38BPYY46XV7GB4). To set an approver, we recommend to follow these steps: 1. Run the [Document Details](https://developers.pandadoc.com/reference/document-details) request. 2. Copy the `steps` part from the `approval_execution` section of the response into the `selected_approvers` field of the Send Document payload. 3. Modify your payload according to business needs: set `is_selected` to true for one approver. > 📘 **Note**: You can change the selected approver only if you revert your document back to the `document.draft` status. + * Send Document + * @param id Document ID + * @param documentSendRequest + */ + public sendDocument(id: string, documentSendRequest: DocumentSendRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.sendDocument(id, documentSendRequest, observableOptions); + return result.toPromise(); + } + + /** + * It is useful to request document status to ensure a document is in the expected state before calling additional API methods. ### Required Document Statuses Here are some common methods and the `document.status` required to proceed: | API Method | Required Document State | | :------------------- | :---------------------- | | Send A Document | `document.draft` | | Get Document Details | `document.draft` | | Embed A Document | `document.sent` | | Download A Document | `document.completed` | > 📘 Polling vs Webhooks > > If you are using the `GET` document status endpoint for [**polling**](https://en.wikipedia.org/wiki/Polling_(computer_science)), we also support and recommend using **webhooks** for event-driven needs: ### Available Document Statuses The following is a complete list of all possible document statuses returned: | Document Status | Status Description | | :-------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `document.uploaded` | The document has just been created or uploaded. It is in processing and will be in `document.draft` state soon. | | `document.error` | The document creation has failed. This status is terminal, you should stop polling after getting it. | `document.draft` | The document is in a draft state. All aspects of the document can be edited in this state. Our API does not support edits after the document has been created, but it can still be edited manually on | | `document.sent` | The document has been \"sealed\" and optionally sent. No further document edits can occur except for document recipient(s) filling out or signing the document. | | `document.viewed` | Document recipient(s) have viewed the sent document. | | `document.waiting_approval` | The document has an [automatic approval workflow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) and has not yet been approved. | | `document.rejected` | The document has an [automatic approval workflow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) and was rejected. | | `document.approved` | The document has an [automatic approval workflow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) and was approved. | | `document.waiting_pay` | The document has a [Stripe payment](https://support.pandadoc.com/en/articles/9714942-stripe-checkout-payments) option and is awaiting payment. | | `document.paid` | The document has a [Stripe payment](https://support.pandadoc.com/en/articles/9714942-stripe-checkout-payments) option and was paid. | | `document.completed` | The document has been completed by all recipients. | | `document.voided` | The document expired and is no longer available for completion or signature. | | `document.declined` | The document was [manually marked](https://support.pandadoc.com/en/articles/9714842-manually-change-document-status) as \"Declined\" | | `document.external_review` | The document is reviewed by it\'s recipient using Suggest Edit feature | + * Document Status + * @param id Specify document ID. + */ + public statusDocumentWithHttpInfo(id: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.statusDocumentWithHttpInfo(id, observableOptions); + return result.toPromise(); + } + + /** + * It is useful to request document status to ensure a document is in the expected state before calling additional API methods. ### Required Document Statuses Here are some common methods and the `document.status` required to proceed: | API Method | Required Document State | | :------------------- | :---------------------- | | Send A Document | `document.draft` | | Get Document Details | `document.draft` | | Embed A Document | `document.sent` | | Download A Document | `document.completed` | > 📘 Polling vs Webhooks > > If you are using the `GET` document status endpoint for [**polling**](https://en.wikipedia.org/wiki/Polling_(computer_science)), we also support and recommend using **webhooks** for event-driven needs: ### Available Document Statuses The following is a complete list of all possible document statuses returned: | Document Status | Status Description | | :-------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `document.uploaded` | The document has just been created or uploaded. It is in processing and will be in `document.draft` state soon. | | `document.error` | The document creation has failed. This status is terminal, you should stop polling after getting it. | `document.draft` | The document is in a draft state. All aspects of the document can be edited in this state. Our API does not support edits after the document has been created, but it can still be edited manually on | | `document.sent` | The document has been \"sealed\" and optionally sent. No further document edits can occur except for document recipient(s) filling out or signing the document. | | `document.viewed` | Document recipient(s) have viewed the sent document. | | `document.waiting_approval` | The document has an [automatic approval workflow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) and has not yet been approved. | | `document.rejected` | The document has an [automatic approval workflow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) and was rejected. | | `document.approved` | The document has an [automatic approval workflow](https://support.pandadoc.com/en/articles/9714799-approval-workflow) and was approved. | | `document.waiting_pay` | The document has a [Stripe payment](https://support.pandadoc.com/en/articles/9714942-stripe-checkout-payments) option and is awaiting payment. | | `document.paid` | The document has a [Stripe payment](https://support.pandadoc.com/en/articles/9714942-stripe-checkout-payments) option and was paid. | | `document.completed` | The document has been completed by all recipients. | | `document.voided` | The document expired and is no longer available for completion or signature. | | `document.declined` | The document was [manually marked](https://support.pandadoc.com/en/articles/9714842-manually-change-document-status) as \"Declined\" | | `document.external_review` | The document is reviewed by it\'s recipient using Suggest Edit feature | + * Document Status + * @param id Specify document ID. + */ + public statusDocument(id: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.statusDocument(id, observableOptions); + return result.toPromise(); + } + + /** + * This method transfers ownership of all documents from one member to another. + * Transfer all documents ownership + * @param documentTransferAllOwnershipRequest + */ + public transferAllDocumentsOwnershipWithHttpInfo(documentTransferAllOwnershipRequest: DocumentTransferAllOwnershipRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.transferAllDocumentsOwnershipWithHttpInfo(documentTransferAllOwnershipRequest, observableOptions); + return result.toPromise(); + } + + /** + * This method transfers ownership of all documents from one member to another. + * Transfer all documents ownership + * @param documentTransferAllOwnershipRequest + */ + public transferAllDocumentsOwnership(documentTransferAllOwnershipRequest: DocumentTransferAllOwnershipRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.transferAllDocumentsOwnership(documentTransferAllOwnershipRequest, observableOptions); + return result.toPromise(); + } + + /** + * This operation allows transferring the ownership of a document to another user by specifying the document ID and membership ID. + * Update document ownership + * @param id Specify document ID. + * @param documentTransferOwnershipRequest + */ + public transferDocumentOwnershipWithHttpInfo(id: string, documentTransferOwnershipRequest: DocumentTransferOwnershipRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.transferDocumentOwnershipWithHttpInfo(id, documentTransferOwnershipRequest, observableOptions); + return result.toPromise(); + } + + /** + * This operation allows transferring the ownership of a document to another user by specifying the document ID and membership ID. + * Update document ownership + * @param id Specify document ID. + * @param documentTransferOwnershipRequest + */ + public transferDocumentOwnership(id: string, documentTransferOwnershipRequest: DocumentTransferOwnershipRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.transferDocumentOwnership(id, documentTransferOwnershipRequest, observableOptions); + return result.toPromise(); + } + + /** + * Use the PATCH method to update a PandaDoc document. > 🚧 Document status > > You can only update a document in the Draft status (`document.draft`). > > After creating a new document, it usually retains a `document.uploaded` status for 3-5 seconds while the document syncs across PandaDoc servers. When the document is available for further API calls, the document moves to the `document.draft` state. Use [Document Status](https://developers.pandadoc.com/reference/document-status) or Webhooks to check document status. + * Update Document + * @param id Document ID + * @param documentUpdateRequest + */ + public updateDocumentWithHttpInfo(id: string, documentUpdateRequest: DocumentUpdateRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.updateDocumentWithHttpInfo(id, documentUpdateRequest, observableOptions); + return result.toPromise(); + } + + /** + * Use the PATCH method to update a PandaDoc document. > 🚧 Document status > > You can only update a document in the Draft status (`document.draft`). > > After creating a new document, it usually retains a `document.uploaded` status for 3-5 seconds while the document syncs across PandaDoc servers. When the document is available for further API calls, the document moves to the `document.draft` state. Use [Document Status](https://developers.pandadoc.com/reference/document-status) or Webhooks to check document status. + * Update Document + * @param id Document ID + * @param documentUpdateRequest + */ + public updateDocument(id: string, documentUpdateRequest: DocumentUpdateRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.updateDocument(id, documentUpdateRequest, observableOptions); + return result.toPromise(); + } + + +} + + + +import { ObservableFoldersApi } from './ObservableAPI'; + +import { FoldersApiRequestFactory, FoldersApiResponseProcessor} from "../apis/FoldersApi"; +export class PromiseFoldersApi { + private api: ObservableFoldersApi + + public constructor( + configuration: Configuration, + requestFactory?: FoldersApiRequestFactory, + responseProcessor?: FoldersApiResponseProcessor + ) { + this.api = new ObservableFoldersApi(configuration, requestFactory, responseProcessor); + } + + /** + * Create a new folder to store your documents. For the full list of folder operations and their limitations, see [Organize Documents and Folders](https://developers.pandadoc.com/docs/organize-folders). + * Create Documents Folder + * @param documentsFolderCreateRequest + */ + public createDocumentFolderWithHttpInfo(documentsFolderCreateRequest: DocumentsFolderCreateRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.createDocumentFolderWithHttpInfo(documentsFolderCreateRequest, observableOptions); + return result.toPromise(); + } + + /** + * Create a new folder to store your documents. For the full list of folder operations and their limitations, see [Organize Documents and Folders](https://developers.pandadoc.com/docs/organize-folders). + * Create Documents Folder + * @param documentsFolderCreateRequest + */ + public createDocumentFolder(documentsFolderCreateRequest: DocumentsFolderCreateRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.createDocumentFolder(documentsFolderCreateRequest, observableOptions); + return result.toPromise(); + } + + /** + * Create a new folder to store your templates. For the full list of folder operations and their limitations, see [Organize Templates and Folders](https://developers.pandadoc.com/docs/organize-folders). + * Create Templates Folder + * @param templatesFolderCreateRequest + */ + public createTemplateFolderWithHttpInfo(templatesFolderCreateRequest: TemplatesFolderCreateRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.createTemplateFolderWithHttpInfo(templatesFolderCreateRequest, observableOptions); + return result.toPromise(); + } + + /** + * Create a new folder to store your templates. For the full list of folder operations and their limitations, see [Organize Templates and Folders](https://developers.pandadoc.com/docs/organize-folders). + * Create Templates Folder + * @param templatesFolderCreateRequest + */ + public createTemplateFolder(templatesFolderCreateRequest: TemplatesFolderCreateRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.createTemplateFolder(templatesFolderCreateRequest, observableOptions); + return result.toPromise(); + } + + /** + * Get the list of folders which contain Documents in your account. > 📘 > > The root folder is not listed in the response. For the full list of folder operations and their limitations, see [Organize Documents and Folders](https://developers.pandadoc.com/docs/organize-folders). + * List Documents Folders + * @param [parentUuid] The UUID of the folder containing folders. To list the folders located in the root folder, remove this parameter in the request. + * @param [count] Optionally, specify how many folders to return. + * @param [page] Optionally, specify which page of the dataset to return. + */ + public listDocumentFoldersWithHttpInfo(parentUuid?: string, count?: number, page?: number, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.listDocumentFoldersWithHttpInfo(parentUuid, count, page, observableOptions); + return result.toPromise(); + } + + /** + * Get the list of folders which contain Documents in your account. > 📘 > > The root folder is not listed in the response. For the full list of folder operations and their limitations, see [Organize Documents and Folders](https://developers.pandadoc.com/docs/organize-folders). + * List Documents Folders + * @param [parentUuid] The UUID of the folder containing folders. To list the folders located in the root folder, remove this parameter in the request. + * @param [count] Optionally, specify how many folders to return. + * @param [page] Optionally, specify which page of the dataset to return. + */ + public listDocumentFolders(parentUuid?: string, count?: number, page?: number, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.listDocumentFolders(parentUuid, count, page, observableOptions); + return result.toPromise(); + } + + /** + * Get the list of folders that contain Templates in your account. > 📘 > > The root folder is not listed in the response. For the full list of folder operations and their limitations, see [Organize Templates and Folders](https://developers.pandadoc.com/docs/organize-folders). + * List Templates Folders + * @param [parentUuid] The UUID of the folder containing folders. To list the folders located in the root folder, remove this parameter in the request. + * @param [count] Optionally, specify how many folders to return. + * @param [page] Optionally, specify which page of the dataset to return. + */ + public listTemplateFoldersWithHttpInfo(parentUuid?: string, count?: number, page?: number, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.listTemplateFoldersWithHttpInfo(parentUuid, count, page, observableOptions); + return result.toPromise(); + } + + /** + * Get the list of folders that contain Templates in your account. > 📘 > > The root folder is not listed in the response. For the full list of folder operations and their limitations, see [Organize Templates and Folders](https://developers.pandadoc.com/docs/organize-folders). + * List Templates Folders + * @param [parentUuid] The UUID of the folder containing folders. To list the folders located in the root folder, remove this parameter in the request. + * @param [count] Optionally, specify how many folders to return. + * @param [page] Optionally, specify which page of the dataset to return. + */ + public listTemplateFolders(parentUuid?: string, count?: number, page?: number, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.listTemplateFolders(parentUuid, count, page, observableOptions); + return result.toPromise(); + } + + /** + * Rename Documents Folder. For the full list of folder operations and their limitations, see [Organize Documents and Folders](https://developers.pandadoc.com/docs/organize-folders). + * Rename Documents Folder + * @param id The UUID of the folder that you are renaming. + * @param documentsFolderRenameRequest + */ + public renameDocumentFolderWithHttpInfo(id: string, documentsFolderRenameRequest: DocumentsFolderRenameRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.renameDocumentFolderWithHttpInfo(id, documentsFolderRenameRequest, observableOptions); + return result.toPromise(); + } + + /** + * Rename Documents Folder. For the full list of folder operations and their limitations, see [Organize Documents and Folders](https://developers.pandadoc.com/docs/organize-folders). + * Rename Documents Folder + * @param id The UUID of the folder that you are renaming. + * @param documentsFolderRenameRequest + */ + public renameDocumentFolder(id: string, documentsFolderRenameRequest: DocumentsFolderRenameRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.renameDocumentFolder(id, documentsFolderRenameRequest, observableOptions); + return result.toPromise(); + } + + /** + * Rename a templates folder. For the full list of folder operations and their limitations, see [Organize Templates and Folders](https://developers.pandadoc.com/docs/organize-folders). + * Rename Templates Folder + * @param id The UUID of the folder which you are renaming. + * @param templatesFolderRenameRequest + */ + public renameTemplateFolderWithHttpInfo(id: string, templatesFolderRenameRequest: TemplatesFolderRenameRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.renameTemplateFolderWithHttpInfo(id, templatesFolderRenameRequest, observableOptions); + return result.toPromise(); + } + + /** + * Rename a templates folder. For the full list of folder operations and their limitations, see [Organize Templates and Folders](https://developers.pandadoc.com/docs/organize-folders). + * Rename Templates Folder + * @param id The UUID of the folder which you are renaming. + * @param templatesFolderRenameRequest + */ + public renameTemplateFolder(id: string, templatesFolderRenameRequest: TemplatesFolderRenameRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.renameTemplateFolder(id, templatesFolderRenameRequest, observableOptions); + return result.toPromise(); + } + + +} + + + +import { ObservableFormsApi } from './ObservableAPI'; + +import { FormsApiRequestFactory, FormsApiResponseProcessor} from "../apis/FormsApi"; +export class PromiseFormsApi { + private api: ObservableFormsApi public constructor( configuration: Configuration, requestFactory?: FormsApiRequestFactory, responseProcessor?: FormsApiResponseProcessor ) { - this.api = new ObservableFormsApi(configuration, requestFactory, responseProcessor); + this.api = new ObservableFormsApi(configuration, requestFactory, responseProcessor); + } + + /** + * Retrieve a paginated list of forms with optional filtering and sorting options. + * List Forms + * @param [count] Specify how many forms to return. Default is 50 forms, maximum is 100 forms. + * @param [page] Specify which page of the dataset to return. + * @param [status] Specify which status of the forms dataset to return. + * @param [orderBy] Specify the form dataset order to return. + * @param [asc] Specify sorting the result-set in ascending or descending order. + * @param [name] Specify the form name. + */ + public listFormWithHttpInfo(count?: number, page?: number, status?: Array<'draft' | 'active' | 'disabled'>, orderBy?: 'name' | 'responses' | 'status' | 'created_date' | 'modified_date', asc?: boolean, name?: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.listFormWithHttpInfo(count, page, status, orderBy, asc, name, observableOptions); + return result.toPromise(); + } + + /** + * Retrieve a paginated list of forms with optional filtering and sorting options. + * List Forms + * @param [count] Specify how many forms to return. Default is 50 forms, maximum is 100 forms. + * @param [page] Specify which page of the dataset to return. + * @param [status] Specify which status of the forms dataset to return. + * @param [orderBy] Specify the form dataset order to return. + * @param [asc] Specify sorting the result-set in ascending or descending order. + * @param [name] Specify the form name. + */ + public listForm(count?: number, page?: number, status?: Array<'draft' | 'active' | 'disabled'>, orderBy?: 'name' | 'responses' | 'status' | 'created_date' | 'modified_date', asc?: boolean, name?: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.listForm(count, page, status, orderBy, asc, name, observableOptions); + return result.toPromise(); + } + + +} + + + +import { ObservableMembersApi } from './ObservableAPI'; + +import { MembersApiRequestFactory, MembersApiResponseProcessor} from "../apis/MembersApi"; +export class PromiseMembersApi { + private api: ObservableMembersApi + + public constructor( + configuration: Configuration, + requestFactory?: MembersApiRequestFactory, + responseProcessor?: MembersApiResponseProcessor + ) { + this.api = new ObservableMembersApi(configuration, requestFactory, responseProcessor); + } + + /** + * > 🚧 > > This endpoint is only exposed upon request. Please reach out to your Account Manager to get access. > 📘 > > Make sure you\'re using Public API keys generated by Org Admin, otherwise you\'ll receive a 403 response. + * Create Member Token + * @param memberId Member id. + * @param [createMemberTokenRequest] + */ + public createMemberTokenWithHttpInfo(memberId: string, createMemberTokenRequest?: CreateMemberTokenRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.createMemberTokenWithHttpInfo(memberId, createMemberTokenRequest, observableOptions); + return result.toPromise(); + } + + /** + * > 🚧 > > This endpoint is only exposed upon request. Please reach out to your Account Manager to get access. > 📘 > > Make sure you\'re using Public API keys generated by Org Admin, otherwise you\'ll receive a 403 response. + * Create Member Token + * @param memberId Member id. + * @param [createMemberTokenRequest] + */ + public createMemberToken(memberId: string, createMemberTokenRequest?: CreateMemberTokenRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.createMemberToken(memberId, createMemberTokenRequest, observableOptions); + return result.toPromise(); + } + + /** + * Returns the member details of the current user (the owner of the API key). **User** - is an account with a license in the Organization. **Member** - is a User with a predefined Role in the Workspace. | Parameter | Description | |---|---| | `user_id` | A unique identifier of the `user` in the **organization** | | `membership_id` | A unique identifier of the `user` in the **workspace** | | `email` | A user email address | | `first_name` | A user\'s first name | | `last_name` | A user\'s last name | | `is_active` | A boolean value that identifies if a member is active and not blocked | | `workspace` | A unique identifier of the user\'s current active workspace | | `workspace_name` | A name of the user\'s current active workspace | | `email_verified` | A boolean value that identifies if the email is verified | | `role` | A member\'s role in the workspace | | `user_license` | A user license in the organization: 
`Full (Standard)`; 
`Read-only`; 
`eSignature`; 
`Guest`; 
`Creator` | | `date_created` | A date when a member was added to the workspace | | `date_modified` | Last modified date of a member | + * Current Member Details + */ + public detailsCurrentMemberWithHttpInfo(_options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.detailsCurrentMemberWithHttpInfo(observableOptions); + return result.toPromise(); + } + + /** + * Returns the member details of the current user (the owner of the API key). **User** - is an account with a license in the Organization. **Member** - is a User with a predefined Role in the Workspace. | Parameter | Description | |---|---| | `user_id` | A unique identifier of the `user` in the **organization** | | `membership_id` | A unique identifier of the `user` in the **workspace** | | `email` | A user email address | | `first_name` | A user\'s first name | | `last_name` | A user\'s last name | | `is_active` | A boolean value that identifies if a member is active and not blocked | | `workspace` | A unique identifier of the user\'s current active workspace | | `workspace_name` | A name of the user\'s current active workspace | | `email_verified` | A boolean value that identifies if the email is verified | | `role` | A member\'s role in the workspace | | `user_license` | A user license in the organization: 
`Full (Standard)`; 
`Read-only`; 
`eSignature`; 
`Guest`; 
`Creator` | | `date_created` | A date when a member was added to the workspace | | `date_modified` | Last modified date of a member | + * Current Member Details + */ + public detailsCurrentMember(_options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.detailsCurrentMember(observableOptions); + return result.toPromise(); + } + + /** + * A method to retrieve a member\'s details by ID. **User** - is an account with a license in the Organization. **Member** - is a User with a predefined Role in the Workspace. | Parameter | Description | |---|---| | `user_id` | A unique identifier of the `user` in the **organization** | | `membership_id` | A unique identifier of the `user` in the **workspace** | | `email` | A user email address | | `first_name` | A user\'s first name | | `last_name` | A user\'s last name | | `is_active` | A boolean value that identifies if a member is active and not blocked | | `workspace` | A unique identifier of the user\'s current active workspace | | `workspace_name` | A name of the user\'s current active workspace | | `email_verified` | A boolean value that identifies if the email is verified | | `role` | A member\'s role in the workspace | | `user_license` | A user license in the organization: 
`Full (Standard)`; 
`Read-only`; 
`eSignature`; 
`Guest`; 
`Creator` | | `date_created` | A date when a member was added to the workspace | | `date_modified` | Last modified date of a member | + * Member Details + * @param id Membership id. + */ + public detailsMemberWithHttpInfo(id: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.detailsMemberWithHttpInfo(id, observableOptions); + return result.toPromise(); + } + + /** + * A method to retrieve a member\'s details by ID. **User** - is an account with a license in the Organization. **Member** - is a User with a predefined Role in the Workspace. | Parameter | Description | |---|---| | `user_id` | A unique identifier of the `user` in the **organization** | | `membership_id` | A unique identifier of the `user` in the **workspace** | | `email` | A user email address | | `first_name` | A user\'s first name | | `last_name` | A user\'s last name | | `is_active` | A boolean value that identifies if a member is active and not blocked | | `workspace` | A unique identifier of the user\'s current active workspace | | `workspace_name` | A name of the user\'s current active workspace | | `email_verified` | A boolean value that identifies if the email is verified | | `role` | A member\'s role in the workspace | | `user_license` | A user license in the organization: 
`Full (Standard)`; 
`Read-only`; 
`eSignature`; 
`Guest`; 
`Creator` | | `date_created` | A date when a member was added to the workspace | | `date_modified` | Last modified date of a member | + * Member Details + * @param id Membership id. + */ + public detailsMember(id: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.detailsMember(id, observableOptions); + return result.toPromise(); + } + + /** + * Retrieve all members details of the workspace implied by the OAuth token or API key.\\ For each member, the `workspace` parameter shows their active workspace, that is the workspace they are currently working in.\\ This means the `workspace` value can differ from the workspace implied by your API key. + * List Members + */ + public listMembersWithHttpInfo(_options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.listMembersWithHttpInfo(observableOptions); + return result.toPromise(); + } + + /** + * Retrieve all members details of the workspace implied by the OAuth token or API key.\\ For each member, the `workspace` parameter shows their active workspace, that is the workspace they are currently working in.\\ This means the `workspace` value can differ from the workspace implied by your API key. + * List Members + */ + public listMembers(_options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.listMembers(observableOptions); + return result.toPromise(); + } + + +} + + + +import { ObservableNotaryApi } from './ObservableAPI'; + +import { NotaryApiRequestFactory, NotaryApiResponseProcessor} from "../apis/NotaryApi"; +export class PromiseNotaryApi { + private api: ObservableNotaryApi + + public constructor( + configuration: Configuration, + requestFactory?: NotaryApiRequestFactory, + responseProcessor?: NotaryApiResponseProcessor + ) { + this.api = new ObservableNotaryApi(configuration, requestFactory, responseProcessor); + } + + /** + * Create a notarization request to connect with a notary and complete online notarizations for your signers within minutes. > 🚧 **Important:** This endpoint supports only documents in draft status. ## Prerequisites > 🚧 Before you start > > Ensure the following before creating a notarization request: > > - Install the Notary On-Demand or Notary add-on > - Create a document for notarization and get its `document_id`. To create a document, use the [Create Document from Template](https://developers.pandadoc.com/reference/create-document-from-pandadoc-template) or [Create Document from File Upload](https://developers.pandadoc.com/reference/create-document-from-pdf) endpoint. ## Request Details For the notarization request, include in the request body: - `document_id` - At least one `invitees`, specifying their `email`, `first_name`, and `last_name` - Optionally, include a `message` for your signers - Optionally, using `disable_invitees_notifications` you can disable all notifications for invitees including email with invitation for notarization. This is useful when you are using alternative delivery methods. - If in-house notary must be assigned to this request, include the `notary` object with the notary\'s `id`, `scheduled_at` timestamp, and an optional `message` for the notary After the API call is executed, your signers will receive an email invitation for notarization. Alternatively, you can directly share the `notarization_link` with your signers, which is available in the 201 response body. Upon successful notarization, you will receive an email with a link to the notarized document. ## Usage Tips > 📘 Best Practices > > - Ensure that signers are added as both invitees in the request body and recipients in the document to avoid inconveniences during notary sessions > - Signers will receive an email with a notary link upon a successful API call; this link is also in the 201 response > - In case if notary is not specified in the request, signers will use the link to connect with commissioned online notaries, available Mon-Fri, 9 AM - 9 PM Central Time, typically responding within 2 minutes > - If notary is specified, signers will use the link to connect with your in-house notary at the scheduled time ## Limits A maximum of 100 API calls per minute is permitted. Exceeding this limit triggers a 429 Too Many Requests error. ## Troubleshooting **Solutions for 4xx Response Codes:** - **403 Forbidden (Inactive Add-on)**: Ensure the Notary On-Demand or Notary add-on is installed - **403 Forbidden (Transactions Limit)**: Purchase additional transactions either through the Notary UI or by contacting the Sales team - **429 Too Many Requests**: If you hit the limit, hold your API calls, then send them after waiting for the retry time > 📘 To learn more about PandaDoc Notary On-Demand, visit our [website](https://notary.pandadoc.com/notary-on-demand/). + * Create Notarization Request + * @param createNotarizationRequest + */ + public createNotarizationRequestWithHttpInfo(createNotarizationRequest: CreateNotarizationRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.createNotarizationRequestWithHttpInfo(createNotarizationRequest, observableOptions); + return result.toPromise(); + } + + /** + * Create a notarization request to connect with a notary and complete online notarizations for your signers within minutes. > 🚧 **Important:** This endpoint supports only documents in draft status. ## Prerequisites > 🚧 Before you start > > Ensure the following before creating a notarization request: > > - Install the Notary On-Demand or Notary add-on > - Create a document for notarization and get its `document_id`. To create a document, use the [Create Document from Template](https://developers.pandadoc.com/reference/create-document-from-pandadoc-template) or [Create Document from File Upload](https://developers.pandadoc.com/reference/create-document-from-pdf) endpoint. ## Request Details For the notarization request, include in the request body: - `document_id` - At least one `invitees`, specifying their `email`, `first_name`, and `last_name` - Optionally, include a `message` for your signers - Optionally, using `disable_invitees_notifications` you can disable all notifications for invitees including email with invitation for notarization. This is useful when you are using alternative delivery methods. - If in-house notary must be assigned to this request, include the `notary` object with the notary\'s `id`, `scheduled_at` timestamp, and an optional `message` for the notary After the API call is executed, your signers will receive an email invitation for notarization. Alternatively, you can directly share the `notarization_link` with your signers, which is available in the 201 response body. Upon successful notarization, you will receive an email with a link to the notarized document. ## Usage Tips > 📘 Best Practices > > - Ensure that signers are added as both invitees in the request body and recipients in the document to avoid inconveniences during notary sessions > - Signers will receive an email with a notary link upon a successful API call; this link is also in the 201 response > - In case if notary is not specified in the request, signers will use the link to connect with commissioned online notaries, available Mon-Fri, 9 AM - 9 PM Central Time, typically responding within 2 minutes > - If notary is specified, signers will use the link to connect with your in-house notary at the scheduled time ## Limits A maximum of 100 API calls per minute is permitted. Exceeding this limit triggers a 429 Too Many Requests error. ## Troubleshooting **Solutions for 4xx Response Codes:** - **403 Forbidden (Inactive Add-on)**: Ensure the Notary On-Demand or Notary add-on is installed - **403 Forbidden (Transactions Limit)**: Purchase additional transactions either through the Notary UI or by contacting the Sales team - **429 Too Many Requests**: If you hit the limit, hold your API calls, then send them after waiting for the retry time > 📘 To learn more about PandaDoc Notary On-Demand, visit our [website](https://notary.pandadoc.com/notary-on-demand/). + * Create Notarization Request + * @param createNotarizationRequest + */ + public createNotarizationRequest(createNotarizationRequest: CreateNotarizationRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.createNotarizationRequest(createNotarizationRequest, observableOptions); + return result.toPromise(); + } + + /** + * Use this method to delete a notarization request. Once notarization request is deleted it cannot be restored. > 🚧 Notarization Request status > > You can only delete a notarization request in status \'SENT\', \'WAITING_FOR_NOTARY\' or \'INCOMPLETE\'. > If the notarization request is in any other status, the request will return a 400 Bad Request error. By default all invitees will receive email notification about deletion of the notarization request. If you want to disable this notification, you can use the `disable_invitees_notifications` parameter when creating request (see [Create Notarization Request](https://developers.pandadoc.com/reference/create-notarization-request)). + * Delete Notarization Request + * @param sessionRequestId Notarization Request ID. + */ + public deleteNotarizationRequestWithHttpInfo(sessionRequestId: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.deleteNotarizationRequestWithHttpInfo(sessionRequestId, observableOptions); + return result.toPromise(); + } + + /** + * Use this method to delete a notarization request. Once notarization request is deleted it cannot be restored. > 🚧 Notarization Request status > > You can only delete a notarization request in status \'SENT\', \'WAITING_FOR_NOTARY\' or \'INCOMPLETE\'. > If the notarization request is in any other status, the request will return a 400 Bad Request error. By default all invitees will receive email notification about deletion of the notarization request. If you want to disable this notification, you can use the `disable_invitees_notifications` parameter when creating request (see [Create Notarization Request](https://developers.pandadoc.com/reference/create-notarization-request)). + * Delete Notarization Request + * @param sessionRequestId Notarization Request ID. + */ + public deleteNotarizationRequest(sessionRequestId: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.deleteNotarizationRequest(sessionRequestId, observableOptions); + return result.toPromise(); + } + + /** + * Retrieve a list of notaries associated with your organization. ## Important Notes - At the moment, notaries can be added to organization only manually through the PandaDoc Notary UI. - Organization must have Notary addon enabled to use this endpoint + * List Notaries + * @param [status] Filter by status (comma-separated values supported). Valid values are INVITED, UNDER_REVIEW, ACTIVE, REJECTED, INACTIVE + * @param [commissionState] Filter by commission state (comma-separated values supported) + * @param [offset] Number of results to skip + * @param [limit] Maximum number of results to return + * @param [orderBy] Sort by name, email, or status (default is email). Use a - prefix for descending order (e.g., -email) + */ + public listNotariesWithHttpInfo(status?: Array<'INVITED' | 'UNDER_REVIEW' | 'ACTIVE' | 'REJECTED' | 'INACTIVE'>, commissionState?: Array, offset?: number, limit?: number, orderBy?: 'email' | '-email' | 'status' | '-status' | 'name' | '-name', _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.listNotariesWithHttpInfo(status, commissionState, offset, limit, orderBy, observableOptions); + return result.toPromise(); + } + + /** + * Retrieve a list of notaries associated with your organization. ## Important Notes - At the moment, notaries can be added to organization only manually through the PandaDoc Notary UI. - Organization must have Notary addon enabled to use this endpoint + * List Notaries + * @param [status] Filter by status (comma-separated values supported). Valid values are INVITED, UNDER_REVIEW, ACTIVE, REJECTED, INACTIVE + * @param [commissionState] Filter by commission state (comma-separated values supported) + * @param [offset] Number of results to skip + * @param [limit] Maximum number of results to return + * @param [orderBy] Sort by name, email, or status (default is email). Use a - prefix for descending order (e.g., -email) + */ + public listNotaries(status?: Array<'INVITED' | 'UNDER_REVIEW' | 'ACTIVE' | 'REJECTED' | 'INACTIVE'>, commissionState?: Array, offset?: number, limit?: number, orderBy?: 'email' | '-email' | 'status' | '-status' | 'name' | '-name', _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.listNotaries(status, commissionState, offset, limit, orderBy, observableOptions); + return result.toPromise(); + } + + /** + * Get details about a notarization request by its `id`. Details include: - Basic notarization request information (status, creator, invitees). - Signed documents information with links for downloading. - Notarization session recording information with link for downloading. - Timestamps associated with a notarization request. ## Available Notarization Request Statuses The following is a complete list of all possible notarization request statuses returned: | Notarization Request Status | Status Description | | :-------------------------- | :----------------------------------------------------------------------------------------------------------------- | | SENT | Notarization request has been created. Invitees are notified and can start the process of finding a notary. | | WAITING_FOR_NOTARY | One of the invitees initialised the process of finding a notary. | | ACCEPTED | Notarization request has been accepted by the notary. At this time nobody has joined the notarization session yet. | | LIVE | Notarization session has started. | | COMPLETED | Notarization session is finished. Documents have been successfully signed and ready for downloading. | | INCOMPLETE | Notarization session has started but was not completed successfully. | ## Signed documents Signed documents are the documents that were successfully signed during the notarization session. The signed document\'s info is available only if the notarization request has `COMPLETED` status, otherwise the returned list will be empty. In case you uploaded several documents for notarization then the `signed_documents` list will contain links for downloading for each document separately (with `SINGLE` document type) and link for the combined document (with `COMBINED` document type accordingly). ## Recording Recording is the video of the notarization session. The recording info is available only if the notarization request has `COMPLETED` status and recording is available, otherwise the returned object will be empty. > 📘 Links expire in 1 hour > > **Note**: The signed document and recording links expire in 1 hour. After this time it will be not possible to download files using the returned urls. In this case you need to call endpoint again since each request generates a new link. ## Limits A maximum of 100 API calls per minute is permitted. Exceeding this limit triggers a 429 Too Many Requests error. + * Notarization Request Details + * @param sessionRequestId Notarization Request ID. + */ + public notarizationRequestDetailsWithHttpInfo(sessionRequestId: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.notarizationRequestDetailsWithHttpInfo(sessionRequestId, observableOptions); + return result.toPromise(); + } + + /** + * Get details about a notarization request by its `id`. Details include: - Basic notarization request information (status, creator, invitees). - Signed documents information with links for downloading. - Notarization session recording information with link for downloading. - Timestamps associated with a notarization request. ## Available Notarization Request Statuses The following is a complete list of all possible notarization request statuses returned: | Notarization Request Status | Status Description | | :-------------------------- | :----------------------------------------------------------------------------------------------------------------- | | SENT | Notarization request has been created. Invitees are notified and can start the process of finding a notary. | | WAITING_FOR_NOTARY | One of the invitees initialised the process of finding a notary. | | ACCEPTED | Notarization request has been accepted by the notary. At this time nobody has joined the notarization session yet. | | LIVE | Notarization session has started. | | COMPLETED | Notarization session is finished. Documents have been successfully signed and ready for downloading. | | INCOMPLETE | Notarization session has started but was not completed successfully. | ## Signed documents Signed documents are the documents that were successfully signed during the notarization session. The signed document\'s info is available only if the notarization request has `COMPLETED` status, otherwise the returned list will be empty. In case you uploaded several documents for notarization then the `signed_documents` list will contain links for downloading for each document separately (with `SINGLE` document type) and link for the combined document (with `COMBINED` document type accordingly). ## Recording Recording is the video of the notarization session. The recording info is available only if the notarization request has `COMPLETED` status and recording is available, otherwise the returned object will be empty. > 📘 Links expire in 1 hour > > **Note**: The signed document and recording links expire in 1 hour. After this time it will be not possible to download files using the returned urls. In this case you need to call endpoint again since each request generates a new link. ## Limits A maximum of 100 API calls per minute is permitted. Exceeding this limit triggers a 429 Too Many Requests error. + * Notarization Request Details + * @param sessionRequestId Notarization Request ID. + */ + public notarizationRequestDetails(sessionRequestId: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.notarizationRequestDetails(sessionRequestId, observableOptions); + return result.toPromise(); + } + + +} + + + +import { ObservableOAuth20AuthenticationApi } from './ObservableAPI'; + +import { OAuth20AuthenticationApiRequestFactory, OAuth20AuthenticationApiResponseProcessor} from "../apis/OAuth20AuthenticationApi"; +export class PromiseOAuth20AuthenticationApi { + private api: ObservableOAuth20AuthenticationApi + + public constructor( + configuration: Configuration, + requestFactory?: OAuth20AuthenticationApiRequestFactory, + responseProcessor?: OAuth20AuthenticationApiResponseProcessor + ) { + this.api = new ObservableOAuth20AuthenticationApi(configuration, requestFactory, responseProcessor); + } + + /** + * Create or refresh an access token to make requests on behalf of a user. This endpoint is used to obtain an `access_token` and `refresh_token` for the first time, and to refresh the `access_token` when it expires. This endpoint is part of OAuth 2.0 implementation. You need to configure OAuth App to obtain `client_id` and `client_secret`. Read more about [OAuth 2.0 implementation](https://developers.pandadoc.com/reference/authentication-process). Make sure you\'re sending the header `Content-Type: application/x-www-form-urlencoded`. ## Create Access Token As a result of the OAuth 2.0 user authentication process, you should get a `code` that can be exchanged for an `access_token`. Use this endpoint to do this exchange, and to refresh the token later. > 🚧 Invalid Grant? > > If you receive an `invalid grant` response it is likely because you used the same `code` more than once from the [Authorize a PandaDoc User](ref:authorize-a-user) step above. The `code` parameter is generated for one-time use. A new `code` value must be generated if you wish to change API users, permissions, or simply generate a new `code` value for the same PandaDoc user. > 📘 expires_in > > `expires_in` is based in seconds. Currently, a token expires in 31535999 seconds = 1 year. ## Refresh Access Token Eventually, `access_token` expires and accessing an API method returns **401 unauthorized**. Your application needs to refresh the OAuth2 token with the stored `refresh_token` returned when initially creating an access token. Once refreshed, calls on behalf of the originally authorized user can resume immediately. Use the newly returned `access_token` for all future API requests. > 🚧 Invalid Grant? > > If you receive an `invalid grant` response, it is likely because your `refresh_token` is invalid. + * Create/Refresh Access Token + * @param [grantType] This value must be set to `refresh_token`. + * @param [clientId] Client ID that is automatically generated after application creation in the Developer Dashboard. + * @param [clientSecret] Client secret that is automatically generated after application creation in the Developer Dashboard. + * @param [code] `auth_code` from the server on the previous step (Authorize a PandaDoc User). + * @param [scope] Requested permissions. Use `read+write` as our default value to send documents. + * @param [refreshToken] `refresh_token` you received and stored from the server when initially creating an `access_token`. + */ + public accessTokenWithHttpInfo(grantType?: string, clientId?: string, clientSecret?: string, code?: string, scope?: string, refreshToken?: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.accessTokenWithHttpInfo(grantType, clientId, clientSecret, code, scope, refreshToken, observableOptions); + return result.toPromise(); } /** - * List forms. - * Forms - * @param count Optionally, specify how many forms to return. Default is 50 forms, maximum is 100 forms. - * @param page Optionally, specify which page of the dataset to return. - * @param status Optionally, specify which status of the forms dataset to return. - * @param orderBy Optionally, specify the form dataset order to return. - * @param asc Optionally, specify sorting the result-set in ascending or descending order. - * @param name Specify the form name. + * Create or refresh an access token to make requests on behalf of a user. This endpoint is used to obtain an `access_token` and `refresh_token` for the first time, and to refresh the `access_token` when it expires. This endpoint is part of OAuth 2.0 implementation. You need to configure OAuth App to obtain `client_id` and `client_secret`. Read more about [OAuth 2.0 implementation](https://developers.pandadoc.com/reference/authentication-process). Make sure you\'re sending the header `Content-Type: application/x-www-form-urlencoded`. ## Create Access Token As a result of the OAuth 2.0 user authentication process, you should get a `code` that can be exchanged for an `access_token`. Use this endpoint to do this exchange, and to refresh the token later. > 🚧 Invalid Grant? > > If you receive an `invalid grant` response it is likely because you used the same `code` more than once from the [Authorize a PandaDoc User](ref:authorize-a-user) step above. The `code` parameter is generated for one-time use. A new `code` value must be generated if you wish to change API users, permissions, or simply generate a new `code` value for the same PandaDoc user. > 📘 expires_in > > `expires_in` is based in seconds. Currently, a token expires in 31535999 seconds = 1 year. ## Refresh Access Token Eventually, `access_token` expires and accessing an API method returns **401 unauthorized**. Your application needs to refresh the OAuth2 token with the stored `refresh_token` returned when initially creating an access token. Once refreshed, calls on behalf of the originally authorized user can resume immediately. Use the newly returned `access_token` for all future API requests. > 🚧 Invalid Grant? > > If you receive an `invalid grant` response, it is likely because your `refresh_token` is invalid. + * Create/Refresh Access Token + * @param [grantType] This value must be set to `refresh_token`. + * @param [clientId] Client ID that is automatically generated after application creation in the Developer Dashboard. + * @param [clientSecret] Client secret that is automatically generated after application creation in the Developer Dashboard. + * @param [code] `auth_code` from the server on the previous step (Authorize a PandaDoc User). + * @param [scope] Requested permissions. Use `read+write` as our default value to send documents. + * @param [refreshToken] `refresh_token` you received and stored from the server when initially creating an `access_token`. */ - public listForm(count?: number, page?: number, status?: Array<'draft' | 'active' | 'disabled'>, orderBy?: 'name' | 'responses' | 'status' | 'created_date' | 'modified_date', asc?: boolean, name?: string, _options?: Configuration): Promise { - const result = this.api.listForm(count, page, status, orderBy, asc, name, _options); + public accessToken(grantType?: string, clientId?: string, clientSecret?: string, code?: string, scope?: string, refreshToken?: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.accessToken(grantType, clientId, clientSecret, code, scope, refreshToken, observableOptions); return result.toPromise(); } @@ -780,78 +2688,145 @@ export class PromiseFormsApi { -import { ObservableMembersApi } from './ObservableAPI'; +import { ObservableProductCatalogApi } from './ObservableAPI'; -import { MembersApiRequestFactory, MembersApiResponseProcessor} from "../apis/MembersApi"; -export class PromiseMembersApi { - private api: ObservableMembersApi +import { ProductCatalogApiRequestFactory, ProductCatalogApiResponseProcessor} from "../apis/ProductCatalogApi"; +export class PromiseProductCatalogApi { + private api: ObservableProductCatalogApi public constructor( configuration: Configuration, - requestFactory?: MembersApiRequestFactory, - responseProcessor?: MembersApiResponseProcessor + requestFactory?: ProductCatalogApiRequestFactory, + responseProcessor?: ProductCatalogApiResponseProcessor ) { - this.api = new ObservableMembersApi(configuration, requestFactory, responseProcessor); + this.api = new ObservableProductCatalogApi(configuration, requestFactory, responseProcessor); } /** - * A method to define to whom credentials belong - * Current member details + * Create a new catalog item. + * Create Catalog Item + * @param productCatalogItemRequest */ - public detailsCurrentMember(_options?: Configuration): Promise { - const result = this.api.detailsCurrentMember(_options); + public createCatalogItemWithHttpInfo(productCatalogItemRequest: ProductCatalogItemRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.createCatalogItemWithHttpInfo(productCatalogItemRequest, observableOptions); return result.toPromise(); } /** - * A method to retrieve a member's details by id - * Member details - * @param id Membership id + * Create a new catalog item. + * Create Catalog Item + * @param productCatalogItemRequest */ - public detailsMember(id: string, _options?: Configuration): Promise { - const result = this.api.detailsMember(id, _options); + public createCatalogItem(productCatalogItemRequest: ProductCatalogItemRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.createCatalogItem(productCatalogItemRequest, observableOptions); return result.toPromise(); } /** - * Retrieve all members details of the workspace - * List members + * Delete catalog item. + * Delete Catalog Item + * @param itemUuid Catalog item UUID */ - public listMembers(_options?: Configuration): Promise { - const result = this.api.listMembers(_options); + public deleteCatalogItemWithHttpInfo(itemUuid: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.deleteCatalogItemWithHttpInfo(itemUuid, observableOptions); return result.toPromise(); } + /** + * Delete catalog item. + * Delete Catalog Item + * @param itemUuid Catalog item UUID + */ + public deleteCatalogItem(itemUuid: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.deleteCatalogItem(itemUuid, observableOptions); + return result.toPromise(); + } -} - + /** + * Get catalog item. + * Catalog Item Details + * @param itemUuid Catalog item UUID + */ + public getCatalogItemWithHttpInfo(itemUuid: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.getCatalogItemWithHttpInfo(itemUuid, observableOptions); + return result.toPromise(); + } + /** + * Get catalog item. + * Catalog Item Details + * @param itemUuid Catalog item UUID + */ + public getCatalogItem(itemUuid: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.getCatalogItem(itemUuid, observableOptions); + return result.toPromise(); + } -import { ObservableOAuth20AuthenticationApi } from './ObservableAPI'; + /** + * This method searches for items in your [product catalog](https://support.pandadoc.com/en/articles/9714691-product-catalog). Use the `query` parameter to search in title, SKU, description, category name, custom fields name and value. You can also search for items by their type, billing type, and category id. Order search results, in both ascending and descending order, by these item properties: - SKU - Name - Price - Modification date Use the `exclude_uuids` parameter to exclude particular uuids from the search request. + * List Catalog Items Search + * @param [page] Page number. + * @param [perPage] Items per page. + * @param [query] Search query. Searches the following fields: Title, SKU, description, category name, custom fields name and value. + * @param [orderBy] Ordering principle for displaying search results. + * @param [types] Filter by catalog item types. + * @param [billingTypes] Filter by billing types. + * @param [excludeUuids] A list of item uuids to be excluded from search. + * @param [categoryId] Category id. + * @param [noCategory] + */ + public searchCatalogItemsWithHttpInfo(page?: number, perPage?: number, query?: string, orderBy?: 'sku' | '-sku' | 'title' | '-title' | 'price' | '-price' | 'date_modified' | '-date_modified', types?: Array, billingTypes?: Array<'one_time' | 'recurring'>, excludeUuids?: Array, categoryId?: string, noCategory?: boolean, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.searchCatalogItemsWithHttpInfo(page, perPage, query, orderBy, types, billingTypes, excludeUuids, categoryId, noCategory, observableOptions); + return result.toPromise(); + } -import { OAuth20AuthenticationApiRequestFactory, OAuth20AuthenticationApiResponseProcessor} from "../apis/OAuth20AuthenticationApi"; -export class PromiseOAuth20AuthenticationApi { - private api: ObservableOAuth20AuthenticationApi + /** + * This method searches for items in your [product catalog](https://support.pandadoc.com/en/articles/9714691-product-catalog). Use the `query` parameter to search in title, SKU, description, category name, custom fields name and value. You can also search for items by their type, billing type, and category id. Order search results, in both ascending and descending order, by these item properties: - SKU - Name - Price - Modification date Use the `exclude_uuids` parameter to exclude particular uuids from the search request. + * List Catalog Items Search + * @param [page] Page number. + * @param [perPage] Items per page. + * @param [query] Search query. Searches the following fields: Title, SKU, description, category name, custom fields name and value. + * @param [orderBy] Ordering principle for displaying search results. + * @param [types] Filter by catalog item types. + * @param [billingTypes] Filter by billing types. + * @param [excludeUuids] A list of item uuids to be excluded from search. + * @param [categoryId] Category id. + * @param [noCategory] + */ + public searchCatalogItems(page?: number, perPage?: number, query?: string, orderBy?: 'sku' | '-sku' | 'title' | '-title' | 'price' | '-price' | 'date_modified' | '-date_modified', types?: Array, billingTypes?: Array<'one_time' | 'recurring'>, excludeUuids?: Array, categoryId?: string, noCategory?: boolean, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.searchCatalogItems(page, perPage, query, orderBy, types, billingTypes, excludeUuids, categoryId, noCategory, observableOptions); + return result.toPromise(); + } - public constructor( - configuration: Configuration, - requestFactory?: OAuth20AuthenticationApiRequestFactory, - responseProcessor?: OAuth20AuthenticationApiResponseProcessor - ) { - this.api = new ObservableOAuth20AuthenticationApi(configuration, requestFactory, responseProcessor); + /** + * Update catalog item. + * Update Catalog Item + * @param itemUuid Catalog item UUID + * @param productCatalogItemPatchRequest + */ + public updateCatalogItemWithHttpInfo(itemUuid: string, productCatalogItemPatchRequest: ProductCatalogItemPatchRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.updateCatalogItemWithHttpInfo(itemUuid, productCatalogItemPatchRequest, observableOptions); + return result.toPromise(); } /** - * Create/Refresh Access Token - * @param grantType This value must be set to `refresh_token`. - * @param clientId Client ID that is automatically generated after application creation in the Developer Dashboard. - * @param clientSecret Client secret that is automatically generated after application creation in the Developer Dashboard. - * @param code `auth_code` from the server on the previous step (Authorize a PandaDoc User). - * @param scope Requested permissions. Use `read+write` as our default value to send documents. - * @param refreshToken `refresh_token` you received and stored from the server when initially creating an `access_token`. + * Update catalog item. + * Update Catalog Item + * @param itemUuid Catalog item UUID + * @param productCatalogItemPatchRequest */ - public accessToken(grantType?: string, clientId?: string, clientSecret?: string, code?: string, scope?: string, refreshToken?: string, _options?: Configuration): Promise { - const result = this.api.accessToken(grantType, clientId, clientSecret, code, scope, refreshToken, _options); + public updateCatalogItem(itemUuid: string, productCatalogItemPatchRequest: ProductCatalogItemPatchRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.updateCatalogItem(itemUuid, productCatalogItemPatchRequest, observableOptions); return result.toPromise(); } @@ -875,13 +2850,28 @@ export class PromiseQuotesApi { } /** + * This operation updates the details of a specific quote within a document by specifying the document ID and quote ID. + * Quote update + * @param documentId Document ID + * @param quoteId Quote ID + * @param quoteUpdateRequest + */ + public quoteUpdateWithHttpInfo(documentId: string, quoteId: string, quoteUpdateRequest: QuoteUpdateRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.quoteUpdateWithHttpInfo(documentId, quoteId, quoteUpdateRequest, observableOptions); + return result.toPromise(); + } + + /** + * This operation updates the details of a specific quote within a document by specifying the document ID and quote ID. * Quote update * @param documentId Document ID * @param quoteId Quote ID - * @param quoteUpdateRequest + * @param quoteUpdateRequest */ - public quoteUpdate(documentId: string, quoteId: string, quoteUpdateRequest: QuoteUpdateRequest, _options?: Configuration): Promise { - const result = this.api.quoteUpdate(documentId, quoteId, quoteUpdateRequest, _options); + public quoteUpdate(documentId: string, quoteId: string, quoteUpdateRequest: QuoteUpdateRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.quoteUpdate(documentId, quoteId, quoteUpdateRequest, observableOptions); return result.toPromise(); } @@ -890,57 +2880,63 @@ export class PromiseQuotesApi { -import { ObservableSectionsApi } from './ObservableAPI'; +import { ObservableTemplateSettingsApi } from './ObservableAPI'; -import { SectionsApiRequestFactory, SectionsApiResponseProcessor} from "../apis/SectionsApi"; -export class PromiseSectionsApi { - private api: ObservableSectionsApi +import { TemplateSettingsApiRequestFactory, TemplateSettingsApiResponseProcessor} from "../apis/TemplateSettingsApi"; +export class PromiseTemplateSettingsApi { + private api: ObservableTemplateSettingsApi public constructor( configuration: Configuration, - requestFactory?: SectionsApiRequestFactory, - responseProcessor?: SectionsApiResponseProcessor + requestFactory?: TemplateSettingsApiRequestFactory, + responseProcessor?: TemplateSettingsApiResponseProcessor ) { - this.api = new ObservableSectionsApi(configuration, requestFactory, responseProcessor); + this.api = new ObservableTemplateSettingsApi(configuration, requestFactory, responseProcessor); } /** - * List sections - * @param documentId Document ID + * Retrieves the settings for a specified template. Only the language field is currently supported. + * Get template settings + * @param templateId Unique identifier of the template to retrieve settings for. */ - public listSections(documentId: string, _options?: Configuration): Promise { - const result = this.api.listSections(documentId, _options); + public templateSettingsGetWithHttpInfo(templateId: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.templateSettingsGetWithHttpInfo(templateId, observableOptions); return result.toPromise(); } /** - * Section details - * @param documentId Document ID - * @param uploadId Upload ID + * Retrieves the settings for a specified template. Only the language field is currently supported. + * Get template settings + * @param templateId Unique identifier of the template to retrieve settings for. */ - public sectionDetails(documentId: string, uploadId: string, _options?: Configuration): Promise { - const result = this.api.sectionDetails(documentId, uploadId, _options); + public templateSettingsGet(templateId: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.templateSettingsGet(templateId, observableOptions); return result.toPromise(); } /** - * Section Info - * @param documentId Document ID - * @param sectionId Section ID + * Updates the settings for a specified template. Only the language field is currently supported. + * Update template settings + * @param templateId Unique identifier of the template to update settings for. + * @param updateTemplateSettingsRequest */ - public sectionInfo(documentId: string, sectionId: string, _options?: Configuration): Promise { - const result = this.api.sectionInfo(documentId, sectionId, _options); + public templateSettingsUpdateWithHttpInfo(templateId: string, updateTemplateSettingsRequest: UpdateTemplateSettingsRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.templateSettingsUpdateWithHttpInfo(templateId, updateTemplateSettingsRequest, observableOptions); return result.toPromise(); } /** - * Upload section - * @param documentId Document ID - * @param uploadSectionRequest Use a PandaDoc template or an existing PDF to upload a section. See the creation request examples [by template](/schemas/UploadSectionByTemplateRequest) and [by pdf](/schemas/UploadSectionByPdfRequest) - * @param mergeFieldScope Determines how the fields are mapped when creating a section. * document: Default value. The fields of the entire document are updated. * upload: Only the fields from the created section are updated. The merge field is appended with the upload ID. + * Updates the settings for a specified template. Only the language field is currently supported. + * Update template settings + * @param templateId Unique identifier of the template to update settings for. + * @param updateTemplateSettingsRequest */ - public uploadSection(documentId: string, uploadSectionRequest: UploadSectionRequest, mergeFieldScope?: 'document' | 'upload', _options?: Configuration): Promise { - const result = this.api.uploadSection(documentId, uploadSectionRequest, mergeFieldScope, _options); + public templateSettingsUpdate(templateId: string, updateTemplateSettingsRequest: UpdateTemplateSettingsRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.templateSettingsUpdate(templateId, updateTemplateSettingsRequest, observableOptions); return result.toPromise(); } @@ -963,41 +2959,205 @@ export class PromiseTemplatesApi { this.api = new ObservableTemplatesApi(configuration, requestFactory, responseProcessor); } + /** + * This operation allows you to create a new template by providing the necessary template details. + * Create Template + * @param createTemplateFromUrlRequest + * @param [fields] A comma-separated list of additional fields to include in the response. + */ + public createTemplateWithHttpInfo(createTemplateFromUrlRequest: CreateTemplateFromUrlRequest, fields?: Array<'content_date_modified'>, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.createTemplateWithHttpInfo(createTemplateFromUrlRequest, fields, observableOptions); + return result.toPromise(); + } + + /** + * This operation allows you to create a new template by providing the necessary template details. + * Create Template + * @param createTemplateFromUrlRequest + * @param [fields] A comma-separated list of additional fields to include in the response. + */ + public createTemplate(createTemplateFromUrlRequest: CreateTemplateFromUrlRequest, fields?: Array<'content_date_modified'>, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.createTemplate(createTemplateFromUrlRequest, fields, observableOptions); + return result.toPromise(); + } + + /** + * Creates a new editing session for the Embedded Editor. The response includes an E-Token, which is required to open the template. #### Limitations - **Single Active Session per User-Template Pair** Only one editing session can be active at a time for a specific user and template. Creating a new session for the same user-template pair will automatically invalidate the previous one. - **Weekly Session Cap** A maximum of **250** editing sessions can be created for a single template per week. Any attempt to exceed this limit will result in a `403 Forbidden` error. + * Create Template Editing Session + * @param id Template ID + * @param editingSessionRequest + */ + public createTemplateEditingSessionWithHttpInfo(id: string, editingSessionRequest: EditingSessionRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.createTemplateEditingSessionWithHttpInfo(id, editingSessionRequest, observableOptions); + return result.toPromise(); + } + + /** + * Creates a new editing session for the Embedded Editor. The response includes an E-Token, which is required to open the template. #### Limitations - **Single Active Session per User-Template Pair** Only one editing session can be active at a time for a specific user and template. Creating a new session for the same user-template pair will automatically invalidate the previous one. - **Weekly Session Cap** A maximum of **250** editing sessions can be created for a single template per week. Any attempt to exceed this limit will result in a `403 Forbidden` error. + * Create Template Editing Session + * @param id Template ID + * @param editingSessionRequest + */ + public createTemplateEditingSession(id: string, editingSessionRequest: EditingSessionRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.createTemplateEditingSession(id, editingSessionRequest, observableOptions); + return result.toPromise(); + } + + /** + * This asynchronous endpoint allows users to create a new template by uploading a file. The uploaded file is processed in the background to generate the template. The maximum allowable file size for upload is 100 MB. Field tags and form fields are not supported yet. Once the file is uploaded, the processing will happen asynchronously, and users need to check [the status of the template](https://developers.pandadoc.com/reference/template-status) creation. + * Create Template from File Upload + * @param [fields] A comma-separated list of additional fields to include in the response. + * @param [file] Binary PDF/DocX/RTF File. + * @param [data] JSON as a multipart/form-data string. + */ + public createTemplateWithUploadWithHttpInfo(fields?: Array<'content_date_modified'>, file?: HttpFile, data?: CreateTemplateRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.createTemplateWithUploadWithHttpInfo(fields, file, data, observableOptions); + return result.toPromise(); + } + + /** + * This asynchronous endpoint allows users to create a new template by uploading a file. The uploaded file is processed in the background to generate the template. The maximum allowable file size for upload is 100 MB. Field tags and form fields are not supported yet. Once the file is uploaded, the processing will happen asynchronously, and users need to check [the status of the template](https://developers.pandadoc.com/reference/template-status) creation. + * Create Template from File Upload + * @param [fields] A comma-separated list of additional fields to include in the response. + * @param [file] Binary PDF/DocX/RTF File. + * @param [data] JSON as a multipart/form-data string. + */ + public createTemplateWithUpload(fields?: Array<'content_date_modified'>, file?: HttpFile, data?: CreateTemplateRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.createTemplateWithUpload(fields, file, data, observableOptions); + return result.toPromise(); + } + + /** + * Delete a template + * Delete Template + * @param id Template ID + */ + public deleteTemplateWithHttpInfo(id: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.deleteTemplateWithHttpInfo(id, observableOptions); + return result.toPromise(); + } + /** * Delete a template * Delete Template * @param id Template ID */ - public deleteTemplate(id: string, _options?: Configuration): Promise { - const result = this.api.deleteTemplate(id, _options); + public deleteTemplate(id: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.deleteTemplate(id, observableOptions); + return result.toPromise(); + } + + /** + * Get details about a template by `id`. Details include: - Basic template information (name, author, etc) - Roles - All fields with values - All tokens with values - Pricing information (pricing tables, products, quotes) - Template metadata - Template tags - Content placeholders - Modification timestamps. Note that `date_modified` means any changes associated with the template roles, while `content_date_modified` logs any changes in the template content. + * Template Details + * @param id Template ID + */ + public detailsTemplateWithHttpInfo(id: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.detailsTemplateWithHttpInfo(id, observableOptions); return result.toPromise(); } /** - * Return detailed data about a template. - * Details Template + * Get details about a template by `id`. Details include: - Basic template information (name, author, etc) - Roles - All fields with values - All tokens with values - Pricing information (pricing tables, products, quotes) - Template metadata - Template tags - Content placeholders - Modification timestamps. Note that `date_modified` means any changes associated with the template roles, while `content_date_modified` logs any changes in the template content. + * Template Details * @param id Template ID */ - public detailsTemplate(id: string, _options?: Configuration): Promise { - const result = this.api.detailsTemplate(id, _options); + public detailsTemplate(id: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.detailsTemplate(id, observableOptions); + return result.toPromise(); + } + + /** + * Retrieves a list of templates. You can filter results by a search query, tags, or fields. + * List Templates + * @param [q] Search query. Filter by template name. + * @param [shared] Returns only the shared templates. + * @param [deleted] Returns only the deleted templates. + * @param [count] Specify how many templates to return. + * @param [page] Specify which page of the dataset to return. + * @param [id] Specify template ID. + * @param [folderUuid] UUID of the folder where the templates are stored. + * @param [tag] Search tag. Filter by template tag. + * @param [fields] A comma-separated list of additional fields to include in the response. + */ + public listTemplatesWithHttpInfo(q?: string, shared?: boolean, deleted?: boolean, count?: number, page?: number, id?: string, folderUuid?: string, tag?: Array, fields?: Array<'content_date_modified'>, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.listTemplatesWithHttpInfo(q, shared, deleted, count, page, id, folderUuid, tag, fields, observableOptions); return result.toPromise(); } /** - * Optionally, filter by a search query or tags. + * Retrieves a list of templates. You can filter results by a search query, tags, or fields. * List Templates - * @param q Optional search query. Filter by template name. - * @param shared Returns only the shared templates. - * @param deleted Optional. Returns only the deleted templates. - * @param count Optionally, specify how many templates to return. Default is 50 templates, maximum is 100 templates. - * @param page Optionally, specify which page of the dataset to return. - * @param id Optionally, specify template ID. - * @param folderUuid UUID of the folder where the templates are stored. - * @param tag Optional search tag. Filter by template tag. - * @param fields A comma-separated list of additional fields to include in the response. Each field must be a valid template property. Currently, only one additional field, `content_date_modified`, is supported. For example, `GET /templates?fields=content_date_modified`. + * @param [q] Search query. Filter by template name. + * @param [shared] Returns only the shared templates. + * @param [deleted] Returns only the deleted templates. + * @param [count] Specify how many templates to return. + * @param [page] Specify which page of the dataset to return. + * @param [id] Specify template ID. + * @param [folderUuid] UUID of the folder where the templates are stored. + * @param [tag] Search tag. Filter by template tag. + * @param [fields] A comma-separated list of additional fields to include in the response. + */ + public listTemplates(q?: string, shared?: boolean, deleted?: boolean, count?: number, page?: number, id?: string, folderUuid?: string, tag?: Array, fields?: Array<'content_date_modified'>, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.listTemplates(q, shared, deleted, count, page, id, folderUuid, tag, fields, observableOptions); + return result.toPromise(); + } + + /** + * ## Available Template Statuses The following is a complete list of all possible template statuses returned: | Template Status | Status Description | | :------------------- | :-------------------------------------------------------------------------------------------------------------------------------------- | | `template.UPLOADED` | The template upload process has been initiated and is currently in progress. It will soon transition to the `template.PROCESSED` state. | | `template.PROCESSED` | The template has been successfully uploaded and created. At this stage, all aspects of the template are editable. | | `template.ERROR` | The template upload process has failed. Please refer to the error details in the response for more information. | + * Template Status + * @param id Template ID + */ + public statusTemplateWithHttpInfo(id: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.statusTemplateWithHttpInfo(id, observableOptions); + return result.toPromise(); + } + + /** + * ## Available Template Statuses The following is a complete list of all possible template statuses returned: | Template Status | Status Description | | :------------------- | :-------------------------------------------------------------------------------------------------------------------------------------- | | `template.UPLOADED` | The template upload process has been initiated and is currently in progress. It will soon transition to the `template.PROCESSED` state. | | `template.PROCESSED` | The template has been successfully uploaded and created. At this stage, all aspects of the template are editable. | | `template.ERROR` | The template upload process has failed. Please refer to the error details in the response for more information. | + * Template Status + * @param id Template ID + */ + public statusTemplate(id: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.statusTemplate(id, observableOptions); + return result.toPromise(); + } + + /** + * > 🚧 Template status > > You can only update a template in the PROCESSED status (`template.PROCESSED`). > > After creating a new template, it usually retains a `template.uploaded` status for 3-5 seconds while the template syncs across PandaDoc servers. When the template is available for further API calls, the template moves to the `template.PROCESSED` state. Use [Template Status](https://developers.pandadoc.com/reference/template-status) or Webhooks to check template status. + * Template Update + * @param id Template ID + * @param templateUpdateRequest + */ + public updateTemplateWithHttpInfo(id: string, templateUpdateRequest: TemplateUpdateRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.updateTemplateWithHttpInfo(id, templateUpdateRequest, observableOptions); + return result.toPromise(); + } + + /** + * > 🚧 Template status > > You can only update a template in the PROCESSED status (`template.PROCESSED`). > > After creating a new template, it usually retains a `template.uploaded` status for 3-5 seconds while the template syncs across PandaDoc servers. When the template is available for further API calls, the template moves to the `template.PROCESSED` state. Use [Template Status](https://developers.pandadoc.com/reference/template-status) or Webhooks to check template status. + * Template Update + * @param id Template ID + * @param templateUpdateRequest */ - public listTemplates(q?: string, shared?: boolean, deleted?: boolean, count?: number, page?: number, id?: string, folderUuid?: string, tag?: Array, fields?: string, _options?: Configuration): Promise { - const result = this.api.listTemplates(q, shared, deleted, count, page, id, folderUuid, tag, fields, _options); + public updateTemplate(id: string, templateUpdateRequest: TemplateUpdateRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.updateTemplate(id, templateUpdateRequest, observableOptions); return result.toPromise(); } @@ -1021,34 +3181,200 @@ export class PromiseUserAndWorkspaceManagementApi { } /** - * Add member - * @param workspaceId - * @param addMemberRequest - * @param notifyUser Send a confirmation email to the user that was added to workspace(s). - * @param notifyWsAdmins Send a confirmation email to all workspace admins indicating that the user has been added to the workspace. + * Add an existing user to a workspace. - You must be an organization admin or a workspace admin to add members. + * Add Member to Workspace + * @param workspaceId + * @param addMemberRequest + * @param [notifyUser] Send a confirmation email to the user that was added to workspace(s). + * @param [notifyWsAdmins] Send a confirmation email to all workspace admins indicating that the user has been added to the workspace. + */ + public addMemberWithHttpInfo(workspaceId: string, addMemberRequest: AddMemberRequest, notifyUser?: boolean, notifyWsAdmins?: boolean, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.addMemberWithHttpInfo(workspaceId, addMemberRequest, notifyUser, notifyWsAdmins, observableOptions); + return result.toPromise(); + } + + /** + * Add an existing user to a workspace. - You must be an organization admin or a workspace admin to add members. + * Add Member to Workspace + * @param workspaceId + * @param addMemberRequest + * @param [notifyUser] Send a confirmation email to the user that was added to workspace(s). + * @param [notifyWsAdmins] Send a confirmation email to all workspace admins indicating that the user has been added to the workspace. + */ + public addMember(workspaceId: string, addMemberRequest: AddMemberRequest, notifyUser?: boolean, notifyWsAdmins?: boolean, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.addMember(workspaceId, addMemberRequest, notifyUser, notifyWsAdmins, observableOptions); + return result.toPromise(); + } + + /** + * Generate a new API key for the workspace. Check out [API Key Authentication article](https://developers.pandadoc.com/reference/api-key-authentication-process) for detailed API Keys description. > 📘 > - Only an **Org Admin** can generate an API keys. > - To make another user a key\'s owner, pass `user_id` of this user. The user should has an **Admin** role in the workspace. > - Generating a new key invalidates existing key with the same type. Using this request, you can deactivate the key you\'re using for the request. + * Create API Key + * @param workspaceId Workspace id. + * @param createApiKeyRequest + */ + public createApiKeyWithHttpInfo(workspaceId: string, createApiKeyRequest: CreateApiKeyRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.createApiKeyWithHttpInfo(workspaceId, createApiKeyRequest, observableOptions); + return result.toPromise(); + } + + /** + * Generate a new API key for the workspace. Check out [API Key Authentication article](https://developers.pandadoc.com/reference/api-key-authentication-process) for detailed API Keys description. > 📘 > - Only an **Org Admin** can generate an API keys. > - To make another user a key\'s owner, pass `user_id` of this user. The user should has an **Admin** role in the workspace. > - Generating a new key invalidates existing key with the same type. Using this request, you can deactivate the key you\'re using for the request. + * Create API Key + * @param workspaceId Workspace id. + * @param createApiKeyRequest */ - public addMember(workspaceId: string, addMemberRequest: AddMemberRequest, notifyUser?: boolean, notifyWsAdmins?: boolean, _options?: Configuration): Promise { - const result = this.api.addMember(workspaceId, addMemberRequest, notifyUser, notifyWsAdmins, _options); + public createApiKey(workspaceId: string, createApiKeyRequest: CreateApiKeyRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.createApiKey(workspaceId, createApiKeyRequest, observableOptions); return result.toPromise(); } /** + * Create users, and assign them roles, licenses, and workspaces. - You must be an organization admin to create users. - We check that the user email domain matches your organization domain. - We check that the user email and phone number have a valid format. * Create User - * @param createUserRequest - * @param notifyUser Send a confirmation email to the user that was added to workspace(s). - * @param notifyWsAdmins Send a confirmation email to all workspace admins indicating that the user has been added to the workspace. + * @param createUserRequest + * @param [notifyUser] Send a confirmation email to the user that was added to workspace(s). + * @param [notifyWsAdmins] Send a confirmation email to all workspace admins indicating that the user has been added to the workspace. */ - public createUser(createUserRequest: CreateUserRequest, notifyUser?: boolean, notifyWsAdmins?: boolean, _options?: Configuration): Promise { - const result = this.api.createUser(createUserRequest, notifyUser, notifyWsAdmins, _options); + public createUserWithHttpInfo(createUserRequest: CreateUserRequest, notifyUser?: boolean, notifyWsAdmins?: boolean, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.createUserWithHttpInfo(createUserRequest, notifyUser, notifyWsAdmins, observableOptions); return result.toPromise(); } /** + * Create users, and assign them roles, licenses, and workspaces. - You must be an organization admin to create users. - We check that the user email domain matches your organization domain. - We check that the user email and phone number have a valid format. + * Create User + * @param createUserRequest + * @param [notifyUser] Send a confirmation email to the user that was added to workspace(s). + * @param [notifyWsAdmins] Send a confirmation email to all workspace admins indicating that the user has been added to the workspace. + */ + public createUser(createUserRequest: CreateUserRequest, notifyUser?: boolean, notifyWsAdmins?: boolean, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.createUser(createUserRequest, notifyUser, notifyWsAdmins, observableOptions); + return result.toPromise(); + } + + /** + * Create a workspace in your organization. - You need to be an Org Admin to create a workspace. - You will be added to the new workspace with an Admin role. + * Create Workspace + * @param createWorkspaceRequest + */ + public createWorkspaceWithHttpInfo(createWorkspaceRequest: CreateWorkspaceRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.createWorkspaceWithHttpInfo(createWorkspaceRequest, observableOptions); + return result.toPromise(); + } + + /** + * Create a workspace in your organization. - You need to be an Org Admin to create a workspace. - You will be added to the new workspace with an Admin role. * Create Workspace - * @param createWorkspaceRequest + * @param createWorkspaceRequest + */ + public createWorkspace(createWorkspaceRequest: CreateWorkspaceRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.createWorkspace(createWorkspaceRequest, observableOptions); + return result.toPromise(); + } + + /** + * Deactivate the workspace, remove all the members from it and make it unavailable. + * Deactivate Workspace + * @param workspaceId + * @param [body] + */ + public deactivateWorkspaceWithHttpInfo(workspaceId: string, body?: any, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.deactivateWorkspaceWithHttpInfo(workspaceId, body, observableOptions); + return result.toPromise(); + } + + /** + * Deactivate the workspace, remove all the members from it and make it unavailable. + * Deactivate Workspace + * @param workspaceId + * @param [body] + */ + public deactivateWorkspace(workspaceId: string, body?: any, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.deactivateWorkspace(workspaceId, body, observableOptions); + return result.toPromise(); + } + + /** + * Get a list of all the active workspaces in the organization. + * List Workspaces + * @param [count] Number of elements in page. + * @param [page] Page number. + */ + public getWorkspacesListWithHttpInfo(count?: number, page?: number, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.getWorkspacesListWithHttpInfo(count, page, observableOptions); + return result.toPromise(); + } + + /** + * Get a list of all the active workspaces in the organization. + * List Workspaces + * @param [count] Number of elements in page. + * @param [page] Page number. */ - public createWorkspace(createWorkspaceRequest: CreateWorkspaceRequest, _options?: Configuration): Promise { - const result = this.api.createWorkspace(createWorkspaceRequest, _options); + public getWorkspacesList(count?: number, page?: number, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.getWorkspacesList(count, page, observableOptions); + return result.toPromise(); + } + + /** + * Get a list of all users with membership in your organization, with their contact information, license type, and workspace roles. You must be an organization admin to list users. + * List Users + * @param [count] Number of elements in page. + * @param [page] Page number. + * @param [showRemoved] Filter option - show users with removed memberships. + */ + public listUsersWithHttpInfo(count?: number, page?: number, showRemoved?: boolean, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.listUsersWithHttpInfo(count, page, showRemoved, observableOptions); + return result.toPromise(); + } + + /** + * Get a list of all users with membership in your organization, with their contact information, license type, and workspace roles. You must be an organization admin to list users. + * List Users + * @param [count] Number of elements in page. + * @param [page] Page number. + * @param [showRemoved] Filter option - show users with removed memberships. + */ + public listUsers(count?: number, page?: number, showRemoved?: boolean, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.listUsers(count, page, showRemoved, observableOptions); + return result.toPromise(); + } + + /** + * This operation removes a specified member from a workspace by providing the workspace ID and member ID. + * Remove Member from Workspace + * @param workspaceId Workspace id + * @param memberId Member id + */ + public removeMemberWithHttpInfo(workspaceId: string, memberId: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.removeMemberWithHttpInfo(workspaceId, memberId, observableOptions); + return result.toPromise(); + } + + /** + * This operation removes a specified member from a workspace by providing the workspace ID and member ID. + * Remove Member from Workspace + * @param workspaceId Workspace id + * @param memberId Member id + */ + public removeMember(workspaceId: string, memberId: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.removeMember(workspaceId, memberId, observableOptions); return result.toPromise(); } @@ -1072,26 +3398,58 @@ export class PromiseWebhookEventsApi { } /** - * Get webhook event by uuid - * @param id Webhook event uuid + * This operation fetches detailed information about a specific webhook event using its unique identifier. + * Webhook Event Details + * @param id Webhook event uuid. + */ + public detailsWebhookEventWithHttpInfo(id: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.detailsWebhookEventWithHttpInfo(id, observableOptions); + return result.toPromise(); + } + + /** + * This operation fetches detailed information about a specific webhook event using its unique identifier. + * Webhook Event Details + * @param id Webhook event uuid. + */ + public detailsWebhookEvent(id: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.detailsWebhookEvent(id, observableOptions); + return result.toPromise(); + } + + /** + * This operation retrieves a paginated list of all webhook events. + * List Webhook Events + * @param count Specify how many event results to return. + * @param page Specify which page of the dataset to return. + * @param [since] Return results where the event creation time is greater than or equal to this value. + * @param [to] Return results where the event creation time is less than this value. + * @param [type] Returns results by the specified event types. + * @param [httpStatusCode] Returns results with the specified HTTP status codes. + * @param [error] Returns results with the following errors. */ - public detailsWebhookEvent(id: string, _options?: Configuration): Promise { - const result = this.api.detailsWebhookEvent(id, _options); + public listWebhookEventWithHttpInfo(count: number, page: number, since?: Date, to?: Date, type?: Array, httpStatusCode?: Array, error?: Array, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.listWebhookEventWithHttpInfo(count, page, since, to, type, httpStatusCode, error, observableOptions); return result.toPromise(); } /** - * Get webhook event page - * @param count Number of element in page - * @param page Page number - * @param since Filter option: all events from specified timestamp - * @param to Filter option: all events up to specified timestamp - * @param type Filter option: all events of type - * @param httpStatusCode Filter option: all events of http status code - * @param error Filter option: all events with following error + * This operation retrieves a paginated list of all webhook events. + * List Webhook Events + * @param count Specify how many event results to return. + * @param page Specify which page of the dataset to return. + * @param [since] Return results where the event creation time is greater than or equal to this value. + * @param [to] Return results where the event creation time is less than this value. + * @param [type] Returns results by the specified event types. + * @param [httpStatusCode] Returns results with the specified HTTP status codes. + * @param [error] Returns results with the following errors. */ - public listWebhookEvent(count: number, page: number, since?: Date, to?: Date, type?: Array, httpStatusCode?: Array, error?: Array, _options?: Configuration): Promise { - const result = this.api.listWebhookEvent(count, page, since, to, type, httpStatusCode, error, _options); + public listWebhookEvent(count: number, page: number, since?: Date, to?: Date, type?: Array, httpStatusCode?: Array, error?: Array, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.listWebhookEvent(count, page, since, to, type, httpStatusCode, error, observableOptions); return result.toPromise(); } @@ -1115,56 +3473,134 @@ export class PromiseWebhookSubscriptionsApi { } /** - * Create webhook subscription - * @param webhookSubscriptionCreateRequest + * This operation creates a new webhook subscription by specifying its details. + * Create Webhook Subscription + * @param webhookSubscriptionCreateRequest */ - public createWebhookSubscription(webhookSubscriptionCreateRequest: WebhookSubscriptionCreateRequest, _options?: Configuration): Promise { - const result = this.api.createWebhookSubscription(webhookSubscriptionCreateRequest, _options); + public createWebhookSubscriptionWithHttpInfo(webhookSubscriptionCreateRequest: WebhookSubscriptionCreateRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.createWebhookSubscriptionWithHttpInfo(webhookSubscriptionCreateRequest, observableOptions); return result.toPromise(); } /** - * Delete webhook subscription + * This operation creates a new webhook subscription by specifying its details. + * Create Webhook Subscription + * @param webhookSubscriptionCreateRequest + */ + public createWebhookSubscription(webhookSubscriptionCreateRequest: WebhookSubscriptionCreateRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.createWebhookSubscription(webhookSubscriptionCreateRequest, observableOptions); + return result.toPromise(); + } + + /** + * This operation deletes a specific webhook subscription identified by its UUID. + * Delete Webhook Subscription + * @param id Webhook subscription uuid. + */ + public deleteWebhookSubscriptionWithHttpInfo(id: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.deleteWebhookSubscriptionWithHttpInfo(id, observableOptions); + return result.toPromise(); + } + + /** + * This operation deletes a specific webhook subscription identified by its UUID. + * Delete Webhook Subscription + * @param id Webhook subscription uuid. + */ + public deleteWebhookSubscription(id: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.deleteWebhookSubscription(id, observableOptions); + return result.toPromise(); + } + + /** + * Get webhook subscription by uuid + * Webhook Subscription Details + * @param id Webhook subscription uuid + */ + public detailsWebhookSubscriptionWithHttpInfo(id: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.detailsWebhookSubscriptionWithHttpInfo(id, observableOptions); + return result.toPromise(); + } + + /** + * Get webhook subscription by uuid + * Webhook Subscription Details * @param id Webhook subscription uuid */ - public deleteWebhookSubscription(id: string, _options?: Configuration): Promise { - const result = this.api.deleteWebhookSubscription(id, _options); + public detailsWebhookSubscription(id: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.detailsWebhookSubscription(id, observableOptions); + return result.toPromise(); + } + + /** + * This operation fetches a paginated list of webhook subscriptions. + * List Webhook Subscriptions + */ + public listWebhookSubscriptionsWithHttpInfo(_options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.listWebhookSubscriptionsWithHttpInfo(observableOptions); + return result.toPromise(); + } + + /** + * This operation fetches a paginated list of webhook subscriptions. + * List Webhook Subscriptions + */ + public listWebhookSubscriptions(_options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.listWebhookSubscriptions(observableOptions); return result.toPromise(); } /** - * Get webhook subscription by uuid + * This operation updates the details of a webhook subscription. + * Update Webhook Subscription * @param id Webhook subscription uuid + * @param webhookSubscriptionPatchRequest */ - public detailsWebhookSubscription(id: string, _options?: Configuration): Promise { - const result = this.api.detailsWebhookSubscription(id, _options); + public updateWebhookSubscriptionWithHttpInfo(id: string, webhookSubscriptionPatchRequest: WebhookSubscriptionPatchRequest, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.updateWebhookSubscriptionWithHttpInfo(id, webhookSubscriptionPatchRequest, observableOptions); return result.toPromise(); } /** - * Get all webhook subscriptions + * This operation updates the details of a webhook subscription. + * Update Webhook Subscription + * @param id Webhook subscription uuid + * @param webhookSubscriptionPatchRequest */ - public listWebhookSubscriptions(_options?: Configuration): Promise { - const result = this.api.listWebhookSubscriptions(_options); + public updateWebhookSubscription(id: string, webhookSubscriptionPatchRequest: WebhookSubscriptionPatchRequest, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.updateWebhookSubscription(id, webhookSubscriptionPatchRequest, observableOptions); return result.toPromise(); } /** - * Update webhook subscription + * This operation regenerates the shared key for a specific webhook subscription identified by its UUID. + * Update Webhook Subscription Shared Key * @param id Webhook subscription uuid - * @param webhookSubscriptionPatchRequest */ - public updateWebhookSubscription(id: string, webhookSubscriptionPatchRequest: WebhookSubscriptionPatchRequest, _options?: Configuration): Promise { - const result = this.api.updateWebhookSubscription(id, webhookSubscriptionPatchRequest, _options); + public updateWebhookSubscriptionSharedKeyWithHttpInfo(id: string, _options?: PromiseConfigurationOptions): Promise> { + const observableOptions = wrapOptions(_options); + const result = this.api.updateWebhookSubscriptionSharedKeyWithHttpInfo(id, observableOptions); return result.toPromise(); } /** - * Regenerate webhook subscription shared key + * This operation regenerates the shared key for a specific webhook subscription identified by its UUID. + * Update Webhook Subscription Shared Key * @param id Webhook subscription uuid */ - public updateWebhookSubscriptionSharedKey(id: string, _options?: Configuration): Promise { - const result = this.api.updateWebhookSubscriptionSharedKey(id, _options); + public updateWebhookSubscriptionSharedKey(id: string, _options?: PromiseConfigurationOptions): Promise { + const observableOptions = wrapOptions(_options); + const result = this.api.updateWebhookSubscriptionSharedKey(id, observableOptions); return result.toPromise(); } diff --git a/tsconfig.json b/tsconfig.json index d9776b7..a70445c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,25 +2,37 @@ "compilerOptions": { "strict": true, /* Basic Options */ - "target": "es2017", - "module": "commonjs", + "target": "es5", "moduleResolution": "node", "declaration": true, + "typeRoots": [ + "node_modules/@types" + ], + "skipLibCheck": true, /* Additional Checks */ - "noUnusedLocals": false, /* Report errors on unused locals. */ // TODO: reenable (unused imports!) - "noUnusedParameters": false, /* Report errors on unused parameters. */ // TODO: set to true again - "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + "noUnusedLocals": false, /* Report errors on unused locals. */ // TODO: reenable (unused imports!) + "noUnusedParameters": false, /* Report errors on unused parameters. */ // TODO: set to true again + "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ - "removeComments": true, + "removeComments": false, "sourceMap": true, "outDir": "./dist", "noLib": false, + "lib": [ + "es6" + ,"ES2017.Object" + ,"ES2021.String" + ], }, "exclude": [ "dist", - "node_modules" + "node_modules", + "../node_modules" ], "include": ["src/**/*.ts"] -} \ No newline at end of file +} From 4ec7ff1d308c23ba08e00b70dc2a7ffdfdcbc2fc Mon Sep 17 00:00:00 2001 From: pdsaroka Date: Mon, 5 Jan 2026 15:59:16 +0000 Subject: [PATCH 2/2] chore: Add GitHub Actions workflow for package publishing and script to sanitize README --- .github/workflows/publish.yml | 66 +++++++++++++++++++++++++++++++++++ scripts/prepare_release.js | 27 ++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 .github/workflows/publish.yml create mode 100644 scripts/prepare_release.js diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..bdf178e --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,66 @@ +name: Publish Package + +on: + push: + tags: + - "v*" + +permissions: + id-token: write # required for npm trusted publishing (OIDC) + contents: read + +concurrency: + group: publish-${{ github.ref }} + cancel-in-progress: false + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + registry-url: "https://registry.npmjs.org" + + - name: Validate tag matches package version + if: startsWith(github.ref, 'refs/tags/v') + shell: bash + run: | + PKG_VERSION="$(node -p "require('./package.json').version")" + TAG_VERSION="${GITHUB_REF_NAME#v}" + if [[ "$TAG_VERSION" != "$PKG_VERSION" ]]; then + echo "Tag version ($TAG_VERSION) does not match package.json version ($PKG_VERSION)." + exit 1 + fi + + - name: Install dependencies + run: npm install --ignore-scripts --no-audit --no-fund + + - name: Prepare release (sanitize README) + run: node scripts/prepare_release.js + + - name: Build package + run: npm run build + + - name: Verify package contents + run: npm pack --dry-run --ignore-scripts + + - name: Choose npm dist-tag + id: npm_dist_tag + shell: bash + run: | + VERSION="$(node -p "require('./package.json').version")" + if [[ "$VERSION" == *-* ]]; then + echo "tag=next" >> "$GITHUB_OUTPUT" + else + echo "tag=latest" >> "$GITHUB_OUTPUT" + fi + + - name: Publish to npm (OIDC) + if: startsWith(github.ref, 'refs/tags/v') + run: npm publish --provenance --tag "${{ steps.npm_dist_tag.outputs.tag }}" --ignore-scripts diff --git a/scripts/prepare_release.js b/scripts/prepare_release.js new file mode 100644 index 0000000..34ad514 --- /dev/null +++ b/scripts/prepare_release.js @@ -0,0 +1,27 @@ +const fs = require("fs"); +const path = require("path"); + +const filePath = path.join(__dirname, "..", "README.md"); + +// Remove Documentation for API Endpoints section from README.md +try { + const fullDescription = fs.readFileSync(filePath, "utf8"); + + const fromIndex = fullDescription.indexOf( + "### Documentation for API Endpoints" + ); + const toIndex = fullDescription.indexOf("## License"); + + if (fromIndex === -1 || toIndex === -1) { + console.log("README.md: markers not found, no changes made"); + process.exit(0); + } + + const description = + fullDescription.slice(0, fromIndex) + fullDescription.slice(toIndex); + fs.writeFileSync(filePath, description, "utf8"); + console.log("README.md was updated"); +} catch (err) { + console.error(err); + process.exit(1); +}